cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in dynamically file name generation procedure

Former Member
0 Kudos

Hi All,

I had scenario where i need to generate target filename dynamically for that i'm using UDF mentioned in the below blog :

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

to generate filename for target file adapter.

UDF used:

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey keyHeader1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "HeaderFieldOne");

conf.put(keyHeader1, a);

return "";

While giving filename in receiver file adapter what should be the filename given in receiver file communication channel?

Regards,

VKG.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI

In the receiver communication channel, give DYNAMIC.dat as the file name and check the adapter specific message attributes in advanced tab of your receiver communication channel.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi All,

Thankz for ur quick answers but here in my scenario Sender adapter is JDBC adapter and receiver adater is file adapter.

@Swetha: Here we have to drop files which are pipe delimitted so wat should be given for the file name in communication channel.

@Nityanand: I had given file name as raw_text_.txt like this but file name should be generated from

one of the field name from source which is not mapped to target.For instance if source field is F1 the file name should be "raw_text_F1.txt".

@Rajesh: I had enabled ASMA propertis in file adapter.

Regards,

VKG.

Former Member
0 Kudos

If you want filename as you specified it looks like one is constant and other is value from source ,so you do concat of these two before config.put statement

Rajesh

Former Member
0 Kudos

Hi Rajesh,

Thankz for ur reply if i need to concatenate then how the following code should be edited :

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");

String Outputfile = conf.put(key,a);

return Outputfile;

for getting file name as raw_text_F1.txt at target side.

And wat sholud be mentioned for FileName: in receiver file communication channel.

Former Member
0 Kudos

HI,

If you want to get teh file name as "raw_text_F1.txt", then try concatnating logic in ur code.

ITs not mandatory that u need to mention teh same file name in ur receiver communication channel.

use the below sample code in ur UDF for the required file name...

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String ourSourceFileName = "raw_text_" + conf.get(key) + ".txt";

return ourSourceFileName;

Also, do remember to check the adapter specific message attributes in ur receiver file communciation channel.

Former Member
0 Kudos

Hi,

Thankz for ur reply .Actually i mentioned raw_text_.txt in communication channel but while monitoring

in RWB message is not getting displayed . Same is getting displayed in SXMB_MONI .We are unable to see payload in RWB for receiver file communication channel.

Any suggestions plz..

Regards,

VKG

Former Member
0 Kudos

Hi,

If you are not being able to see the msg in RWB, it's nothing to do with the file name you mention in your receiver file channel.

When you check the adapter specific attributes in your channel, it implies that the file name would be set as per the file name in your UDF in your message mapping. It does'nt bother abt the file name you give in your channel.

when you run the scenario,check whether the file is created in target directory which you have given in the reciever file channel. Also, check in SXMB_MONI, if anything is erroring out during mapping. If it shows no error in sxmb_moni, then your mapping should be fine. If it shows error in RWB, check your fcc parameters if you have any.

Former Member
0 Kudos

Did you end up in any error .go to CommunicationChannel monitoring in RWB and check the status of receiver file adapter.

Did you got any error in Mapping during runtime?

If any specific error do post.

Rajesh

Former Member
0 Kudos

Rajesh/Swetha,

Thankz for ur inputs.Actually i havent got any errors but i'm unable to see my receiver payload in CC Monitoring in RWB.Wat could be the reason...??

Regards,

VKG

Former Member
0 Kudos

Hope this is async scenario and do one thing

go to MessagingSystem and check there the received and sent messages and provide some filter conditions and there you can check the payload of your CC

http://host:Httpport/MessagingSystem/monitor/monitor.jsp

Rajesh

Former Member
0 Kudos

Hi,

My scenario is asynchronus scenario. When i use that messaging tool i'm getting following error:

There was an error processing your request.

com.sap.aii.af.ra.ms.impl.app.AdminException: Reading Messages from Archive failed, due to: null

With the following stack trace:

java.lang.NullPointerException

at com.tssap.dtr.client.lib.protocol.Connection.(Connection.java:304)

at com.sap.archtech.archconn.UnqualifiedArchSession.(UnqualifiedArchSession.java:33)

at com.sap.archtech.archconn.ArchSessionFactory.getSession(ArchSessionFactory.java:62)

at com.sap.aii.af.ra.ms.impl.core.archiving.ArchivingJobController.getMessageBeans(ArchivingJobController.java:1380)

at com.sap.aii.af.ra.ms.app.ArchivingBeanImpl.getMonitorBean(ArchivingBeanImpl.java:171)

at com.sap.aii.af.ra.ms.app.ArchivingRIObjectImpl0_0.getMonitorBean(ArchivingRIObjectImpl0_0.java:868)

at com.sap.aii.af.ra.ms.app.ArchivingRI_Stub.getMonitorBean(ArchivingRI_Stub.java:1518)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)

at java.lang.reflect.Method.invoke(Method.java:391)

at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)

at $Proxy348.getMonitorBean(Unknown Source)

at jsp_monitor1228729032638._jspService(jsp_monitor1228729032638.java:464)

at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)

at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)

at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(AccessController.java:219)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)

Former Member
0 Kudos

If there is a basis team for you then you can ask them for this .

Rajesh

Former Member
0 Kudos

Hi,

You can give any file name, that shouldn't be a problem it will automatically create based upon the UDF you are using.

But do check that you have enabled the adapter specific parameter --> file name in both the sender and the receiver.

Try this...

Regards,

Nithiyanandam

Former Member
0 Kudos

What is the error message you are getting and note you cannot test these in messagemapping.

you should return some value ,if you dont have return some dummy /constant string

Make sure checked the ASMA Properties of adapter

Rajesh