03-03-2009 9:49 PM
Hi,
I'm developing a custom idoc function module and we'd like to capture all the messages including warnings, errors, etc. My internal table of IDOC_STATUS might have a '52' if some data is incomplete along with a '51' if the data error is more severe.
The ALE layer doesn't seem to recognize the highest level of error in the IDOC_STATUS table.
I am setting the IDOC_CONTRL-STATUS to '51' so I'm not sure how ALE decides the final status of the IDOC.
Am I supposed to sort the IDOC_STATUS table? Am I not supposed to include minor errors in the table after I encounter a more severe one?
Thanks for any suggestions you can offer,
Ray
if ls_data-matnr is initial.
perform append_status using 'matnr' '51'.
endif.
if ls_data-arktx is initial. "less severe
perform append_status using 'arktx' '52'.
endif.
form append_status using p_fnam p_stat.
if p_stat = '51'.
idoc_contrl-status = '51'.
endif.
idoc_status-status = p_stat.
idoc_status-msgv1 = p_fnam.
...
append idoc_status.
endform.
03-03-2009 10:04 PM
Before control get out of the function module , try to do someting
after sorting your IDOC status table
read table i_idoc_status with key msgty = 'E'.
if sy-subrc eq 0.
perform f_create_status using 'YSS' 'E' '739'
space space space space '51'.
endif.
" Here YSS 739 message will be " IDoc failed...."
endfunction
form f_create_status using msgid msgty msgnr
msgv1 msgv2 msgv3 msgv4 status.
data: lmsgid like sy-msgid,
lmsgty like sy-msgty,
lmsgno like sy-msgno,
lmsgv1 like sy-msgv1,
lmsgv2 like sy-msgv2,
lmsgv3 like sy-msgv3,
lmsgv4 like sy-msgv4.
move: msgid to lmsgid,
msgty to lmsgty,
msgnr to lmsgno,
msgv1 to lmsgv1,
msgv2 to lmsgv2,
msgv3 to lmsgv3,
msgv4 to lmsgv4.
i_idoc_status-docnum = v_docnum.
i_idoc_status-status = status.
i_idoc_status-msgty = lmsgty.
i_idoc_status-msgid = lmsgid.
i_idoc_status-msgno = lmsgno.
i_idoc_status-msgv1 = lmsgv1.
i_idoc_status-msgv2 = lmsgv2.
i_idoc_status-msgv3 = lmsgv3.
i_idoc_status-msgv4 = lmsgv4.
append i_idoc_status.
endform.
so 51 will be treated as highlevel message in I_IDOC_STATUS table
a®
03-04-2009 3:42 AM
Hi,
I would think it's logical to include any error in the IDOC status, as such the user is able to rectify the errors at once.
Regarding the last status of IDOC, why not you check from least severe error up to most sever error, so that your IDOC status will be in the right sequence and you don't have to sort your IDOC status?
Regards,
Lim...