Application Development 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: 

Sample code Inbound IDOC error processing

Former Member
0 Kudos

Can some body help me with sample error processing code for an Inbound IDOC? I will have to process an incoming DEBMAS IDOC using a custom function module which inturn calls the function module IDOC_INPUT_DEBITOR and a few other BAPIs that doesn't have the IDOC_STATUS Internal table passed any where.

I also want to know the places where I have to incorporate this error processing code within the custom function module. While I do know what is the processing that I have to do and also that statuses 60, 56 and 51 are to be checked. But I am trying to understand how can we code checking the status of IDOC.

How about this, do you think, this works?

data: l_idoc_status like line of IDOC_STATUS.

read table IDOC_STATUS into l_idoc_status with key status = 51.

if sy-subrc = 0.

perform send_email_notification.

endif.

Thanks much in advance.

1 REPLY 1

Former Member
0 Kudos

LOOP AT idoc_status WHERE status = '56' OR status = '60' OR status = '63'

OR status = '65' OR status = '67' OR status = '68' OR status = '59'

OR status = '72' OR status = '51'.

PERFORM send_email_notification.

RETURN.

ENDLOOP.

Is there a better way of writing this code?