‎2006 Sep 06 1:48 PM
Hi there,
I have a BAdI to implement CRM_ORDERADM_H_BADI where it will check certain header data. If there is a certain condition that is met, we must not allow the transaction to continue by adding error message on the top (the red button). How can we populate this error log within the BAdI implementation (putting it in codes in the method of the BAdI implementation).
Many thanks in advance,
Regards,
MuJi
‎2006 Sep 06 1:49 PM
put like this
data: w_msg type standard table of shp_badi_error_log initial size 0,
msg like line of w_msg.
if sy-subrc ne 0.
msg-msgty = 'E'.
msg-msgid = 'YW2'.
msg-msgno = '041'.
msg-msgv1 =
'PGI not allowed ,Pls Enter Truck No in Bill of lad.Field'.
append msg to ct_log.
endif.
<b>In BADI u cannt raise Error Messages but u can Post the Messages to Application Logs, So u have to Update ur messages to CT_LOG.</b>Regards
Prabhu
Message was edited by: Prabhu Peram
‎2006 Sep 06 1:49 PM
put like this
data: w_msg type standard table of shp_badi_error_log initial size 0,
msg like line of w_msg.
if sy-subrc ne 0.
msg-msgty = 'E'.
msg-msgid = 'YW2'.
msg-msgno = '041'.
msg-msgv1 =
'PGI not allowed ,Pls Enter Truck No in Bill of lad.Field'.
append msg to ct_log.
endif.
<b>In BADI u cannt raise Error Messages but u can Post the Messages to Application Logs, So u have to Update ur messages to CT_LOG.</b>Regards
Prabhu
Message was edited by: Prabhu Peram
‎2006 Sep 06 1:56 PM
Thanks Prabhu,
What is the type of msg?
Also what do you mean by <i>CT_lOG create APPLICATION Log for the transaction.</i>?
Many thanks,
MuJi
‎2006 Sep 06 2:05 PM
Check the Changing and Export parameters of the BADI method you are implementing, normally most of the BADIs have a parameter defined to handle error messages. My system doesnt have the enhancement otherwise would have helped you in pointing out the parameter.
hith
Sunil Achyut
‎2006 Sep 06 2:14 PM
Unfortunately, I don't think there is any parameter that handles errors...
‎2006 Sep 06 2:33 PM
Hi Prabhu,
Seems liek shp_badi_error_log is not recognised, is that the correct one?
‎2006 Sep 06 2:48 PM
If your objective is just to show an error, then you can use a message type I to show a popup at the cost of annoying user to hit enter. If however, you use message type E, it basically stops the transaction which I dont think is your objective. Have you read the documenation in SPRO to see if there is any error handling done in the BADI. Normally each BADI has a purpose and sometimes you may not have error handling in the BADI, it all depends on what the BADI is trying to influence.
hith
Sunil Achyut