Skip to Content

Have to provide a popup when there is a Sales order change(VA02)

Hello,

I would like to know how to capture Sales order changes(VA02) through an enhancement. Based upon users changes which can be either a addition or deletion in sales order then I have to provide a popup. I am unable to find out whether Sales order has undergone a change or not. Field r185d-dataloss is alway having 'X' whether data has changed or not. System field SY-DATAR is not capturing any deletion is sales order.

I am using USEREXIT_SAVE_DOCUMENT_PREPARE but unable to check sales order is changed or not.

I need to provide popup after user clicks on Save. Tables CDPOS & CDHDR won't have current sales order change.

Thanks for your replies.

Edited by: harryibm on Dec 11, 2011 8:07 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Dec 12, 2011 at 03:39 AM

    Hi Harry,

    Instead of going for tables like CDHDR and CDPOS youcan do in this way.Check in this structure RVSCDCOM_ALV_SD.In program SAPMV45A compare xvbak and yvbak.Check the fields with start updkz*.Here you will get all the indicators like chnage,delete,modify all.I hope this will resolve your issue.

    Regards,

    Madhu.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello,

      The fields updkz_old,updkz_new,updkz_update,updkz_mark_del,updkz_delete have no effect when order is changed or not. The function modules Read_header and *Read_positions are used after Sales order changes are updated. I have also tried SY-DATAR has no effect when header partner is deleted. This system field is having 'X' when I change only but not working for delete.

      Please you have any other clues.

  • Posted on Dec 12, 2011 at 07:07 AM

    Hi

    Check if this works

    if sy-datar = 'X' and sy-tcode = 'VA02'.
    "Raise popup
    endif.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 12, 2011 at 08:28 AM

    I am using USEREXIT_SAVE_DOCUMENT_PREPARE but unable to check sales order is changed or not.

    Donot do any changes and hit save. check if this routine is triggered if you are not changing anything.

    In program MV45AF0B_BELEG_SICHERN there is a condition

    IF R185D-DATALOSS = SPACE       FORCE_UPDATE   = SPACE     AND
           UPD_VBUK IS INITIAL        AND
           UPD_VBUP IS INITIAL.
    

    The else part will only tirgger if its changed. The routine USEREXIT_SAVE_DOCUMENT_PREPARE is called in the else part.

    Add a comment
    10|10000 characters needed characters exceeded

    • Documentation Says

      If a standard field is changed, the field r185d-dataloss is set to X. The system queries this indicator at the beginning of the safety routine. This is why this indicator must also be set during the maintenance of user-specific tables that are also to be saved.

      Check if its set to X anywhere in the user exits using the where used list of the structure name. No idea about configuration.

      Kesav

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.