Sunteți pe pagina 1din 6

Oracle Applications 11i Oracle Inventory

How to Create Stock Locators Using API By Ahmed Bilal a mian1!"1#gmail$com %or www$erpst&''$com

1$ Create (a le
Create a temporary table using following script CREATE TABLE DEV_DATA ( SR_ ! "#BER$ % V_!R&_%D "#BER$ % VE T!R'_!R&A %(AT%! "#BER$ S"B_% VE T!R' C)AR(* B'TE+$ ,ARE)!"SE C)AR(* B'TE+$ -L!R C)AR(* B'TE+$ R!, C)AR(* B'TE+$ RAC. C)AR(* B'TE+$ B% C)AR(* B'TE+$ B!/ C)AR(* B'TE+$ S"00L%ER C)AR(1 B'TE+$ S0ARE2 C)AR(* B'TE+$ S0ARE3 C)AR(* B'TE+$ C!DE C)AR(14 B'TE+$ CREAT%! _DATE DATE$ STAT"S C)AR(2 B'TE+ +

)$ Upload *ata in (a le &sing S+LL*,


Control -ile Synta5 LOAD DATA INFILE 'Data.csv' APPEND INTO TABLE Dev_Data REPLACE FIELDS TERMINATED BY ',' TRAILING NULLCOLS ( SR_NO "t !"(#SR_NO$", IN%_ORG_ID "t !"(#IN%_ORG_ID$", IN%ENTORY_ORGANI&ATION "t !"(#IN%ENTORY_ORGANI&ATION$", SUB_IN%ENTORY "t !"(#SUB_IN%ENTORY$", 'ARE(OUSE "t !"(#'ARE(OUSE$", FLOR "t !"(#FLOR$", RO'N "t !"(#RO'N$", RAC) "t !"(#RAC)$", BIN "t !"(#BIN$", BO* "t !"(#BO*$", SUPPLIER "t !"(#SUPPLIER$", SPARE+ "t !"(#SPARE+$", SPARE, "t !"(#SPARE,$", CODE "t !"(#CODE$", CREATION_DATE "t !"(#CREATION_DATE$" $ Verify Data is uploa6e6 successfully by using following two 7ueries

Select count(8+ from 6e9_6ata Select 8 from 6e9_6ata 'ou can use any ot:er met:o6 to populate t:e temporary table ot:er t:an s7l loa6er;

-$ Uploading Script .API/


Connect by "sing A00S Cre6entials to Database$ e5ecute t:e following script t:is will create locators; DECLARE l_msg_6ata VARC)AR3(2<<+= l_msg_count "#BER= l_return_status VARC)AR3(2+= l_locator_i6 "#BER= l_locator_e5ists VARC)AR3(2+= l_org_i6 "#BER >? 22<= @8!rganiAation_i6 8@ l_organiAation_co6e VARC)AR3(2<+ >? BV<2B= @8!rganiAation_Co6e 8@ l_sub_co6e VARC)AR3(2<+ = @8Variable for Subin9entory8@ l_concatenate6_segments VARC)AR3(2<<+= @8Variable for Locator Segment8@ l_user_i6 "#BER >? 23C3= @8 "ser %D -rom - D_users Table 8@ l_resp_i6 "#BER >? 3<C*1= @8Responsibility %68@ l_resp_appl_i6 "#BER >? 1<2= @8 Responsibility Application i6 8@ @8-etc: 6ata into a cursor for creation of Locator8@ cursor c_loc is select sr_no$sub_in9entory$co6e from 6e9_6ata= 9_loc c_locDrowtype= BE&% /* * APPS_INITIALIZE Required because indirectly use profile options */ - D_&L!BAL;A00S_% %T%AL%(E(l_user_i6$ l_resp_i6$l_resp_appl_i6+= /* pen !ursor */ !0E c_loc= L!!0 -ETC) c_loc % T! 9_loc= E/%T ,)E c_locD !T-!" D= l_concatenate6_segments >? 9_loc;co6e= l_sub_co6e >? 9_loc;sub_in9entory= - D_#S&_0"B;% %T%AL%(E= /* * "irst create p#ysical locators first and use t#e returned $alue of %_in$entory_location_ * in t#e ne%t call * */

DBMS_OUTPUT.PUT_LINE(BTrying to create BEEl_concatenate6_segments+= % V_L!C_,#S_0"B;CREATE_L!CAT!R( 5_return_status ?F l_return_status$ 5_msg_count ?F l_msg_count$ 5_msg_6ata ?F l_msg_6ata$ 5_in9entory_location_i6 ?F l_locator_i6$ 5_locator_e5ists ?F l_locator_e5ists$ p_organiAation_i6 ?F l_org_i6$ p_organiAation_co6e ?F l_organiAation_co6e$ p_concatenate6_segments ?F l_concatenate6_segments$ p_6escription ?F BLocator Create6 By A0%B$@8'ou can also use :ere 6escription of 'our Locator Combination8@ p_in9entory_location_type ?F *$ && Stora'e locator p_picGing_or6er ?F "LL$ p_location_ma5imum_units ?F "LL$ p_subin9entory_co6e ?F l_sub_co6e$ @8Subin9entory Co6e 8@ p_location_weig:t_uom_co6e ?F "LL$ p_ma5_weig:t ?F "LL$ p_9olume_uom_co6e ?F "LL$ p_ma5_cubic_area ?F "LL$ p_5_coor6inate ?F "LL$ p_y_coor6inate ?F "LL$ p_A_coor6inate ?F "LL$ p_p:ysical_location_i6 ?F "LL$ p_picG_uom_co6e ?F "LL$ p_6imension_uom_co6e ?F "LL$ p_lengt: ?F "LL$ p_wi6t: ?F "LL$ p_:eig:t ?F "LL$ p_status_i6 ?F 2$ && (efault status )Acti$e) p_6ropping_or6er ?F "LL += DBMS_OUTPUT.PUT_LINE(BReturn Status BEEl_return_status+= %- l_return_status % (BEB$ B"B+ T)E DBMS_OUTPUT.PUT_LINE(BH of Errors BEEl_msg_count+= up6ate 6e9_6ata set status ? l_return_status w:ere sr_no ? 9_loc;sr_no = commit= %- l_msg_count ? 2 T)E DBMS_OUTPUT.PUT_LINE(BError BEEl_msg_6ata+= ELSE -!R i % 2;;l_msg_count L!!0 DBMS_OUTPUT.PUT_LINE(BError BEE- D_#S&_0"B;&ET(i$ B-B++= E D L!!0= E D %-= ELSE DBMS_OUTPUT.PUT_LINE(BLocator %6 is BEEl_locator_i6+= E D %-= /* * No* try to create t#e Pro+ect/Tas, Locator * * p_concatenated_se'-ents s#ould al*ays be t#e $alue t#at you see in t#e des,top for-s * not internal ids * If t#e des,top for- s#o*s )Stor././.Pacific Pu-ps.) && t#e sa-e s#ould be passed to * t#e API

* */ DBMS_OUTPUT.PUT_LINE(BTrying to create BEEl_concatenate6_segments+= % V_L!C_,#S_0"B;CREATE_L!CAT!R( 5_return_status ?F l_return_status$ 5_msg_count ?F l_msg_count$ 5_msg_6ata ?F l_msg_6ata$ 5_in9entory_location_i6 ?F l_locator_i6$ 5_locator_e5ists ?F l_locator_e5ists$ p_organiAation_i6 ?F l_org_i6$ p_organiAation_co6e ?F l_organiAation_co6e$ p_concatenate6_segments ?F l_concatenate6_segments$ p_6escription ?F BLocator Create6 By A0%B$ p_in9entory_location_type ?F *$ && Stora'e locator p_picGing_or6er ?F "LL$ p_location_ma5imum_units ?F "LL$ p_subin9entory_co6e ?F l_sub_co6e$ p_location_weig:t_uom_co6e ?F "LL$ p_ma5_weig:t ?F "LL$ p_9olume_uom_co6e ?F "LL$ p_ma5_cubic_area ?F "LL$ p_5_coor6inate ?F "LL$ p_y_coor6inate ?F "LL$ p_A_coor6inate ?F "LL$ p_p:ysical_location_i6 ?F l_locator_i6$ && 0alue 'ot fro- call abo$e p_picG_uom_co6e ?F "LL$ p_6imension_uom_co6e ?F "LL$ p_lengt: ?F "LL$ p_wi6t: ?F "LL$ p_:eig:t ?F "LL$ p_status_i6 ?F 2$ && (efault status )Acti$e) p_6ropping_or6er ?F "LL += DBMS_OUTPUT.PUT_LINE(BReturn Status BEEl_return_status+= %- l_return_status % (BEB$ B"B+ T)E DBMS_OUTPUT.PUT_LINE(BH of Errors BEEl_msg_count+= up6ate 6e9_6ata set status ? l_return_status w:ere sr_no ? 9_loc;sr_no = commit= %- l_msg_count ? 2 T)E DBMS_OUTPUT.PUT_LINE(BError BEEl_msg_6ata+= ELSE -!R i % 2;;l_msg_count L!!0 DBMS_OUTPUT.PUT_LINE(BError BEE- D_#S&_0"B;&ET(i$ B-B++= E D L!!0= E D %-= ELSE DBMS_OUTPUT.PUT_LINE(BLocator %6 is BEEl_locator_i6+= E D %-= E D L!!0= E D L!!0= CL!SE c_loc= E D=

0$ Check Created val&es


Select 8 from mtl_item_locations ,:ere 6escription ? ILocator Create6 by A0%J

S-ar putea să vă placă și