|
|
This website is not affiliated with, sponsored by, or approved by SAP AG.
Logistics : SD and its sub-modules (Inquires, Quotes, Order Entry, SIS, Sales Contacts, Dist. & Billing)
Moderators: thx4allthefish, Snowy, mike_ac, Lost Identity
by Theberge43 » Wed Mar 14, 2012 7:59 am
Hi, I am having syntax issues when creating a complex procedure for the Sales Order. I want to perform a lot of steps depending on one value (on big IF) and within this I'll have the smaller steps with each their own individual conditions. - Code: Select all
**** Perform all these steps (
**** Step 1 - First IF Char2 = Char3 + 10 if Char4 = 'x'
**** Step 2 - Second IF Char5 = Char6 + 20 if Char7 = 'x'
**** Global IF for all steps ) IF char1 = 'x'
Of course I simplified my example, the detailed steps are a little more complex. I'm wondering if this is possible or not, right now it is giving me syntax error directly on the first "(".
-
Theberge43
-
- Posts: 10
- Joined: Fri Apr 11, 2008 8:19 am
by mike_ac » Wed Mar 14, 2012 8:56 am
Dependencies are not like a programming language. The scripting rules are very basic. You'll have to use AND logic instead of trying to build nested functions.
If you have a long dependency that looks like this, you might consider using a variant table instead.
"If a cluttered desk is a sign of a cluttered mind, of what, then, is an empty desk?" –Albert Einstein, when confronted by a neat freak about the disarray in his work space
-
mike_ac
-
- Posts: 4466
- Joined: Wed Dec 22, 2004 10:14 am
- Location: Deep Texas
by Theberge43 » Wed Mar 14, 2012 9:42 am
Thanks, that answers my question. I need to put it individually for each step.
-
Theberge43
-
- Posts: 10
- Joined: Fri Apr 11, 2008 8:19 am
by Sharpshooter » Thu Mar 15, 2012 6:16 am
Actually, all you need to do is add a comma in between each step: - Code: Select all
**** Perform all these steps (
**** Step 1 - First IF Char2 = Char3 + 10 if Char4 = 'x',
**** Step 2 - Second IF Char5 = Char6 + 20 if Char7 = 'x',
**** Global IF for all steps ) IF char1 = 'x'
Good luck!
-
Sharpshooter
-
- Posts: 934
- Joined: Wed Mar 17, 2010 12:01 pm
- Location: In the dark
by Theberge43 » Thu Mar 15, 2012 6:59 am
Well, I think I have them in my real dependency. I will still review it.
-
Theberge43
-
- Posts: 10
- Joined: Fri Apr 11, 2008 8:19 am
by Theberge43 » Thu Mar 15, 2012 7:52 am
I tried exactly this: - Code: Select all
**** Perform all these steps ( **** Step 1 - First IF P_RL_BASIS_WEIGHT_I = P_RL_BASIS_WEIGHT_I + 10 if P_RL_BASIS_WEIGHT_M = 10,
**** Step 2 - Second IF P_RL_BASIS_WEIGHT_I = P_RL_BASIS_WEIGHT_I + 20 if P_RL_BASIS_WEIGHT_M = 20,
**** Global IF for all steps ) if P_RL_BASIS_WEIGHT_M SPECIFIED
I'm getting this error: Syntax error in simple action/procedure (Row 2)
-
Theberge43
-
- Posts: 10
- Joined: Fri Apr 11, 2008 8:19 am
by Sharpshooter » Thu Mar 15, 2012 9:18 am
Get rid of the parentheses...
Good luck!
-
Sharpshooter
-
- Posts: 934
- Joined: Wed Mar 17, 2010 12:01 pm
- Location: In the dark
by Theberge43 » Thu Mar 15, 2012 9:26 am
Tried this: - Code: Select all
**** Perform all these steps **** Step 1 - First IF P_RL_BASIS_WEIGHT_I = P_RL_BASIS_WEIGHT_I + 10 if P_RL_BASIS_WEIGHT_M = 10, **** Step 2 - Second IF P_RL_BASIS_WEIGHT_I = P_RL_BASIS_WEIGHT_I + 20 if P_RL_BASIS_WEIGHT_M = 20, **** Global IF for all steps if P_RL_BASIS_WEIGHT_M SPECIFIED
I get error on first line. Syntax error in simple action/procedure (Row 3) I checked to make sure my characteristics are numeric by the way.
-
Theberge43
-
- Posts: 10
- Joined: Fri Apr 11, 2008 8:19 am
by Sharpshooter » Thu Mar 15, 2012 10:46 am
If you double-click the message, you should get a more detailed explanation of the problem. Are any of these chars reference characteristics BTW?
Good luck!
-
Sharpshooter
-
- Posts: 934
- Joined: Wed Mar 17, 2010 12:01 pm
- Location: In the dark
by Theberge43 » Thu Mar 15, 2012 11:58 am
Ok, I have a different error when I go in CU02 (I was in PMEVC). - Code: Select all
**** Perform all these steps **** Step 1 - First IF P_RL_BASIS_WEIGHT_I = P_RL_PRODUCT_QTY + 10 if P_RL_BASIS_WEIGHT_M = 10, **** Step 2 - Second IF P_RL_BASIS_WEIGHT_I = P_RL_BASIS_WEIGHT_I + 20 if P_RL_BASIS_WEIGHT_M = 20, **** Global IF for all steps if P_RL_BASIS_WEIGHT_M SPECIFIED
The error is on line 004: E28021 Error: remaining part of expression cannot be interpreted.
-
Theberge43
-
- Posts: 10
- Joined: Fri Apr 11, 2008 8:19 am
by Sharpshooter » Thu Mar 15, 2012 12:18 pm
And it should place the cursor at the exact point where it can't figure out what's next. As you now are showing more code, I can see that you do need the parentheses: - Code: Select all
**** Perform all these steps **** Step 1 - First IF ( P_RL_BASIS_WEIGHT_I = P_RL_PRODUCT_QTY + 10 if P_RL_BASIS_WEIGHT_M = 10, **** Step 2 - Second IF P_RL_BASIS_WEIGHT_I = P_RL_BASIS_WEIGHT_I + 20 if P_RL_BASIS_WEIGHT_M = 20 ) **** Global IF for all steps if P_RL_BASIS_WEIGHT_M SPECIFIED
And you have to get rid of the comma after the last step - the comma only separates steps. Some really basic things to check (do not be offended, please): Be sure the dependency type is indeed a procedure. Be sure that the asterisk is in the first position of each comment line.
Good luck!
-
Sharpshooter
-
- Posts: 934
- Joined: Wed Mar 17, 2010 12:01 pm
- Location: In the dark
by Theberge43 » Thu Mar 15, 2012 12:23 pm
Not offended at all, thanks for the help by the way! Here, I copied the code exactly like yours: - Code: Select all
000010 **** Perform all these steps 000020 **** Step 1 - First IF 000030 ( P_RL_BASIS_WEIGHT_I = P_RL_PRODUCT_QTY + 10 000040 if P_RL_BASIS_WEIGHT_M = 10, 000050 **** Step 2 - Second IF 000060 P_RL_BASIS_WEIGHT_I = P_RL_BASIS_WEIGHT_I + 20 000070 if P_RL_BASIS_WEIGHT_M = 20 ) 000080 **** Global IF for all steps 000090 if P_RL_BASIS_WEIGHT_M SPECIFIED
Error : E28024 Syntax error in simple action/procedure Line 000030.
-
Theberge43
-
- Posts: 10
- Joined: Fri Apr 11, 2008 8:19 am
by Sharpshooter » Thu Mar 15, 2012 12:29 pm
Oh crap, my bad. One of those days! Can't see the woods for the trees. You cannot wrap a "Global IF" around the individual actions. You will need to put the logic in each: - Code: Select all
000010 **** Perform all these steps 000020 **** Step 1 - First IF 000030 P_RL_BASIS_WEIGHT_I = P_RL_PRODUCT_QTY + 10 000040 if P_RL_BASIS_WEIGHT_M = 10 and P_RL_BASIS_WEIGHT_M SPECIFIED, 000050 **** Step 2 - Second IF 000060 P_RL_BASIS_WEIGHT_I = P_RL_BASIS_WEIGHT_I + 20 000070 if P_RL_BASIS_WEIGHT_M = 20 and P_RL_BASIS_WEIGHT_M SPECIFIED
Good luck!
-
Sharpshooter
-
- Posts: 934
- Joined: Wed Mar 17, 2010 12:01 pm
- Location: In the dark
by Theberge43 » Thu Mar 15, 2012 12:46 pm
Hehe. Thanks a lot, so the first conclusion was right, we have come full circle ! Thanks for trying I appreciate it.
-
Theberge43
-
- Posts: 10
- Joined: Fri Apr 11, 2008 8:19 am
Return to Logistics SD
Who is online
Users browsing this forum: No registered users and 2 guests
|
|