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 recording

Former Member
0 Likes
435

hi friends,

this is my code for the bdc rec program.

LOOP AT T_FOR_DISP .

REFRESH T_BDCDATA.

SET PARAMETER ID 'MAT' FIELD T_FOR_DISP-MATNR.

PERFORM BDC_DYNPRO USING 'SAPMM60X'

'0106' .

PERFORM BDC_FIELD USING 'BDC_CURSOR'

T_FOR_DISP-MATNR .

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00' .

PERFORM BDC_FIELD USING 'AM60X-MATAW'

'X' .

PERFORM BDC_FIELD USING 'AM60X-MATNR'

T_FOR_DISP-MATNR .

  • PERFORM BDC_FIELD USING 'AM60X-PRGRP'

  • '' .

PERFORM BDC_FIELD USING 'AM60X-WERKS'

T_FOR_DISP-WERKS .

PERFORM BDC_FIELD USING 'AM60X-VERAW'

'X' .

PERFORM BDC_FIELD USING 'RM60X-VERSB'

T_FOR_DISP-VERSB .

PERFORM BDC_FIELD USING 'RM60X-DATVE'

T_FOR_DISP-DATVE .

PERFORM BDC_FIELD USING 'RM60X-DATBE'

T_FOR_DISP-DATBE .

PERFORM BDC_FIELD USING 'RM60X-ENTLU'

T_FOR_DISP-ENTLU .

PERFORM BDC_DYNPRO USING 'SAPLM60E'

'0200' .

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=POLO' .

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0204KOPF1'.

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0202SUB2' .

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PBPT-MATNR(01)'.

PERFORM BDC_FIELD USING 'RM60X-PBPT_SELKZ(01)'

'X'.

PERFORM BDC_DYNPRO USING 'SAPLSP01'

'0500' .

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=OPT1' .

PERFORM BDC_DYNPRO USING 'SAPLM60E'

'0200' .

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=SICH' .

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0204KOPF1' .

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0202SUB2' .

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PBPT-MATNR(01)'.

CALL TRANSACTION 'MD62'

USING T_BDCDATA

and skip first screen.

  • MODE 'N'

  • UPDATE 'A'

  • MESSAGES INTO T_MESSAGES.

*DELETE T_FOR_DISP.

ENDLOOP.

From the above code, i'm able to trigger the transaction from the program, but unable to perform the last two operations - deleting the entries in transaction and saving it.

Plz look into my code and if you need more info. plz let me know.

Advance thanks and hoping to reward you asap.

hi friends,

this is my code for the bdc rec program.

LOOP AT T_FOR_DISP .

REFRESH T_BDCDATA.

SET PARAMETER ID 'MAT' FIELD T_FOR_DISP-MATNR.

PERFORM BDC_DYNPRO USING 'SAPMM60X'

'0106' .

PERFORM BDC_FIELD USING 'BDC_CURSOR'

T_FOR_DISP-MATNR .

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00' .

PERFORM BDC_FIELD USING 'AM60X-MATAW'

'X' .

PERFORM BDC_FIELD USING 'AM60X-MATNR'

T_FOR_DISP-MATNR .

  • PERFORM BDC_FIELD USING 'AM60X-PRGRP'

  • '' .

PERFORM BDC_FIELD USING 'AM60X-WERKS'

T_FOR_DISP-WERKS .

PERFORM BDC_FIELD USING 'AM60X-VERAW'

'X' .

PERFORM BDC_FIELD USING 'RM60X-VERSB'

T_FOR_DISP-VERSB .

PERFORM BDC_FIELD USING 'RM60X-DATVE'

T_FOR_DISP-DATVE .

PERFORM BDC_FIELD USING 'RM60X-DATBE'

T_FOR_DISP-DATBE .

PERFORM BDC_FIELD USING 'RM60X-ENTLU'

T_FOR_DISP-ENTLU .

PERFORM BDC_DYNPRO USING 'SAPLM60E'

'0200' .

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=POLO' .

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0204KOPF1'.

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0202SUB2' .

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PBPT-MATNR(01)'.

PERFORM BDC_FIELD USING 'RM60X-PBPT_SELKZ(01)'

'X'.

PERFORM BDC_DYNPRO USING 'SAPLSP01'

'0500' .

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=OPT1' .

PERFORM BDC_DYNPRO USING 'SAPLM60E'

'0200' .

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=SICH' .

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0204KOPF1' .

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0202SUB2' .

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PBPT-MATNR(01)'.

CALL TRANSACTION 'MD62'

USING T_BDCDATA

and skip first screen.

  • MODE 'N'

  • UPDATE 'A'

  • MESSAGES INTO T_MESSAGES.

*DELETE T_FOR_DISP.

ENDLOOP.

From the above code, i'm able to trigger the transaction from the program, but unable to perform the last two operations - deleting the entries in transaction and saving it.

Plz look into my code and if you need more info. plz let me know.

Advance thanks and hoping to reward you asap.

1 REPLY 1
Read only

Former Member
0 Likes
369

hi Praveen,

first, put the OKCODE after the group you are processing, look:

yours' like this:

PERFORM BDC_DYNPRO USING 'SAPLM60E'

'0200' .

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=SICH' .

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0204KOPF1' .

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0202SUB2' .

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PBPT-MATNR(01)'.

change to:

PERFORM BDC_DYNPRO USING 'SAPLM60E'

'0200' .

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0204KOPF1' .

PERFORM BDC_FIELD USING 'BDC_SUBSCR'

'SAPLM60E 0202SUB2' .

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'PBPT-MATNR(01)'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=SICH' .

I already had problem cuz of this...

regards,

Roberto