2006 Dec 29 4:47 AM
Hi,
My case is like this .
LOOP
IF
<b>IF
ENDIF.</b>
ENDIF.
ENDLOOP.
I want to move the code between my middle if-endif(bold here) to a subroutine. if i move to a subroutine it is showing error that inconsistent nesting.
request your help.
regards,
Ratna
Hi,
My case is like this .
LOOP
IF
<b>IF
ENDIF.</b>
ENDIF.
ENDLOOP.
I want to move the code between my middle if-endif(bold here) to a subroutine. if i move to a subroutine it is showing error that inconsistent nesting.
request your help.
regards,
Ratna
2006 Dec 29 5:07 AM
2006 Dec 29 5:09 AM
Hi Ratan ,
It should not display such an error , if you have moved your code to a subroutine .
Coule you please paste the relevant code here so that we can help you out .
Regards
Arun
2006 Dec 29 5:12 AM
Hi Ratna,
Inside the second if statement, it is possible to send the values to the subroutine.for ex:
if gc_mode = 'W'.
PERFORM opendataset_mode USING gv_intrn gc_mode.
endif.
this will work even if it is within another if statement.
just use 'USING' while passing the values to the subroutine.it will work.
hope it is helpful, let me know if you still have doubt in this topic.
reward points if helpful.
Message was edited by:
Pradeep Kumar
2006 Dec 29 5:12 PM
I just tried following way and I dont get any nesting error. Is this what you are saying?
data: begin of itab occurs 0,
matnr like mara-matnr,
end of itab.
data: var type c value 'x'.
loop at itab.
if var eq 'x'.
if var eq 'x1'.
perform xx.
endif.
endif.
endloop.
&----
*& Form xx
&----
text
----
--> p1 text
<-- p2 text
----
form xx.
endform. " xx
Thanks,
Santosh
2007 Jan 02 5:56 AM
I think probably why the error is coming is because u havent put a period after 'if'...it should be like this...
<b>If</b> <condition><b> .</b>
<b>If</b> <condition><b> .</b>
Perform .......
<b>Endif.
Endif.</b>