on 03-23-2009 9:08 AM
Hi all,
I have a requirement to map all the content in the textfiles to the single tag of xml .Do any one know how to configure this in Communication channel. I referred SAP help docs but all for mapping it with by separter or by fixed length etc.. I want to map all the contents in a single field.
Laks
Hi,
From what i see, all the data in your file should go under one node in the XML. Right?
Well, dont use FCC here. in the sender adapter instead of FCC use message protocol as FILE and then use a java mapping.The java mapping will be similar to this wiki entry - https://wiki.sdn.sap.com/wiki/display/XI/WholePayloadtoaXML+field
Regards
joel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shabarish and Jeol,
Thanks a lot for your answers.. I will try this . I forgot to mention one more thing ...
I have two field in the target structure.
Field1 - need to map with some content in the text file
Field2- Map everything in the text file.
In order to map the field1 , is there anyway i can do it without FCC then ?
suppose if the text file contains texts like
BEGINFIELD="testtext" some text
I need to map the "testtext" in field1 and BEGINFIELD="testtext" some text in field2
Laks
>
> Field1 - need to map with some content in the text file
> Field2- Map everything in the text file.
>
> In order to map the field1 , is there anyway i can do it without FCC then ?
>
> suppose if the text file contains texts like
> BEGINFIELD="testtext" some text
>
> I need to map the "testtext" in field1 and BEGINFIELD="testtext" some text in field2
>
> Laks
1. in the java mapping use the logic of substring to extract the value. between BEGINFIELD=" and the next occurance of "
2. pass this value between your XML tag.
Hi Sabharish,
I used this code but it is just generating empty file .... though my input text file has some content..
https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/wholePayloadtoaXML+field
though this code is successfully compiled and imported . I checked in the trace as well ,, the function in that code is getting executed. Does anyone have an idea why I am not getting the expected output ?
Laks
try to add trace to messages and see what is happening.
try to put
trace.addInfo(outputPayload);
after
outputPayload =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ StartXMLTag
+ strXML
+ EndXMLTag;
See in the trace if your file content is visible.
The only way to troubleshoot java mapping is by adding traces at various places and checking the flow.
>
> Hi all,
>
> I have a requirement to map all the content in the textfiles to the single tag of xml .Do any one know how to configure this in Communication channel. I referred SAP help docs but all for mapping it with by separter or by fixed length etc.. I want to map all the contents in a single field.
>
> Laks
https://wiki.sdn.sap.com/wiki/display/XI/WholePayloadtoaXML+field ref this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.