cancel
Showing results for 
Search instead for 
Did you mean: 

question on sapscript

adel_adel
Participant
0 Kudos

Hi all,

I have the following question :

In my abap program u have the following:

data : WA_count type i.

select single * from nast where kappl = 'EV'.

  • after this statement is nast-anzal = 1 (type of nast-anzal is

DEC2).

wa_count = nast-anzal.

so far so good.

On my sapscript :

/: if &wa_count& = 1.

One

/: else.

Others

/: endif.

The word 'Others' is printed (i accept One ).

Its seems simple but i dont know what i do wrong.

I tried also with : if &nast=anzal& = 1 ('1' eq ..etc)

Thanks

Accepted Solutions (0)

Answers (7)

Answers (7)

adel_adel
Participant
0 Kudos

Thanks gustavo ..

The &wa_count(C)& works perfect ..

Former Member
0 Kudos

Try this, before doing the comparation, print the actual value of wa_count in the sapscript.This way you can check the exact value the sapscript is receiving.

You can also take off the /: and replace it with * in the if line, because perhaps extra spaces there are disrupting the command, and this way you can see it. In that case try using &wa_count(C)& to condense the extra spaces.

adel_adel
Participant
0 Kudos

still doenst't working

Former Member
0 Kudos

Hi Adel,

Can you change your WA_COUNT declaration from type I to NAST-ANZAL type and try again.


DATA WA_COUNT TYPE NAST-ANZAL.

/: if &wa_count& = '1'.
One
/: else.
Others
/: endif.

Thanks,

Vinay

adel_adel
Participant
0 Kudos

Of course i died he debugging before posting the question.

The value is 1 .

Hexadicam value is 001C.

But it still not working.

Former Member
0 Kudos

Debug your script also and see wt is value of both variables.

nast-anzal and wa_count.

Former Member
0 Kudos

Debug your code/script to find out value of nast-anzal.

Former Member
0 Kudos

Hi..

It could be '01'. Please check the value that is retreived from nast is 1 or 01.

The rest looks fine.

Regards,

Vishwa.