09-16-2008 10:05 PM
Hello,
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,
venkat.
09-16-2008 10:52 PM
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,
IDOC_STATUS_WRITE_TO_DATABASE in which you have
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
09-16-2008 10:52 PM
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,
IDOC_STATUS_WRITE_TO_DATABASE in which you have
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