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: 

VA01 - Change order type

Former Member
0 Kudos

Hello everybody,

in VA01 I need to change order type after I previously inserted a specific order type (e.g. TA) and then I need to change it depending on which reference document I give (by clicking on "creating with reference").

I tried to resolve this issue by using MV45AFZZ at first with userexit_move_field_to_vbak and then userexit_field_modification ,but something strange happened :

in user exit I change vbak-auart value with a different one,but label in the dynpro header still appear as the previous order type (TA),though the other field that appeared seems correct and congruent with the new one.In fact,when I save the document,in VA03 it appear as the new order type (not TA).

My consideration is that seems that standard code does not refresh correctly the label and some other text,because in the main dynpro still remain the "old" type and maybe this create some "confusion".

Maybe there are some sap note to install ?


I was thinking something with BADI....someone could help pls ?

Thank you in advance

6 REPLIES 6

TammyPowlas
Active Contributor

Hi Luca - I recommend reviewing similar threads as it sounds like there are some prerequisites before doing this: https://archive.sap.com/discussions/thread/1456748 https://archive.sap.com/discussions/thread/1827853

0 Kudos

Hi Tammy,

the fact is that I'm just creating a new one order,then the change on order type is at runtime.

Maybe I did not explain well the problem...

Thank you anyway !

SimoneMilesi
Active Contributor

Hello Luca.

If i understood well, you are able to change the green field and not the red one, correct?

If this is your aim, when you change the order type, select also TVAKT-BEZEI into TVAKT-BEZEI variable (it should be globally declared) using SY-LANGU and the new Order Type.

Otherwise you can check Screen 4301 / 4002 for SAPMV45A to see if you can add an enhanchement.

Former Member
0 Kudos

What I mean is this...

Jelena
Active Contributor
0 Kudos

If memory serves, the label might be the least of your worries.

First of all, the usual question - why is this needed? On the first screen in VA01, we enter a document type and click "create with reference". If for a specific referenced document you don't want to allow creation of the chosen document type then simply don't maintain copy control for it in SD configuration. Then the users would get an error message that such document can't be copied. After that they can chose a suitable order type.

It's not a good UI practice to play "switcheroo" on the users in background. I entered one order type, then I hit enter and see a totally different one? I'd be very much confused...

Also these days I believe the practice shifted from "no, you must use VA01 because it's standard" to "better UI + API" approach. Instead of breaking standard, you could just create a simple screen where the users pick a reference document and are directed to the appropriate document type (basic CALL TRANSACTION... SKIP FIRST SCREEN" can do that). Or even a screen to enter the required information and then call BAPI to create the order. The users would be very happy about this IMHO as never in my life I heard a single person say they loved VA01.

But if it's just "la-la-la-la we want to do it like we want" then I'm afraid the user exits won't help you here because they're executed after some main logic based on the document type has already been called. Once in a past project a consultant implemented something like that using a modification. It was a long time ago and these days there might be some enhancement point for this. But I really would discourage pursuing this option in general.

Former Member
0 Kudos

Hi Jelena,

first thank you for having shared your thoughts that concern this issue,I would take care of your opinion but...you know

when you work as consultant you have to satisfy the best and the worst requests from the customer you are working for....and this

is of course one of those "worst"! So,I'm agree about your thoughts but they choose to use this user exit (already widely used for other issues) to manage this situation to avoid bigger investment creating new one program or else.

It seems that is only a matter of "label" and "description" because the logic seems to respect the new one order type of the reference document.
Anyway,I just tried to convince the person who gave me this problem to resolve,suggesting a blocking message that advice a different order type between the one that has been selected and the one linked to the reference document.

Luca