Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Please help very urgent

Former Member
0 Kudos
331

Hi friends

please help me out this problem.

POSNE LIKE VBEP-POSNE, "DAYS

VBELE LIKE VBEP-VBELE, "STATUS

if itab-POSNE le 0.

ITAB-VBELE = "OVER DUE".

elseif itab-POSNE > 0 AND itab-lmeng le 10.

ITAB-VBELE = "CRITICAL".

elseif itab-POSNE > 10.

ITAB-VBELE = "UNDER FOLLOW-UP".

endif.

when i compiling the above code, am getting the following error.

Field "ELSEIF" is unknown. It is neither in one of the specified tables.

nor defined by a "data" statement. "DATA" statement.

Thanks in advance.

Regards

Rajaram

1 ACCEPTED SOLUTION

Former Member
0 Kudos
282

Hi Rajaram,

POSNE LIKE VBEP-POSNE, "DAYS

VBELE LIKE VBEP-VBELE, "STATUS

if itab-POSNE le 0.

ITAB-VBELE = 'OVER DUE'.

elseif itab-POSNE > 0 AND itab-lmeng le 10.

ITAB-VBELE = 'CRITICAL'.

elseif itab-POSNE > 10.

ITAB-VBELE = "UNDER FOLLOW-UP".

endif.

You have specified the value in double cotes ", This will consider as comment. You want to specify the value in single cotes. This is the problem

Regards,

Rusidar

15 REPLIES 15

Former Member
0 Kudos
282

Hi Rajaram,

please try this

if itab-POSNE le 0.

ITAB-VBELE = "OVER DUE".

elseif ( itab-POSNE > 0 AND itab-lmeng le 10 ).

ITAB-VBELE = "CRITICAL".

elseif itab-POSNE > 10.

ITAB-VBELE = "UNDER FOLLOW-UP".

else.

endif.

reward if helpful

regards

arun

Former Member
0 Kudos
282

Hi,

Write this:

data: POSNE LIKE VBEP-POSNE, "DAYS
VBELE LIKE VBEP-VBELE. "STATUS


if itab-POSNE le 0.
ITAB-VBELE = 'OVER DUE'.

elseif itab-POSNE > 0 AND itab-lmeng le 10.
ITAB-VBELE = 'CRITICAL'.

elseif itab-POSNE > 10.
ITAB-VBELE = 'UNDER FOLLOW-UP'.
endif.

Jogdand M B

Message was edited by:

Jogdand M B

former_member188827
Active Contributor
0 Kudos
282

if u have given "over due" in inverted commas, give it in single quotes...

may b dis 'll solve ur probelm

Message was edited by:

abapuser

Former Member
0 Kudos
283

Hi Rajaram,

POSNE LIKE VBEP-POSNE, "DAYS

VBELE LIKE VBEP-VBELE, "STATUS

if itab-POSNE le 0.

ITAB-VBELE = 'OVER DUE'.

elseif itab-POSNE > 0 AND itab-lmeng le 10.

ITAB-VBELE = 'CRITICAL'.

elseif itab-POSNE > 10.

ITAB-VBELE = "UNDER FOLLOW-UP".

endif.

You have specified the value in double cotes ", This will consider as comment. You want to specify the value in single cotes. This is the problem

Regards,

Rusidar

0 Kudos
282

Hi Rusidar

I got it, now its working, thank you very much to all.

And one more thing can you tell me, i have done subtraction in the variable itab-POSNE.

actually the value of itab-POSNE is < 0, but it is not showing the sign in the report. can you tell me please.

POSNE like VBEP-POSNE.

EDATU LIKE VBEP-EDATU

DATE1 = SY-DATUM.

ITAB-POSNE = ITAB-EDATU - DATE1

Regards

Rajaram

0 Kudos
282

hi

declare posne as a 6-letter character data

DATA : begin of itab occurs 0,

....

posne(6),

....

end of itab.

