Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC for VA01

former_member188791
Participant
0 Likes
4,253

Hi Group,

For one of my requirement I am using BDC for VA01 transaction, Main recoding contains below sections:

1. Header in

2. Go to -> Header -> Text

2. Item (Material and quantity)

3. Go to --> Item->Additional Data A

4.Go to --> Item--> Order data

5.Go to --> Condition

I recorded successfully but in the code I am getting correct logic to apply for multiple line items, can any body have similar recording please share.

Here I am attaching BDC recording:

--------------------------------------------------------------------

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'

                               'ZDR1'.

perform bdc_field       using 'VBAK-VKORG'

                               'GRCO'.

perform bdc_field       using 'VBAK-VTWEG'

                               '01'.

perform bdc_field       using 'VBAK-SPART'

                               '01'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBAK-FAKSK'.

perform bdc_field       using 'VBAK-FAKSK'

                               ''.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '=KTEX_SUB'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_field       using 'BDC_CURSOR'

                               'RV45A-MABNR(01)'.

perform bdc_dynpro      using 'SAPMV45A' '4002'.

perform bdc_field       using 'BDC_OKCODE'

                               '/EBACK'.

perform bdc_field       using 'LV70T-SPRAS'

                               'EN'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBAP-ZMENG(03)'.

perform bdc_field       using 'RV45A-MABNR(01)'

                               '815'.

perform bdc_field       using 'RV45A-MABNR(02)'

                               '814'.

perform bdc_field       using 'RV45A-MABNR(03)'

                               '813'.

perform bdc_field       using 'VBAP-ZMENG(01)'

                               '              323'.

perform bdc_field       using 'VBAP-ZMENG(02)'

                               '               34'.

perform bdc_field       using 'VBAP-ZMENG(03)'

                               '               23'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '=PBES'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

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\12'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-BSTKD_E'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'VBKD-BSTKD_E'

                               'US9999999'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\09'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-KDKG1'.

perform bdc_field       using 'VBAP-MVGR1'

                               'Z01'.

perform bdc_field       using 'VBKD-KDKG1'

                               '01'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\05'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBAP-POSEX'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'VBKD-BSTKD_E'

                               'US9999999'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(01)'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(01)'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(01)'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(09)'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KBETR(08)'.

perform bdc_field       using 'KOMV-KSCHL(08)'

                               'ZPR0'.

perform bdc_field       using 'KOMV-KBETR(08)'

                               '           10.00'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=POS+'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(09)'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KBETR(08)'.

perform bdc_field       using 'KOMV-KSCHL(08)'

                               'ZPR0'.

perform bdc_field       using 'KOMV-KBETR(08)'

                               '           10.00'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\09'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(09)'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-BSTKD_E'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'VBKD-BSTKD_E'

                               'US9999999'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\12'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBAP-POSEX'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'VBKD-BSTKD_E'

                               'US9999999'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=POS+'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-KDKG1'.

perform bdc_field       using 'VBAP-MVGR1'

                               'Z01'.

perform bdc_field       using 'VBKD-KDKG1'

                               '02'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\09'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-KDKG1'.

perform bdc_field       using 'VBAP-MVGR1'

                               'Z01'.

perform bdc_field       using 'VBKD-KDKG1'

                               '02'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\05'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-BSTKD_E'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'VBKD-BSTKD_E'

                               'US9999999'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KBETR(08)'.

perform bdc_field       using 'KOMV-KSCHL(08)'

                               'ZPR0'.

perform bdc_field       using 'KOMV-KBETR(08)'

                               '           10.00'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/EBACK'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(09)'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\01'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_field       using 'BDC_CURSOR'

                               'RV45A-MABNR(04)'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBAK-AUGRU'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_field       using 'VBAK-AUGRU'

                               '001'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '=SICH'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_field       using 'VBAK-AUGRU'

                               '001'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_field       using 'BDC_CURSOR'

                               'RV45A-MABNR(01)'.

perform bdc_dynpro      using 'SAPLSPO2' '0101'.

