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: 

SAP ABAP : how can I make link between Plant and Quotation type in VA01

former_member226520
Participant
0 Kudos
425

Dear Friends,

I am having a requirement in VA21 ,here I am creating a qutation ,

My quotation type is ZDRA so it is fixed for plant code 1170

so when I am creating quotation with ZDRA then in input Plant field there should come 1170 but in non editable mode,

how can I do that .

Hope you have got me

regards,

Rihan

9 REPLIES 9

Jelena
Active Contributor
0 Kudos
235

VA01 is for the sales orders, not sure how it's relevant. Plant is an item level field and it is derived automatically. The best we can do is use some user exit (e.g. on VBAP change or on saving document - there is plenty of documentation on the SD user exits) to display an error message if someone tries to use document type X with plant Y.

Overall this is not a very good process, I'd check back with the SD consultant if they could figure out a better solution. What is the reason for restricting the plant?

0 Kudos
235

hye Jelena ,

the requirement is that we want to restrict the quotation type restricted at plant level

suppose user take an out put type ZDRA and this is for plant 1170 , so 1170 should

come automatically and user can not change it and there is no chance of user

mistake to select the wrong plant for the o/p type .

hope you got me , please suggest some solution.

rihan

Former Member
0 Kudos
235

Hi,

I suppose you mean sales organisation and not plant. The org. unit in VA21 (quoatation) is sales organisation on header level.

You can define a transaction variant with Tcode SHD0.

There you can define fix values for entry fields. The user has to start the transaction variant as tcode, lets say zdra_va21 instead of original va21.

/Michael

Jelena
Active Contributor
0 Kudos
235

Michael, but this would not prevent anyone from going to VA21 and entering quotation there, wouldn't it?

Rihan, now I'm actually confused even more. So is this ZDRA the quotation type (document type) or output type? These are two completely different things. Also what is driving this requirement - why do you have to have some special type for just one plant?

Former Member
0 Kudos
235

Jelena,

you can restrict by assignment of sales document type to sales area. See view V_TVAKZ.

Customizing path: Sales and Distribution / Sales / Sales Documents / Sales Document Header / Assign Sales Area to Sales Document Types. My assumption is that ZRDA is the document type.

Jelena
Active Contributor
0 Kudos
235

Michael - yes, I'm aware of that. But in this case variant transaction won't work because it'll also check that assignment and will throw a message that combination or document type / sales area is invalid. It's like catch 22.

Former Member
0 Kudos
235

Jelena, we are discussing but Rihan is the one who has got the problem

I do not think this is a good solution but it would work.

Let us assume you assign sales org AAAA, distribution chanel BB and division CC to the document type ZRDA in customizing. Then a transaction variant for va21 is created which will fill all these fields in VA21 and make them unchangeable. Then the transaction variant is assigned to a transaction code, Let's say ZVA21_ZRDA. Then it would work. Do you agree?
In addition you can give authorization for this transaction only to sales people of org. AAAA.

Another possible solution would be to provide an own transaction Z_VA21. First Input is only document type. If the cutomer enters ZRDA then the program can fill the org. units and CALL TRANSACTION VA21 with skip first screen.

0 Kudos
235

Dear Michael/Jelena,

I am satisfied with both of you, But you are discussing in a wrong direction , this is

not my requirement,

Jelena :-ZDRA is a Quotation or Document type .

Michael : - I did not restrict ZDRA on sales organization or Sales area.

My Requirement is that when I give Document Type ZDRA in VA21 and then

Press enter then in item where I give my Material code there should come Plant

'1170' automatically .

I want this because I want to restrict ZDRA restrict for other Plant .

Now I hope you both have got my requirement now.

Screen shot is attached.

Regards,

Rihan

Former Member
0 Kudos
235

Hi Rihan,

o.k. In this case I would suggest an implementation of for form routine

  USEREXIT_SOURCE_DETERMINATION in Include MV45AFZB. This is old fashioned userexit and you need an object key from SAP the first time you are changing MV45AFZB. There you can set the plant code vbap-werks. Please consider that it is processed after the material is added. It make sense because the material must be assigned to the plant. Otherwise SAP would raise an error.

Regards

Michael