‎2007 Dec 07 7:05 AM
can any one provide me alternate code for following statement using 1.READ from internal table, 2. by using "for all entries".
<u>following is the code</u>
*TABLE J_5HPDBEAR
LOOP AT gt_cr INTO gs_cr.
SELECT * FROM j_5hpdbear WHERE annuser = gs_cr-ausfuehrer.
gs_cr-vorname = j_5hpdbear-vorname. "First name
gs_cr-nachname = j_5hpdbear-nachname. "last name
gs_cr-mail = j_5hpdbear-mail. "mail id
*
MODIFY gt_cr FROM gs_cr.
*
ENDSELECT.
ENDLOOP.
here gs-cr is the header for gt_cr
‎2007 Dec 07 6:34 PM
if not gt_cr is initial.
select *
from j_5hpdbear
into table gt_j_5hpdbear
for all entries in gt_cr
where annuser = gt_cr-ausfuehrer.
loop at gt_cr into gs_cr.
read table gt_j_5hpdbear into wa_j_5hpdbear where annuser = gs_cr-ausfuehrer.
if sy-subrc = 0.
move :
wa_j_5hpdbear-vorname to gs_cr-vorname ,
wa_j_5hpdbear-nachname to gs_cr-nachname,
wa_j_5hpdbear-mail to gs_cr-mail.
modify gt_cr from gs_cr index sy-tabix transporting vorname nachname mail .
endif.
endloop.
endif.
‎2007 Dec 07 9:15 AM
Hi
if gt_cr is not initial.
select * form J_5HPDBEAR into table itab
for all entries in gt_cr
where annuser = gt_cr-annuser.
endif.
next do what ever you want.
Reward if it is helpful.
Thanks
Siva Kuamr.
‎2007 Dec 07 9:20 AM
Hi,
do like this.......
TABLE J_5HPDBEAR.
If gt_cr is not intial.
SELECT * FROM j_5hpdbear into table git_j_5hpdbear for all entries in gt_cr WHERE annuser = gt_cr-ausfuehrer.
endif.
sort git_j_5hpdbear by annuser.
LOOP AT gt_cr INTO gs_cr.
Read table git_j_5hpdbear into wa_j_5hpdbear with key annuser = gs_cr-annuser binary search.
if sy-subrc = 0.
gs_cr-vorname = wa_j_5hpdbear-vorname. "First name
gs_cr-nachname = wa_j_5hpdbear-nachname. "last name
gs_cr-mail = wa_j_5hpdbear-mail. "mail id
MODIFY gt_cr FROM gs_cr.
clear gs_cr.
endif.
ENDLOOP.Regards,
Satish
‎2007 Dec 07 6:34 PM
if not gt_cr is initial.
select *
from j_5hpdbear
into table gt_j_5hpdbear
for all entries in gt_cr
where annuser = gt_cr-ausfuehrer.
loop at gt_cr into gs_cr.
read table gt_j_5hpdbear into wa_j_5hpdbear where annuser = gs_cr-ausfuehrer.
if sy-subrc = 0.
move :
wa_j_5hpdbear-vorname to gs_cr-vorname ,
wa_j_5hpdbear-nachname to gs_cr-nachname,
wa_j_5hpdbear-mail to gs_cr-mail.
modify gt_cr from gs_cr index sy-tabix transporting vorname nachname mail .
endif.
endloop.
endif.