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

Run BDC Group

Former Member
0 Likes
1,397

Hello,

I create a BDC group with BDC_OPEN_GROUP and BDC_CLOSE_GROUP.

How can i run this group into a program?

Thanks,

Sené

Hello,

I create a BDC group with BDC_OPEN_GROUP and BDC_CLOSE_GROUP.

How can i run this group into a program?

Thanks,

Sené

6 REPLIES 6
Read only

Former Member
0 Likes
1,052

Hi Senen,

Create a report program and then add these function modules.

To get a sample code execute SHDB and give any transaction and do the recording and save. Once you are finished select the entry you created and copy it to a zprogram. You have the code. Refer that code, you will understand.

Regards

Arun

Read only

0 Likes
1,052

Thanks Arun, but i think my explanation was very bad.

I know how have to use BDC_OPEN_GROUP and BDC_CLOSE_GROUP. When i run my progran the group A is created using this functions and i can execute A with transaction SM35. But i need execute group A from my program after call BDC_CLOSE_GROUP.

Best regards

Read only

amit_khare
Active Contributor
0 Likes
1,052

Hi,

Make a call to BDC_INSERT Function module.See the sample code.

call function 'BDC_OPEN_GROUP'

exporting

group = 'Z5AK_MM02'

keep = 'X'

user = 'DEVELOPER'.

if sy-subrc <> 0.

message e016.

endif.

loop at it_mater.

select single vpsta from mara into v_vpsta where matnr = it_mater-v_matnum.

call function 'SELECTION_VIEWS_FIND'

exporting

bildsequenz = '21'

pflegestatus = v_vpsta

tables

bildtab = i_bildtab.

endloop.

loop at i_bildtab where guifu = 'SP04'.

concatenate 'MSICHTAUSW-KZSEL(' i_bildtab-idxbd ')' into v_var.

endloop.

loop at it_mater.

clear it_bdc.

it_bdc-program = 'SAPLMGMM'.

it_bdc-dynpro = '0060'.

it_bdc-dynbegin = 'X'.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'RMMG1-MATNR'.

it_bdc-fval = it_mater-v_matnum.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'BDC_OKCODE'.

it_bdc-fval = '/00'.

append it_bdc.

clear it_bdc.

it_bdc-program = 'SAPLMGMM'.

it_bdc-dynpro = '0070'.

it_bdc-dynbegin = 'X'.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'BDC_OKCODE'.

it_bdc-fval = '=RESA'.

append it_bdc.

clear it_bdc.

it_bdc-program = 'SAPLMGMM'.

it_bdc-dynpro = '0070'.

it_bdc-dynbegin = 'X'.

append it_bdc.

clear it_bdc.

it_bdc-fnam = v_var.

it_bdc-fval = 'X'.

append it_bdc.

  • CLEAR it_bdc.

  • it_bdc-fnam = 'MSICHTAUSW-KZSEL(03)'.

  • it_bdc-fval = 'X'.

  • APPEND it_bdc.

clear it_bdc.

it_bdc-fnam = 'BDC_OKCODE'.

it_bdc-fval = '=ENTR'.

append it_bdc.

clear it_bdc.

it_bdc-program = 'SAPLMGMM'.

it_bdc-dynpro = '0080'.

it_bdc-dynbegin = 'X'.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'RMMG1-WERKS'.

it_bdc-fval = it_mater-v_werks.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'RMMG1-VKORG'.

it_bdc-fval = it_mater-v_sales.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'RMMG1-VTWEG'.

it_bdc-fval = it_mater-v_channel.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'BDC_OKCODE'.

it_bdc-fval = '=ENTR'.

append it_bdc.

clear it_bdc.

it_bdc-program = 'SAPLMGMM'.

it_bdc-dynpro = '4000'.

it_bdc-dynbegin = 'X'.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'BDC_OKCODE'.

it_bdc-fval = '=BU'.

append it_bdc.

*call transaction 'Z5AK3' using it_bdc mode 'N' MESSAGES INTO ITAB.

call function 'BDC_INSERT'

exporting

tcode = 'MM02'

tables

dynprotab = it_bdc.

if sy-subrc <> 0. .

message e016.

endif.

refresh it_bdc.

endloop.

call function 'BDC_CLOSE_GROUP'.

if sy-subrc <> 0.

message e017.

endif.

Regards,

Amit

Read only

Former Member
0 Likes
1,052

Hi,

use rsbdcsub program to run session implicitly from program

when session is created

use table apQI

Regards

amole

Read only

0 Likes
1,052

Thanks Amole,

this was the solution!

Best Regards

Sené

Read only

Former Member
0 Likes
1,052

Hi,

use below logic

SUBMIT RSBDCSUB AND RETURN

WITH MAPPE = P_GROUP "Session

WITH VON = GV_QUEUE_DT "Creation dt

WITH Z_VERARB = GC_MARK "Status: to process

WITH FEHLER = SPACE. "Status: Incorrect

GV_SUBRC = SY-SUBRC.

Regards

amole