Skip to Content
0
Former Member
Jan 29, 2008 at 10:19 AM

BDC to create SO(VA01) for multiple line items

271 Views

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.

sankargoud.j@gmail.com

Pls help me this is urgent requirement.

Thanks & Regards,

J.Lokesh