05-11-2009 8:42 AM
i m writing a report using if elseif condition...i m getting following error
if v_x = 'X'.
......
elseif v_y = 'X'.
....
elseif v_z = 'X'.
select ...into itab...
loop at itab.
select single....
.....
append itab2.
endloop.
elseif v-c = 'X'.
....
else.
.....
endif.
Above code is showing error as " NO Open IF Statement"
at the elseif statement.pls hlp
05-11-2009 8:44 AM
05-11-2009 8:47 AM
if p_upload eq 'X'.
call function 'UPLOAD'
..
if sy-subrc ne 0.
message e000 with 'unable to read file'.
else.
...
if v_line gt 0.
loop at i_itab.
select single vbeln lifsk vdatu..
if sy-subrc eq 0.
..
endif.
endloop.
else.
..
endif.
endif.
elseif p_del_gi eq 'X'.
...
LOOP AT i_vbelv into wa_vbelv.
select single kunnr auart lifsk vdatu..
if sy-subrc = 0.
...
endif.
endloop.
elseif p_req_dl eq 'X'.
select vbeln lifsk vdatu into (vbak-vbeln, vbak-lifsk, vbak-vdatu)
...
endselect.
else.
select vbeln lifsk vdatu into (vbak-vbeln, vbak-lifsk, vbak-vdatu)
...
endselect.
endif.
Edited by: Matt on May 11, 2009 9:48 AM
Edited by: Matt on May 11, 2009 9:48 AM - add tags and removed unnecessary lines taking the post over the character limit.
05-11-2009 8:56 AM
Hi Venu,
Its simple,,
Just count the No of If's you written and Endif's you written,,,
one condition is not closed properly...
Thanks & regards,
Dileep .C
05-11-2009 8:56 AM
Pretty print your code, and you should see, by the indentation, where the problem lies. I have not found a problem with your code, however, it looks fine to me.
matt
05-11-2009 8:46 AM
Have you close the previous statement before the elseif statement by means of putting . ?
Regards.
Sarbajit.
Edited by: Sarbajit Majumdar on May 11, 2009 1:17 PM
05-11-2009 9:09 AM
Hi Venu,
please check the code how many IF conditions are in your code , I thought some endif conditions are missed.
My suggestion is , why you use loop and select statment Consecutively ...and please check the code performance once- how much time it will take for execution.
Siva Prasad
SAP-Practice
05-11-2009 9:19 AM
Hi,
The number of if conditions should match with the endif statement.
Double click on the if statement you will get the correct endif you coded.
Regards
Sabu
05-11-2009 9:30 AM
Hi,
Here your code looks fine, may be the error is coming from another stage of code.
Here your error shows that you have defined 'Endif' extra as there is no 'If' for that.
Check your code .
Regards,
Himanshu