Application Development 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: 

BDC material

Former Member
0 Kudos

hi ,

I am new to BDC ,can any one post me BDC material with examples just like "abap in 21 days " step by step guide.

I tried many sites .But i didnt understand them,

thanks in advance

2 REPLIES 2

raja_thangamani
Active Contributor
0 Kudos

Here is the example code of changing sales order using BDC.

REPORT ZVA02 .


data : bdcmsg like bdcmsgcoll occurs 0 with header line.
data : bdcdata like bdcdata  occurs 0 with header line.
data : v_msg(200).

perform va02 using :
      'SAPMV45A' '0102' 'X' '' '',
      'SAPMV45A' '0102' '' 'BDC_CURSOR' 'VBAK-VBELN',
      'SAPMV45A' '0102' '' 'VBAK-VBELN' '30000044',
      'SAPMV45A' '0102' '' 'BDC_OKCODE' '/00',

      'SAPMV45A' '4001' 'X' '' '',
      'SAPMV45A' '4001' '' 'BDC_OKCODE' '=POPO',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_CURSOR' 'RV45A-MABNR(01)',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',

      'SAPMV45A' '0251' 'X' '' '',
      'SAPMV45A' '0251' '' 'BDC_CURSOR' 'RV45A-POSNR',
      'SAPMV45A' '0251' '' 'BDC_OKCODE' '=POSI',
      'SAPMV45A' '0251' '' 'RV45A-POSNR' '20',


      'SAPMV45A' '4001' 'X' '' '',
      'SAPMV45A' '4001' '' 'BDC_OKCODE' '=ITEM',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_CURSOR' 'RV45A-MABNR(01)',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',

      'SAPMV45A' '4003' 'X' '' '',
      'SAPMV45A' '4003' '' 'BDC_OKCODE' '=T05',
      'SAPMV45A' '4003' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4003' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4003' '' 'BDC_CURSOR' 'RV45A-KWMENG',

      'SAPLV60F' '4001' 'X' '' '',
      'SAPLV60F' '4001' '' 'BDC_OKCODE' '=SBACK',
      'SAPLV60F' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPLV60F' '4001' '' 'BDC_SUBSCR' 'SAPLV60F',
      'SAPLV60F' '4001' '' 'BDC_CURSOR' 'FPLT-AFDAT(01)',
      'SAPLV60F' '4001' '' 'FPLT-AFDAT(01)' '21.04.2004',

      'SAPMV45A' '4001' 'X' '' '',
      'SAPMV45A' '4001' '' 'BDC_OKCODE' '=SICH',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_CURSOR' 'RV45A-MABNR(01)',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A'.


call transaction 'VA02' using bdcdata mode 'N' update 'A' messages into

bdcmsg.

if sy-subrc ne 0.

loop at bdcmsg where msgtyp = 'E'.

Write: ' Sale Order is being Processed by' , bdcmsg-msgv2.

endloop.
endif.

form va02 using prg dyn beg fname fvalue.

bdcdata-program = prg.

bdcdata-DYNPRO = dyn.

bdcdata-DYNBEGIN = beg.

bdcdata-FNAM = fname.
bdcdata-FVAL = fvalue.
append bdcdata.
endform.

Raja T

raja_thangamani
Active Contributor
0 Kudos

Here is the example code of changing sales order using BDC.

REPORT ZVA02 .


data : bdcmsg like bdcmsgcoll occurs 0 with header line.
data : bdcdata like bdcdata  occurs 0 with header line.
data : v_msg(200).

perform va02 using :
      'SAPMV45A' '0102' 'X' '' '',
      'SAPMV45A' '0102' '' 'BDC_CURSOR' 'VBAK-VBELN',
      'SAPMV45A' '0102' '' 'VBAK-VBELN' '30000044',
      'SAPMV45A' '0102' '' 'BDC_OKCODE' '/00',

      'SAPMV45A' '4001' 'X' '' '',
      'SAPMV45A' '4001' '' 'BDC_OKCODE' '=POPO',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_CURSOR' 'RV45A-MABNR(01)',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',

      'SAPMV45A' '0251' 'X' '' '',
      'SAPMV45A' '0251' '' 'BDC_CURSOR' 'RV45A-POSNR',
      'SAPMV45A' '0251' '' 'BDC_OKCODE' '=POSI',
      'SAPMV45A' '0251' '' 'RV45A-POSNR' '20',


      'SAPMV45A' '4001' 'X' '' '',
      'SAPMV45A' '4001' '' 'BDC_OKCODE' '=ITEM',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_CURSOR' 'RV45A-MABNR(01)',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',

      'SAPMV45A' '4003' 'X' '' '',
      'SAPMV45A' '4003' '' 'BDC_OKCODE' '=T05',
      'SAPMV45A' '4003' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4003' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4003' '' 'BDC_CURSOR' 'RV45A-KWMENG',

      'SAPLV60F' '4001' 'X' '' '',
      'SAPLV60F' '4001' '' 'BDC_OKCODE' '=SBACK',
      'SAPLV60F' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPLV60F' '4001' '' 'BDC_SUBSCR' 'SAPLV60F',
      'SAPLV60F' '4001' '' 'BDC_CURSOR' 'FPLT-AFDAT(01)',
      'SAPLV60F' '4001' '' 'FPLT-AFDAT(01)' '21.04.2004',

      'SAPMV45A' '4001' 'X' '' '',
      'SAPMV45A' '4001' '' 'BDC_OKCODE' '=SICH',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A',
      'SAPMV45A' '4001' '' 'BDC_CURSOR' 'RV45A-MABNR(01)',
      'SAPMV45A' '4001' '' 'BDC_SUBSCR' 'SAPMV45A'.


call transaction 'VA02' using bdcdata mode 'N' update 'A' messages into

bdcmsg.

if sy-subrc ne 0.

loop at bdcmsg where msgtyp = 'E'.

Write: ' Sale Order is being Processed by' , bdcmsg-msgv2.

endloop.
endif.

form va02 using prg dyn beg fname fvalue.

bdcdata-program = prg.

bdcdata-DYNPRO = dyn.

bdcdata-DYNBEGIN = beg.

bdcdata-FNAM = fname.
bdcdata-FVAL = fvalue.
append bdcdata.
endform.

Raja T