Adding output message to a quotation/order/delivery/invoice

RV_MESSAGES_INSERT
Share on Facebook10Share on LinkedIn5Tweet about this on TwitterShare on Google+2
Please Share!!

If we have a requirement to add output message to Quotation or Order or Delivery or Invoice etc programmatically (not by configuration), then we can do it by calling SAP Function Modules RV_MESSAGES_INSERT followed by RV_MESSAGES_UPDATE. These two FMs should be called in the same order, Insert followed by Update. If the output message is not getting inserted at the desired place, then you need to add a commit work (depending on the place where you are writing your piece of code).

[adToAppearHere]

VA03, VL03N, VF03

Common problem faced while using RV_MESSAGES_INSERT & RV_MESSAGES_UPDATE.
* You would be able to view the output message only in Display mode (ex VA23/VA03/VL03N/VF03) but NOT in Change mode (i.e. VA22/VA02/VL02N etc).
Solution: Pass NAST-MANUE = ‘X’. ” Message processed manually

Sample code to put Output Message to Delivery Header:

wa_nast-kappl = ‘V2’.
wa_nast-objky = wa_likp-vbeln.
wa_nast-mandt = wa_likp-mandt.
wa_nast-kschl = ‘ZINV’.
wa_nast-spras = ‘E’.
wa_nast-parnr = wa_likp-kunnr.
wa_nast-parvw = ‘SH’.
wa_nast-erdat = sy-datum.
wa_nast-eruhr = sy-uzeit.
wa_nast-nacha = ‘8’.
wa_nast-vsztp = ‘1’.
wa_nast-manue = ‘X’. ” Message processed manually (This is important)

APPEND wa_nast TO i_nast.

CALL FUNCTION ‘RV_MESSAGES_INSERT
TABLES
tab_xnast = i_nast.

CALL FUNCTION ‘RV_MESSAGES_UPDATE
EXPORTING
msg_kappl = wa_nast-kappl
msg_objky = wa_nast-objky.

COMMIT WORK.

 

If you want to get updates about our new tweaks and tricks, please subscribe. We respect your privacy and take protecting it seriously.

If you liked it, please share it. Thank you very much for your time!!

 

 

Image courtesy : www.iconfinder.com

Share on Facebook10Share on LinkedIn5Tweet about this on TwitterShare on Google+2
Please Share!!

14 Comments on "Adding output message to a quotation/order/delivery/invoice"

  1. Nice post. It will help many.

  2. Vijaykumar Gundeti | September 25, 2015 at 6:38 pm |

    Nice blog Sir.. very much needful for the SAP ABAP freshers.. it would be more helpful if you post some more detailed topics from ABAP..
    Thank you thanks alot

    • Dear Vijay – Thank you so much for visiting our page. Happy you liked it. We will look into your suggestions.

      Keep visiting.

      Regards,
      Raju.

  3. Shishira Shastri H | September 12, 2015 at 7:19 am |

    Thanks for the info SAP YARD.

  4. Nice blog …Keep it up!!

  5. Thanks for sharing this post .. it’s very useful.

  6. Goutam Bhattacharya | September 9, 2015 at 5:03 am |

    Thanks for the Post.Really helpful.Keep up the Good Work.

  7. Thanks Arjan..

  8. Thanks so much, this was very helpful!

Comments are closed.