perform bdc_field       using 'BDC_OKCODE'

                               '=OPT1'.

perform bdc_transaction using 'VA01' .

perform close_group.

---------------------------------------------------------------------

Hi Group,

For one of my requirement I am using BDC for VA01 transaction, Main recoding contains below sections:

1. Header in

2. Go to -> Header -> Text

2. Item (Material and quantity)

3. Go to --> Item->Additional Data A

4.Go to --> Item--> Order data

5.Go to --> Condition

I recorded successfully but in the code I am getting correct logic to apply for multiple line items, can any body have similar recording please share.

Here I am attaching BDC recording:

--------------------------------------------------------------------

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'

                               'ZDR1'.

perform bdc_field       using 'VBAK-VKORG'

                               'GRCO'.

perform bdc_field       using 'VBAK-VTWEG'

                               '01'.

perform bdc_field       using 'VBAK-SPART'

                               '01'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBAK-FAKSK'.

perform bdc_field       using 'VBAK-FAKSK'

                               ''.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '=KTEX_SUB'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_field       using 'BDC_CURSOR'

                               'RV45A-MABNR(01)'.

perform bdc_dynpro      using 'SAPMV45A' '4002'.

perform bdc_field       using 'BDC_OKCODE'

                               '/EBACK'.

perform bdc_field       using 'LV70T-SPRAS'

                               'EN'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBAP-ZMENG(03)'.

perform bdc_field       using 'RV45A-MABNR(01)'

                               '815'.

perform bdc_field       using 'RV45A-MABNR(02)'

                               '814'.

perform bdc_field       using 'RV45A-MABNR(03)'

                               '813'.

perform bdc_field       using 'VBAP-ZMENG(01)'

                               '              323'.

perform bdc_field       using 'VBAP-ZMENG(02)'

                               '               34'.

perform bdc_field       using 'VBAP-ZMENG(03)'

                               '               23'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '=PBES'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

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\12'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-BSTKD_E'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'VBKD-BSTKD_E'

                               'US9999999'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\09'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-KDKG1'.

perform bdc_field       using 'VBAP-MVGR1'

                               'Z01'.

perform bdc_field       using 'VBKD-KDKG1'

                               '01'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\05'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBAP-POSEX'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'VBKD-BSTKD_E'

                               'US9999999'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(01)'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(01)'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(01)'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(09)'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KBETR(08)'.

perform bdc_field       using 'KOMV-KSCHL(08)'

                               'ZPR0'.

perform bdc_field       using 'KOMV-KBETR(08)'

                               '           10.00'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=POS+'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(09)'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KBETR(08)'.

perform bdc_field       using 'KOMV-KSCHL(08)'

                               'ZPR0'.

perform bdc_field       using 'KOMV-KBETR(08)'

                               '           10.00'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\09'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(09)'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-BSTKD_E'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'VBKD-BSTKD_E'

                               'US9999999'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\12'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBAP-POSEX'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'VBKD-BSTKD_E'

                               'US9999999'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=POS+'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-KDKG1'.

perform bdc_field       using 'VBAP-MVGR1'

                               'Z01'.

perform bdc_field       using 'VBKD-KDKG1'

                               '02'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\09'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-KDKG1'.

perform bdc_field       using 'VBAP-MVGR1'

                               'Z01'.

perform bdc_field       using 'VBKD-KDKG1'

                               '02'.

perform bdc_dynpro      using 'SAPMV45A' '4003'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\05'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBKD-BSTKD_E'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'VBKD-BSTKD_E'

                               'US9999999'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KBETR(08)'.

perform bdc_field       using 'KOMV-KSCHL(08)'

                               'ZPR0'.

perform bdc_field       using 'KOMV-KBETR(08)'

                               '           10.00'.

perform bdc_dynpro      using 'SAPMV45A' '5003'.

perform bdc_field       using 'BDC_OKCODE'

                               '/EBACK'.

