2007 Dec 06 12:45 PM
Hi experts,
i have a lifnr in a variable gv_lifnr and i have a internal table git_lifnr consiting of set of 10 lifnrs ,how can i search that gv_lifnr is in git_lifnr or not please advice
2007 Dec 06 12:52 PM
Hi,
Loop at itab
if itab-lifnr =gv_lifnr
endif.
endloop.
Reagrds,
Prashant
Hi experts,
i have a lifnr in a variable gv_lifnr and i have a internal table git_lifnr consiting of set of 10 lifnrs ,how can i search that gv_lifnr is in git_lifnr or not please advice
2007 Dec 06 12:47 PM
hi,
u can use
read statment and than check that if sy-subrc is 0 than its there in table...
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr,
END OF itab.
DATA : f TYPE i.
itab-matnr = '101'.
APPEND itab.
itab-matnr = '102'.
APPEND itab.
itab-matnr = '103'.
APPEND itab.
itab-matnr = '104'.
APPEND itab.
itab-matnr = '105'.
APPEND itab.
LOOP AT itab.
READ TABLE itab WITH KEY matnr = '106'.
IF sy-subrc = 0.
f = 1.
EXIT.
ENDIF.
ENDLOOP.
IF f = 1.
WRITE:/ 'Available'.
ENDIF.
2007 Dec 06 12:50 PM
Sort table git_lifnr.
Read table git_lifnr into gwa_lifnr with key lifnr = gv_lifnr binary search.
If sy-subrc = 0.
* You got entry
endif.Regards,
Satish
2007 Dec 06 12:51 PM
Hi,
You can loop your internal table.
Loop at itab.
Read table itab with key lifnr = gt_lifnr.
if sy-subrc eq 0.
Do your further processing.
endif.
endloop.
Thanks,
lalit
2007 Dec 06 12:52 PM
Hi,
Loop at itab
if itab-lifnr =gv_lifnr
endif.
endloop.
Reagrds,
Prashant
2007 Dec 06 12:54 PM
hi ,
u can use:
LOOP AT itab.
READ TABLE itab WITH KEY lifnr eq gv_lifnr.
IF sy-subrc = 0.
means it is thier in the internal table....
reward if helpful
regards,
sohi
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |