on 04-14-2014 12:35 PM
Hello ,
We have one requirement in which we have to split a flat file in SAP PI 7.3 in to two files based upon a particular condition.
COndition can be if payroll area =1 then it should be the part of first file and if payroll area =2 then it should be part of second file.
The main file will be a mix of payroll area 1 and 2. When this split is done then we have to send the two files to different receivers.
If there is some blog on SDN then please help!!!
Regards
Gaurav Ranjan
Hi Gaurav,
You can solve it using graphical mapping. Use 2 Message mapping, you will fill the info always with an IF condition.
Then, create 2 Operation Mapping and split the information in the Interface Determination, using 2 Receivers.
No more,
Message types: 2 target structures and one source structure
Mapping: 2 objects
OM: 2 objets
Then, 2 receivers, and a conditional Interface Determination.
Regards-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Simply, create two different mappings (one for each file format) and filter the records at mapping level.
Thanks
Amit Srivastava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Amit ,
I am planning to create one message mapping only with multiple target mapping and based upon the condition records will be filled.
This is given in the blog suggested :
My only concern is i want all the records consolidated in one file/not one file for a record.
Please help!!!
Hi Gaurav,
Have you thought in file lookup?, you can write one/several files at mapping level and to put your logic split in java code if you are more comfortable with java developing. Check this wiki: File Lookup in UDF - Process Integration - SCN Wiki, you only should to change the read for a write sentence.
Regards.
Hello,
>>My only concern is i want all the records consolidated in one file/not one file for a record.
U want to create two different files depending upon the conditions? right?
If yes, then in signature tab change the occ as 0..1 (instead of 0..unbounded), in addition to that make sure the cardinality of Record nodes in both the target structures is 0..Unbounded (in the blog if u check the occ of EmployeeDetails and EmpDetails is 0..1 but according to ur req it should be 0..Unbounded)
But, having said so if i were you then i would have created two different mappings and avoided doing multimapping.
Thanks
Amit Srivastava
Thanks Amit ,
I understand your point.
Just to know if the requirement is increased to say a maximum of 4 files instead of two , then also you will prefer creating 4 mappings instead of multimapping.
Our requirement can extend up to 4 files so just want to know which way is the best for performance and design.
Thanks
Hello Gaurav,
Quite a few times, in case of huge data i have noticed performance issues while using multimapping so i generally avoid using it if i have few alternatives available with me.
Now coming to your scenario, design wise both the options (multimapping/separate mappings) are feasible and correct, but it's the performance which should be a deciding factor.
So, if the source data is not very huge then u can go with multimapping, and if not then i would suggest you to create separate mappings.
Thanks
Amit Srivastava
Ranjan..
Plz check the below link..
(See page no 5 and 6 in PDF -- Mapping logic ,This link help of the 95% for u ....)
......
Mutti.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create the target structure as below and go with multi mapping.
MT1 0..1
Seg1 0..unbounded
field1
field2
......
MT1 0..1
Seg1 0..unbounded
field1
field2
......
Based on the condition you open either of the segments and fill the relevant fields in it .Here you are creating single file with multiple records for both cases.
Regards
Venkat
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.