Pls help me to create SO using BDC for multiple line items (VA01)
Hi all,
My requirement is to create SO for multiple line items in ECC6.0
My recording for VA01 is like this.
start-of-selection.
perform open_group.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-AUART'
'ZOR'.
perform bdc_field using 'VBAK-VKORG'
'2000'.
perform bdc_field using 'VBAK-VTWEG'
'10'.
perform bdc_field using 'VBAK-SPART'
'05'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-WERKS(01)'.
perform bdc_field using 'RV45A-MABNR(01)'
'hrpocf'.
perform bdc_field using 'VBAP-POSNR(01)'
' 10'.
perform bdc_field using 'RV45A-KWMENG(01)'
' 55'.
perform bdc_field using 'VBAP-WERKS(01)'
'2010'.
perform bdc_dynpro using 'SAPLCEI0' '0109'.
perform bdc_field using 'BDC_CURSOR'
'RCTMS-MWERT(06)'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'RCTMS-MNAME(01)'
'A_THICK_MM'.
perform bdc_field using 'RCTMS-MNAME(02)'
'A_WIDTH_MM'.
perform bdc_field using 'RCTMS-MNAME(03)'
'A_EQUIVALENT_SPEC'.
perform bdc_field using 'RCTMS-MNAME(04)'
'A_BATCH_WEIGHT_MAX_SI'.
perform bdc_field using 'RCTMS-MNAME(05)'
'A_BATCH_WEIGHT_MIN_SI'.
perform bdc_field using 'RCTMS-MNAME(06)'
'A_COIL_INNER_DIA_MM'.
perform bdc_field using 'RCTMS-MWERT(01)'
'3.2'.
perform bdc_field using 'RCTMS-MWERT(02)'
'1200'.
perform bdc_field using 'RCTMS-MWERT(03)'
'IS_11513_GR_D_1985'.
perform bdc_field using 'RCTMS-MWERT(04)'
'26.4'.
perform bdc_field using 'RCTMS-MWERT(05)'
'26.4'.
perform bdc_field using 'RCTMS-MWERT(06)'
'610'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-WERKS(02)'.
perform bdc_field using 'RV45A-MABNR(02)'
'hrpocf'.
perform bdc_field using 'VBAP-POSNR(02)'
' 11'.
perform bdc_field using 'RV45A-KWMENG(02)'
' 66'.
perform bdc_field using 'VBAP-WERKS(02)'
'2010'.
perform bdc_dynpro using 'SAPLCEI0' '0109'.
perform bdc_field using 'BDC_CURSOR'
'RCTMS-MWERT(06)'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'RCTMS-MNAME(01)'
'A_THICK_MM'.
perform bdc_field using 'RCTMS-MNAME(02)'
'A_WIDTH_MM'.
perform bdc_field using 'RCTMS-MNAME(03)'
'A_EQUIVALENT_SPEC'.
perform bdc_field using 'RCTMS-MNAME(04)'
'A_BATCH_WEIGHT_MAX_SI'.
perform bdc_field using 'RCTMS-MNAME(05)'
'A_BATCH_WEIGHT_MIN_SI'.
perform bdc_field using 'RCTMS-MNAME(06)'
'A_COIL_INNER_DIA_MM'.
perform bdc_field using 'RCTMS-MWERT(01)'
'3.1'.
perform bdc_field using 'RCTMS-MWERT(02)'
'1250'.
perform bdc_field using 'RCTMS-MWERT(03)'
'IS_11513_GR_D_1985'.
perform bdc_field using 'RCTMS-MWERT(04)'
'20.084'.
perform bdc_field using 'RCTMS-MWERT(05)'
'20.084'.
perform bdc_field using 'RCTMS-MWERT(06)'
'610'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=PDE3'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSNR(01)'.
perform bdc_field using 'RV45A-VBAP_SELKZ(01)'
'X'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\09'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-INCO2'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'VBKD-FKDAT'
'29.01.2008'.
perform bdc_field using 'VBAP-TAXM1'
'1'.
perform bdc_field using 'VBAP-TAXM2'
'1'.
perform bdc_field using 'VBAP-TAXM3'
'0'.
perform bdc_field using 'VBAP-TAXM4'
'0'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DELETE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DETAIL'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXVB'.
perform bdc_field using 'RSTXT-TXLINE(02)'
'FDGFDG'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXBA'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\10'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-POSEX_E'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'VBAP-POSEX'
'108128'.
perform bdc_field using 'VBKD-BSTKD_E'
'3011192'.
perform bdc_field using 'VBKD-POSEX_E'
'000005'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=PDE3'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSNR(02)'.
perform bdc_field using 'RV45A-VBAP_SELKZ(02)'
'X'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\09'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-INCO2'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'VBKD-FKDAT'
'29.01.2008'.
perform bdc_field using 'VBAP-TAXM1'
'1'.
perform bdc_field using 'VBAP-TAXM2'
'1'.
perform bdc_field using 'VBAP-TAXM3'
'0'.
perform bdc_field using 'VBAP-TAXM4'
'0'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DELETE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DETAIL'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXVB'.
perform bdc_field using 'RSTXT-TXLINE(02)'
'GFGFDG'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXBA'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\10'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-POSEX_E'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'VBAP-POSEX'
'108128'.
perform bdc_field using 'VBKD-BSTKD_E'
'3011192'.
perform bdc_field using 'VBKD-POSEX_E'
'000005'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSEX'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'VBAP-POSEX'
'108128'.
perform bdc_field using 'VBKD-BSTKD_E'
'3011192'.
perform bdc_field using 'VBKD-POSEX_E'
'5'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=KKAU'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(01)'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\02'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-KONDA'.
perform bdc_field using 'VBAK-AUDAT'
'29.01.2008'.
perform bdc_field using 'VBAK-VKBUR'
'IN15'.
perform bdc_field using 'VBAK-WAERK'
'INR'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-KDGRP'
'CF'.
perform bdc_field using 'VBKD-PLTYP'
'01'.
perform bdc_field using 'VBKD-KONDA'
'01'.
perform bdc_field using 'VBKD-BZIRK'
'NORTH'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\03'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-VSART'.
perform bdc_field using 'VBAK-VSBED'
'01'.
perform bdc_field using 'VBKD-KZAZU'
'X'.
perform bdc_field using 'VBKD-VSART'
'ER'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\05'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-INCO2'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'VBKD-FKDAT'
'29.01.2008'.
perform bdc_field using 'VBAK-TAXK1'
'1'.
perform bdc_field using 'VBAK-TAXK3'
'l'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\09'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-ZLSCH'.
perform bdc_field using 'VBKD-KTGRD'
'01'.
perform bdc_field using 'VBKD-ZLSCH'
'c'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DELETE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DETAIL'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXVB'.
perform bdc_field using 'RSTXT-TXLINE(02)'
'BDFBFDB'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXBA'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\11'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=KSTC'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'J_STMAINT-ANWS(02)'.
perform bdc_field using 'J_STMAINT-ANWS(01)'
perform bdc_field using 'J_STMAINT-ANWS(02)'
'X'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'J_STMAINT-ANWS(03)'.
perform bdc_field using 'J_STMAINT-ANWS(02)'
perform bdc_field using 'J_STMAINT-ANWS(03)'
'X'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'J_STMAINT-ANWS(04)'.
perform bdc_field using 'J_STMAINT-ANWS(03)'
perform bdc_field using 'J_STMAINT-ANWS(04)'
'X'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'BDC_CURSOR'
'JOSTD-OBJNR'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-TXT_VBELN'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(01)'.
perform bdc_transaction using 'VA01'.
perform close_group.
if in excel file one row of records means i am succesfully creating SO.
But for multiple i am not getting idea to create SO.
My excel file details like this.In this excel file based on VBKD-BSTKD_E value i have to keep the records in line items.
VBAK-AUART :Order Type
VBAK-VKORG : Sales Org
VBAK-VTWEG : Distri Channel
VBAK-SPART : Division
VBAK-KUNNR : Sold-to-Party
VBPA-KUNNAR : Ship-to-Party
VBAK-BSTNK : PO No
VBAK-BSTDK : PO Date
VBAP-MATNR : Material No
A_THICK_MM
A_WIDTH_MM
A_EQUIVALENT_SPEC
A_COIL_INNER_DIA_MM
A_BATCH_WEIGHT_MIN_SI
A_BATCH_WEIGHT_MAX_SI
VBAP-KWMENG : Qty
VBAP-WERKS : Delivery Plant
VBKD-INCO2 : Incoterm2
VBKD-KONDA : Price Group
VBKD-VSART : Shipping Type
VBAK-TAXK1 : Cust Tax-1
VBAK-TAXK2 : Cust Tax-2
VBAK-TAXK3 : Cust Tax-3
VBAK-TAXK4 : Cust Tax-4
VBKD-ZLSCH : Payment Method
VBAP-TAXM1 : Mat tax clss-1
VBAP-TAXM2 : Mat tax clss-2
VBAP-TAXM3 : Mat tax clss-3
VBAP-TAXM4 : Mat tax clss-4
VBAP-POSEX : IMPS Order No
VBKD-BSTKD_E : old SO in 4.6c
VBKD-POSEX_E : old SO Item in 4.6c
Text Id : TDC No
Text Id-ES10 : Special Inst(Unld const & Veh)
ZOR,2000,10,5,100000,100000,PO NO 125,19.01.2008,HRPOCF,3.1,1200,IS_11513_GR_D_1985,610,20.084,20.084
51,2010,Mumbai,01Freight-pre paid,ER,2,0,L,0,c,1,1,0,0,108128,3011192, 1,PO 444 AMD 1,Spl Inst
based on VBKD-BSTKD_E line items has to create.
if VBKD-BSTKD_E = 3011192 is like 4 records in excel means for these 4 should be one SO
if it is changed to 3011193 then only different SO.
PLs If any one knows solution pls write some sample code for me.
If u send that code to my mail id also very thankful.
Pls help me this is urgent requirement.
[email protected]
Thanks & Regards,
J.Lokesh
If u want to add Items data, u have to handle the Table control by writing the complete code.
U have to write code for 2 items, when u press enter u will get new row to enter new record one by one.
Narendra
Similar Messages
-
BDC for multiple line items (VA01)
Hi Experts,
I create a BDC for VA01 transaction for single line item in that now i want to upload multiple line items also with o/p of total no. of records uploaded, no. of records posted and the no. of error records...
Can any body explain with sample code...Hi,
if the flat file is containing header and item records...
first split those records tooo two internal tables header and item..
Loop at header ...
process of recording steps for header....
Loop at item...
here create a varialbe with char 2 .. for index value....
process of item recording steps..
increment the index value by 1....
here u have to pass 'p+' OK_CODE..
Endloop ..(item)
Endloop...(header)
for more info goo through this link...
http://www.sap-img.com/bdc.htm
hope helpful
Raghunath.S -
How Can I Create One Entry Sheet For Multiple Line Items of A PO
Please Tell Me How Can I Create One Entry Sheet For Multiple Line Items of A PO
hi,
It is not possible to create single Service Entry sheet for multiple PO line items. It is 1 to 1 relation.
you have to make different service entry sheets for different item of service master.
regards
Manish Joshi -
"BDC for multiple line items of PO"
I am using this code to move data for multiple line items of a PO. But only one is getting transferred. I am using BDC for this.
FORM transaction_bdc .
DATA :
v_cnt(2) TYPE n,
v_bst(2) TYPE n,
v_bn TYPE i,
v_bstpo(25),
v_ebtyp(25),
v_menge(25),
v_eeind(25),
v_xblnr(25),
v_xblnr1(25),
v_ebelp(2) TYPE n,
v_ebelpt(2),
v_menge1(11),
v_ebt TYPE i,
v_vebtyp LIKE ekes-ebtyp,
v_eb(2) TYPE n,
v_tcselflag(40),
v_tem(2) TYPE n,
v_correct TYPE i,
v_file TYPE string.
DATA: ls_outtab TYPE tb_struc.
DATA: l_valid TYPE c,
l_locked TYPE c.
CALL METHOD g_grid->check_changed_data
IMPORTING
e_valid = l_valid.
IF l_valid EQ 'X'.
LOOP AT tb_output WHERE check EQ 'X' .
MOVE-CORRESPONDING tb_output TO itab_output.
APPEND itab_output.
CLEAR itab_output.
ENDLOOP.
IF tb_output-check <> 'X'.
MESSAGE e003 WITH text-004.
ENDIF.
ENDIF.
IF itab_output[] IS NOT INITIAL.
PERFORM open_group.
***looping at purchase order level.
LOOP AT itab_output where ebelp is not initial .
CLEAR v_bn.
CLEAR v_ebt.
PERFORM bdc_dynpro USING 'SAPMM06E' '0105'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06E-BSTNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RM06E-BSTNR'
itab_output-ebeln.
***Changing alphanumeric fields and quantity fields to character type**
*v_ebelp = tB_OUTPUT-ebelp.
*clear v_ebelpt.
*v_menge1 = tB_OUTPUT-menge.
*v_ebelpt = v_ebelp.
***End Of Changing**
*Checking for the exact number of the item**
LOOP AT tb_output where ebeln = itab_output-ebeln.
READ TABLE itab_output INDEX 1.
IF tb_output-ebelp = itab_output-ebelp.
exit.
ELSE.
v_bn = v_bn + 1.
ENDIF.
ENDLOOP.
v_bst = v_bn + 1.
*End Of Checking**
**Mapping items**
v_tem = 1.
CONCATENATE 'RM06E-BSTPO(' v_bst ')' INTO v_bstpo.
CONCATENATE 'RM06E-TCSELFLAG(' v_tem ')' INTO v_tcselflag.
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
v_bstpo.
PERFORM bdc_field USING 'BDC_OKCODE'
'=DETA'.
PERFORM bdc_field USING 'RM06E-EBELP'
v_ebelpt.
PERFORM bdc_dynpro USING 'SAPMM06E' '0111'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EKPO-BSTAE'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
v_bstpo.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BSTA'.
PERFORM bdc_field USING 'RM06E-EBELP'
v_ebelpt.
PERFORM bdc_field USING v_tcselflag
'X'.
**Checking weather Confirmation category already exists**
SELECT ebtyp FROM ekes INTO v_vebtyp WHERE ebelp =
itab_output-ebelp AND ebeln = itab_output-ebeln.
ENDSELECT.
IF sy-dbcnt > 0.
v_ebt = sy-dbcnt.
ENDIF.
v_eb = v_ebt + 1.
**End Of Checking**
**For Line items**
CONCATENATE 'EKES-EBTYP(' v_eb ')' INTO v_ebtyp.
CONCATENATE 'EKES-MENGE(' v_eb ')' INTO v_menge.
CONCATENATE 'RM06E-EEIND(' v_eb ')' INTO v_eeind.
CONCATENATE 'EKES-XBLNR(' v_eb ')' INTO v_xblnr.
**End**
PERFORM bdc_dynpro USING 'SAPLEINB' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
v_xblnr.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING v_ebtyp
itab_output-ebtyp.
PERFORM bdc_field USING v_eeind
itab_output-eindt.
PERFORM bdc_field USING v_menge
v_menge1.
PERFORM bdc_field USING v_xblnr
itab_output-xblnr.
**End Of Mappings**
*loop at itab_output.
MOVE-CORRESPONDING itab_output TO ekes.
modify ekes.
MOVE-CORRESPONDING itab_output TO eket.
MODIFY eket.
MOVE-CORRESPONDING tb_output TO ekpo.
MODIFY ekpo.
ENDLOOP.
CALL TRANSACTION 'ME22N'
USING itbdc
MODE 'E'.
commit work.
perform bdc_transaction using 'ME22N'.
**End Of Purchase Order Loop**
PERFORM close_group.
endloop.
endif.Hi Asha,
check the below code once...
LOOP AT tb_output where ebeln = itab_output-ebeln.
READ TABLE itab_output INDEX 1.
IF tb_output-ebelp = itab_output-ebelp.
exit.
ELSE.
v_bn = v_bn + 1.
ENDIF.
ENDLOOP.
Here you are reading the table itab_output with index 1, it means you alway reading the first record of that internal table.
Regards,
Satya. -
To Record J1IS BDC For Multiple Line Items
Hi,
Iam trying to record BDC for J1IS transaction.
while recording material document which contains more than 8 line items , Only 8 line items get saved and the rest of the items doesn't get saved ,
But when I do this manually then all the line items get saved,
Can anyone give the remedy for this Problem (to record J1IS for multiple line items).
Thanks in Advance.
Regards,
S.Janani.Hi Janani / Leo
The problem might be that the scroll down functionality after 8 line items is not recorded in your recording.
In order to overcome the issue, you need to check OK__CODE whicle page down and add it in recording after Number of line items are greater than 8.
Please check below link for details:
http://scn.sap.com/thread/1106677
http://scn.sap.com/thread/797827
http://scn.sap.com/thread/2037271
Best Regards,
Sachin -
hi all,
i am developing bdc program to upload multiple line items for ml10.
i am uploading folling fields
spec_no
astyp
txz01,
sort1,
waers,
matkl,
ekorg,
srvpos ' service number
menge. 'quantity
service number and quantity are multiple line items.
i have developed a code which is taking single record only, it is not working for multiple service no and quantity.
include bdcrecx1.
parameters: filename like rlgrap-filename.
data: begin of record,
SPEC_NO(10),
ASTYP(4),
TXZ01(40),
SORT1(20),
WAERS(5),
MATKL(9),
EKORG(4),
NEW_ROW(10),
SRVPOS(18),
MENGE(13),
end of record.
data: itab_program like record occurs 0 with header line.
At Selection Screen
at selection-screen on value-request for filename.
perform query_filename changing filename.
*START-OF-SELECTION
start-of-selection.
*-- Upload flat data to ITAB.
perform upload_to_itab.
*{ chg001 -- modified as per requirement
perform open_group.
loop at itab_program.
perform upload_programs.
endloop.
perform close_group.
FORM UPLOAD_TO_ITAB *
form upload_to_itab.
call function 'WS_UPLOAD'
exporting
CODEPAGE = ' '
filename = filename
filetype = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
tables
data_tab = itab_program
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
write : 'File opening error.'.
endif.
endform.
FORM QUERY_FILENAME *
--> P_FILENAME *
form query_filename changing p_filename.
data : tmp_filename like filename.
call function 'WS_FILENAME_GET'
exporting
def_filename = filename
mask = ',.txt,.txt.'
mode = 'O'
title = 'Select the file to Upload'
importing
filename = tmp_filename
exceptions
inv_winsys = 01
no_batch = 02
selection_cancel = 03
selection_error = 04.
if sy-subrc = 0.
filename = tmp_filename.
endif.
endform.
*perform open_group.
*& Form UPLOAD_programs
text
--> p1 text
<-- p2 text
form upload_programs.
perform bdc_dynpro using 'SAPLMLSM' '0100'.
perform bdc_field using 'BDC_CURSOR'
'TEMP_SPEC-ASTYP'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'TMP_SPEC-SPEC_NO'
ITAB_PROGRAM-SPEC_NO.
perform bdc_field using 'TMP_SPEC-ASTYP'
ITAB_PROGRAM-ASTYP.
*****************************************************************SCREEN1
perform bdc_dynpro using 'SAPLMLSM' '0200'.
perform bdc_field using 'BDC_CURSOR'
'TMP_SPEC-EKORG'.
perform bdc_field using 'BDC_OKCODE'
'=SRV'.
perform bdc_field using 'TMP_SPEC-TXZ01'
ITAB_PROGRAM-TXZ01.
perform bdc_field using 'TMP_SPEC-SORT1'
ITAB_PROGRAM-SORT1.
perform bdc_field using 'TMP_SPEC-WAERS'
ITAB_PROGRAM-WAERS.
perform bdc_field using 'TMP_SPEC-MATKL'
ITAB_PROGRAM-MATKL.
perform bdc_field using 'TMP_SPEC-EKORG'
ITAB_PROGRAM-EKORG.
*****************************************************************END OF SCREEN2
perform bdc_dynpro using 'SAPLMLSP' '0201'.
perform bdc_field using 'BDC_OKCODE'
'=BZE'.
*perform bdc_field using 'RM11P-HEADTEXT'
ITAB_PROGRAM-TXZ01.
perform bdc_field using 'BDC_SUBSCR'
'SAPLMLSP'.
perform bdc_dynpro using 'SAPLMLSP' '0201'.
perform bdc_field using 'BDC_OKCODE'
'=BZE'.
perform bdc_field using 'BDC_CURSOR'
'ESLL-MENGE(01)'.
perform bdc_field using 'ESLL-SRVPOS(01)'
ITAB_PROGRAM-SRVPOS.
perform bdc_field using 'ESLL-MENGE(01)'
ITAB_PROGRAM-MENGE.
perform bdc_dynpro using 'SAPLMLSP' '0201'.
perform bdc_field using 'BDC_OKCODE'
'=SAV'.
perform bdc_field using 'BDC_SUBSCR'
'SAPLMLSP'.
perform bdc_transaction using 'ML10'.
endform. " UPLOAD_programs
can any body help me in this regard.
thanks in advance
sivaLoop at itab_program.
< Here will be your BDC Program>
call transaction..... .
endloop.
and all the records in you internal table itab_program will get updated...
Regards.
Jayant
<b>Please award if helpful</b> -
Hi All,
In my BDC BDCDATA table is populated properly but when I am trying to put the data in to the BDC_INSERT it is talking only first item insted.
Please Suggest
Regards
SagarHi,
When populating table control the index of the fieldname changes... you need to concatenate the index to the fieldname inorder to populate the correct line item
check this sample code.
LOOP AT itab_fields WHERE count EQ w_index.
ADD 1 TO w_tabix.
IF w_tabix gt <no> " number of visible lines of the table control of the screen
PERFORM bdc_dynpro USING 'SAPLSD41' '2200'.
PERFORM bdc_field USING 'BDC_CURSOR'
w_fname.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
w_tabix = 2.
ENDIF.
CONCATENATE 'DD03P-FIELDNAME(' w_tabix ')' INTO w_fname.
CONCATENATE 'DD03P-KEYFLAG(' w_tabix ')' INTO w_fkey.
CONCATENATE 'DD03D-DATATYPE(' w_tabix ')' INTO w_ftype.
CONCATENATE 'DD03P-LENG(' w_tabix ')' INTO w_flen.
CONCATENATE 'DD03P-DDTEXT(' w_tabix ')' INTO w_fdesc.
PERFORM bdc_dynpro USING 'SAPLSD41' '2200'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING w_fname
itab_fields-fname.
PERFORM bdc_field USING w_fkey
itab_fields-fkey.
PERFORM bdc_field USING w_ftype
itab_fields-ftype.
PERFORM bdc_field USING w_flen
itab_fields-flen.
PERFORM bdc_field USING w_fdesc
itab_fields-fdesc.
ENDLOOP.
regards
padma
Edited by: Padmavathi Palli on Sep 22, 2008 11:17 AM -
BDC to create SO(VA01) for multiple line items
Hi all,
My requirement is to create SO for multiple line items in ECC6.0
My recording for VA01 is like this.
start-of-selection.
perform open_group.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-AUART'
'ZOR'.
perform bdc_field using 'VBAK-VKORG'
'2000'.
perform bdc_field using 'VBAK-VTWEG'
'10'.
perform bdc_field using 'VBAK-SPART'
'05'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-WERKS(01)'.
perform bdc_field using 'RV45A-MABNR(01)'
'hrpocf'.
perform bdc_field using 'VBAP-POSNR(01)'
' 10'.
perform bdc_field using 'RV45A-KWMENG(01)'
' 55'.
perform bdc_field using 'VBAP-WERKS(01)'
'2010'.
perform bdc_dynpro using 'SAPLCEI0' '0109'.
perform bdc_field using 'BDC_CURSOR'
'RCTMS-MWERT(06)'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'RCTMS-MNAME(01)'
'A_THICK_MM'.
perform bdc_field using 'RCTMS-MNAME(02)'
'A_WIDTH_MM'.
perform bdc_field using 'RCTMS-MNAME(03)'
'A_EQUIVALENT_SPEC'.
perform bdc_field using 'RCTMS-MNAME(04)'
'A_BATCH_WEIGHT_MAX_SI'.
perform bdc_field using 'RCTMS-MNAME(05)'
'A_BATCH_WEIGHT_MIN_SI'.
perform bdc_field using 'RCTMS-MNAME(06)'
'A_COIL_INNER_DIA_MM'.
perform bdc_field using 'RCTMS-MWERT(01)'
'3.2'.
perform bdc_field using 'RCTMS-MWERT(02)'
'1200'.
perform bdc_field using 'RCTMS-MWERT(03)'
'IS_11513_GR_D_1985'.
perform bdc_field using 'RCTMS-MWERT(04)'
'26.4'.
perform bdc_field using 'RCTMS-MWERT(05)'
'26.4'.
perform bdc_field using 'RCTMS-MWERT(06)'
'610'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-WERKS(02)'.
perform bdc_field using 'RV45A-MABNR(02)'
'hrpocf'.
perform bdc_field using 'VBAP-POSNR(02)'
' 11'.
perform bdc_field using 'RV45A-KWMENG(02)'
' 66'.
perform bdc_field using 'VBAP-WERKS(02)'
'2010'.
perform bdc_dynpro using 'SAPLCEI0' '0109'.
perform bdc_field using 'BDC_CURSOR'
'RCTMS-MWERT(06)'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'RCTMS-MNAME(01)'
'A_THICK_MM'.
perform bdc_field using 'RCTMS-MNAME(02)'
'A_WIDTH_MM'.
perform bdc_field using 'RCTMS-MNAME(03)'
'A_EQUIVALENT_SPEC'.
perform bdc_field using 'RCTMS-MNAME(04)'
'A_BATCH_WEIGHT_MAX_SI'.
perform bdc_field using 'RCTMS-MNAME(05)'
'A_BATCH_WEIGHT_MIN_SI'.
perform bdc_field using 'RCTMS-MNAME(06)'
'A_COIL_INNER_DIA_MM'.
perform bdc_field using 'RCTMS-MWERT(01)'
'3.1'.
perform bdc_field using 'RCTMS-MWERT(02)'
'1250'.
perform bdc_field using 'RCTMS-MWERT(03)'
'IS_11513_GR_D_1985'.
perform bdc_field using 'RCTMS-MWERT(04)'
'20.084'.
perform bdc_field using 'RCTMS-MWERT(05)'
'20.084'.
perform bdc_field using 'RCTMS-MWERT(06)'
'610'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=PDE3'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSNR(01)'.
perform bdc_field using 'RV45A-VBAP_SELKZ(01)'
'X'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\09'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-INCO2'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'VBKD-FKDAT'
'29.01.2008'.
perform bdc_field using 'VBAP-TAXM1'
'1'.
perform bdc_field using 'VBAP-TAXM2'
'1'.
perform bdc_field using 'VBAP-TAXM3'
'0'.
perform bdc_field using 'VBAP-TAXM4'
'0'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DELETE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DETAIL'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXVB'.
perform bdc_field using 'RSTXT-TXLINE(02)'
'FDGFDG'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXBA'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\10'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-POSEX_E'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'VBAP-POSEX'
'108128'.
perform bdc_field using 'VBKD-BSTKD_E'
'3011192'.
perform bdc_field using 'VBKD-POSEX_E'
'000005'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=PDE3'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSNR(02)'.
perform bdc_field using 'RV45A-VBAP_SELKZ(02)'
'X'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\09'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-INCO2'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'VBKD-FKDAT'
'29.01.2008'.
perform bdc_field using 'VBAP-TAXM1'
'1'.
perform bdc_field using 'VBAP-TAXM2'
'1'.
perform bdc_field using 'VBAP-TAXM3'
'0'.
perform bdc_field using 'VBAP-TAXM4'
'0'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DELETE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DETAIL'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXVB'.
perform bdc_field using 'RSTXT-TXLINE(02)'
'GFGFDG'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXBA'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\10'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-POSEX_E'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'VBAP-POSEX'
'108128'.
perform bdc_field using 'VBKD-BSTKD_E'
'3011192'.
perform bdc_field using 'VBKD-POSEX_E'
'000005'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSEX'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'VBAP-POSEX'
'108128'.
perform bdc_field using 'VBKD-BSTKD_E'
'3011192'.
perform bdc_field using 'VBKD-POSEX_E'
'5'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=KKAU'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(01)'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\02'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-KONDA'.
perform bdc_field using 'VBAK-AUDAT'
'29.01.2008'.
perform bdc_field using 'VBAK-VKBUR'
'IN15'.
perform bdc_field using 'VBAK-WAERK'
'INR'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-KDGRP'
'CF'.
perform bdc_field using 'VBKD-PLTYP'
'01'.
perform bdc_field using 'VBKD-KONDA'
'01'.
perform bdc_field using 'VBKD-BZIRK'
'NORTH'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\03'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-VSART'.
perform bdc_field using 'VBAK-VSBED'
'01'.
perform bdc_field using 'VBKD-KZAZU'
'X'.
perform bdc_field using 'VBKD-VSART'
'ER'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\05'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-INCO2'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'VBKD-FKDAT'
'29.01.2008'.
perform bdc_field using 'VBAK-TAXK1'
'1'.
perform bdc_field using 'VBAK-TAXK3'
'l'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\09'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-ZLSCH'.
perform bdc_field using 'VBKD-KTGRD'
'01'.
perform bdc_field using 'VBKD-ZLSCH'
'c'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DELETE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DETAIL'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXVB'.
perform bdc_field using 'RSTXT-TXLINE(02)'
'BDFBFDB'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXBA'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\11'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=KSTC'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'J_STMAINT-ANWS(02)'.
perform bdc_field using 'J_STMAINT-ANWS(01)'
perform bdc_field using 'J_STMAINT-ANWS(02)'
'X'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'J_STMAINT-ANWS(03)'.
perform bdc_field using 'J_STMAINT-ANWS(02)'
perform bdc_field using 'J_STMAINT-ANWS(03)'
'X'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'J_STMAINT-ANWS(04)'.
perform bdc_field using 'J_STMAINT-ANWS(03)'
perform bdc_field using 'J_STMAINT-ANWS(04)'
'X'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'BDC_CURSOR'
'JOSTD-OBJNR'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-TXT_VBELN'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(01)'.
perform bdc_transaction using 'VA01'.
perform close_group.
if in excel file one row of records means i am succesfully creating SO.
But for multiple i am not getting idea to create SO.
My excel file details like this.In this excel file based on VBKD-BSTKD_E value i have to keep the records in line items.
VBAK-AUART :Order Type
VBAK-VKORG : Sales Org
VBAK-VTWEG : Distri Channel
VBAK-SPART : Division
VBAK-KUNNR : Sold-to-Party
VBPA-KUNNAR : Ship-to-Party
VBAK-BSTNK : PO No
VBAK-BSTDK : PO Date
VBAP-MATNR : Material No
A_THICK_MM
A_WIDTH_MM
A_EQUIVALENT_SPEC
A_COIL_INNER_DIA_MM
A_BATCH_WEIGHT_MIN_SI
A_BATCH_WEIGHT_MAX_SI
VBAP-KWMENG : Qty
VBAP-WERKS : Delivery Plant
VBKD-INCO2 : Incoterm2
VBKD-KONDA : Price Group
VBKD-VSART : Shipping Type
VBAK-TAXK1 : Cust Tax-1
VBAK-TAXK2 : Cust Tax-2
VBAK-TAXK3 : Cust Tax-3
VBAK-TAXK4 : Cust Tax-4
VBKD-ZLSCH : Payment Method
VBAP-TAXM1 : Mat tax clss-1
VBAP-TAXM2 : Mat tax clss-2
VBAP-TAXM3 : Mat tax clss-3
VBAP-TAXM4 : Mat tax clss-4
VBAP-POSEX : IMPS Order No
VBKD-BSTKD_E : old SO in 4.6c
VBKD-POSEX_E : old SO Item in 4.6c
Text Id : TDC No
Text Id-ES10 : Special Inst(Unld const & Veh)
ZOR,2000,10,5,100000,100000,PO NO 125,19.01.2008,HRPOCF,3.1,1200,IS_11513_GR_D_1985,610,20.084,20.084
51,2010,Mumbai,01Freight-pre paid,ER,2,0,L,0,c,1,1,0,0,108128,3011192, 1,PO 444 AMD 1,Spl Inst
based on VBKD-BSTKD_E line items has to create.
if VBKD-BSTKD_E = 3011192 is like 4 records in excel means for these 4 should be one SO
if it is changed to 3011193 then only different SO.
PLs If any one knows solution pls write some sample code for me.
If u send that code to my mail id also very thankful.
[email protected]
Pls help me this is urgent requirement.
Thanks & Regards,
J.LokeshHI,
Instead of using BDC , why dont you make use of BAPI.
As you are on ECC, you can make use of BAPI BAPI_SALESORDER_CREATEFROMDAT2
Collect all your records based on PO # and pass them into line item table structure ORDER_ITEMS_IN.
*--Logic something like this.
loop at it_exceldata into l_line.
loop at it_exceldata into l_so where bstkd_e eq l_line-bstkd.
*This will loop at all the same PO#
*collect the data related into corr tables. and append
endloop.
*Now you are outside the loop.
*Call the BAPI to update this SO
delete it_exceldata where bstkd_e eq l_line-bstkd_e.
endloop.
Also pass all the necessary data to header structure ORDER_HEADER_IN
Do not check for Sy-subrc at the end of execution.
Instead read the Return table with message type 'A' or 'E whichi means there is an error/abort in BAPI execution.
Remember to expicitly COMMIT_WORK after succesfull execution of BAPI using BAPI_TRANSACTION_COMMIT
Please let me know , if you need more help in this
Gary. -
How to create an inspection lot for each line item of the Purchase order?
Hi,
How to create an inspection lot for each line item of the Purchase order ?
In detail if possible.Hi
please check this
[thread|Create Inspection Lot; -
Dear All,
I am writing BDC for F-28
Where wanted to add multiple line items in screen 0731 for the field rfo5a-sel01
It's urgent
Regards
ShashikantHi,
You can use the program RFBIBL00 to upload the FI documents.
Sample BDC
File Format : Below listed fields must be filled when you wnat to post new document. Program will recognize new document by itab-newdoc = 'X'.
NEWDOC , "New Doc
BLDAT(10) , "Doc Date
BUDAT(10) , "Posting Date
BLART(2) , "Document Type
XBLNR LIKE BKPF-XBLNR , "Refrence
BKTXT LIKE BKPF-BKTXT , "Doc Header Text
You need one serverfile. After sucessfully run of program you have to run the progrma RFBIBL00. Pass data transfer type = 'B'.
Regards,
Naimesh.
PS: Reward points, if it is useful..!
REPORT ZTEST_NP .
Tables
TABLES: BSEG ,
BGR00,
BBKPF,
BBSEG,
t001.
Internal Tables
DATA: BEGIN OF ITAB OCCURS 0 ,
NEWDOC , "New Doc
BLDAT(10) , "Doc Date
BUDAT(10) , "Posting Date
BLART(2) , "Document Type
XBLNR LIKE BKPF-XBLNR , "Refrence
BKTXT LIKE BKPF-BKTXT , "Doc Header Text
BSCHL(2) , "Posting Key
HKONT(10) , "Account
UMSKZ(1), "Sp GL ind
ZLSCH(1) , "Payment Method
ZLSPR(1) , "Payment Block
WRBTR(16), "Amount without sign
KOSTL(10), "Cost center
GSBER(4) , "Business Area
ZUONR LIKE BSEG-ZUONR , "Assignment
AUFNR LIKE BSEG-AUFNR , "Order
PERNR(8) , "Personal Number
SGTXT LIKE BSEG-SGTXT, "Line Item Text
END OF ITAB .
DATA: ITAB1 LIKE ITAB OCCURS 0 WITH HEADER LINE.
DATA: I_BBKPF LIKE BBKPF OCCURS 0 WITH HEADER LINE.
DATA: I_BBSEG LIKE BBSEG OCCURS 0 WITH HEADER LINE.
DATA: I_BWITH LIKE BWITH OCCURS 0 WITH HEADER LINE.
Data Declaration
DATA: C_NODATA(1) TYPE C VALUE '/',
W_CNT TYPE I.
FIELD-SYMBOLS <F>.
SELECTION-SCREEN: BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-T01.
PARAMETER: P_BUKRS LIKE BKPF-BUKRS OBLIGATORY,
PSESSION(12) OBLIGATORY DEFAULT 'Auto_FI',
P_SFILE LIKE RLGRAP-FILENAME OBLIGATORY ,
P_LFILE LIKE RLGRAP-FILENAME OBLIGATORY .
SELECTION-SCREEN: END OF BLOCK BLK1.
At Selection Screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LFILE.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = P_LFILE.
Start Of Selection
START-OF-SELECTION .
OPEN DATASET P_SFILE FOR OUTPUT IN TEXT MODE .
PERFORM INIT_BGR00 USING C_NODATA.
PERFORM INIT_IBKPF USING C_NODATA.
PERFORM INIT_IBSEG USING C_NODATA.
PERFORM UPLOAD .
PERFORM SET_DATA.
*& Form INIT_BGR00
FORM INIT_BGR00 USING NODATA .
CLEAR BGR00.
BGR00-STYPE = '0'.
BGR00-GROUP = PSESSION.
BGR00-MANDT = SY-MANDT .
BGR00-USNAM = SY-UNAME .
bgr00-start = datum .
BGR00-XKEEP = 'X'.
BGR00-NODATA = NODATA.
TRANSFER BGR00 TO P_SFILE.
ENDFORM. " INIT_BGR00
*& Form INIT_IBKPF
FORM INIT_IBKPF USING NODATA .
Initialize data fields with NODATA:
W_CNT = 0.
DO.
ADD 1 TO W_CNT.
ASSIGN COMPONENT W_CNT OF STRUCTURE I_BBKPF TO <F>.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
MOVE NODATA TO <F>.
ENDDO.
ENDFORM.
*& Form INIT_IBSEG
FORM INIT_IBSEG USING NODATA.
Initialize data fields with NODATA:
W_CNT = 0.
DO.
ADD 1 TO W_CNT.
ASSIGN COMPONENT W_CNT OF STRUCTURE I_BBSEG TO <F>.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
MOVE NODATA TO <F>.
ENDDO.
ENDFORM.
*& Form INIT_BBKPF
FORM INIT_BBKPF.
MOVE I_BBKPF TO BBKPF.
BBKPF-STYPE = '1'.
ENDFORM. " INIT_BBKPF
*& Form INIT_BBSEG
FORM INIT_BBSEG.
MOVE I_BBSEG TO BBSEG.
BBSEG-STYPE = '2'.
BBSEG-TBNAM = 'BBSEG'.
ENDFORM. " INIT_BBSEG
*& Form UPLOAD
FORM UPLOAD.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_LFILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = ITAB
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
IF SY-SUBRC NE 0 .
MESSAGE S001(01) WITH 'The File Could not be Uploaded..!' .
LEAVE LIST-PROCESSING .
ELSE.
DELETE ITAB INDEX 1 .
ENDIF .
LOOP AT ITAB .
DO .
REPLACE '.' WITH '' INTO ITAB-BLDAT .
IF SY-SUBRC NE 0 .
CONDENSE ITAB-BLDAT NO-GAPS .
EXIT .
ENDIF .
ENDDO .
DO .
REPLACE '.' WITH '' INTO ITAB-BUDAT .
IF SY-SUBRC NE 0 .
CONDENSE ITAB-BUDAT NO-GAPS .
EXIT .
ENDIF .
ENDDO .
MODIFY ITAB .
ENDLOOP .
ENDFORM. " UPLOAD
*& Form SET_DATA
FORM SET_DATA.
DATA: L_DOCCNT TYPE I,
L_LNCNT TYPE I .
SELECT SINGLE * FROM T001
WHERE BUKRS = P_BUKRS.
LOOP AT ITAB .
IF ITAB-NEWDOC = 'X' OR ITAB-NEWDOC = 'x' .
CLEAR : L_LNCNT .
L_DOCCNT = L_DOCCNT + 1.
PERFORM INIT_BBKPF .
BBKPF-TCODE = 'FB01'.
BBKPF-BUKRS = P_BUKRS.
WRITE : ITAB-BLDAT DD/MM/YY TO BBKPF-BLDAT.
WRITE : ITAB-BUDAT DD/MM/YY TO BBKPF-BUDAT.
BBKPF-BLART = ITAB-BLART .
BBKPF-WAERS = T001-WAERS.
BBKPF-BKTXT = ITAB-BKTXT .
BBKPF-XBLNR = ITAB-XBLNR .
TRANSFER BBKPF TO P_SFILE.
ENDIF .
L_LNCNT = L_LNCNT + 1 .
IF L_LNCNT GT 990 .
MESSAGE S001(01) WITH 'Number of Records Exceed 990 Line Items'
'Program cannot be executed' .
LEAVE LIST-PROCESSING .
ENDIF .
PERFORM INIT_BBSEG .
BBSEG-NEWKO = ITAB-HKONT .
BBSEG-NEWBS = ITAB-BSCHL .
BBSEG-WRBTR = ITAB-WRBTR .
IF NOT ITAB-KOSTL IS INITIAL .
BBSEG-KOSTL = ITAB-KOSTL .
ELSE .
IF NOT ITAB-GSBER IS INITIAL .
BBSEG-GSBER = ITAB-GSBER .
ENDIF .
ENDIF .
BBSEG-ZUONR = ITAB-ZUONR.
BBSEG-SGTXT = ITAB-SGTXT .
IF NOT ITAB-AUFNR IS INITIAL .
BBSEG-AUFNR = ITAB-AUFNR .
ENDIF .
IF NOT ITAB-UMSKZ IS INITIAL .
BBSEG-NEWUM = ITAB-UMSKZ .
ENDIF .
IF ITAB-BSCHL = '29' OR ITAB-BSCHL = '39' OR ITAB-BSCHL = '09' .
BBSEG-ZFBDT = BBKPF-BLDAT .
ENDIF .
IF NOT ITAB-ZLSCH IS INITIAL .
BBSEG-ZLSCH = ITAB-ZLSCH .
ENDIF .
IF NOT ITAB-PERNR IS INITIAL .
BBSEG-PERNR = ITAB-PERNR .
ENDIF .
IF NOT ITAB-ZLSPR IS INITIAL .
BBSEG-ZLSPR = ITAB-ZLSPR .
ENDIF .
TRANSFER BBSEG TO P_SFILE.
ENDLOOP .
IF L_DOCCNT NE 0 .
WRITE :/ P_SFILE , 'has been created' .
WRITE :/ L_DOCCNT , 'DOCUMENTS UPLOADED' .
ELSE .
WRITE :/'INPUT FILE CONTAINS NO DATA' .
ENDIF .
CLOSE DATASET P_SFILE .
ENDFORM. " SET_DATA
Reward points if Useful
Regards
Gokul -
Tcode to create single delivery document for all line items in PO
Hi all,
Sorry if it is a simple question, But I am from SD module. What is Tcode to create a single delivery documents for all line items in PO. I have 3 line items with Different materials having diffent quantities and there are different delivery dates and different delivery schedule dates. I need to create single delivery. Could you please tell me how to do it? What is the Tcode?
Thanks
AnilHi,
Inbound delivery T.code VL31N.
Regards,
JS -
Create a new reservation with multiple line items
When I am creating a reservation through TC MB21, it picks up the GL code assigned to the material but the commitment item is not changing but remains the same as is in the first line item.
Kindly suggest what additional changes needs to be done so that the commitment item is derived from the GL code.
Thanks
ShivajiThanks
-
Hello,
Previously, I was creating zxp from mxi file using the menu "Package zxp Extension" in Extension Manager CS6. But now for Extension manager CC there is no such menu available. Please help me to create zxp using mxi for CC?
Thanks.I need this for both mac and windows. I tried using Extension manager CS6 to create zxp. I am able to create(using CS6) and install (to CC) for one project successfully. But for another project, zxp is created but while installing it is showing error message as, "The MXI file in this extension is invalid. The extension will not be installed."
The same zxp is getting installed with CS6 extension manager. I compared mxi files, couldn't found any difference.
Please help out. Thanks for support.
Thanks,
Deepak -
Creating a PO Using BAPI For Multiple PLants Or Multiple Line Items
Hi All
Can you please suggest me how to create a Purchase Order Using BAPI_PO_Create1 for Multiple Plants Or for Multiple Line items. The Requirement is like the PO is for single material for single vendor but for mulple stores i.e plants
NOte: Suggest me the Creation of PO for MUltiple Line items or for multiple plants Using BAPI . Hope you people will give me the needful.
Regards
Shivakumar BandariHi,
Here is the sample code to do that...
*---> po header data
wa_poheader-vendor = your vendor..
wa_poheader-doc_type = Your doc type..check with Functional contact....
wa_poheader-purch_org = Purchasing Org..
wa_poheader-pur_group = Purchasing Group
*---> po header data (change toolbar)
wa_poheaderx-vendor = 'X'.
wa_poheaderx-doc_type = 'X'.
wa_poheaderx-purch_org = 'X'.
wa_poheaderx-pur_group = 'X'.
*---> poitem data
data: item like ekpo-ebelp.
item = '0010'.
loop at t_parts.
it_poitem-po_item = '00010'.
IT_POITEM-PLANT = Plant..
IT_POITEM-STGE_LOC = Sloc...
*---> poitemx (item data change toolbar)
it_poitemx-po_item = '0010'.
it_poitemx-po_itemx = 'X'.
IT_POITEMX-PLANT = 'X'.
IT_POITEMX-STGE_LOC = 'X'.
*---> add record's to internal table
APPEND: it_poitem,
it_poitemx.
endloop.
*call bapi_po_create1
CLEAR v_ebeln.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = wa_poheader
poheaderx = wa_poheaderx
IMPORTING
exppurchaseorder = v_ebeln
TABLES
return = it_return
poitem = it_poitem
poitemx = it_poitemx.
*---> check the return table for error message
READ TABLE it_return WITH KEY type = 'E'.
IF sy-subrc NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
endif.
Thanks,
Murali -
Unable to create PO with multiple line items through LSMW-BAPI method
Hi All,
I have a requirement of creating PO through LSMW. I can't use LSMW standard batch input program since there are some fileds not available and also it has many limitations. I'm using LSMW-BAPI method ( Business object BUS2012) which create IDOC and uses BAPI_PO_CREATE1 to ultimately post the PO in the system. I am trying to create PO from a single file which contains both Header and Item data.
Now my problem is that everytime PO is being created with Single line item only. Everytime I am giving multiple item data in the source file LSMW is preparing multiple IDOCs for multiple line items. As per my understanding this is happenng since header and item is in the same hierarchy level of IDOC type PORDCR102 and the control record is inserted for every line item in the source file.
It seems that through LSMW-BAPI it is not possible to create PO with multiple line items. Can anybody provide some input regarding this? Thanks in advance.
BR,
Atanu MukherjeeSolved by myself.
Earlier the problem was that LSMW was not being able to recognize items under same header. It was creating new IDOCs every time it gets a new item. To enable this we need to create two structure HEADERDATA and ITEMDATA. Two additional identifier fields with identifier value 'H' and 'I' should be added in these two structures respectively. Then we need one sequential file with the identifiers field followed by the header and Item data. Example:
H~header data
I~item data
I~item data
This would help the standard program to understand what are the items under same header and ultimately create PO with multiple line items.
BR,
Atanu Mukherjee
Maybe you are looking for
-
Desparate for a single key on left side of keyboard that serves as DELETE
I am running a MacBook Pro on 10.5.8 using Microsoft Word 2008. My right arm has aching tendonitis and enabling my left hand to delete stuff would help a ton. Thus, I desparately need a single-key (not function+key or command+key) that DELETES letter
-
Bought new camera to work with Raw images in CS5 but file would not open so I downloaded latest update. It only allowed me to save in a file ( could have OPENED instead of saving so I don't know those results). How do I get the new download to work i
-
Gantt Chart - #DATA# value
Hi All, I am using Oracle Apex version 4.2.2.00.11. I do have a gantt chart in one of my application and that is working fine, in this gantt chart we are not using any custom XML generation logic. Now we got another requirement from client, in this w
-
Special character ' in the string variable
Hi, I need to insert in the string veriable the special character '. How should I do it ? variable = '''. It does not work ... BR Wojcieh
-
If Thunderbird and Firefox is running the Thunderbird is very slow!
If Thunderbird and Firefox is running, the Thunderbird is very-very slow - in Windows 7! If Firefox closed Thunderbird is run fine... very good. If i reopened Firefox browser... the Thunderbird is very-very slow again. What is the problem?