Skip to Content
0
Former Member
Mar 24, 2009 at 03:54 PM

dbcnt in a loop.

70 Views

Hi Experts,

In a loop the following select query is there ,

Now I would like to get this out of loop , when I do that then how can I check dbcnt on a read statement.

LOOP AT it_output.

SELECT teindt seindt

INTO (it_output-eindt , it_output-edt)

FROM eket AS t

LEFT JOIN ekes AS s

ON sebeln = tebeln AND

sebelp = tebelp AND

s~ebtyp = 'AB'

WHERE t~ebeln = it_output-ebeln

AND t~ebelp = it_output-ebelp.

IF sy-dbcnt = 1.

MODIFY it_output.

ELSE.

INSERT it_output.

ENDIF.

ENDSELECT.

ENDLOOP.

Please suggest me whether this can be possible .

Thanks in advance.