cancel
Showing results for 
Search instead for 
Did you mean: 

If condition in SAP Script

Former Member
0 Kudos

Hi,

I have written a condition in the text elements like below.

IF &EKPO-NETWR& GT '300'

Print some text.

ELSE

Print other text.

ENDIF

But its not working.If i put EQ or NE,its working fine.But if i put GT,GE,LT,LE or >,< ,its not working.

Suggest if there is any other symbol to be used in SAP Sccript for GT,GE.

Thanks,

Aparna.

Accepted Solutions (0)

Answers (7)

Answers (7)

former_member296785
Participant
0 Kudos

hey guyz...wot is the solution? please help me.... am facing same issue.

Thanks & Regards

Sachin

former_member296785
Participant
0 Kudos

Issue Solved.
Guys Set FLAG value...and use FALG instead of LT GT GE LE.

Thanks n Regards,

Sachin M

Former Member
0 Kudos

Hi all,

Me to Facing the same problem while using IF condition in the SAP Script for the following code.

IF &ITAB-TCS& GT 0

&SY-ULINE(65)&,,,,,,Tax Collected at Source,,&ITAB-TCS&

,,,,,,&SY-ULINE(65)&

ELSEIF &ITAB-TCS& EQ &0&

&SY-ULINE(65)&

ENDIF

i tried with all the optons mentioned,but no luck.

try to give some resolution for this.

Regards,

Sathya

Former Member
0 Kudos

HI All,

Even i am facing the same problem < 0, >0 condition is not working. plz help me out .

Former Member
0 Kudos

Not solved the problem

former_member268430
Discoverer
0 Kudos

Hi Aparna,

Hope you figure out what went wrong.

It happened to me as well. But did figure out eventually.

I suggest that you put a dummy text in your condition just to see if the system execute the logic as previously suggested.

Verify the language that you are testing and modifying.

Kind Regards,

Lino

Former Member
0 Kudos

you don hv to specify quotes for numeric data....

try removing the quotes.....n check...

Former Member
0 Kudos

We have tried with quotes,without quotes,>. Nothing is working. Only EQ & NE is working fine.

Former Member
0 Kudos

< , > should work

Alternatively, once you are in the window..go to Check>Syntax check>Select your prog

This would give you an idea of whats going wrong

Regards,

Prashant

Former Member
0 Kudos

Hi Aparna,

try using

IF &EKPO-NETWR& GT 300, without the quotes. I think it will work.

Former Member
0 Kudos

Hi aparna,

in my script i have used a condition like :

if structure name-fieldname>0

print some text

else

print other text

it is working fine for me so i don't think the problem is > or < sign . There must some problem in your condition. so debug your script and see what value is coming in EKPO-NETWR .

regards

Saurabh

Former Member
0 Kudos

Hi!

I think, that the fault has to do with the processing of program symbols. The comparison is always performed on literal values, that is, the symbols are formatted as character strings before they are compared.

You can find more information in sap online documentation, http://help.sap.com/saphelp_nw70/helpdata/en/d1/80318f454211d189710000e8322d00/frameset.htm

kind regards, Fößleitner Johann