2007 Jun 11 12:19 PM
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
2007 Jun 11 12:25 PM
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
2007 Jun 11 12:22 PM
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
2007 Jun 11 12:24 PM
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
2007 Jun 11 12:25 PM
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
2007 Jun 11 12:25 PM
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
2007 Jun 11 1:34 PM
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
2007 Jun 11 2:43 PM
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.
2007 Jun 12 5:41 AM
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
2007 Jun 12 6:13 AM
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.
2007 Jun 12 7:01 AM
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
2007 Jun 12 7:12 AM
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
2007 Jun 11 12:29 PM
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
2007 Jun 11 12:31 PM
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
2007 Jun 11 12:31 PM
write your statuses in single quotes.
this will solve your problem.
regards.
2007 Jun 11 12:33 PM
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.
2007 Jun 11 12:41 PM
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