Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

drop IDOC if a field is empty


I am sending a IDOC to PI.

Now I want to stop IDOC being generated if one of the fields of the IDOC is empty.

I know its a 1 min job in PI to stop based on a field. But I want to stop it at ERP.

can this be done on ABAP side?

please suggest

thanks in advance,



Hello Venkat,

You might have been given a Spread Sheet or some document containing all the Segments-Fields to be populated. Now, if you want to Stop the IDoc being sent to the PI system, here is the Procedure.

1. Check the Fields are populated using an Exit ( or in your own

Selection Program if you have a Custom FM).

2. If they are not populated, populate an Error Table say,

I_ERR_TAB with the Segment Name and Field Name.

3. Once the Population is Complete, then EXPORT the Internal

table to some Memory ID.

4. Now, in the Standard Function Module

IDOC_CREATE_ON_DATABASE, create an Enhancement

Implementation (In case of ECC 6.0) in which IMPORT the

Internal Table from the Memory.

5. If the Internal Table is not initial, then Call another FM,


to pass the Parameter IDOC_STATUS with the Error Status

which is a Parameter in the FM mentioned in Step 4.

6. Now, your Posting Program will work in such a way that if

any of the Fields are missing in your IDoc, then your IDoc

will get generated but with Status 26 which will stop the IDoc

from being Transmitted to the External System.

Hope it was clear.

Thanks and Regards,

Venkat Phani Prasad Konduri

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question