‎2011 Feb 16 8:55 AM
Hi Gurus,
i have to implement a custom procedure with the following requirment:
Based on custom rules, the output should not be processed.
I try to modify the print report recalled by rsnast00 and i give e returncode = 3 but the message on the document is setted as succesfully processed (green icon).
I want to keep the message as new (yellow icon).
The output must be processed when saving the document (a Purchase order).
Any suggestion?
Control routines cannot be a solution because customer do not want to use them.
Thanks!
‎2011 Feb 17 11:10 AM
Hi,
Why don't you use requirement routine to stop triggering of the output on not meeting the conditions?
Thanks,
Vinod.
‎2011 Feb 17 12:19 PM
Hi Vinod,
i think there was a misunderstanding on some terms.
i wrote:
Control routines cannot be a solution because customer do not want to use them.
Meaning your requirement routines with my "control routines".
Customer do not want to implement any of them
‎2011 Feb 17 12:49 PM
Hi,
Ok. If there is some business reason behind, You can try with an alternate solution.
Your print program will have subroutine something like FORM ENTRY.
In the start of the routine itself, place your validations. If validation fails use EXIT statement /come out of processing so that control comes out of the routine and dont process the output. At the same time set the return code to nonzero. You also have to update the NAST protocal.
Below is sample code.
FORM ENTRY USING return_code us_screen.
IF validations fails.
retcode = sy-subrc.
syst-msgno = c_900.
syst-msgid = c_am.
syst-msgty = c_e.
"Populate msgv1,2,3,4 if required.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
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
EXCEPTIONS
OTHERS = 1.
ELSE.
"Proceed with output processing.
ENDIF.
ENDFORM.
‎2011 Feb 17 3:22 PM
I want to keep the message as new (yellow icon).
The output must be processed when saving the document (a Purchase order).
Any suggestion?
Control routines cannot be a solution because customer do not want to use them.
That requirement doesn't really make sense for a released PO though. 'Processed' and 'Yellow' are contradictory. Why does the customer not want to use a requirement (or lack of a condition record) to stop the proposal? Has someone with experience explained to them in depth how it works? If you don't see a condition, you have a determination log that tells you exactly why it wasn't proposed.
If you're stuck though, I would look at setting the NAST-AKTIV ('X' = deactivated) and NAST-SNDPR ('X" = disregard) values in the message maintenance process just like SAP does...