cancel
Showing results for 
Search instead for 
Did you mean: 

to get same timestamp for two different files

Former Member
0 Kudos

Hi Experts,

   I have a situation here. SAP PI is generating two files, one .txt and other .xml file. data fields are completely different in both the files.

I have written a udf to get the date and timestamp (yyyymmddHHmmss)  appended to the file name . for e.g Filename_timestamp.

Now both the files are getting generated with a difference of 1 sec.

My requirement is to get the same date and timestamp for both the files.

I assume, if we create a global variable in one mapping and then use the same in another mapping, then its possible.

please help me out here.

Regards

Veeru

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Issue resolved. I have written a global program. I have called this global program in my UDF.

Thanks for all your help

Regards

Veeru

Answers (3)

Answers (3)

former_member184720
Active Contributor
0 Kudos

If they are two different mappings(interfaces) then you can refer to below blog -

Former Member
0 Kudos

I am only looking for the same date and timestamp for both the generated files.

One is XML file and other is .TXT file.

former_member184720
Active Contributor
0 Kudos

>>>>I am only looking for the same date and timestamp for both the generated files.

That is understood. But how are those files being generated.

Explain your scenario?

If they are being generated separately by two interfaces(through different mappings) then you can achieve the same using above shared blog

Former Member
0 Kudos

Hi Hareesh,

   Here is my scenario.

Proxy --> PI --> THIRD PARTY. I have used ICO.

Proxy triggers and PI generates two files, one is txt file and other is control file i.e. xml file. Under receiver interface tab of ICO, have configured two OM. Files are getting generated but third party client is asking for the same date and timestamp as the DOT NET program is picking up the files based on the same date and timestamp.

For file names with date and time stamp, have used UDF function.

former_member182412
Active Contributor
0 Kudos

Hi Veer,

You can do this with multi mapping.

If you use Dynamic configuration with ASMA then refer below blog.

A new approach: Multi-mapping Dynamic Configuration using a generic custom module

Regards,

Praveen.

former_member184720
Active Contributor
0 Kudos

Thanks for providing additional details.. Above blog might not work..

<<removed link to blog as it was already shared by Praveen>>

GO for multi mapping, add additional segment in both structures which can be removed by adapter module later. Refer to blog shared by Praveen

Message was edited by: Hareesh Gampa

engswee
Active Contributor
0 Kudos

Hi Veer

If you are going for the single multi mapping approach (to combine both OMs into one) as suggested by Praveen & Hareesh, you can also consider the following approach if you do not want to develop an adapter module for it. Choice is entirely up to you.

Rgds

Eng Swee

former_member182412
Active Contributor
0 Kudos

Hi Veer,

You can do this using TIME_SENT constant of StreamTransformationConstants, check below blog for more detail.

Regards,

Praveen.

former_member192343
Active Contributor
0 Kudos

Hi Veer, how PI generates files by splitting message or by 2 independent interfaces?

Former Member
0 Kudos

Hi Veer,

Are the files generating in one go?means at same time?

Thanks,

Arthita

Former Member
0 Kudos

Yes Arthita,

   These files are generating one by one time with a difference of 1 sec or 2 sec.

FYI : I have used two different mapping, two different operations mapping.