‎2007 Jul 15 5:55 PM
WHAT IS THE USE OF MOVE ...TRANSPORTING STATEMENT.WHAT IS THE EFFECT IN THE HEADER AND BODY OF AN INTERNAL TABLE
‎2007 Jul 15 7:55 PM
If u use TRANSPORTING comp1 comp2 in addition to MODIFY itab .. then only the specified comp1 comp2 ... components of the work area or header line are assigned to the corresponding components of the line(s) to be changed...
Reward points if useful
Regards
Prax
‎2007 Sep 13 1:11 PM
hi veera,
see the report below this might give u a better idea
here T508A is a data base table
so my advice would be 1st go and check this table
putting the following value
zeity = 1
mofid =11
and see the date (endda) in the same u .
now copy the code and exicute it
the date(endda)of table T508A
will change to '88881231
8888 yyyy
12 mm
31 dd.
data: idx type sy-tabix.
data: itab type standard table of t508a.
data: wa_tab type t508a.
select * from t508a into table itab
where zeity = '1'
and mofid = '11'.
*
loop at itab INTO WA_TAB.
idx = sy-tabix.
WA_TAB-ENDDA = '88881231'.
MODIFY ITAB FROM WA_TAB INDEX IDX TRANSPORTING ENDDA.
endloop.
modify t508a from TABLE itab.
hope this lll help u
award points if helpful.
anuj
‎2007 Sep 13 1:19 PM
Hi,
MODIFY TABLE itab FROM wa [TRANSPORTING f1 f2 ...].
The work area wa, which must be compatible with the line type of the internal table, plays a double role in this statement. Not only it is used to find the line that you want to change, but it also contains the new contents. The system searches the internal table for the line whose table key corresponds to the key fields in wa.
You can specify the non-key fields that you want to assign to the table line in the TRANSPORTING addition. You can also specify the fields f1 f2 dynamically using (n1) (n2) as the contents of a field n1 n2 . If <ni> is empty when the statement is executed, it is ignored. You can also restrict all fields f1 f2 to subfields by specifying offset and length.
For tables with a complex line structure, the use of the TRANSPORTINGaddition results in better performance, provided the system does not have to transport unnecessary table-like components.
Regards
Sudheer
‎2007 Sep 13 1:25 PM
hi,
MODIFY ...TRANSPORTING STATEMENT statement is used to modify the fields in the internal table that are given after TRANSPORTING.
for ex: there might be some scenarios where u need to modify few fields of a record [not entire record] in such situations we go for this MODIFY ...TRANSPORTING ........... statement. then it will modify only those fields of the internal table which are specified by
TRANSPORTING keyword.
for ex:
itab is a internal table with fields
sno sname age sex
1 suresh 24 m
2 babu 24 m
now my requirement is to change name and age fields of second record in itab then i try like this as.
parameter: p_no type i.
loop at itab where sno = 2 or p_no.
itab-sname = 'aluri'.
itab-age = '23'.
MODIFY ITAB INDEX P_NO TRANSPORTING SNAME AGE.
ENDLOOP.
LOOP AT ITAB.
WRITE:/10 ITAB-SNO,
20 ITAB-SNAME,
30 ITAB-AGE,
40 ITAB-SEX.
ENDLOOP.
IF HELPFUL REWARD SOME POINTS.
WITH REGARDS,
SURESH ALURI.