on 04-23-2010 10:33 AM
Hi,
this is Anil.I got a problem in scripts.In my script 'IF' condition is exceeeded more than one line.what ever i kept in the first line of the IF condition ,it is working properly.but from the second line onwards the code is not working properly.can any one help me in this topic plz.I have tried '=','/=','/',continuos text also.
Thank you,
Anil.
Hi,
In that if condition better to write another IF condition.
I mean nested if.
Regards and Best wishes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anil,
There is one other option is well in SAP script. Pls follow the steps:
1. On the same editor scrren follow the path to put whole condition in one line:
a. Put the cursor on the line which you wud like to extend, then (In main menu) Edit -> Page Left/Right -.
Now here your are in right side of the editor, You can put remaining statement here.
Pls tell me if it is not clear.
Regards,
Lokesh.
Hi,
I think there are two more options.
1. If whole editor line is full than from next line put the tage format = (Extended Line), ang put the condition in this line.
2. Follow the path: double click on window -> Click on Text Element... Now you will be at editor page. So do not change the editor here. Just put your code on that page. Try this.
Regrads,
Lokesh.
Edited by: Lokesh Tarey on Apr 23, 2010 3:28 PM
Hi anil,
I know your problem and you've to use one of the already mentioned workarounds, but I've another hint. Instead of
/: IF &VBDKR-LAND1& = 'FI' OR &VBDKR-LAND1& = 'DE' OR
/: &VBDKR-LAND1& = 'AT' OR &VBDKR-LAND1& = 'CY'
/: ENDIF
write this
/: DEFINE &L& = &VBDKR-LAND1&
/: IF &L& = 'FI' OR &L& = 'DE' OR &L& = 'AT' OR &L& = 'CY'
/: ENDIF
With the little trick to use a shorter symbol for the original symbol you'll get a shorter IF-Statement!
Hello,
Try Writing a perform subroutine in external program, and perform the validations needed.
Based on the results, take further action.
Hope this helps.
THanks,
Kaleem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Anil,
I think there is some misunderstanding between you and us..
I think all the suggested solutions (i think there were 4 different: many IFs, CASE, PERFORM, shifting page...) will work correctly, just try any of them and you will see
Regards,
MC
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anil,
Try do what Kiran suggested, you can achieve it via following statements:
/: IF &VBDKR-LAND1& = 'FI' OR &VBDKR-LAND1& = 'DE'
/: do_what_you_want
/: ELSE
/: IF &VBDKR-LAND1& = 'AT' OR &VBDKR-LAND1& = 'CY'
/: do_what_you_want
/: ENDIF
/: ENDIF
If you have only ORs in your conditional statement it is quite easy to implement it (one example solution is written above).
The problem may occur when you will have more complicated condition.In such case it is easier to call subroutine and make all conditions and calculations outside the sapscript, and return necessary data back to the form.
Kind regards,
MC
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
/: IF &VBDKR-LAND1& = 'FI' OR &VBDKR-LAND1& = 'DE' OR
/: &VBDKR-LAND1& = 'AT' OR &VBDKR-LAND1& = 'CY' OR
/: &VBDKR-LAND1& = 'CZ' OR &VBDKR-LAND1& = 'DK' OR
/: &VBDKR-LAND1& = 'EE' OR &VBDKR-LAND1& = 'ES'
FT: SOME TEXT
/: ELSE
FT: SOME TEXT
/: ENDIF.
This is my condition.so for these lands the footer should display in scripts else it should priint another.
sooo for me the lands in ist line of the IF condition is working form 2nd line lands are not working .
sooo kindly help me in this plz.
Thank you,
Anil.
Hi,
I would suggest the following solution:
/: CASE &VBDKR-LAND1&
/: WHEN 'FI'
FT: SOME TEXT
/: WHEN 'DE'
FT: SOME TEXT
/: WHEN 'AT'
FT: SOME TEXT
/: WHEN 'CY'
FT: SOME TEXT
/: WHEN 'CZ'
FT: SOME TEXT
..... the same for each country
/: WHEN OTHERS
FT: SOME OTHER TEXT
/: ENDCASE
Kind regards,
MC
goto edit and select shift left/right and enter conditions, i guess this way ur two conditions will be accomodated in each line for others if nothing is working then split the conditions like.
IF <condiotion>
Endif.
If <condition>
Endif.
though not a good practice but if nothing else is working use this
Or u can use a perform check the condition in perform and send back a flag.
chekc this flag to print ur texts
Edited by: Kartik Tarla on Apr 23, 2010 4:00 PM
hi kartik,
plz try to understand this.
see i have footer text which has to be printed only for the lands which are mentioned in the IF condition soo i cant use the case and nested if ,ok.soo for all the lands in if condition the footer text is same soo nested if and case conditions are useless.
plz try once.
thank you.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.