10-20-2004 9:47 AM
Hi,
If I cannot provide output throught smartform (print invoice) I need to change the status of message from yellow to red color.
Its possible to do it?
the image describing it is here:
http://img98.exs.cx/img98/5038/logprocessing.jpg
thanks
10-20-2004 9:59 AM
Hi Martin,
You can change the status to red by passing "Ë" to the "MSG_TY" parameter when calling function module "NAST_PROTOCOL_UPDATE".
Regards,
Srini
10-20-2004 9:59 AM
Hi Martin,
You can change the status to red by passing "Ë" to the "MSG_TY" parameter when calling function module "NAST_PROTOCOL_UPDATE".
Regards,
Srini
10-20-2004 10:17 AM
Hi Srinivas,
I did it, but without success. Any other idea?
Could it depends on the fact, that the invoice was already one time printed succesfully?
thanks,
martin
10-20-2004 10:42 AM
Hi Martin,
I don't think the reason for yellow color status would be determined because of the original print.
i think the yellow color is due to the warning message type passed to the NAST function module and sometimes a warning message will not output the print.
Regards,
Srini
10-20-2004 10:45 AM
Hi,
You need to set the return code in your print program to 4 to indicate the printing has failed.
Kind regards
Colin.
10-20-2004 11:20 AM
Hi,
I did it, but the status color hasnt change and there is no message in Processing log.
10-20-2004 11:57 AM
This definitely works.
Please post your code here so I can take a look for you.
All you need to post is the form called in your print program.
Kind regards
Colin.
10-20-2004 12:54 PM
Its called 2 times:
1) update
IF sy-subrc <> 0.
cf_retcode = sy-subrc.
PERFORM protocol_update.
endif.
FORM PROTOCOL_UPDATE.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
MSG_ARBGB = SYST-MSGID "ZOCCR
MSG_NR = SYST-MSGNO "117
MSG_TY = SYST-MSGTY "E
MSG_V1 = SYST-MSGV1 "000070
MSG_V2 = SYST-MSGV2
MSG_V3 = SYST-MSGV3
MSG_V4 = SYST-MSGV4
EXCEPTIONS
OTHERS = 1.
ENDFORM.
2) and then below
FORM entry USING return_code us_screen.
DATA: lf_retcode TYPE sy-subrc.
xscreen = us_screen.
PERFORM processing USING us_screen
CHANGING lf_retcode.
IF lf_retcode NE 0. "2
return_code = 1.
ELSE.
return_code = 0.
ENDIF.
ENDFORM.
...
restore original NAST record (in case TNAPR-RONAM changed something)
nast = temp_nast.
return code unchanged: program didn't behave properly
IF returncode = 999. "returncode = 1
syst-msgid = 'VN'.
syst-msgno = 068.
syst-msgty = 'E'.
syst-msgv1 = tnapr-ronam.
syst-msgv2 = tnapr-pgnam.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = syst-msgid
msg_nr = syst-msgno
msg_ty = syst-msgty "E
msg_v1 = syst-msgv1
msg_v2 = syst-msgv2
EXCEPTIONS
OTHERS = 0.
ENDIF.
IF returncode NE 0.
EXIT.
ENDIF.
In case that i during debug change the return code to 999 or 4, still the color is not changed.
10-20-2004 1:11 PM
Hi,
I have just tried to do the same printing a purchase order.
If the RETURN_CODE returned from FORM ENTRY is not zero then the output when displayed in the document is set to 'red 'status
I suggest changing your FORM ENTRY to just hard code RETURN_CODE = 4 and set a break-point in this form to check it is being executed.
Your output type will need to be a type '1' (Print via scheduled job) as opposed to '4' (Print immediately) to see the break-point stop. Then use RSNAST00 to produce the document and see if it stops at the break-point.
Let me know how you get on.
Cheers
Colin.
10-20-2004 1:58 PM
thanks,
I tryed it, without success.
I will try to completely redesign the program used for smartform printing and then it must go. If not, then I will write message into this topic again. ))
br,
martin
10-20-2004 2:22 PM
Hi,
This should work as I have also tried it with delivery output which is what you are doing......
One final thing before you completely redesign !
Is there anything after your code which may reset the return code to zero thus making the printing thinking it worked ?
Kind regards
Colin.
07-31-2020 12:40 PM
We can change the processing log by changing the return code.
Thank you for the correct answer.