2008 Jul 23 6:26 AM
Hi,
I am having this requirement.I want to move the contents of xkomv which is a field symbol of type komv into an internal table i_xkomv which is also of type komv.Can any one please help me with the exact code
Thanks in advance
2008 Jul 23 6:29 AM
Hi,
If both the internal tables are of same structure then you can directly pass the contents like:
i_xkomv [ ] = xkomv [ ].
Regards,
Swarna Munukoti
Edited by: Swarna Munukoti on Jul 23, 2008 7:29 AM
2008 Jul 23 6:29 AM
Hi,
If both the internal tables are of same structure then you can directly pass the contents like:
i_xkomv [ ] = xkomv [ ].
Regards,
Swarna Munukoti
Edited by: Swarna Munukoti on Jul 23, 2008 7:29 AM
2008 Jul 23 6:33 AM
Hi,
Define a workarea of type komv.
move-corresponding <xkomv> into ws_komv.
append i_komv from ws_komv.
Regards,
Subramanian
2008 Jul 23 6:35 AM
Hi,
Assuming i_xkomv is an internal table with header line.
i_xkomv-komv = <xkomv>.
append i_xkomv.
Regards
Adil
2008 Jul 23 6:37 AM
Hi,
Check here:
TYPES: BEGIN OF TY_LINE,
MISHPACHA,
EMP_PERNR,
PRATY,
END OF TY_LINE.
DATA: ITAB1 TYPE STANDARD TABLE OF TY_LINE,
ITAB2 TYPE STANDARD TABLE OF TY_LINE,
ITAB3 TYPE STANDARD TABLE OF TY_LINE,
ITAB4 TYPE STANDARD TABLE OF TY_LINE,
ITAB5 TYPE STANDARD TABLE OF TY_LINE.
PERFORM FILL_TAB USING: 'ITAB1[]' 'A' 'B',
'ITAB2[]' 'C' 'D',
'ITAB3[]' 'E' 'F',
'ITAB4[]' 'G' 'H',
'ITAB5[]' 'I' 'L'.
PERFORM UPDATE_TAB USING: 'ITAB1[]' 'A' 'E',
'ITAB2[]' 'D' 'B',
'ITAB3[]' 'E' 'B',
'ITAB4[]' 'H' 'B',
'ITAB5[]' 'I' 'B'.
&----
*& Form FILL_TAB
&----
text
----
-->P_0041 text
-->P_LV_STR1 text
-->P_EMP_PERNR text
----
FORM FILL_TAB USING TABNAME
P_LV_STR1
P_EMP_PERNR.
FIELD-SYMBOLS: <TAB> TYPE TABLE.
DATA: WA TYPE TY_LINE.
ASSIGN (TABNAME) TO <TAB>.
WA-MISHPACHA = P_LV_STR1.
WA-EMP_PERNR = P_EMP_PERNR.
APPEND WA TO <TAB>.
ENDFORM. " FILL_TAB
&----
*& Form UPDATE_TAB
&----
text
----
-->P_TAB text
-->P_VALUE text
----
FORM UPDATE_TAB USING P_TAB
P_CHECK
P_VALUE.
FIELD-SYMBOLS: <TAB> TYPE TABLE,
<WA> TYPE ANY,
<FIELD> TYPE ANY.
ASSIGN (P_TAB) TO <TAB>.
LOOP AT <TAB> ASSIGNING <WA>.
ASSIGN COMPONENT 'EMP_PERNR' OF STRUCTURE <WA> TO <FIELD>.
CHECK <FIELD> = P_CHECK.
ASSIGN COMPONENT 'PRATY' OF STRUCTURE <WA> TO <FIELD>.
<FIELD> = P_VALUE.
ENDLOOP.
ENDFORM. " UPDATE_TAB
Regards,
Shiva Kumar
2008 Jul 23 6:38 AM
Hi,
try by taking a structure of komv type and then internal table of this type and do assignment as
i_xkomv[] = xkomv[].
With thanks & regards,
Sravani yendru.
2008 Jul 23 6:47 AM
Hi try like this...
DATA wa LIKE LINE OF itab1.
FIELD-SYMBOLS : <fs_komv> LIKE wa.
ASSIGN wa TO <fs_komv>.
LOOP AT itab1 INTO <fs_komv>.
APPEND <fs_revc> TO itab2.
ENDLOOP.
Edited by: venkat reddy on Jul 23, 2008 7:48 AM
2008 Jul 23 6:55 AM
hi shah kunal,
tables : komv, konv, konvd.
field-symbols : <xkomv> type komv.
data : i_xkomv like standard table of komv with header line.
data : wa_xkomv like komv.
start-of-selection.
*select single * into wa_xkomv from konv.*
assign wa_xkomv to <xkomv>.
append <xkomv> to i_xkomv.
loop at i_xkomv.
write i_xkomv-KNUMV.
endloop.
Please try this code for assigning a value from field symbol to internal table.
Reward points if helpfull.
Regards.
Ragu