‎2008 May 29 10:45 AM
Dear Gurus,
The following is used now. Need to change into Loop statement.
Read the internal table t_ABC INTO w_ABC WITH KEY .... "ABC is to collect all Successful Insertion
IF sy-subrc NE 0.
CLEAR w_ABC.
Read the internal table t_XYZ INTO w_ABC WITH KEY ....
IF sy-subrc EQ 0.
PERFORM locktable.
INSERT ABC FROM w_ABC.
IF sy-subrc NE 0.
w_failure = c_x.
ENDIF.
PERFORM unlocktable.
APPEND w_ABC TO t_ABC. "Here t_ABC will hv only all Successful Insertion records
CLEAR w_ABC.
ENDIF.
ENDIF.
Since there will be more than one record, I can't use READ Statement.
How to use Loop? But it should not affect performance.
My worry is that, if i use "Locking the table" and "Insert" inside Loop, then it will affect performance.
Can any one please help me out?
It's pretty urgent.
Points will be rewarded immediately.
Thanks & Regards,
Neeraj
‎2008 May 29 10:48 AM
hi replace read by this statement..
loop at itab into wa where field1 = v_field .
append and then clear
endloop.
regards,
venkat
‎2008 May 29 11:19 AM
Hi,
Loop at t_abc INTO w_ABC .
Read table t_XYZ INTO w_ABC WITH KEY ....
IF sy-subrc EQ 0.
PERFORM locktable.
INSERT ABC FROM w_ABC.
IF sy-subrc NE 0.
w_failure = c_x.
ENDIF.
PERFORM unlocktable.
APPEND w_ABC TO t_ABC. "Here t_ABC will hv only all Successful Insertion records
CLEAR w_ABC.
ENDIF.
ENDIF.