cancel
Showing results for 
Search instead for 
Did you mean: 

send .vdu,.txt files (File adapter)

Former Member
0 Kudos

Hi Everyone,

I have a bunch of text files with different extensions (.TXT,.VDU ETC) Would like to FTP these files to different server. Here is the problem "I want to send these files directly to the receiving file server". Should I use File content conversion?.I heard that we can send any file using a converter. Is that true?

I want a response from the receiving FTP server to update a SAPZTABLE whether the file has received successfully or not.Is that possible?

Thanks in advance.

Thanks,

Gowri

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

HI

Corrected your code itself Try it



DynamicConfiguration conf = (Dynamic.Configuration) 
container.getTransformationParameters().get (Stream TransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/xi/system/File","FileName");
String name = conf.get(key);
return name;

Well its not different from what Mike did

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2664

Thanks

Gaurav

Edited by: Gaurav Bhargava on Nov 7, 2008 3:56 AM

Former Member
0 Kudos

Hi Gaurav,

Thanks for your help.Its really quick. I had tried the code in the below mentioned steps.

1. Created message mapping between two identical message types.

2. Created UDF function with name "result".

3. Deleted argument line and selected radiobutton "CONTEXT".

4. COPY PASTED your given code.

5. Mapped RESULT to TARGET name.

6. In the TEST tab I gave file name executed the code.

7.Got below error

22:50:04 Start of test

Compilation of test_af2f_mm successful Runtime exception during processing target field mapping /ns0:test_af2f_mt/binaryfile/filename. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._test_af2f_mm_ method Result$[] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:test_af2f_mt/binaryfile/filename. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._test_af2f_mm_ method Result$[] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:364) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:415) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:118) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.execute(MapServiceRemoteObjectImpl0_0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) 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(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172) Root Cause: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._test_af2f_mm_ method Result$[] at com.sap.aii.mappingtool.tf3.rt.C2CFunctionWrapper.cacheContext(C2CFunctionWrapper.java:98) at com.sap.aii.mappingtool.tf3.rt.C2CFunctionWrapper.gotoNextContext(C2CFunctionWrapper.java:44) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:266) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:415) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:118) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.execute(MapServiceRemoteObjectImpl0_0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) 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(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172) RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:test_af2f_mt/binaryfile/filename. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._test_af2f_mm_ method Result$[]

22:50:06 End of test

Thanks in advance,

Gowri

Former Member
0 Kudos

HI Mike & Raj

I think its doable.

I have tried this once but it hit on performance. As for Ack message BPM keep on waiting and file size was 40 MB. Due to issues we removed this and moved with a Java proxy based approach

I had transferred the files using Java proxy and then send message to XI which in turn updates SAP table.

Thanks

Gaurav

Former Member
0 Kudos

Hi Michael,Raj,Anand,

Thanks for your help. Can I get the response with out BPM? If at all I need to use the BPM do we have any step by step guide, coz I had never used BPM before.

Thanks in advance.

Gowri.

Former Member
0 Kudos

Hi Raj,

I had tried reading a filename in mapping progrm, using the procedure that you had mentioned in the scenario

(http://sapient.xi.googlepages.com/xi-excellentintegration). This is the code I had wriiten in the UDF.

DynamicConfiguration conf = (Dynamic.Configuration)

container.getTransformationParameters().get (Stream TransformationConstants.DYNAMIC_CONFIGURATION);

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

String name = conf.get(key);

conf.put(key,name);

return ""name"";

But when I am tessting this in TEST tab in MAPPING PROGRAM. I am getting an error.

Could you please correct me if I am wrong.

Thanks in advance,

Gowri

Former Member
0 Kudos

Hi Gowri

Try this UDF cache type context

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

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

String filename = conf.get(key);

result.addValue(filename);

Thanks

Gaurav

justin_santhanam
Active Contributor
0 Kudos

Gowri,

I believe it's possible using BPM. Please go thru Michal's blog.

PS: Since it's possible only thru BPM, you can't implement the blog, which referred by Anand above. You can read any files in xi, even without Content conversion.for example -http://sapient.xi.googlepages.com/xi-excellentintegration

raj

MichalKrawczyk
Active Contributor
0 Kudos

hi Raj,

>I believe it's possible using BPM. Please go thru Michal's blog.

>

I don't think it's possible to update a table with an application ack - unless I'm mistaken

if this would be possible I'd like to see it too

BTW

you don't need a BPM to receive an app ack from ftp (it's mentioned in the comments of my blog)

Regards,

Michal Krawczyk

justin_santhanam
Active Contributor
0 Kudos

Michal,

I didn't meant to say that you have to do exactly your BPM in order to insert the data into the SAP Table. We need some additional steps in order to send update to SAP.

As you said, the process will be completed only after the BPM gets successful Transport Ack , correct? Hence I thought,it would be good option to keep another Send step after that in order to send Update to table. I thought only after XI got successful Transport ACK, it will go to the next step! Please correct me if I'm wrong.

If I'm wrong, apologize for leading to the wrong direction!

Thanks

raj.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>I thought only after XI got successful Transport ACK, it will go to the next step! Please correct me if I'm wrong.

but can we evaluate ack in a BPM ?

I never done this but maybe it's possible - did you ever do that ?

if so then sure we could go this way I'm just not sure about this ack evaluation

Regards,

Michal Krawczyk

justin_santhanam
Active Contributor
0 Kudos

No Michal, I haven't worked on Ack's.. But could you please let me know one thing? In Send step if you request for Transport Ack, it will go to the next step only if it gets Positive Ack or Even Negative Ack?

raj.

MichalKrawczyk
Active Contributor
0 Kudos

hi Raj,

honestly don't remember for 100% - but it should I guess

but since I'm not 100% I don't want to say it does

Regards,

Michal Krawczyk

justin_santhanam
Active Contributor
0 Kudos

Thanks Michal for your valuabale time and responses, I really appreciate it!

I will give a try and will let others know the outcome.

Thanks,

raj.

MichalKrawczyk
Active Contributor
0 Kudos

Hi Raj,

>I will give a try and will let others know the outcome.

great

Regards,

Michal Krawczyk

Former Member
0 Kudos

>

> Hi Everyone,

>

> I have a bunch of text files with different extensions (.TXT,.VDU ETC) Would like to FTP these files to different server. Here is the problem "I want to send these files directly to the receiving file server". Should I use File content conversion?.I heard that we can send any file using a converter. Is that true?

if u dont' need any conversion, then u don;t need File content conversion..

i don;t know answer for other question... but with BPM, i think it should be possible.