2016 Aug 03 8:26 PM
HI expert,
when i am featching records from internal table on base of logical expression.. multiple logic expression not working..
below is my expression..
2016 Aug 03 9:04 PM
Important question : could you please explain what you want to do? (don't answer you want it to work)
By the way, using translatable texts (text-xxx) as a means of defining constants is a very bad idea! (hopefully SAP never does that, it would be fun to see the result!) Better use either constants (key word CONSTANTS) or text literals (like 'COFI') depending on the context.
2016 Aug 04 6:35 AM
Hi Ryan,
in decision "AND" statement is not working after condition change below is logical expression.
IF ( ls_glset-shortname = 'FREIGHT_FORW' OR
ls_glset-shortname = 'RENT' OR
ls_glset-shortname = 'TRAVL_CONVNC' OR
ls_glset-shortname = 'SALPF_BONUS' OR
ls_glset-shortname = 'OTHEREXPENSES' ) AND
( ls_faglflext-activ <> 'RKP1' AND ls_faglflext-prctr <> '11ITMIS' ).
above logic working on both condition if ls_faglflext-activ <> 'RKP1' or faglflext-prctr <> '11ITMIS'
it's treat like a "OR" not "AND"
Thnkx
Prakash
2016 Aug 04 6:40 AM
2016 Aug 03 10:39 PM
Hi Prakash,
Seconded what Sandra has said regarding use of translatable texts in logical expressions. Also, look closely at the the fields you have defined for the value '11ITMIS' - in one case you have the field as pprctr and the other is prctr which might only be a typo but it could also reflect two separate fields when you mean for them to be the same.
Regards,
Ryan Crosby
2016 Aug 04 6:35 AM
Hi Ryan,
in decision "AND" statement is not working after condition change below is logical expression.
IF ( ls_glset-shortname = 'FREIGHT_FORW' OR
ls_glset-shortname = 'RENT' OR
ls_glset-shortname = 'TRAVL_CONVNC' OR
ls_glset-shortname = 'SALPF_BONUS' OR
ls_glset-shortname = 'OTHEREXPENSES' ) AND
( ls_faglflext-activ <> 'RKP1' AND ls_faglflext-prctr <> '11ITMIS' ).
above logic working on both condition if ls_faglflext-activ <> 'RKP1' or faglflext-prctr <> '11ITMIS'
it's treat like a "OR" not "AND"
Thnkx
Prakash
2016 Aug 04 6:48 AM
Hello Prakash,
Based on your code snipped the requirement looks like -
process the code inside the if block only if ls_glset-shortname is any of the literal values( 'FREIGHT_FORW' etc) and ls_faglflext-active is not 'RKP1' and ls_faglflext-prctr is not '11ITMIS'.
Here you can remove the parenthesis ( ) around the ls_faglflext conditions as it doesn't make any difference to the processing. Also did you check in debugging what's value you are getting for
ls_glset-shortname, ls_faglflext-active and ls_faglflext-prctr. Please shre with us the values you are getting during debugging for these variables.
Thanks,
Mainak
2016 Aug 04 6:42 AM
Dear Prakash,
What is your input value that your logic not working ?
Why do you use "shortname" field as the condition ? Is there not a GL Account ?
Because it is related with the Upper/lower letter and causes your condition will not be true.
Regards,
Yance