Skip to Content
0
Former Member
Sep 27, 2005 at 08:02 PM

problem in IF and ENDIF.

149 Views

Hi Experts,

I have a problem in the IF AND IF loops, since my program I find a string based on the grid, what's happening is in the pop up if i type the string which is in the first grid, at the first click of find itself it finds the string.

But if i type the string which is in the second grid, I have press the continue button in the pop up twice and then only it finds it.

Samething vice-versa for other grids, 3 times for 3rd grid 4 times for 4th grid.

Here is my code.

FORM search.

DATA: search TYPE sy-subrc.

PERFORM find USING grid1

itab1

CHANGING search.

IF search NE 0.

PERFORM find USING grid2

itab2

CHANGING search.

IF search NE 0.

PERFORM find USING grid3

itab3

CHANGING search.

IF search NE 0.

PERFORM find USING grid4

itab4

CHANGING search.

ENDIF.

ENDIF.

ENDIF.

ENDFORM.

Can anyone please tell me what could be the problem?

Thanks in advance.

Prabs.