cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Variables within the Dynamic Naming Convention File-File Scenario

Former Member
0 Kudos

I am running PI7.1 SP6.

I have multiple fields which I need to use to populate the filename when I create a file in file to file scenario, using dynamic naming convention.

I have configured the sender and receiver adapters okay.

It is creating the filename with only the first field though and not the susbequent required fields.There are 6 variables that need to populate the filename...

var1 payload:DataIn,1,Header,1,MERGEID,1

var2 payload:DataIn,1,Header,1,LANGUAGE,1

var3 payload:DataIn,1,Header,1,NORECORD,1

var4 payload:DataIn,1,Header,1,FILETYPE,1

var5 payload:DataIn,1,Header,1,DATAACC,1

var6 payload:DataIn,1,Header,1,CAMPTYPE,1

%var1%_%var2%_%var3%_%var4%_%var5%_%var6%.xml

currently, the file name is MERGEID.xml

and not MERGEID_LANGUAGE_NORECORD_FILETYPE_DATAACC_CAMPTYPE.xml

Has anyone completed this type of function before?

Accepted Solutions (1)

Accepted Solutions (1)

former_member9864
Participant
0 Kudos

Hi,

well that's weird. I have used dynamic file name a lot but with only one variable. What you have mentioned should be working too. Strange is, if the var2 - var6 are not populated, your generated filename should be MERGEID_.xml but not MERGEID.xml

I know it should not be the case, but can you just double check that if you haved activated your changes on the receiver channel and whether that receiver channel is really the one configured in your receiver agreement?

Since the var1 is working, another workaround is to create a dummy field in target structure and during the mapping you concatenate the six fields into this dummy field. Then you need to use only one varialbles in the receiver channel.

Regards,

Chen

Former Member
0 Kudos

The receiver is saved and activated! I am already using the Accessing Adapter-Specific Attributes to read the filename from the sender file and populate this, but you are right, it should have an _ between the mergeid and the file suffix!

I will extend the trace file within the NWA to debug and run it again! see if there is anything that I am missing in config!

I have used dynamic naming before, and variables, but never used more than one variable like I am on this project!!

former_member9864
Participant
0 Kudos

Hi,

in addition:

1)If you want to use variable substitution, then make sure to uncheck the "Adapter specific attribute" on receiver channel. Otherwise the target filename will be overwritten by the one in your sender channel.

2)check the message's audit log on runtime workbench. There might be some useful information like

Error while initializing variable substitution:
com.sap.aii.adapter.file.varsubst.VariableDataSourceException: Cannot parse pseudo-path for variable substitution 'var2'.

Regards,

Chen

Former Member
0 Kudos

Hi Chen!

that fixed it!

I was checking it for a colleague after I did a UDF for reading the sending filename to another field...

Unchecked the "Adapter specific attribute" and it now works okay!

henrique_pinto
Active Contributor
0 Kudos

please close the thread.

henrique_pinto
Active Contributor
0 Kudos

please close the thread.

Answers (2)

Answers (2)

Former Member
0 Kudos

I Feel that if you create an Graphical variable and try to get the six field concatenated and mapped to the Graphical variable and then use Graphical variable to map the file name it would be much feasible.

Shabarish_Nair
Active Contributor
0 Kudos

use Dynamic configuration with the adapter specific attributes to get what you desire. Avoid variable substitution.

Ref:

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 - this blog will show how the same file name from the sender is used to populate at the receiver also.

http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

Former Member
0 Kudos

i need to read the 6 different fields to populate the output file naming convention.

Are you suggesting I need to create a UDF to create a filename?

How do I map that then if I create it???

Shabarish_Nair
Active Contributor
0 Kudos

>

> i need to read the 6 different fields to populate the output file naming convention.

>

> Are you suggesting I need to create a UDF to create a filename?

>

> How do I map that then if I create it???

Create a UDF with the 6 different fields as the input. Create the filename and pass it to the conf.put(key, filenamestring) assuming filenamestring will contain your req. filename.