Application Development and Automation 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: 
Read only

USEREXIT_SAVE_DOCUMENT_PREPARE

Former Member
0 Likes
2,133

HI EXPERT!,

I have requirement in said user exit . I have to check status for vbap-ktgrm (AAG account assignment group )for each line item.

how would I procedd? If possible plase help code

USEREXIT_SAVE_DOCUMENT_PREPARE

1 ACCEPTED SOLUTION
Read only

saranwin
Contributor
0 Likes
1,865

Hey,

Just right your validation inside the Subroutine. it will trigger for all the line items.

Main Program: SAPMV45A

Program: MV45AFZZ

Subroutine: USEREXIT_SAVE_DOCUMENT_PREPARE

Sample Code:

DATA: C_VA01(4) TYPE C VALUE 'VA01',
      C_VA02(4) TYPE C VALUE 'VA02'.

IF SY-TCODE = C_VA01 OR SY-TCODE = C_VA02.        "CREATE SALES ORDER
   MOVE-CORRESPONDING ZSDSTRC_VBAK TO VBAK.
ENDIF.

Note: This subroutine will trigger at the time of creation as well as change.

Using this you can validate your screen data and check the data before saving.

VBAK - Header

VBAP - Item

Regards,

Saravanan M.

HI EXPERT!,

I have requirement in said user exit . I have to check status for vbap-ktgrm (AAG account assignment group )for each line item.

how would I procedd? If possible plase help code

USEREXIT_SAVE_DOCUMENT_PREPARE

5 REPLIES 5
Read only

Former Member
0 Likes
1,865

Hi

U need to loop the internal table XVBAP

Max

Read only

saranwin
Contributor
0 Likes
1,866

Hey,

Just right your validation inside the Subroutine. it will trigger for all the line items.

Main Program: SAPMV45A

Program: MV45AFZZ

Subroutine: USEREXIT_SAVE_DOCUMENT_PREPARE

Sample Code:

DATA: C_VA01(4) TYPE C VALUE 'VA01',
      C_VA02(4) TYPE C VALUE 'VA02'.

IF SY-TCODE = C_VA01 OR SY-TCODE = C_VA02.        "CREATE SALES ORDER
   MOVE-CORRESPONDING ZSDSTRC_VBAK TO VBAK.
ENDIF.

Note: This subroutine will trigger at the time of creation as well as change.

Using this you can validate your screen data and check the data before saving.

VBAK - Header

VBAP - Item

Regards,

Saravanan M.

Read only

Former Member
0 Likes
1,865

Hi,

After checking status vbap-KTGRM i have to maintain incompletion log accordingly...I thing I have to see another table XVBUV for incompletion procedure (item category)

Read only

0 Likes
1,865

Hey,

Both XVBUV and VBUV were triggering in the same subroutine.

Regards,

Saravanan M

Read only

Former Member
0 Likes
1,865

Hi Sarvanan M,

This is the actual requirement.

If AAG (ktgrm) is NE space (AAG field having some value),

It should not be displayed in the incompletion log.

Else,

It should be displayed in the incompletion log.

What I'm trying to do is,just deleting from Xvbuv field fehgr. I thing it will serve my purpose.?