Hi,
We have implemented the BADI /SCMB/BOL_VALFRMWRK to implement a custom
check when CHANGING the ASN as per the steps in the below blog:
http://wiki.scn.sap.com/wiki/display/SCM/Advanced+shipping+notification
However the issue we are facing is that inspite of the error message
being displayed the ASN can be changed manually as shown in attached
document.
The code is as follows:
DATA: lo_svdelivery TYPE REF TO /sca/cl_svdelivery,
lo_log_prot TYPE REF TO /scmb/cl_bol_prot,
lt_delivery TYPE /scmb/dm_delvry_tab,
ls_delivery TYPE /scmb/dm_delvry_str.
IF ip_control_data-process_name = 'DELIVERY_PUBLISH'.
* Initialize the local log
CREATE OBJECT lo_log_prot.
CALL METHOD lo_log_prot->init( ).
* get service class
lo_svdelivery ?= ip_object.
* get the order to be checked
CALL METHOD lo_svdelivery->get
IMPORTING
* ES_DLV =
et_dlv = lt_delivery.
READ TABLE lt_delivery INTO ls_delivery INDEX 1.
IF sy-subrc = 0.
IF ls_delivery-tracking-id = 'X'.
CALL METHOD lo_log_prot->add_message
EXPORTING
ip_msgty = 'E'
ip_msgid = 'ZSNC'
ip_msgno = '001'.
* ip_msgv1 = 'DUMMY'.
et_prot = lo_log_prot->get_prot( ).
ENDIF.
ENDIF.
Please advise how we can prevent the ASN not to be changed inspite of
the custom error message?