‎2005 Feb 16 10:02 PM
Hello,
I have 2 internal tables as mentioned below
Table I
F1 F2
VBELN XXXX
AEDAT 01/01/2005
F1 & F2 are fields of Table I
Table II
VBELN AEDAT
Is it possible to populate the values of Table I to
Table II based the field names which is one of the values in Table I ?. These 2 tables doesn't have the same fields.
After copying the values in Table II should be
Table II
VBELN AEDAT
XXXX 01/01/2005
Thanks in advance,
Jay
‎2005 Feb 16 10:40 PM
Hi Jay
As far as I understood, you can achieve this using field symbols. Look at the following sample code. There I assume your internal tables <i>table_1</i> and <i>table_2</i> having their header lines.
<u>E.g.</u>
FIELD-SYMBOLS <f> .
LOOP AT table_1 .
ASSIGN COMPONENT (table_1-f1)
OF STRUCTURE table_2
TO <f> .
IF sy-subrc = 0 .
<f> = table_1-f2 .
ENDIF .
ENDLOOP .
APPEND table_2 .
UNASSIGN <f> .Hope this much helps...
Kind Regards
*--Serdar
ssimsekler@yahoo.com
‎2005 Feb 16 10:40 PM
Hi Jay
As far as I understood, you can achieve this using field symbols. Look at the following sample code. There I assume your internal tables <i>table_1</i> and <i>table_2</i> having their header lines.
<u>E.g.</u>
FIELD-SYMBOLS <f> .
LOOP AT table_1 .
ASSIGN COMPONENT (table_1-f1)
OF STRUCTURE table_2
TO <f> .
IF sy-subrc = 0 .
<f> = table_1-f2 .
ENDIF .
ENDLOOP .
APPEND table_2 .
UNASSIGN <f> .Hope this much helps...
Kind Regards
*--Serdar
ssimsekler@yahoo.com