‎2007 May 14 8:07 AM
Hi Gurus,
LOOP AT gi_coas.
READ TABLE gi_ekkn WITH KEY aufnr = gi_coas-aufnr
BINARY SEARCH.
IF sy-subrc EQ 0.
gi_ekkn-kostl = gi_coas-kostv.
MODIFY gi_ekkn TRANSPORTING kostl.
ENDIF.
ENDLOOP.
Will this code work or not let me know.
its giving short dump for me.
is there anything wrong in it.
‎2007 May 14 8:10 AM
Hi
Hi which table you have to modify?
gi_ekkn or gi_coas?
Only you can modify gi_coas with the value read from gi_ekkn.
LOOP AT gi_coas.
READ TABLE gi_ekkn WITH KEY aufnr = gi_coas-aufnr
BINARY SEARCH.
IF sy-subrc EQ 0.
gi_ekkn-kostl = gi_coas-kostv.
MODIFY <b>gi_coas</b> <b> index sy-tabix</b> TRANSPORTING kostl.
ENDIF.
ENDLOOP.
Reward points if useful
Regards
Anji
Message was edited by:
Anji Reddy Vangala
‎2007 May 14 8:11 AM
HI
try this.
LOOP AT gi_coas.
READ TABLE gi_ekkn WITH KEY aufnr = gi_coas-aufnr
BINARY SEARCH.
IF sy-subrc EQ 0.
gi_ekkn-kostl = gi_coas-kostv.
<b>MODIFY gi_ekkn index sy-tabix TRANSPORTING kostl .</b>
ENDIF.
ENDLOOP.
‎2007 May 14 8:16 AM
Best way is to use Workareas
LOOP AT gi_coas into wa_coas.
READ TABLE gi_ekkn into wa_ekkn WITH KEY aufnr = wa_coas-aufnr
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_ekkn-kostl = wa_coas-kostv.
MODIFY gi_ekkn from wa_ekkn.
ENDIF.
ENDLOOP.
‎2007 May 14 8:23 AM
hi Mac.
you can only modify the table which you are looping in... the statement that you have written is wrong...
Please replace the table name... according to your requiremnt and rest all on the coding and syntax sid looks good,.
regards,
jayant
‎2007 May 14 8:23 AM
Hi,
In ECC6.0 latest we want to use Workarea before entering the values in internal table or retrieving from db table to internal table...
So use work aeas it ill be very useful
reward if useful
‎2007 May 14 8:29 AM
‎2007 May 14 8:37 AM
Hi,
try this:
1. give where condition
2. use INDEX claause
Jogdand M B
‎2007 May 14 9:04 AM
Hi,
The best solution with good performance and with out modify is the one below.
FIELD-SYMBOLS: <gi_ekkn> like line of gi_ekkn.
LOOP AT gi_coas.
READ TABLE gi_ekkn ASSIGNING <gi_ekkn>WITH KEY aufnr = gi_coas-aufnr
IF sy-subrc EQ 0.
<gi_ekkn>-kostl = gi_coas-kostv.
ENDIF.
ENDLOOP.
Best Regards,
Sesh
‎2007 May 14 9:12 AM
<b>sort gi_ekkn by aufnr.</b>
LOOP AT gi_coas.
READ TABLE gi_ekkn WITH KEY aufnr = gi_coas-aufnr
BINARY SEARCH.
IF sy-subrc EQ 0.
v_kostl = gi_coas-kostv.
MODIFY gi_ekkn FROM gi_coas TRANSPORTING kostl.
ENDIF.
ENDLOOP.
Give KOSTL in both tables.
‎2007 May 14 10:49 AM
hi frnd.
try this one,,
LOOP AT gi_coas into wa_coas.
READ TABLE gi_ekkn into wa_ekkn WITH KEY aufnr = wa_coas-aufnr
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_ekkn-kostl = wa_coas-kostv.
MODIFY gi_coas index sy-tabix TRANSPORTING kostl.
ENDIF.
ENDLOOP.
regards
vijay