ITAB-POSNE = ITAB-EDATU - DATE1 will give a negative result.

folLow this statement by CONDENSE ITAB-POSNE NO-GAPS.

hope this solves your problem.

0 Kudos
282

Hi all

Actually am refering the field POSNE as follows

POSNE LIKE VBEP-POSNE

the length also 6, but still am not getting the minus(-) sign.

can you help me.

Thanks in advance.

Regards

Rajaram

0 Kudos
282

hi,

the data type of vbep-posne is NUMC i.e. numeric type , which is not used for calculation purposes.

still, u can use the following code , which will work only if teh difference between the dates is 5-digit (since the negative sign requires the sixth position in the field)

IF edatu < date1.

REPLACE ALL OCCURRENCES OF '0' IN posne WITH space.

CONCATENATE posne '-' INTO posne.

ENDIF.

this way, the field posne can get negative sign.

0 Kudos
282

Sorry yar

DATA : DATE1 TYPE SY-DATUM.

data : begin of itab occurs 0,

POSNE LIKE VBEP-POSNE, "DAYS

END OF ITAB.

DATE1 = SY-DATUM.

ITAB-POSNE = ITAB-POSNE - DATE1.

if itab-POSNE < 0.

REPLACE ALL OCCURRENCES OF '0' IN ITAB-POSNE WITH space.

CONCATENATE ITAB-POSNE '-' INTO ITAB-POSNE.

ITAB-VBELE = 'OVER DUE'.

endif.

MODIFY ITAB.

ENDLOOP.

This is my code, still am not getting please rectify it. Sorry for the disturbance.

Thanks in advance.

Regards

Rajaram

0 Kudos
282

HI yar

Thanks yar i corrected it, thank you very much. it was really helpful.

Instead of ITAB-POSNE = ITAB-EDATU - DATE1. line i tried

ITAB-POSNE = ITAB-POSNE - DATE1. this, that's why the problem.

Now it is working yar.

May i know your name and about you.

Regards

Rajaram

Former Member
0 Kudos
282

seee the text in the " " codes should be replace with ' ' codes ....

if itab-POSNE le 0.

ITAB-VBELE =<b> 'OVER DUE'</b>.

elseif itab-POSNE > 0 AND itab-VBELE le 10 .

ITAB-VBELE = <b>'CRITICAL'</b> .

elseif itab-POSNE > 10.

ITAB-VBELE = <b>'UNDER FOLLOW-UP'</b>.

endif.

reward points if it is usefull

girish

former_member196299
Active Contributor
0 Kudos
282

hi Raja ,

Accvording to the logic you are right . Please check on esp. the quotes and the spacings in your program code . You get this kind of errors for these reasons .

Regards,

Ranjita

Former Member
0 Kudos
282

write your statuses in single quotes.

this will solve your problem.

regards.

Former Member
0 Kudos
282

hi,

<b>once u check, internal table field type and passing data type are same or not.</b>

i think make mistake in any one of the these areas....

1) passing values to internal table in double quotaion marks. " "

2) internal table field type and variable type(which are passed to internal table) are not same.

3) internal table field defined without necessary fields.

regards,

Ashokreddy.

Former Member
0 Kudos
282

Hi,

You cann't put double quots, use single quots.

Try with this:

DATA : BEGIN OF ITAB OCCURS 0,

POSNE LIKE VBEP-POSNE, "DAYS

VBELE LIKE VBEP-VBELE, "STATUS

LMENG LIKE VBEP-LMENG,

END OF ITAB.

IF ITAB-POSNE LE 0.

ITAB-VBELE = 'OVER DUE'.

ELSEIF ITAB-POSNE > 0 AND ITAB-LMENG LE 10.

ITAB-VBELE = 'CRITICAL'.

ELSEIF ITAB-POSNE > 10.

ITAB-VBELE = 'UNDER FOLLOW-UP'.

ENDIF.

Regards,

Bhaskar