2010 Feb 24 7:04 AM
I have made an internal table. I would like to check a specific field in this table if it has a specific input.
How shall I do the checking using abap commants?
2010 Feb 24 7:12 AM
LOOP AT ITAB WHERE ITAB-FIELD = 'ABCD'.
FLAG = 'X'.
ENDLOOP.
IF FLAG = 'X'
FOUND.
ELSE.
NOT FOUND.
ENDIF.
I have made an internal table. I would like to check a specific field in this table if it has a specific input.
How shall I do the checking using abap commants?
2010 Feb 24 7:07 AM
Something like this.
LOOP AT gt_itab into gtt_wa.
If gtt_wa-lvorm Eq 'X'.
gtt_outtab-status = 'Released'.
endif.
ENDLOOP.
2010 Feb 24 7:16 AM
>
> LOOP AT gt_itab into gtt_wa.
> If gtt_wa-lvorm Eq 'X'.
> gtt_outtab-status = 'Released'.
> endif.
> ENDLOOP.
>
{quote}
Looping at gt_itab and altering the values of gtt_outtab without having any read/modify statements for gtt_outtab?
The correct snippet should look like:
LOOP AT gt_itab into gtt_wa.
If gtt_wa-lvorm Eq 'X'.
gtt_wa-status = 'Released'.
modify gt_itab from gt_wa.
endif.
ENDLOOP.
or
LOOP AT gt_itab into gtt_wa.
If gtt_wa-lvorm Eq 'X'.
read table gtt_outtab into gtt_wa with key XYZ = gt_itab-XYZ binary search."sort gtt_outtab by XYZ
gtt_outtab-status = 'Released'.
modify gtt_outtab index sy-tabix.
endif.
ENDLOOP.
Cheers
2010 Feb 24 7:20 AM
2010 Feb 24 7:08 AM
Hi
READ TABLE ITBA WITH KEY CARRID = 'AA'.
IF sy-subrc = 0.
" Means the Value you are looking for is there
else.
Message 'No Value found' "Etc any message or it means Not found
endif.Cheerz
Ram
2010 Feb 24 7:12 AM
2010 Feb 24 7:12 AM
LOOP AT ITAB WHERE ITAB-FIELD = 'ABCD'.
FLAG = 'X'.
ENDLOOP.
IF FLAG = 'X'
FOUND.
ELSE.
NOT FOUND.
ENDIF.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |