2007 May 18 4:40 AM
Hi,
I have 2 internal tables with different struc:
1 itab1 2. itab2
CID, CID
CEID, CEID
Month From
Year TO
for the second itab at run time i want to provide the values from(concatination of month and year) and TO.
1. i want to extract the data from the DB tables and add to the itab1
2. same data is copied to itab2 but at run time i wnat to concatenate the month and year in FROm and TO values will pass.
3. itab2 two is compare with another DB tables ...
Please help me with the code by taking any example..
can anyone will help me in this as iam unable to copy the data friol itab1 to itab2 because of diff strucure...
ur help is appreciable....
anjali
Hi,
I have 2 internal tables with different struc:
1 itab1 2. itab2
CID, CID
CEID, CEID
Month From
Year TO
for the second itab at run time i want to provide the values from(concatination of month and year) and TO.
1. i want to extract the data from the DB tables and add to the itab1
2. same data is copied to itab2 but at run time i wnat to concatenate the month and year in FROm and TO values will pass.
3. itab2 two is compare with another DB tables ...
Please help me with the code by taking any example..
can anyone will help me in this as iam unable to copy the data friol itab1 to itab2 because of diff strucure...
ur help is appreciable....
anjali
2007 May 18 4:48 AM
Is this what you are looking for??
loop at itab1.
move-corresponding itab1 to itab2.
itab2-month_from = sy-datum+4(2).
itab2-year_to = sy-datum+0(4).
append itab2.
endloop.
2007 May 18 5:13 AM
Hi chandersheker,
My concept is diff....
1st iam using select statement
select * from <db1> to itab1.
in itab 1 i have cid,month , year.....
2. i wnat to read one by one record from itab1 and copy into another but i ahve a condition
1 record cid (picup from itab1) FROM (concatenation of month and year) TO i will provide the value).
This step should reapeat for earch and every record and add the changes to itab2.
...................................
after this itab2 is compred with DB2 tables ...
Plz reply its an urgent...
Anjali
2007 May 18 5:19 AM
Anjai, if you post EXACTLY the structure of the two tables people may be able to help you.
2007 May 18 5:30 AM
Hi Neil,
table1 : CID , CEId, Month , Year.
Table2 : CID , CEID, FROM, TO.( in this data already present but we need to modify the data for TO)
these are the two database tables....
table 1 data is coming from thirdparty and these is passing to FM...
1. so ... i have created created itab1 and copied the data from table 1 to itab1( here i created itab1 similar structure to table1)
2. i created 2nd internal table with CID,CEID,FROM and TWO ( FRom aand TO i accepted the fields from Table2)
3. know i want to copy the data of first internal table to second internal table....
but condition is CID (copy as it is) CEID (copy as it is) FROm should be concatenation of Month and year of itab1.TO need to be passed from program.
4. know compare the data which is their in itab2 with table2.
how to gohead can atleast some one will help me... plz provide me the code
Anjali
2007 May 18 5:40 AM
loop at itab1.
move-corresponding itab1 to itab2.
concatenate itab1-month itab1-year into itab2-from.
itab2-to = your_parameter_value.
append itab2.
endloop.
2007 May 18 6:00 AM
Hi
For that after the looping of itab1 you can put an if condition...
See the code given below
loop at itab1.
Cocatenate itab1-Month itab1-year into var1.
if ( var1 = itaab1-CID and var1 = itab1-CEID )
move-corresponding itab1 to itab2.
append itab2.
else.
endif.
endloop.
2007 May 18 6:01 AM
Think this is your requirment.....If not explain once more....
2007 May 18 4:49 AM
Hi
Consider that itab1 and itab2 as the values . now to update the month and year dynamically to itab2 as follows
loop at itab1 into wa1
concatenate wa1-month wa1-year into lv_from
read itab2 with key cid = wa1-cid ceid = wa1-cied into wa2.
wa2-from = lv-from .
clear lv_from .
modify itab2 from wa2 transporting fields from .
endloop.
2007 May 18 4:52 AM
EX:
Internal tables:
data : date(8).
itab1
ID Month
01 12
02 03
03 08
Itab2
Id Year
01 2006
02 2007
03 2005
Loop At itab1.
Read table itab2 WITH KEY id = itab1-id.
If sy-subrc = 0.
Concatenate itab1-month itab2-year INTO date.
ENDIF.
ENDLOOP.
2) for copying data use this
MOVE-CORRESPONDING itab1 TO itab2.
I hope it will solve your problem
Reward points to all useful questions.
2007 May 18 4:54 AM
Hi
loop at itab1 into wa1.
move-corresponding wa1 to wa2.
wa2-month_from = sy-datum+4(2).
wa2-year_to = sy-datum+0(4).
append wa2 to itab2.
endloop.
Reward all helpfull answers.......
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |