Skip to Content
author's profile photo Former Member
Former Member

User Exit for VA02

Hi,

I have written code in user exit EXIT_SAPMV45A_003 for TCode VA02 (Sales Order Change). The code is as given below:

LOOP at XVBAP.

If XVBAP-kwmeng = 100.

XVBAP-kwmeng = 99.

Modify XVBAP.

Endif.

If XVBAP-ARKTX = 'Pumpe Stahlguss Etanorm 170-230'.

XVBAP-ARKTX = 'Changed'.

Modify XVBAP.

Endif.

Endloop.

In debug mode I can see the changed values for Order Quantity (KWMENG) and description (ARKTX). However after the entire code is executed and when I enter the sales order, first I get a pop up "Express Document Update Was Terminated received from author XXXXX". And then when I hit enter, the values are not changed

The project in CMOD and the enhancement in SMOD are activated.

Any help would be appreciated.

Thanks in advance,

Mick

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Oct 13, 2008 at 12:52 PM
    LOOP at XVBAP.
    If XVBAP-kwmeng = 100.
    XVBAP-kwmeng = 99.  "this quanity i am not sure 
    "i think you have to change schedule lines also
    "which is XVBEP table.
    XVBAP-UPDKZ = 'U'.
    Modify XVBAP.
    Endif.
    If XVBAP-ARKTX = 'Pumpe Stahlguss Etanorm 170-230'.
    XVBAP-ARKTX = 'Changed'.
    XVBAP-UPDKZ = 'U'.  "Try this...
    Modify XVBAP.
    Endif.
    Endloop.

    Keep a break point in the above loop, and check in SM13 transaction for the Update termination cause. find the source code wher the error is from SM13 transaction.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Vijay.

      I am able to get the changed description in the sales order based on the code written in the user exit.

      I guess for changing the order quantity at line item level, we will have to change the schedule lines also.

      Points awarded.

  • Posted on Oct 13, 2008 at 01:37 PM

    Instead of Modifying XVBAP in the User exit EXIT_SAPMV45A_003, write your code in the Include MV45AFZZ subroutine USEREXIT_SAVE_DOCUMENT_PREPARE.

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2008 at 12:46 PM

    try this:

    MODIFY xvbap

    TRANSPORTING ARKTX WHERE ref_field = xvbap-ref_field.

    • ref_field is the entry for which you want to modify .. it may be vbeln or posnr.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2008 at 12:47 PM

    Hi Mick

    It means a dump occurs while the data was beeing saved in a background process.

    U should use the trx ST22 and SM13 in order to check the dump.

    Anyway remember you have to set the update flag after changing a value of item of sales order.

    LOOP at XVBAP.
      If XVBAP-kwmeng = 100.
       XVBAP-kwmeng = 99.
       XVBAP-UPDKZ  = 'U'  <-----------------------------
       Modify XVBAP.
     Endif.
     If XVBAP-ARKTX = 'Pumpe Stahlguss Etanorm 170-230'.
       XVBAP-ARKTX = 'Changed'.
       XVBAP-UPDKZ  = 'U'  <-----------------------------
      Modify XVBAP.
     Endif.
    Endloop.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

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.