11-09-2011 10:41 AM
Hi. We have a custom FM for populating segments of the idoc.
We have a scenario wherein if a certain condition is met, we want that the idoc should still be created but will be in error, probably status 51.
Will raising an error message or an exception do this? Or will doing so stop the creation of the idoc?
if <condition>
Message e999 with 'idoc in error'.
endif.
What approach should best be taken?
11-09-2011 10:49 AM
In the inbound IDoc processing function module there is a TABLES param(viz., IDOC_STATUS) which is of type BDIDOCSTAT where you set the status of the IDoc.
Check the structure BDIDOCSTAT, you'll understand how to pass the status & the corres. message details.
We have a scenario wherein if a certain condition is met, we want that the idoc should still be created but will be in error, probably status 51.
Status 51 is relevant for inbound IDocs & not outbound IDocs. Which scenario are you working on?
BR,
SUhas
Edited by: Suhas Saha on Nov 9, 2011 4:21 PM
11-09-2011 10:49 AM
In the inbound IDoc processing function module there is a TABLES param(viz., IDOC_STATUS) which is of type BDIDOCSTAT where you set the status of the IDoc.
Check the structure BDIDOCSTAT, you'll understand how to pass the status & the corres. message details.
We have a scenario wherein if a certain condition is met, we want that the idoc should still be created but will be in error, probably status 51.
Status 51 is relevant for inbound IDocs & not outbound IDocs. Which scenario are you working on?
BR,
SUhas
Edited by: Suhas Saha on Nov 9, 2011 4:21 PM
11-12-2011 10:49 AM
Hi. Sorry. We are working on outbound idocs.
Yeah not status 51, i just revisited the list of idoc status. Basically, what we want to happen is to create the idoc but it will be in Red status.
11-12-2011 11:56 AM
Hi,
After IDOC creation set the status '02' by using below mentioned FM.
EDI_DOCUMENT_STATUS_SET
BR,
Vijay
11-09-2011 10:50 AM
Hi,
Make use of the control record and set the status to 51 which will make the idoc into error status. Triggering error while idoc generation will not be good idea to do this.
Regards
Senthil