11-16-2007 11:48 AM
Hello All,
The Actual requirement is to Extend a Basic Type and add a segment and process a outbound Idoc. The data is retrieved from a custom table to fill the extended custom segment and to issue a custom message in status record of the outbound Idoc if the data does not exist in the custom table for the corresponding document.
Can you please let me know how do we insert a custom message in the status records of an Outbound Idoc ?.
Thanks and regards,
Mahesh
11-16-2007 7:03 PM
Write the below code in user exit.
if return_code = 0.
workflow_result = '0'.
idoc_status-docnum = idoc_contrl-docnum.
idoc_status-status = '53'. <you can give the status number here>
idoc_status-uname = sy-uname.
idoc_status-repid = sy-repid.
idoc_status-msgty = sy-msgty.
idoc_status-msgid = 'XXXX'. <Your own message id>
idoc_status-msgno = p_msgno. <message number>
idoc_status-msgv1 = sy-msgv1.
idoc_status-msgv2 = sy-msgv2.
idoc_status-msgv3 = sy-msgv3.
idoc_status-msgv4 = sy-msgv4.
return_variables-wf_param = 'Processed_IDOCs'. <Your own message>
return_variables-doc_number = idoc_contrl-docnum.
APPEND return_variables.
APPEND idoc_status.
else. <to throw the error message>
workflow_result = '99999'.
call_transaction_done = ''.
idoc_status-docnum = idoc_contrl-docnum.
idoc_status-status = '51'.
idoc_status-uname = sy-uname.
idoc_status-repid = sy-repid.
idoc_status-msgty = 'E'.
idoc_status-msgid = 'XXXX'.
idoc_status-msgno = p_msgno.
idoc_status-msgv1 = itab-ebeln. <You can pass the number>
idoc_status-msgv2 = v_fmreserv_a-xblnr.
idoc_status-msgv3 = ''.
idoc_status-msgv4 = ''.
return_variables-wf_param = 'Error_IDOCs'.
return_variables-doc_number = idoc_contrl-docnum.
APPEND return_variables.
APPEND idoc_status.
endif.
Hope it helps.
Reward if it is useful.
Thanks,
Srinivas
11-16-2007 12:10 PM
Any Suggestions please, this has become priority to me.
Thanks and regards,
Mahesh
11-16-2007 6:52 PM
Hi,
If you want to add a segment to IDoc Basic type...that can be done by TCode WE30...First of all you need to Cancel Release from Edit menu and add a segment to your IDoc type.. Then again Set Release...
Thanks and regards,
Dharitree
11-16-2007 6:54 PM
11-16-2007 7:03 PM
Write the below code in user exit.
if return_code = 0.
workflow_result = '0'.
idoc_status-docnum = idoc_contrl-docnum.
idoc_status-status = '53'. <you can give the status number here>
idoc_status-uname = sy-uname.
idoc_status-repid = sy-repid.
idoc_status-msgty = sy-msgty.
idoc_status-msgid = 'XXXX'. <Your own message id>
idoc_status-msgno = p_msgno. <message number>
idoc_status-msgv1 = sy-msgv1.
idoc_status-msgv2 = sy-msgv2.
idoc_status-msgv3 = sy-msgv3.
idoc_status-msgv4 = sy-msgv4.
return_variables-wf_param = 'Processed_IDOCs'. <Your own message>
return_variables-doc_number = idoc_contrl-docnum.
APPEND return_variables.
APPEND idoc_status.
else. <to throw the error message>
workflow_result = '99999'.
call_transaction_done = ''.
idoc_status-docnum = idoc_contrl-docnum.
idoc_status-status = '51'.
idoc_status-uname = sy-uname.
idoc_status-repid = sy-repid.
idoc_status-msgty = 'E'.
idoc_status-msgid = 'XXXX'.
idoc_status-msgno = p_msgno.
idoc_status-msgv1 = itab-ebeln. <You can pass the number>
idoc_status-msgv2 = v_fmreserv_a-xblnr.
idoc_status-msgv3 = ''.
idoc_status-msgv4 = ''.
return_variables-wf_param = 'Error_IDOCs'.
return_variables-doc_number = idoc_contrl-docnum.
APPEND return_variables.
APPEND idoc_status.
endif.
Hope it helps.
Reward if it is useful.
Thanks,
Srinivas
11-19-2007 4:48 AM
Hello Srinivas,
After appending the message data to Internal table idoc_status, where should i provide this internal table to reflect in the Idoc status.
regards,
Mahesh
04-27-2015 4:52 PM
Hi All,
I know that this thread is old, but I want to add this link:
Modify IDOC Status by Program - ABAP Development - SCN Wiki
It can help visitors of this thread.
Regards.