Skip to Content
avatar image
Former Member

how to update vbak,vbap in MV45AFZZ

DATA: lw_WZEIT TYPE marc-WZEIT,

lw_date type sy-datum.

LOOP at XVBAP where PSTYV = 'ZRET'.

SELECT single WZEIT

into lw_WZEIT

from marc

where matnr = xvbap-matnr.

IF sy-subrc = 0.

lw_date = lw_WZEIT + sy-datum.

if vbak-VDATU < lw_date.

move 'Z1' to xvbak-LIFSK.

move 'A' to xvbap-ABGRU .

endif.

ENDIF.

ENDLOOP.

how to update vbak vbap table in MV45AFZZ ( while saving va01).

Thanks

Suresh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 08, 2007 at 12:43 PM

    Hi Suresh,

    For VBAK and VBAP table updates while document is saved, use the exit

    "userexit_save_document_prepare"

    Assign points if its useful.

    Regards,

    B Raju

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 03:23 AM

    Hi Suresh,

    It is not recommended to code custom update to table VBAK and VBAP directly in MV45AFZZ ( i don't think that would work either since the lock is taking place ).

    Use the appropriate procedure instead ( that is USEREXIT_SAVE_DOCUMENT and USEREXIT_SAVE_DOCUMENT_PREPARE depend on requirement ) , and

    perform modifications you need to internal table vbak and xvbap. Standard SAP program will then update the database tables for you.

    XVBAK is available through all part of MV45AFZZ since this is defined globally to include non vbak header information.

    • Rettung von VBAK Feldern nach AG-Änderung.

    DATA: BEGIN OF XVBAK.

    INCLUDE STRUCTURE VBAK.

    DATA: AGUPDA LIKE RV02P-AGUPD,

    WEUPDA LIKE RV02P-WEUPD,

    AUARTUPDA,

    END OF XVBAK.

    Rgds,

    Tuwuh Sih Winedya

    Add comment
    10|10000 characters needed characters exceeded