We always have some requirement to display custom forms for custom output types in case of deliveries. In case the Output is not generated we need a way to log the same. The shown code achieves the same using ‘NAST_PROTOCOL_UPDATE’ FM.
When an output type fails to issue output the entry is seen in red as,
The cause can be seen in Processing Log on selecting the entry as,
Above functionality can be achieved by using standard FM ‘NAST_PROTOCOL_UPDATE’ appropriately.
Code Snippet is,
TABLES : nast.
FORM entry_pdf USING return_code
*– Check for the Condition for which the output should not be issued
IF <above condition > EQ 1.
CLEAR: syst-msgid, syst-msgno, syst-msgty, syst-msgv1,
syst-msgv2, syst-msgv3, syst-msgv4.
syst-msgid = ‘ZXX’ ” Pass the SE91 Message Class’s Name
syst-msgty = ‘E’ ” Pass as ‘E’ for Error
syst-msgno = 001. ” Pass the Message Number in the SE91 Class.
CALL FUNCTION ‘NAST_PROTOCOL_UPDATE’
msg_arbgb = syst-msgid
msg_nr = syst-msgno
msg_ty = syst-msgty
msg_v1 = syst-msgv1
msg_v2 = syst-msgv2
msg_v3 = syst-msgv3
msg_v4 = syst-msgv4
message_type_not_valid = 01
no_sy_message = 02.
return_code = 4.
In the sample shown, following configuration was done,
* Creation of custom output type ‘ZPED’ and attaching it to delivery item using transaction ‘NACE’ for application ‘V2’.