cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt in Variable substitution

Former Member
0 Kudos

Hi experts,

Can i use variable substitution for taking a part of the input filename.

My output filename contain only a part of the input filename.

Regards,

Divia

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi all,

Thank you very much for your answers.

Former Member
0 Kudos

HI,

You cannot take part of file name using variable substitution. ony full file name will be possible. You need to think for some other alternative.

I will say that use two mappings in interface mapping. One to bring the source file name(Just 1 to 1 mapping) and, other to map trimmmed file name and also the actual mapping.

Kulwinder

Former Member
0 Kudos

Hi,

Even the solution provided by shebarish is good. Write a UDF which should read the source file name dynamically.

Trim the name of the file in that UDF itself and map it to the target. Then use the same field in variable substitution.

It will solve your problem.

Kulwinder

Shabarish_Nair
Active Contributor
0 Kudos

instead of variable substitution use Dynamic configuration. it is much more flexible to use.

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

Blog -

Former Member
0 Kudos

Hi Divia

Yes u can!!

You have to use ur Variable Name in between % % and you can add other fixed values in it also.

eg.

%ABC%xyz.txt

where the value of ABC will come from variable substitution while xyz.txt will remail static.

Regards

Raj

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

Yes. You will require to store the part of the input file name in a output files structure and refer to it in the variable name.

Thanks

SaNv....

Former Member
0 Kudos

Hi Santhosh,

With out storing the part of the input file name in a output files structure, is it not possible to achieve?

Regards

Divia

SudhirT
Active Contributor
0 Kudos

With out storing the part of the input file name in a output files structure

I think No. Either you can take full input file name or you will have to store in target structure which you dont want.

Thanks!

Edited by: Sudhir Tiwari on Dec 18, 2008 7:19 AM

santhosh_kumarv
Active Contributor
0 Kudos

>>With out storing the part of the input file name in a output files structure, is it not possible to achieve?

You can use Dynamic Configuration UDF to set the file name instead of Variable substution.

Have a look at Scenario #2 in my wiki [More with the File Adapter|https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/morewiththeFileAdapter]

Thanks

SaNv...