perform bdc_field       using 'BDC_CURSOR'

                               'KOMV-KSCHL(09)'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '=T\01'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_field       using 'BDC_CURSOR'

                               'RV45A-MABNR(04)'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'BDC_CURSOR'

                               'VBAK-AUGRU'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_field       using 'VBAK-AUGRU'

                               '001'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_dynpro      using 'SAPMV45A' '4001'.

perform bdc_field       using 'BDC_OKCODE'

                               '=SICH'.

perform bdc_field       using 'VBKD-BSTKD'

                               'PO Ref AAAAA'.

perform bdc_field       using 'KUAGV-KUNNR'

                               '500238'.

perform bdc_field       using 'KUWEV-KUNNR'

                               '500238'.

perform bdc_field       using 'VBKD-PRSDT'

                               '05.08.2013'.

perform bdc_field       using 'VBAK-AUGRU'

                               '001'.

perform bdc_field       using 'VBKD-FKDAT'

                               '05.08.2013'.

perform bdc_field       using 'BDC_CURSOR'

                               'RV45A-MABNR(01)'.

perform bdc_dynpro      using 'SAPLSPO2' '0101'.

perform bdc_field       using 'BDC_OKCODE'

                               '=OPT1'.

perform bdc_transaction using 'VA01' .

perform close_group.

---------------------------------------------------------------------

24 REPLIES 24
Read only

FredericGirod
Active Contributor
0 Likes
3,314

Hi,

the standard IDoc ORDER use a batch input to create the sales order, maybe have a look to this IDoc and how SAP do it ..

(or used the program made by SAP ..)

regards

Fred

Read only

0 Likes
3,314

Hi Fred,

Thank you for your reply, I am getting your point ,you mean without using BDC are you suggesting IDOC ?please can you elaborate,if you have any reference code please share with me

Read only

0 Likes
3,314

Hi Rajiv Kurra

Dont use BDC , go with BAPI or LSMW or IDOC method which already suggested by Frédéric Girod

BAPI name is for va01, BAPI_SALESORDER_CREATEFROMDAT2

Today morning i have read another article here in SCN

hope that link helps you sure to proceed further

Regards,

Bastin.G

Read only

0 Likes
3,314

Hi Vinoth,

Thank you for your reply,but due to Error Handling I want to use BDC, if I use session method user can go to SM35 and see the error and can give input on the screen to fix the errors, if I use BAPI or IDOC that facility will not be available.


Any comments welcome.

Read only

0 Likes
3,314

Hi Rajiv Kurra

In BAPI also we can handle error handling , anyway here you want to use BDC only

I have furnished one small VA01 BDC program for your reference

Kindly go through it , it was done one year back ,i hope you can use that logic in your program

Regards,

Bastin.G

Read only

0 Likes
3,314

Hi Rajiv Kurra

In addition , error handling you can do it right ? while handling BAPI

just correct me , if i have said wrong

in BAPI_SALESORDER_CREATEFROMDAT2

there is a RETURN table there , check that FM,  you can put the code based on messages

Regards,

Bastin.G

Read only

0 Likes
3,314

If you need to find how sap create the document from a message use the trans. WE57. For ORDERS it's IDOC_INPUT_ORDERS

regards

Fred

Read only

Former Member
0 Likes
3,314

What exactly is failing for you?

Neal

Read only

0 Likes
3,314

Hi Neal,

For Multiple Line items in table control its failing ,also Additional data screens its not going.

Read only

0 Likes
3,314

Hi Rajiv,

In order to fill all the line items, use P+ command after each line item fill.

Following sample code may help you.

perform bdc_field       using 'BDC_OKCODE'

                               '=P+'.

perform bdc_field       using 'RV45A-MABNR(01)'

                               '815'.

Thanks,

Govind

Read only

Former Member
0 Likes
3,314

A lot of people who have trouble with BDC, are having trouble positioning line item for access.

The solution is to find a repeatable pattern.  Filling in row 1 then row 2 and so doesn't work because you run out of rows.  Ideal would be to fill in the same row every time.

So, what I do is always fill in row 2 then reposition to that line number.  Repositioning puts that line number  in row 1 and then you can fill in row two again.  Just put her into a loop until all rows are entered.

