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

Convert BDC program into Function Module...Urgent

Former Member
0 Likes
1,415

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
770

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

2 REPLIES 2
Read only

Former Member
0 Likes
771

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

Read only

Sougata
Active Contributor
0 Likes
770

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.