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

storage location value in Tcode VA01

Former Member
0 Likes
2,726

Hello experts,

I have done the enhancement for 'VA01'. According to my requirement i have to give some values to storage location for a particular order type.

e.g if my order type is 'zwxl' my storage location should be '0001'.

i am writing the enhancement code in program name SAPFV45P in that in include FV45PF0V_VBAP-POSNR_FUELLEN.

the part of code is :

IF vbak-auart = 'ZWMF'.

vbap-lgort = '0007'.

ELSEIF

vbak-auart = 'ZSDR'.

vbap-lgort = '0001'.

but after the save i dont see my storage location in VA01 even if the order type is ZWMF or ZSDR.the storage location is blank there in VA01.

but if i write if vbak-auart = 'ZWLF'.

vbap-lgort = '0011'.

else.

vbap-lgort = '0004'.

endif.

for this if my order type is not ZWLF the value of the storage location appears in VA01 and that too 0004.

what i can see while debugging is if the order type is other than my requirement for which storage location comes MTCOR-RMARD EQ 'SAPCE'.

and if order type is amongst my requirement the value of MTCOR-RMARD is EQ 'X'.this why the field of storage location comes blank for my reuirement.

plz help.why this is so?

thanks n regards,

Ashmita Singh

1 ACCEPTED SOLUTION
Read only

former_member194416
Contributor
0 Likes
2,047

Hi,

First of all, you do not need to enhance standard code for this. Check exit MV45AFZZ (via tcode se38 ) and try to implement your enhancement in this exit (there is explanation for each subroutine).

Regards,

Edited by: Gungor Ozcelebi on Jul 6, 2010 10:36 AM

6 REPLIES 6
Read only

former_member194416
Contributor
0 Likes
2,048

Hi,

First of all, you do not need to enhance standard code for this. Check exit MV45AFZZ (via tcode se38 ) and try to implement your enhancement in this exit (there is explanation for each subroutine).

Regards,

Edited by: Gungor Ozcelebi on Jul 6, 2010 10:36 AM

Read only

Former Member
0 Likes
2,047

Hi,

Use the user-exit "MV45AFZZ", form-routine "USEREXIT_MOVE_FIELD_TO_VBAP". Update storage location field in structures VBAP & XVBAP.

Regards

Vinod

Read only

Former Member
0 Likes
2,047

Hi,

Check the User Exit MV45AFZB

In USEREXIT_SOURCE_DETERMINATION

You can use this user exit to determine which plant will be used for the delivery. In the standard system, the delivering plant is copied from the customer master or the customer-material info record. If you want to use a different rule, then you must enter it in this user exit.

Check the order type here and overwrite the plant you want to assign.

Thanks.

Read only

Former Member
0 Likes
2,047

thanks experts..Enhancement is working for all the order type except one..ZCRE

AFTER entering the order type n all a pop window appears to enter billing document,

then a information window 'The plant for item 000010 must be redetermined' occurs

then in the form 'VBAP_KOPIEREN_VORBEREITEN'

after PERFORM (MODUL) IN PROGRAM SAPFV45C. VBAP-LGORT value becomes zero

then 'The plant for item 000011 must be redetermined'.

now value of vbap-lgort at this time before initialization is '0004'.

after PERFORM (MODUL) IN PROGRAM SAPFV45C.

value of vbap-lgort become '0004' again.

The plant for item 000020 must be redetermined

value of vbap-lgort is initial at this time.

after PERFORM (MODUL) IN PROGRAM SAPFV45C. value of vbap-lgort becomes initial again.

The plant for item 000021 must be redetermined

after this vbap-lgort is 0004 again.

PERFORM (MODUL) IN PROGRAM SAPFV45C. after this vbap-lgort = '0004'.

The batch number of item 000011 is cancelled

The batch number of item 000021 is cancelled.

plz help.this is for this order type only and for rest of the

order the enhancement is working fine.

for Itme 10 the storage location blank

then for Item 11 storage location is 0004

for item 20 storage location is blank again

and finaly for item no 21 storage location is 0004.

below is my enhancement code.

enhancement 1 zstorage_location. "active version

    • This is to change the storage location

    • as per the order type

if vbak-auart = 'ZWLF'.

vbap-lgort = '0007'.

elseif

vbak-auart = 'ZSCR'.

vbap-lgort = '0001'.

elseif

vbak-auart = 'ZRAW'.

vbap-lgort = '0001'.

elseif

vbak-auart = 'ZORD'.

vbap-lgort = '0004'.

elseif

vbak-auart = 'ZLCI'.

vbap-lgort = '0001'.

elseif

vbak-auart = 'ZEXP'.

vbap-lgort = '0010'.

elseif

vbak-auart = 'ZCRE'.

vbap-lgort = '0008'.

endif.

Read only

0 Likes
2,047

Hi,

As many suggested you should use one of the MV45AF* exits. In SD module for each field change many subroutines need to run and they will automatically run when you use these user exits . And in your case I think you receive this error message, since you placed your enhancement to an inappropriate position. Even if you don't receive any error message, you can not be sure and may have problems about further processing of SD documents like billing in your approach.

Regards,

Edited by: Gungor Ozcelebi on Jul 6, 2010 3:29 PM

Read only

vamshi_mohan
Participant
0 Likes
2,047

You might have selected a wrong BADI. When u start working with a BADI just check whether it is the exact on that you are looking for by placing a break-point in the implementation and running the tcode.