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

Substitutions..

Former Member
0 Likes
1,861

Hi friends,

We have created Subsitutions and they are working fine.

But now for some particular Sales Orders we dont want them to apply.

Any ideas on this, please.

Thanks.

16 REPLIES 16
Read only

Former Member
0 Likes
1,807

Under substitutions you can maintain conditions depending on the sales order.

Regards,

Lalit Mohan Gupta.

Read only

0 Likes
1,807

Thanks.

Could you please let me more about this?

And is there any thing we can do in VA01 user exists so that we should not touch SUBSITUTIONS.

Read only

Former Member
0 Likes
1,807

Hi Park,

if VBAK-AUAUR NE 'SD'"  As per you requierment.
give your substitution logic
ENDIF.

Thanks!

Read only

0 Likes
1,807

Can you tell me where should i write if VBAK-AUAUR NE 'SD'"...if I write pre-requiste text box if gives me a error.

Under STEP 026, we have already written ...

Plant = '2062' AND

Distr. channel = '26'

The above things needs to be applied only if VBAK-AUAUR NE 'SD'"...

Please help.

Read only

0 Likes
1,807

If you are using an user exit to susbstitue the field just double click on the user exit say for example it is

U203 it will take you to ABAP editor now

here you can actually trigger your conidtion

for example in your pre requitse you wrote if vbak-auart = 'AG'.

in U203 write the below code

if vbak-vbeln = '123456'.

vbak-field1 = vbak-field2

endif.

So the above substituion will trigger when sales order is AG

and if sales order no. is 123456 then only subsituion will take place

Regards

Bhanu Malik

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,807

Hello Park,

Under which "Application Area" / "Call up" point have you declared the substitution? Did you check the "prerequisites" available for this "call-up" point?

Plz revert back.

BR,

Suhas

Read only

Former Member
0 Likes
1,807

Thanks for your replies.

I am using Profit Center Accounting and i have almost 450 Steps and I am modifying Step 026.

We want to apply these substitutions (450 Steps) that means the Profit Centers should be applied only when VBAK-SOMEFILED is 'GOOD'.

And under Pre-requistes -- we have

PCASUB-WERKS = '2062' AND

PCASUB-VTWEG = '26'

and under Table Fields - we have Structure PCASUB and SYST.

When if i code VBAK-SOMEFILED is 'GOOD' under Pre-requistes i receive syntax error.

Sorry mates, I am totally confused as I am working on SD module for the first time.

Any ideas....

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,807

Hello Park,

If the field is not available in the "Prerequisite", then you cannot use it in the prerequisite condition.

What is the field you want to check?

BR,

Suhas

Read only

Former Member
0 Likes
1,807

I want to check a Z field from VBAK table.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,807

Hello Park,

If this is the case you need to try a work-around in you code for the exit.

BR,

Suhas

Read only

Former Member
0 Likes
1,807

Thanks.

If I write a IF statement at User exit, how can i exit the SUBSTITUTION..any ideas?

I mean....If i code

If VBAK-SOMEFILED is 'GOOD' then..

how do i QUIT this subsititution...

Thank you.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,807

Hello,

You can code like:

FORM XXX.

CHECK VBAK-SOMEFILED = 'GOOD' .

" Code for your exit

ENDFORM.

So if VBAK-SOMEFILED is not 'GOOD' , then you donot process the exit code.

BR,

Suhas

Read only

Former Member
0 Likes
1,807

Thanks mate.

Will give it a try.

Can I debug the SUBSTITUTIONS..as I added a break point, it failed and it didnt entered.

Thanks

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,807

Hello Park,

AFAIK you can debug the code in a substitution.

You can put BREAK <sy-uname> in your code & give it a try.

BR,

Suhas

Read only

Former Member
0 Likes
1,807

Thanks Suhas for your help.

When i debugged, I noticed that tables VBAK and VBAP are not filled..any ideas?

Read only

Former Member
0 Likes
1,807

Friends, any ideas on this?

Thanks.