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

Modify positions using MV45AFZZ

Former Member
0 Likes
3,135

Hi SAPGurus,

I am attempting to add a verification to the user-exit MV45AFZZ that, accorting to parameters it will clear the field VBAP-PS_PSP_PNR. I am not sure how to do this as there are various tables, xvbap, yvbap for example. I have tried modifying all of them with no luck, is there a flag that has to be marked to carry out the update?

Regards,

Simon

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,126

Hi Simon,

In the Include, MV45AFZZ go to

FORM USEREXIT_MOVE_FIELD_TO_VBAK.

and put a break point,,

then check XVBAK[] & XVBAP[]

it got the values of PS_PSP_PNR what you want to do with,,

change here, every thing will change as you required,,

do like this,,

loop at xvbap.

xvbap-PS_PSP_PNR = (modifications.)

modify XVBAP.

endloop.

Thanks & regards,

Dileep .C

Hi SAPGurus,

I am attempting to add a verification to the user-exit MV45AFZZ that, accorting to parameters it will clear the field VBAP-PS_PSP_PNR. I am not sure how to do this as there are various tables, xvbap, yvbap for example. I have tried modifying all of them with no luck, is there a flag that has to be marked to carry out the update?

Regards,

Simon

9 REPLIES 9
Read only

Former Member
0 Likes
2,126

You cant modify xvbap,yvabp... for that u just create a internal table accoring to ur requirement filed and check this with the condition and transfer this to ur table.

Read only

0 Likes
2,126

Hi sridhar reddy,

I'm not really sure what you're talking about, could you explain yourself?

Read only

Former Member
0 Likes
2,126

Hi ,

What is verfication you need to add ??

Regards,

Suneel G

Read only

0 Likes
2,126

>

> Hi ,

>

> What is verfication you need to add ??

>

> Regards,

> Suneel G

This is what I have now;

 IF vbak-faksk EQ 'ZC'.
    loop at xvbap.
    clear xvbap-ps_psp_pnr.
    modify xvbap.
    endloop.
    ENDIF. 

I had it in the FORM USEREXIT_PRICING_PREPARE_TKOMP also I tried in USEREXIT_SAVE_DOCUMENT and USEREXIT_SAVE_DOCUMENT_PREPARE.

Read only

0 Likes
2,126

Hi Simon,

Try in USEREXIT_MOVE_FIELD_TO_VBAK & USEREXIT_MOVE_FIELD_TO_VBAK.

Thanks & regards,

Dileep .C

Read only

0 Likes
2,126

Did you try userexit_move_field_to_vbap as I mentioned in my reply ?

regards,

Advait

Read only

0 Likes
2,126

Problem solved. Well it doesn't seem to be perfect, when I hit the enter key it doesn't change the values on the dynpro the first time but the second time it does and when I save the order it saves correctly.

My code is as follows;

 FORM userexit_move_field_to_vbak.
*Si el bloqueo está 'ZC' se modifica el campo PS_PSP_PNR
  IF vbak-faksk EQ 'ZC'.
    loop at xvbap where ps_psp_pnr is not INITIAL.
    clear xvbap-ps_psp_pnr.
    modify xvbap.
    endloop.
    ENDIF.
*  vbak-zzfield = xxxx-zzfield2.

ENDFORM.                    "USEREXIT_MOVE_FIELD_TO_VBAK 

Read only

Former Member
0 Likes
2,127

Hi Simon,

In the Include, MV45AFZZ go to

FORM USEREXIT_MOVE_FIELD_TO_VBAK.

and put a break point,,

then check XVBAK[] & XVBAP[]

it got the values of PS_PSP_PNR what you want to do with,,

change here, every thing will change as you required,,

do like this,,

loop at xvbap.

xvbap-PS_PSP_PNR = (modifications.)

modify XVBAP.

endloop.

Thanks & regards,

Dileep .C

Read only

Former Member
0 Likes
2,126

Hi,

You can use the user exit FORM userexit_move_field_to_vbap. This is called for each item, so you ca directly use vbap structure to update any field.

If you want to save anything just before the document is saved, then use the xvbap table, which will have all the items and use the FORM userexit_save_document_prepare.

regards,

Advait