cancel
Showing results for 
Search instead for 
Did you mean: 

Variable substitution for Dynamic filename

Former Member
0 Kudos

Hi All,

my Scenario is Proxy to file. and the receiver file should be a zip file of extension .dat.gz.

In mapping I tried as below. In signature I used one sender and two receiver messages.

SENDER:                         RECEIVER:(2messages)

MT_Product                       MT_Product

-----Row                              ---------Row

---------field1                         -----------field1

---------field2                         -----------field2

---------field3                         -----------field3

                             

                                         MT_Poduct_1

                                           --------field5  

for field5 I mapped current date and I am trying to use it in Reciver file communication channel. will that be correct to use?

In receiver communication channel the file name is Product_%field5%.zip I used

and I used Module Configuration for content conversion and Zipping the file.

In variable substitution I used field5 for dynamic date.

field5-----------

payload:Messages,1,Message2,1,MT_Product_1,1,field5,1

Module Confuguration:

Guys! am on right path????? will this be possible????

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi All,

could anyone please say where can I find the jar files of GUNZIP for Adapter Module Configuration. I searched alot, couldnt able to find ...

Former Member
0 Kudos

Hello,

Why you are using multimapping? Just for defining target file name using var substitution - BTW, that too is incorrect. You cannot use Messages/Message 1 nodes in variable substitution.

Secondly, if I am not wrong the approach of defining dynamic zip file name using variable substitution won’t work because variable substitution will be executed once all the modules before standard call sap adapter gets executed. So during runtime, at var substitution step, ur file will actually be a text file instead of XML as a result u will get an exception.

So, if there is no specific objective of using multimapping then simply use DC.

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit,

Yes you are correct.

My requirement is filename_date.dat.gz , receiver zip file. For achiving this I used another structure for the date. If this is not Ideal, kindly suggest me any other method.

Former Member
0 Kudos

Hello Naveen,

Did u tried using DC?

Remove multimapping and just map your source and target structures and add a DC code to dynamically define the zip file name and then test?

Thanks

Amit Srivastava

Former Member
0 Kudos

I will test and update you soon..........

prasanthi_chavala
Active Contributor
0 Kudos

Hi Naveen,

Since you are mapping current date to field5...why didn't you directly use "add timestamp" in file construction mode in your rcv channel instead of having additional field and using variable substitution?

Thanks,

Prasanthi

Former Member
0 Kudos

Hi Prasanti,

Client need only filename_date.dat.gz, so for the case we are not adding timestamp.