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: 

MV45AFZZ

Former Member
0 Kudos

hello,

we have a z table have the key fields customer and material. other field is cumulative quantity.

when ever the sales order is saved or created(va01 and va02) for the combination of particular customer and material then culumative quantity is to be updated in our z table.so that our client can come to know for particular customer and material the total(cumulative) quantity.

regards

alka

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Do your coding in FORM SAVE_DOCUMENT in MV45AFZZ.

You would have xvbak and xvbap available in this FORM.

Regards

Deepak

P.S Kindly award points if helpful

Message was edited by:

Deepak Krishnakumar

6 REPLIES 6

Former Member
0 Kudos

Hi

Do your coding in FORM SAVE_DOCUMENT in MV45AFZZ.

You would have xvbak and xvbap available in this FORM.

Regards

Deepak

P.S Kindly award points if helpful

Message was edited by:

Deepak Krishnakumar

Former Member
0 Kudos

Hi,

Form SAVE_DOCUMENT can be used for this purpose.

Go to MV45AFZZ and find the subroutine.

In the documentation part of the Subroutine they will explain that this Form is used to update any ztable while saving the document.

Former Member
0 Kudos

Hi Alka ,

Tell me do u want your code to be check when the order is saved or on save i mean the order is generated or not generated.

0 Kudos

yes dinesh every time it's being saved i.e. while being created or changed

regards

alka

Former Member
0 Kudos

hi ,,

whenever u r saving or creating refer to table T180-tcode = 'V' in the user exit MV45AFZZ.

im just showing u some sample code

IF T180-TRTYP = 'V'.  "INDICATES SALES 
    loop at xvbap.
      IF xVBAP-ABGRU NE ' ' .
        SELECT SINGLE * FROM ZXXXXXXXXXX
                                   WHERE SOLDTO = VBAK-KUNNR "CUSTOMER

        IF SY-SUBRC EQ 0.
          SELECT SINGLE * FROM MARA WHERE MATNR = XXX-MATNR
                                        .
          IF SY-SUBRC EQ 0.
            ZXXXXXX-VBELN = XVBAP-VBELN.
            ZXXXXXX-POSNR = XVBAP-POSNR.
            ZXXXXXX-ERZET =  SY-UZEIT.
            ZXXXXXX-UNAME = SY-UNAME.
            ZXXXXXX-KUNNR = VBAK-KUNNR. "CUSTOMER
            ZXXXXXX-MATNR =  V_MATNR ."PASS THIS
            ZXXXXXX-QUNTY =  V_QUNTY .  "CUMULATIVE QUANTITY.
 
            INSERT ZXXXXXXX.

          ENDIF.
        ENDIF.
      ENDIF.
    endloop.
ENDIF.

total cumylative quantity just sum it up and pass to the ztable.

this is sample code of how to proceed .

regards,

vijay

FOR VA01 T180-TRTYP = 'H'.

VA02 T180-TRTYP = 'V'.

CHECK FOR THE TWO VALUES IN UR CASE.

Former Member
0 Kudos

thanx frends...