on 10-05-2010 7:43 PM
I have a DSO (A) with data. Now I need to upload it into another DSO (B) with
few new infoobjects derived in between.
In my DSO A, I have data at Header and Item level.
In a header, we can have multiple items and each item can correspond to either
SOURCE or target related data and each item is categorized in to either
source or target based on TYPE infobject (S or T).
Data Set example:
HEADER|ITEM|TYPE|LOCATION|DATE|QUANTITY
500001|0010|S|PHILADELPHI|02022010|240
500001|0020|T|PITTSBURGHH|02032010|240
In the above data set, item 0010 is Source and 0020 is target. Now using above
data set, I need to make 2 records into 1, meaning both Source and its
target into 1 record.
I will create different infoobjects each 1 for Source and target. For eg,
Source Qty, target Qty, Source LOcation, target Location, Target Date, Target Qty etc...
Now when im updating from A to B, all i need is to identify 2 items in a
header with same quantities and assign the corresponding characteristic
values (Qty, Location etc) to Source and
target info objects (Source Qty, target Qty, Source LOcation,
target Location etc...).
To identify which item/record is source and which one is target,
we have a characteristic (type) which has values 'S' and 'T'.
How do I proceed with this? I know this can be done in the Start Routine, but how do i code? Starting help would be appreciated.
Hi
Would suggest you to try the option of rule groups. In one rule group map the source fields to Source fields and second map to target fields. Then in routine filter out type T in Rule Group1 and type S in Rule Group 2.
Other way is to write End Routine.
"Declare 1 internal table of structure DSO1 and 1 of DSO2
itab_dso2[] = result_package[].
Delete itab_dso2 where type = 'T'. "this will retain only records of type source.
Select * from DSO1 into itab_dso1 for all entries in result_package where header = result_package-header and type = 'T'. "Now u have the corresponding target records.
Loop at itab_dso2 assigning <result_fields>.
Read itab_dso1 into wa_dso1 with key header = <resultfields>-header.
<result_fields>-target loc = wa_target-location. "Assign target values
Endloop.
refresh result_package.
result_package[] = itab_dso2[].
Pls let me know in case u need more info.
Reg
Aparna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If Header is the unique Key in your DSO2;
two load from DSO1 to DSO2:
- load 1 DSO1->DSO2: with Transformation mapping to Source-InfoObject:: select S records
- load 2 DSO1->DSO2: with Transformation mapping to Target-InfoObject:: select T records
is the Header is unique,overwrite Source in load 1, and Target in load 2
DSO1:
HEADER|ITEM|TYPE|LOCATION|DATE|QUANTITY
500001|0010|S|PHILADELPHI|02022010|240
500001|0020|T|PITTSBURGHH|02032010|240
DSO2:load 1(TYPE=S ; map SOURCE):
HEADER | SOURCE-LOCATION | TARGET-LOCATION
500001 | PHILADELPHI | -
DSO2:load 2 (TYPE=T; map TARGET):
HEADER | SOURCE-LOCATION | TARGET-LOCATION
500001 | PHILADELPHI | PITTSBURGHH
done
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any suggestions guys?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.