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

Error handling in BDC

Former Member
0 Likes
443

Hi ,

i used Bathc input method ,after that i have to display success and failure records details , so how we can do this,

can anyone pls tell me with example .

THX

Hi ,

i used Bathc input method ,after that i have to display success and failure records details , so how we can do this,

can anyone pls tell me with example .

THX

2 REPLIES 2
Read only

Former Member
0 Likes
407

Hi,

if you are using the call transaction method in BDC, the error or success messages will be stored in table BDCDATA...(here IT_BDCDATA)

see the sample code below:

  • Start of Selection

START-OF-SELECTION.

  • BDC recording for ME22 : Update line item qty : MENGE field

PERFORM bdc_start USING 'SAPMM06E' '0105'.

PERFORM bdc_proc USING 'BDC_CURSOR' 'RM06E-BSTNR'.

PERFORM bdc_proc USING 'BDC_OKCODE' '/00'.

PERFORM bdc_proc USING 'RM06E-BSTNR' '4500050023'.

PERFORM bdc_start USING 'SAPMM06E' '0120'.

PERFORM bdc_proc USING 'BDC_CURSOR' 'EKPO-MENGE(01)'.

PERFORM bdc_proc USING 'BDC_OKCODE' '=BU'.

  • PERFORM bdc_proc USING 'RM06E-EBELP' '10'.

PERFORM bdc_proc USING 'EKPO-MENGE(01)' p_qty.

PERFORM bdc_start USING 'SAPLSPO1' '0300'.

PERFORM bdc_proc USING 'BDC_OKCODE' '=YES'.

  • Call the transaction

CALL TRANSACTION 'ME22' USING it_bdcdata MODE 'A' MESSAGES IT_BDCDATA.

******************************

loop at it_bdcdata.

  • Process or display messages

endloop.

****************************

&----


*& Form BDC_START

&----


  • text

----


  • -->P_SNAM text

  • -->P_SVAL text

----


FORM bdc_start USING p_snam

p_sval.

wa_bdcdata-program = p_snam.

wa_bdcdata-dynpro = p_sval.

wa_bdcdata-dynbegin = 'X'.

APPEND wa_bdcdata TO it_bdcdata.

CLEAR wa_bdcdata.

ENDFORM. " BDC_START

&----


*& Form BDC_PROC

&----


  • text

----


  • -->P_FNAM text

  • -->P_FVAL text

----


FORM bdc_proc USING p_fnam

p_fval.

wa_bdcdata-fnam = p_fnam.

wa_bdcdata-fval = p_fval.

  • wa_bdcdata-dynbegin = 'X'.

APPEND wa_bdcdata TO it_bdcdata.

CLEAR wa_bdcdata.

ENDFORM. " BDC_PROC

Reward if useful

Regards

Shiva

Read only

0 Likes
407

sir ,

what is i clearly mentioned na it is in Batch input method again ur telling abt call transaction methos ...