‎2008 Mar 10 6:45 AM
hi,
i want to read kunnr from my internal table where name1 = 'vicky' , land1 = 'india'. I want to use the read statement.
regards,
sunny
‎2008 Mar 10 6:48 AM
Hi..
Read table internal_table into wa_itab
where name = 'VICKY' and land1 = 'INDIA'.
<REMOVED BY MODERATOR>
Regards.
Edited by: Alvaro Tejada Galindo on Apr 10, 2008 6:02 PM
‎2008 Mar 10 6:48 AM
Read itab into wa_itab with key name1 = 'vicky'
land1 = 'india'.
if sy-subrc = 0.
v_kunnar = 2a_itab-kunnr.
endif.
Regards,
Amit
‎2008 Mar 10 6:49 AM
Hi,
Try this:
Read table it_kunnr into work area with key name = 'XYZ'
land1 = 'ABC'.
check sy-subrc.
<REMOVED BY MODERATOR>
Regards,
Sandeep
Edited by: Alvaro Tejada Galindo on Apr 10, 2008 6:02 PM
‎2008 Mar 10 6:50 AM
Hi,
READ for any Internal Table
Reads a line of an internal table.
Syntax
READ TABLE <itab> FROM <wa>
|WITH TABLE KEY <k1> = <f1>... <kn> = <fn>
|WITH KEY = <f>
|WITH KEY <k1> = <f1>... <kn> = <fn>
INTO <wa> [COMPARING <f1> <f2>... |ALL FIELDS]
[TRANSPORTING <f1> <f2>... |ALL FIELDS|NO FIELDS]
|ASSIGNING <FS>
|REFERENCE INTO <dref>.
This statement reads either the line of the internal table with the same key as specified in the work area <wa>, the line with the key specified in the TABLE KEY addition, the line that corresponds fully to <f>, or the one corresponding to the freely-defined key in the KEY addition. The contents of the line are either written to the work area <wa>, or the line is assigned to the field symbol <FS>. If you assign the line to a work area, you can compare field contents and specify the fields that you want to transport.
READ for Index Tables
Reads a line of an internal table.
Syntax
READ TABLE <itab> INDEX <idx> INTO <wa>...
| ASSIGNING <FS>
| REFERENCE INTO <dref>.
The line with index 7 is read. The result is specified as with any internal table
Regards,
Priya.
‎2008 Mar 10 6:51 AM
Hi,
u can u the stmt READ TABLE itab WITH KEY k1 = v1 ... kn = vn .
‎2008 Mar 10 6:55 AM
hi,
you can use this codes too :
SORT ITAB BY NAME1 LAND1.
READ TABLE ITAB INTO WA_ITAB WITH KEY NAME1 = 'VICKY'
LAND1 = 'INDIA' BINARY SEARCH.
IF SY-SUBRC EQ 0.
PERFORM YOUR_STEPS.
ENDIF.
‎2008 Mar 10 7:04 AM
Hi,
Use this:
Sort it_tab by name1 land1.
Read table it_tab into wa_tab with key name1 = 'Vicky'
land1 = 'India'
binary search.
if sy-subrc eq 0.
l_kunnr = wa_itab-kunnr.
endif.
hope it will help you.
Thanks,
Parul.
‎2008 Mar 10 7:13 AM
Hi,
You can do as below using read statement:
sort itaby by name land1.
read table itab with key name1 = 'vicky'
land1 = 'india'.
if sy-subrc eq 0.
"Your necessary code
endif.
Thanks,
Sriram Ponna.
‎2008 Apr 10 9:30 AM
Hi,
decalre an internal table and an explicit work area for that.
loop at it.
ReaD TABEL (INTERNAL TABLE NAME) INTO wa with key kunnr = 'VICKY' and land1 = 'INDIA'.
append wa.
modify itab from wa.
clear wa.
endloop.
write : wa-kunnr, wa-land1.
‎2008 Apr 10 1:21 PM
Hi,
Read table itab with key name1 = 'vicky' and land1 = 'india'.
Thank u,
Manjula Devi.D
‎2008 Apr 10 1:34 PM
Hi,
Read table itab with key name1 = 'vicky' and land1 = 'india'.
Regards,
Soumya.
‎2008 Apr 11 1:56 AM
HI,
If your internal table has more than one Record with values:
Name = Vicky and Land = India.
Read statement will fetch the First index with above condition.
If you want to read a particular record with above combination , you should modify ur Read statement with key condition.
Else it will b OK
Thanks
Praveen