HTH,

Neal

PS: Avoid BDC when a BAPI exists as mentioned above!

Read only

Former Member
0 Likes
3,314

Hi,

Dont use BDC. use BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'.

Write one program for create sales order .Upload the excel file using function module 'upload'.

Read only

former_member188791
Participant
0 Likes
3,314

Hi Vinoth,

yes in BAPI we can use return table but in my case after running Batch session user wants to correct Errors on the screen by going to SM35 , also in SM35 there is a visibility to see how many sessions failed or succeess for that particular day.

Read only

gurunathkumar_dadamu
Active Contributor
0 Likes
3,314

Hi Rajiv,

Please do the recording again for the vertical tab for the table control and then try with the code as per Govinda Battul.

Regards,

Gurunath

Read only

0 Likes
3,314

Hi Team,

Thank you for all whoever responded,but when I am running my recording it is exiting when Warning message is coming ,it not even going to Item level.any thoughts

"Please check the billing date"

Read only

0 Likes
3,314

Hi Rajiv Kurra,

Pl. share your complete code to analyze.

or

Please see this links for your reference

http://www.erpgreat.com/abap/bdc-example-using-table-control-in-bdc.htm

http://scn.sap.com/thread/332822.

Read only

0 Likes
3,314

Have you checked the format of the date that you are putting in?

Other similar things that can go wrong:

If you are working in Dev, the date physical month may not be open.  Ask your FICO or SD Functional.

Read only

0 Likes
3,314

Hi Group,

Hi Group,

I have requirement for creating sales order using BDC ,my file structure is shown below:

Order type    Sales Organisation    Distribution Channel    Division                                 

OR1             1000                     10                     10                           

Customer     Material Code    Qty    Price

35000999    10002345    257    5.93

35000999    10002346    33    5.93

35000999    10923457    22    267.33

35000999    10334568    56    234.00

35000234    10002345    1234    5.93

35000234    10002345    257    5.93

as per BDC recording for each customer one Sales order needs to create, for example in the above file structure for customer 35000999 I need to create one order for 4 materials .

customer field should be in header and other 3 fields should be in Item,can any body suggest how I can group header and Item from the above file structure.

Header

-----

Order type

Sales Organisation

Distribution Channel

Division

Customer

Item

----

Material Code

Qty

Price

Read only

0 Likes
3,314

Will there only be 1 SO per customer per file?

Neal

Read only

0 Likes
3,314

yes,1 SO per customer,if n customers exists in File "n" sales orders needs to be created.

Read only

0 Likes
3,314

Is there a reason as to why you are still using BDC after virtually everybody who has replied has said not to use BDC.

Read only

0 Likes
3,314

Hi Martin,

I am using BDC maily because of Error Handling,user wants to correct errors online.

Read only

0 Likes
3,314

SO,

This:

Order type    Sales Organisation    Distribution Channel    Division                                 

OR1             1000                     10                     10                           

Customer     Material Code    Qty    Price

35000999    10002345    257    5.93

35000999    10002346    33    5.93

35000999    10923457    22    267.33

35000999    10334568    56    234.00

35000234    10002345    1234    5.93

35000234    10002345    257    5.93

Could look more like this:

Order type    Sales Organisation    Distribution Channel    Division                                 

OR1             1000                     10                     10                            35000999

OR1         1000                 10                 10                        35000234

Customer     Material Code    Qty    Price

35000999    10002345    257    5.93

35000999    10002346    33    5.93

35000999    10923457    22    267.33

35000999    10334568    56    234.00

35000234    10002345    1234    5.93

35000234    10002345    257    5.93

When you read, then the Header could go into IT_Header

and the Detail could go into IT_detail.

loop at IT_Header

BDC create your header

loop at IT-detail

BDC create your Detail

endloop

BDC Save

Endloop

Does that help?

Neal

Read only

0 Likes
3,314

You get errors when using the BAPI also. You could be spending days on trying to get the BDC to work. It would not take that long using the BAPI.

You are crazy to be doing BDC. Especially when you dont actually know what you are doing.