cancel
Showing results for 
Search instead for 
Did you mean: 

Same Dynamic Filename used multiple times

Former Member
0 Kudos

Hi all,

In PI we would like to use the same dynamically created filename for multiple outputs of the same file in different locations.

Is it possible to create the filename and save it in a Java container (for instance) that can be accessed by other mapping programs?

Many thanks,

Aldo

Accepted Solutions (1)

Accepted Solutions (1)

sunil_singh13
Active Contributor
0 Kudos

Hi Aldo,

If you are using PI 7.1 then it is possible. PI 7.0 does not supports the feature of using a UDF across multiple mappings.

If it is PI 7.0 then What you can do store the File name in some Table in PI only and perform JDBC lookup to read the file name in multiple mapping.

Thanks,

Sunil Singh

Former Member
0 Kudos

Hi Sunil,

I am using 7.1. Could you explain how to do this?

Many thanks,

Aldo

sunil_singh13
Active Contributor
0 Kudos

Aldo,

In that case you can use function libraries . [This|/people/william.li/blog/2008/01/02/sap-pi-71-mapping-enhancements-series-share-user-defined-functions] [original link is broken]; blog will Help you

/people/william.li/blog/2008/01/02/sap-pi-71-mapping-enhancements-series-share-user-defined-functions

Thanks,

Sunil Singh

Former Member
0 Kudos

Hi Sunil,

I don't know if I'll be able to resolve my problem using these features......... but this for sure answers my question. Thank you.!

Best regards,

Aldo

sunil_singh13
Active Contributor
0 Kudos

Aldo,

I am sure you would be able to do it! Nothing is impossible :)...

If it doesn't work for your just let me know for sure I will come up with 3 more options (only if the one I already suggested to you doesn't work ).

Thanks,

Sunil SIngh

Former Member
0 Kudos

>

> Hi Sunil,

>

> I don't know if I'll be able to resolve my problem using these features......... but this for sure answers my question. Thank you.!

>

> Best regards,

>

> Aldo

Just to correct you here... Your requirement is to reuse the file name value in different mappings and NOT to reuse the udf code.

The above blogs say's how to reuse the udf code in different mappings... So make sure what exactly you are looking for...

UDF can only store the value at run time for a particular mapping... once execution is over the value will be lost.

So as suggested by Sunil, you can store the file name into some table and then use the RFCLookup get it into your another mappings...

sunil_singh13
Active Contributor
0 Kudos

Sarvesh,

The Idea was to store the file name in the Global parameter in the Function Library which will be available across the Message Mapping.

Thanks,

Sunil Singh

Former Member
0 Kudos

Hi Sunil,

Are you sure that the Global parameter will carry the value after the mapping (which actually stores the file name in Global parameter.) execution?

I am not agree on this..

Regards,

Sarvesh

sunil_singh13
Active Contributor
0 Kudos

Declare that Variable as a Static.

thanks,

Sunil

Former Member
0 Kudos

>

> Declare that Variable as a Static.

>

> thanks,

> Sunil

I am still not agree on this... because even if you declare the variable as static it can't hold the value after mapping execution is done. This is the basic fundamental...that every variable/internal table releases the memory after the execution, and hence they can't carry/hold anything after execution. They become stateless... So this is not going to work.

This may help when you use two or more mapping in the same Interface mapping.

sunil_singh13
Active Contributor
0 Kudos

I have come across the Scenario in XI where in the variable was declared as a static and Its value was available in Next Run also!!

Former Member
0 Kudos

>

> I have come across the Scenario in XI where in the variable was declared as a static and Its value was available in Next Run also!!

Does any one else has tried this or agree on it? Because as per my knowledge it is not possible.

Answers (1)

Answers (1)

Former Member
0 Kudos

> Is it possible to create the filename and save it in a Java container (for instance) that can be accessed by other mapping programs?

As per my knowledge it is not possible to use it in different mappings.

Regards,

Sarvesh