‎2007 Jul 18 8:12 AM
I have to convert a BDC program generated by recording of MI01 into a Function Module, the generated program is attached below.
Can anyone tel me how to do that, IF anyone can send me a sample code for the BDC and the converted Function module with import and export parametrs with table name it will be heplfu for me or please convert the given code to FM.
report ZTEST_RECORDING
no standard page heading line-size 255.
include bdcrecx1.
start-of-selection.
perform open_group.
perform bdc_dynpro using 'SAPMM07I' '0700'.
perform bdc_field using 'BDC_CURSOR'
'IKPF-XBUFI'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RM07I-BLDAT'
'16.07.2007'.
perform bdc_field using 'RM07I-GIDAT'
'16.07.2007'.
perform bdc_field using 'IKPF-WERKS'
'2000'.
perform bdc_field using 'IKPF-LGORT'
'CS01'.
perform bdc_field using 'IKPF-XBUFI'
'X'.
perform bdc_field using 'RM07I-XLVOCA'
''.
perform bdc_dynpro using 'SAPMM07I' '0721'.
perform bdc_field using 'BDC_CURSOR'
'ISEG-MATNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'BU'.
perform bdc_field using 'ISEG-MATNR(01)'
''.
perform bdc_field using 'ISEG-MATNR(02)'
'150060702000'.
perform bdc_field using 'ISEG-MATNR(03)'
'150060802000'.
perform bdc_field using 'ISEG-MATNR(04)'
'150062902000'.
perform bdc_field using 'ISEG-MATNR(05)'
'150120300000'.
perform bdc_field using 'ISEG-MATNR(06)'
'150120400000'.
perform bdc_field using 'ISEG-MATNR(07)'
'150120500000'.
perform bdc_field using 'ISEG-MATNR(08)'
'150120600000'.
perform bdc_field using 'ISEG-MATNR(09)'
''.
perform bdc_field using 'ISEG-MATNR(10)'
'150120800000'.
perform bdc_field using 'ISEG-MATNR(11)'
'150120805000'.
perform bdc_field using 'ISEG-MATNR(12)'
'150120900000'.
perform bdc_field using 'ISEG-MATNR(13)'
'150120905000'.
perform bdc_field using 'ISEG-MATNR(14)'
''.
perform bdc_transaction using 'MI01'.
perform close_group.
I dont no the generated code is OK or not because i did recording and generate a program, no changes done it that.
Regards,
Nikhil
‎2007 Jul 18 8:16 AM
Hi Nikhil,
I have read about the process that you've followed.
Instead of generating a program after your recording you can opt for creation of a Function Module using the button provided in SHDB transaction screen.
Just after recording plz make use of the button and your work would be done.
<b>Rewards points if this helps,</b>
Kiran
‎2007 Jul 18 8:16 AM
Hi Nikhil,
I have read about the process that you've followed.
Instead of generating a program after your recording you can opt for creation of a Function Module using the button provided in SHDB transaction screen.
Just after recording plz make use of the button and your work would be done.
<b>Rewards points if this helps,</b>
Kiran
‎2007 Jul 18 8:16 AM
In transaction SHDB first record your required transaction then click on Create Function Module button and not the Create Program button. The system will do the rest for you.
Cheers,
Sougata.