2008 Jul 23 8:15 PM
Hi Expets,
I want to read a table inside a LOOP ... ENDLOOP.
But I am not able to do it because while reading I need to take workarea. Kindly suggest a way of reading a table inside a LOOP .. ENDLOOP so that I can read all the contents of the table.
The above mentioned logic I need to implement in BADI.
Thanks,
Vinay.
2008 Jul 23 8:30 PM
Hi Experts,
I am using the below logic whether it works or not please let me know:-
LOOP AT LIT_STBP INTO LW_STBP1.
IF LW_STBP1-STUFE = 1.
CLEAR LW_STBP2.
LOOP AT LIT_TEMP_STBP INTO LW_STBP2
WHERE VWEGX = LW_STBP1-WEGXX.
IF SY-SUBRC = 0.
DELETE LIT_STBP.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
Thanks,
Vinay.
Hi Experts,
I am using the below logic whether it works or not please let me know:-
LOOP AT LIT_STBP INTO LW_STBP1.
IF LW_STBP1-STUFE = 1.
CLEAR LW_STBP2.
LOOP AT LIT_TEMP_STBP INTO LW_STBP2
WHERE VWEGX = LW_STBP1-WEGXX.
IF SY-SUBRC = 0.
DELETE LIT_STBP.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
Thanks,
Vinay.
2008 Jul 23 8:20 PM
Try this,
DATA: ITAB TYPE STANDARD TABLE OF MARA.
WA_ITAB TYPE ITAB.
DATA: ITAB1 TYPE STANDARD TABLE OF MAKT
WA_ITAB TYPE ITAB1.
LOOP AT ITAB INTO WA_ITAB
CLEAR WA_ITAB1
READ TABLE ITAB1 INTO WA_ITAB1 WITH KEY
ENDLOOP.
Thanks,
SKJ
2008 Jul 23 8:20 PM
Check this sample.
data ind type i.
loop.
ind = ind + 1.
read table it_data index ind.
if sy-subrc ne 0.
exit.
endif.
endloop.
2008 Jul 23 8:20 PM
loop at itab.
read table itab index sy-tabix. " every single record will be read here
if sy-subrc eq 0.
logic....
endif.
endloop.
2008 Jul 23 8:30 PM
Hi Experts,
I am using the below logic whether it works or not please let me know:-
LOOP AT LIT_STBP INTO LW_STBP1.
IF LW_STBP1-STUFE = 1.
CLEAR LW_STBP2.
LOOP AT LIT_TEMP_STBP INTO LW_STBP2
WHERE VWEGX = LW_STBP1-WEGXX.
IF SY-SUBRC = 0.
DELETE LIT_STBP.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
Thanks,
Vinay.
2008 Jul 23 8:35 PM
no need of sy-subrc check in side loop.
LOOP AT LIT_STBP INTO LW_STBP1.
IF LW_STBP1-STUFE = 1.
CLEAR LW_STBP2.
LOOP AT LIT_TEMP_STBP INTO LW_STBP2
WHERE VWEGX = LW_STBP1-WEGXX.
DELETE LIT_STBP.
ENDLOOP.
ENDIF.
ENDLOOP.
2008 Jul 25 12:03 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |