Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Log processing - change of status

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

11 REPLIES 11

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

You need to set the return code in your print program to 4 to indicate the printing has failed.

Kind regards

Colin.

0 Kudos

Hi,

I did it, but the status color hasnt change and there is no message in Processing log.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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

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.

0 Kudos

We can change the processing log by changing the return code.

Thank you for the correct answer.