cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding the CC options

Former Member
0 Kudos

Hi ,

In the Communication channel We have an option in the File processing parametrs that is File construction mode Here i gave Append, every time the output is appended to the current file, but my requirement is i want to append the data on the date wise, means today(29/08/08) i want only one file, tomorrow(30/08/08) ill get only one file,...

How to achieve this, how we will give the date in the CC ?

Suppose i add the date field to the target structure and in the mapping time i mapped that field to the current date, and that filed ill use at the CC by using the variable substituting parameters.

My question is i don't want that date field in the target structure after use that in variable substituting parameters, how to delete that field ? (My client don't want that field)

Accepted Solutions (1)

Accepted Solutions (1)

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

Do not use the variable substituion. Did you tried out the solution that I replied the other day in this [thread|https://forums.sdn.sap.com/thread.jspa?threadID=1024575&tstart=0].

Use the UDF to set the filename by this approach you no need to have the date in the target payload and use in varaible substution.

Just follow these steps. It works for me..

1. Create a UDF with two input a,b with the following code.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
 
String fname = "file" + a + ".xml";
conf.put(key, fname);
 
return "b";

2. Map the CurrentDate function with transformDate and with the UDF as input a and any other mandatory field as another input b map the out put of the UDF to the required filed.

3. In the TransformDate function use the Source date format as yyyy/MM/dd and target date format as yyyyMMdd.

note: mapping any source field with b input via UDF to the target field ensures that the UDF is always executed and sets the file name with the current date. Also enable the option set-adapter specific attribute and filename in the target cc.

Thanks

SaNv...

Former Member
0 Kudos

Hi thank you for your reply,

I have one more doubt, the value which we are returning from the UDF, how do we add to this to communication channel?

santhosh_kumarv
Active Contributor
0 Kudos

Hi Venkat,

The file name is directly set by the UDF in the CC.Just you need to enable the option filename and set-adaper apecific attribute in the file adapter.

Insted of mapping any sourcefiled -


> Targetfield directly we pass it to the UDF and return the same and map it to the Target field like source(as B parameter) -


> UDF -


> Targetfield.

This ensures that the UDF is executed every time and the file name is also set.

Thanks

SaNv...

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Could you elaborate further on your requirement.

As per my understanding, if you require only one file every day, why do u need to set it as Append, you can even set it with timestamp.

If you require in the same file, appending happens first come first serve and automatically comes in date wise.

Regards,

Anandh