‎2008 Apr 03 2:12 PM
Hi,
can any one help me out with this problem ??
I need to move data from 5 internal tables into a single internal table.
The filed length for itab1 is 33.
The filed length for itab2 is 77.
The filed length for itab3 is 822.
The filed length for itab4 is 217.
The filed length for itab5 is 26.
The data must come in order i.e first itab1 when the data is written then the itab2 will be written and subsequently itab3 ,itab4 and itab5.
Now this internal table is supplied to a function module which will encrypt that data.
The data in the encrypted file should be such that the first record should end at 33 for data from itab1.(no matter how much data is in it), the data for second record should end at 77 for data from itab2 ( no matter how mcuh data is in it ) and subsequently the same for itab3 ,itab4 and itab5.
‎2008 Apr 03 2:15 PM
1. Set the max field lenght in 5th internal Table
2. Use READ and APPEND starting from the 1st internal table then 2nd...till all records of last I.T got appended.
Use loop for that..
‎2008 Apr 03 2:15 PM
1. Set the max field lenght in 5th internal Table
2. Use READ and APPEND starting from the 1st internal table then 2nd...till all records of last I.T got appended.
Use loop for that..
‎2008 Apr 03 2:29 PM
Hi Rajeev,
I hope you have a single field in ur internal tables as per ur descrption
if so declare one more itab6 and do in this way
data : begin of itab6 occurs 0,
field(822),
end of itab6.
APPEND LINES OF ITAB1 to ITAB6.
APPEND LINES OF ITAB2 to ITAB6.
APPEND LINES OF ITAB3 to ITAB6.
APPEND LINES OF ITAB4 to ITAB6.
APPEND LINES OF ITAB5 to ITAB6.
‎2008 Apr 03 2:31 PM
Hi Rajeev,
you can try this.
data : begin of itab_final occurs 0.
itab1 like itab1,
itab2 like itab2,
itab3 like itab3,
itab4 like itab4,
itab5 like itab5,
DATA : end of itab_final.
loop at ...
read table itab1.....
itab_final-itab1 = itab1.
.........
endloop.
Regards,
Mohaiyuddin
‎2008 Apr 03 2:41 PM
Hello,
To supply the internal table with the others in order, I suggest you to create a internal table with type standard and to use the APPEND command, like the example above:
CONSTANTS: lco_itab TYPE c LENGTH 4 VALUE 'ITAB',
lco_itabs TYPE n value 2.
*** INTERNAL TABLES TO BE GROUPED
DATA: itab1 TYPE STANDARD TABLE OF sflight,
itab2 TYPE STANDARD TABLE OF sflight.
***
DATA: lv_count TYPE n LENGTH 1,
lv_itab TYPE c LENGTH 5,
lt_result LIKE itab1.
FIELD-SYMBOLS: <fs_itab> TYPE INDEX TABLE,
<fs_line> TYPE ANY.
WHILE lv_count < lco_itabs.
lv_count = lv_count + 1.
CONCATENATE lco_itab lv_count INTO lv_itab.
ASSIGN (lv_itab) TO <fs_itab>.
APPEND LINES OF <fs_itab> TO lt_result.
ENDWHILE.Now in the function module I suggest you to create an internal table with type string to join the records (to know the record from each internal table create an importing parameter in the function module where you pass an internal table index and the number of lines in the referred internal table - you can use the command lines( itab ) to get the number of lines in the internal table)
Regards,