cancel
Showing results for 
Search instead for 
Did you mean: 

Variable substitution problem

Former Member
0 Kudos

Dear all ,

I have a query related to variable substitution :

The requirement is that filename should be in the following format : <b>%<store_code>%_%<Date>%_master.xml</b> .

I have done the configuration for Store_code in the variable substitution from Payload .

But I am facing problem related to <b>Date</b> <b>as the requirement is that we should not take the date from the payload .</b> . We used "ADDtimestamp" in the file mode creation but it is generating file with time stamp also which doesn;t serve the purpose .

Can somebody suggest how to take the current date without taking it from payload . Does anyone know something about standard current date which I can assign as Var2 .

Thanks in advance

Regards

Prabhat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Prabhat,

As per SP14 you might use the Adapter-Specific Message Properties that can be filled in the mapping step of XI. Please check the documentation for details: http://help.sap.com/saphelp_nw04/helpdata/en/43/0a7d1be4e622f3e10000000a1553f7/frameset.htm

Best regards

Joachim

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Prabhath,

From your scenario you need a file name as follows:

<store_code>_<date>.xxx

In this case what you can do is that when your target structure which is going in the file data is created, using a user defined function(if message mapping is being used or XSLT mapping with java enhancement) to pull in the current date. This you can populate in a separate node <b>Date with a child node Current_date</b> in your target structure.

In the file adapter what you can do is

1. Variable substitution add a new line to take this date from the XML path of your <b>target structure till Current_date</b> as mentioned above.

2. In the content conversion parameters use the following parameters:

Name Value

Date.fieldFixedLengths 0

Date.fixedLengthTooShortHandling Cut

*Assuming Date is the name of the node that is holding your current_date tag.

Hope this will help you...

Cheers

JK

Former Member
0 Kudos

Dear Jayakrishnan ,

Thanks for your help . As mentioned earlier as per the requirement I don't have to mention "Current_Date" in my xml tag . Now is it possible to assign <b>Date</b> directly in the variable substitution .

Thanks in advance

Regards

Prabhat

Former Member
0 Kudos

Hi Prabhat

"As mentioned earlier as per the requirement I don't have to mention "Current_Date" in my xml tag"

Well JK is trying to explain exactly that, what he is trying to tell you is, create a temporary node called "Current_Date" in your target xml. This node will store the date value which you can pass via variable substitution.

Now in the final xml output, you do not need the current_date node, no problem using file content conversion you can remove that particular node alone.

Check the following blog, as to how to remove the current_date node from your final output.

/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12

We had a similar requirement, where we had to have a dynamic file name. I followed a similar process with success. In case you need further help, mail me. My mail id is in my Business card.

cheers

Sameer