cancel
Showing results for 
Search instead for 
Did you mean: 

File split in SAP PI 7.3.1

Former Member
0 Kudos


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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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-

Former Member
0 Kudos

Hello,

Simply, create two different mappings (one for each file format) and filter the records at mapping level.

Thanks

Amit Srivastava

Former Member
0 Kudos

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 :

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90dcc6f4-0829-2d10-b0b2-c892473f1...

My only concern is i want all the records consolidated in one file/not one file for a record.

Please help!!!

iaki_vila
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Ranjan..

Plz check the below link..

(See page no 5 and 6 in PDF -- Mapping logic ,This link help of the 95% for u ....)

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90dcc6f4-0829-2d10-b0b2-c892473f1...

......

Mutti.

Former Member
0 Kudos

Thanks Mutti ,

As per the blog it states that one file will be produced per record. My requirement is to create only two files based upon the condition.

Can you please advise.

Thanks

Former Member
0 Kudos

Hi Gurav,

It can be easily done by using multi mapping (1:2). Go through below link for steps.

Regards

Venkat

Former Member
0 Kudos

Hi,

If you are sending to 2 different receivers then in ID create the below objects.

1)1 Sender component

2)2 Receiver component

3)1 sender channel ,2 receiver channels

4)1 SA

5)1RD

6)2 RA

Regards

Venkat

Former Member
0 Kudos

Thanks Venkat ,

My scenario is file to file.

However i get the point on how to multimap. But main issue is in this case multiple Idocs will be produced per record.

My requirement is to produce only two files based upon one input file and thens edn it to 3rd party.

Thanks

Former Member
0 Kudos

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