2007 Jul 05 1:46 PM
Hi all,
I am having a ztable A with fields
f1 f2 f3
a 1
a 2
a 3
a 4
a 5
b 2
b 3
i just want to add
b 1
b 4
b 5
my ztable, in the same way value 'a' has 400 values. and 'b' has 100 values. I just want to copy the remaining 300 to value 'b'.
Can you please suggest
Hi all,
I am having a ztable A with fields
f1 f2 f3
a 1
a 2
a 3
a 4
a 5
b 2
b 3
i just want to add
b 1
b 4
b 5
my ztable, in the same way value 'a' has 400 values. and 'b' has 100 values. I just want to copy the remaining 300 to value 'b'.
Can you please suggest
2007 Jul 05 1:49 PM
Priyanka,
One way is to create a flat file and upload it through LSWM.
K.Kiran.
2007 Jul 05 2:10 PM
You could use an internal table. First copy all "a" records to your internal table:
SELECT * FROM ztable INTO w_record
WHERE field1 = 'a'.
APPEND w_record TO w_table.
ENDSELECT.
Then create new entries for the "b" values:
LOOP AT w_table INTO w_record.
SELECT SINGLE * FROM ztable INTO b_record
WHERE field1 = 'b' AND field2 = w_record-field2.
IF sy-subrc <> 0.
b_record-field1 = 'b'.
b_record-field2 = w_record-field2.
INSERT INTO ztable VALUES b_record.
ENDIF.
ENDLOOP.
I hope this helps.
- April King
2007 Jul 05 2:23 PM
Hai ...
here is the code ... just change the fields names and table name as yours ... there see in the debug mode AND SEE IT ...
it was working in my end .
REPORT ZTEST_UPDATE.
tables : spfli .
DATA sflight_tab TYPE TABLE OF sflight.
FIELD-SYMBOLS <sflight> TYPE sflight.
SELECT CARRID CONNID FROM sflight INTO TABLE sflight_tab
WHERE carrid = 'A' .
IF sy-subrc = 0.
LOOP AT sflight_tab ASSIGNING <sflight>.
<sflight>-CARRID = 'B' .
APPEND <sflight> to sflight_tab .
ENDLOOP.
ENDIF.
UPDATE sflight FROM TABLE sflight_tab .
reward points if it is usefull ...
Girish
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |