2006 Aug 17 1:28 PM
EX:Given format
Field1 Field2 Field3 Field4(we get these 4 fields in the form of Tab delimited text file)
How to pick Field2 and Field3 with all the value into another internal table which has these two fields ?
Ex:Required format
Field2 Field3
Thanks in advance.
2006 Aug 17 1:32 PM
Hi shilpa,
loop at itab1 into wa_itab1.
wa_itab2-field2 = wa_itab1-field2.
wa_itab2-field3 = wa_itab1-field3.
append wa_itab2 to itab2.
endloop.
Regards,
Vidya
EX:Given format
Field1 Field2 Field3 Field4(we get these 4 fields in the form of Tab delimited text file)
How to pick Field2 and Field3 with all the value into another internal table which has these two fields ?
Ex:Required format
Field2 Field3
Thanks in advance.
2006 Aug 17 1:32 PM
Hi shilpa,
loop at itab1 into wa_itab1.
wa_itab2-field2 = wa_itab1-field2.
wa_itab2-field3 = wa_itab1-field3.
append wa_itab2 to itab2.
endloop.
Regards,
Vidya
2006 Aug 17 1:34 PM
Hi shilpa,
1. I don't think it is directly possible,
in case of upload using GUI_UPLOAD.
(we have to design the internal table,
as per the data in the file)
2. However, we can do the reverse,
in case of download using GUI_DOWNLOAD
(If our internal table contains 5 fields,
we can output only 2,5 field for eg)
using the parameter COL_SELECT_MASK )
regards,
amit m.
2006 Aug 17 1:34 PM
You split the text from the four fields on TAB.
loop at itab.
SPLIT itab-field at cl_abap_char_utilities=>horizontal_tab into f1 f2 f3 f4.
move f2 to itab1-f2.
move f3 to itab1-f3.
append itab1.
endloop.
Regards
Anurag
Message was edited by: Anurag Bankley
Message was edited by: Anurag Bankley
2006 Aug 17 1:36 PM
Create a new internal table with field2 and field3 fields.
then use move-corresponding statement to move from itab1 to itab2.
move corresponding itab1[] to itab2[]
Regds
Manohar
2006 Aug 17 1:44 PM
Hi,
While uploading data from flat file you couldn`t filter based on field names. After uploading the data, create a second internal table with fields of your need and use MOVE-CORRESPONDING ITAB1 TO ITAB2.
Hope the info. is helpful, reward if so.
Regards
2006 Aug 17 1:47 PM
If I got you right:
If you simply want to copy these two fields from one table to another:
DATA:
lt_itab1 TYPE TABLE OF TS_ITAB1.
lt_itab2 TYPE TABLE OF TS_ITAB2.
ls_itab1 TYPE TS_ITAB1, " structure with F1-F4
ls_itab2 TYPE TS_ITAB2. " structure with F2, F3
LOOP at lt_itab1 INTO ls_itab1.
MOVE-CORRESPONDING ls_itab1 TO ls_itab2.
APPEND ls_itab2 TO lt_ITAB2.
ENDLOOP.
If it is not what you were looking for - be more specific when asking a question.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |