Dynamic file name in receiver - empty line problem with content conversion
Hi,
I do a variable substitution from a filename node in my xml structure. Because I don't want to have the the filename in my flatfile i supress the output with the conversion parameters:
filename.fixedLengthTooShortHandling = Cut
filename.fieldFixedLengths = 0
It's working but: the adapter is puting an empty line at the end of the file. If I even put the filename node at the top of the xml struture it generates the empty line at the top of the flatfile.
Anyone has an idea? is there an other way to set the filename or how can I supress this empty line( I have to) ?
Regrads
J.
Jorg,
Actually speaking we cannot get rid of this with XI. You have to write a OS script to remove this.
Else
you add one more parameter as .endSeparator as backspace ie., 0x08. It will definitely remove the line but I think it is putting a square box at the end of previous line. Please check by giving this and let us know the updates.
Regards,
---Satish
Similar Messages
-
Error dynamic File Name in Receiver File Adapter
Hi all,
Dynamic file name for Receiver file Adapter Problem
my multi mapping look like this in design mode
messages
message1
SD01_E
FileName
row
message2
SD02_E
FileName
row
by processing the xml look like this:
<ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
<FileName>L40SA939.xiConstant</FileName>
- <row>
or
<ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
<FileName>L40SA939.xiConstant</FileName>
- <row>
in file receivere adapter i have try this but it dos not work
payload:SD01_E,1,FileName,1
Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
is there any way to have access to Filename in different root elements??
regards
RalfHi Ralf,
i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
Regards,
Udo -
Dynamic file name in receiver channal
Hi, All,
I would like to set dynamic file name in receiver channal. My xml payload will be like this:
<file_name>file1.txt</file_name>
<text_content>balabala......</text_content>
I would like to output an text file which text content will be the value of <text_content>, file name will be the value of <file_name> in the xml payload.
Is there anyone could help me?
Helpful answer will be surely awarded. Thanks
YangPlease look at the below description from help.sap.com. You can use the below steps to name the file from a value in the payload. You would have to use File Content Conversion to insert the value of the <text_content> in the file.
Variable Substitution (Target Directory/File Name Scheme)
If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
● Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
The variables can refer to attributes of the message header or elements of the message payload.
○ If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
○ If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
namea,nameb,...corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
The description begins at the root of the document and ends at the respective element.
To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (u201CExample Valueu201D) is set as the value for a specified variable.
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<dummy>
<e1>
<e2>Data_1</e2>
<f/>
<g attr="abc">text</g>
<e2>Data_2</e2>
</e1>
</dummy>
<e1>
<e2>illegal/value</e2>
<f/>
<g attr="abc">text</g>
<e2 attr="fghij">Example Value</e2>
</e1>
</root>
Thanks
Praveen M -
How to give a dynamic File Name for Receiver File/FTP Adapter.
Hi Experts,
I have one scenario in which we are creating a flat file of IDOC which is coming from R/3 & sending it to FTP location. For this we have configured Receiver FTP adapter with File Name Scheme as "NT.out" & in File Consturction mode i have given as "Add Time Stamp".
therfore while creating a file it is creating as NTyyyyMMdd-HHmmss-SSS.out
where as my requirement is only to to add Time & not the Date. (NThhmmss.out)
How to do this ?
for your info we are using ABAP Mapping.
Pl help me
Regards,
UmeshHi Umesh,
Add one more field to your target structure for your file name and populate that field as per your requirement like NTyyyyMMdd.out. In receiver communication channel use Variable subtiution option and give the refrence of Payload and file construction mode set as create.
And refer the below weblogs for Variable Subtiutuion File Name Scheme
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
Hope this way would be solve u r problem.
Cheers
Veera
>>>Reward points, if it is needful -
Dynamic File Name on Receiver Side using XSLT mapping
Hi,
My scenario is a Proxy to File scenario.The File on the receiving side is a TEXT file generated due to XSLT mapping. The file name has to be dynamic like- TEST<DDMMYYHHMMSS>File.DAT.
If somebody knows how to do the same please help.
Regards
RituHi Ritu,
I agree to Krishna.With your XSLT mapping create a XML output which can be converted to a text file with content conversion.
And for the dynamic file name, i guess its the date that matters which needs to be in DDMMYYHHMMSS format. the same can be accomplished by a Java function and calling it in your XSLT .
Do refer this weblog it will help you accomplish the same.
>>> /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
Regards,
Shabarish -
FCC: Problems with content conversion
Dear all,
I have a receiver FTP adapter with content conversion. In RWB I'm facing following error message:
Adapter Framework caught exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value 'FCOTUPI')', probably configuration error in file adapter (XML parser error)'
The field with value FCOTUPI could be found in POS recordset. I double check the length of columns but couldn't find
an error.
CC configuration:
Recordset structure: HEADER,POS,SUBPOS
HEADER.fieldFixedLengths = 8,4,8
POS.fieldFixedLengths = 8,20,15,3
SUBPOS.fieldFixedLengths = 5,5
HEADER.fixedLengthTooShortHandling = Cut
POS.fixedLengthTooShortHandling = Cut
SUBPOS.fixedLengthTooShortHandling = Cut
As you can see by the names, I am using as XML to convert a structure with subnodes. In documentation it said
that it is not allowed, but in some threads I found the information that structure could be processed.
Any ideas how to solve this problem?
Thanks
ChrisDear Amit,
thanks for your answer. I already checked this blog, but hoped for other solutions.
My problem: I tried to map my hierarchical structure to a flat structure.
Source
Struc1 (0..unbounded)
-Item1.1
-Struc2 (0..unbounded)
--Item 2.1
--Struc3 (0..unbounded)
---Item3.1
Target:
Struc1 (0..unbounded)
-Item1.1
Struc2 (0..unbounded)
-Item 2.1
Struc3 (0..unbounded)
-Item3.1
But if e.g. the Struc2 appears two time it will be created two time in target structure before
the Struc3 is created. But ths Struc3 belongs to Struc2 and should be created in flat file under
Struc2 directly.
How can we created a flat structure like this
Struc1
Struc2
Struc3
Struc3
Struc2
Struc3
Thanks
Chris -
Setting dynamic file name in Receiver file adapter - not from payload
Guys I just remember reading a weblog but can't find it now that I need it, on how to set the file name in message mapping dynamically but not using any payload field.
Please let me know if you remember this.
Thanks a lot,
Viktor Vargaalso u can check in
<a href="/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II</a>
<a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a> -
Dynamic File name in Receiver File adapter
Hi,
My Scenario is Proxy to File.
I must create filename dynamically in the receiver file adapter by taking the sales order number and divison from the source.
How can i create a dynamic filename? i searched the forum, but i could not get the correct answer,
Please help me out.
Regards
SrinivasHi Srinivas,
> My Scenario is Proxy to File.
> I must create filename dynamically in the receiver file adapter by taking the sales order number and divison from the source.
public String targetFileName(String Sono, String Div, Container container) throws StreamTransformationException
DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String MyFileName = sono + div + "<filename>"+".xml";
conf.put(key, MyFileName);
return MyFileName;
File name you can format according to your requirement.
And one more thing for this you have to specify the ASMA properties. For this check the below link step-1 and step-2.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Regards
Ramesh -
Dynamic File Name for Receiver File Adapter
Hi All,
How can we use dynamic name for Receiver file adapter?
Can anyone help.
Thanks in Advance
ChemmanzHi Chemmanz,
The dynamic filename generation concept is as follows.
In your filename field. just give a variable with % symbols. (eg: %file% ).
Now, under the option Variable Name Substitution, you can give how the value has to be created.
It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
For the former, your give
message:interface_name ,etc
and for the payload part you give,
Payload: "your element root which u wanna acecss"
Just check this link out,
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
And read the contents under variable substitution and it will help you understand the concepts better.
If you have any clarifications, do get back,
Regards,
Bhavesh -
Variable substitution not working for dynamic file name in Receiver File CC
Hi Experts,
I am doing the scenario of Proxy sender to File receiver and my purpose is to Create the text file
as per the filename available in Source Message payload.
I am using the Variable Substitution method for this as shown below.
Source Message Structure:-
<Row> -
having Cocurence 1.1
<Filename> -
having Cocurence 1.1
<Item> -
having Cocurence 1.Unbounded
<Field1>
<field2>
<Item>
<Item>
<Field1>
<field2>
<Item>
<Row>
Target structure is same as the source structure and i have mapped the Filename field of the Source
with the Target structure Filename.
In ID the following is the File receiver CC Configuration.
File Name Scheme:- %Dyn_filename%
In Advance tab, I have selected the Enable option and added one row as Variable name %Dyn_filename%
and Reference as payload:Row,1,Filename,1
In testing I am getting the Error as 'variable Dyn_filename is not found in Message payload'.
Please suggest me.
Regards,
JageshHi Pooja,
Hi Pooja,
Thanks for your valuable reply..
I tried with the same. but still Filename is appearing in Output file.Giving you some details regarding my Receiver File Configuration settings.
Target Message Type:-
<MT_Target_Struct>
<Row>----
1.1 occurence
<Filename_test>----
1.1 occurence
<ITEM>----
1.unbounded occurence
<Field1>
<Field2>
<ITEM>
<ITEM>
<Field1>
<Field2>
<ITEM>
<Row>
<MT_Target_Struct>
Recordset structure:- Row,Filename_test,ITEM
Row.fieldSeparator----
>'nl'
Filename_test.fieldFixedLengths----
>0 (Zero)
Filename_test.fixedLengthTooShortHandling----
>Cut
ITEM.fieldSeparator----
>,
ITEM.endSeparator----
>'nl'
I want only ITEM node to be written in the output file.
Please suggest.
Regards,
Jagesh -
Dynamic file name in receive FTP file adapter
Hi, All,
I have a ABAP proxy -> FTP scenorio. The sender side MT is like this:
<Sender_MT>
<FileName>abc.txt</FileName>
<Record>
<TEXT>.......</TEXT>
<TEXT>.......</TEXT>
<TEXT> ......</TEXT>
</Record>
</Sender_MT>
I would like to output the data which are the values of the tags <TEXT> to a flat file with the file name of the value of <FileName>
I tried to use Variable Substitution in FTP CC. I set a val1 = payload:Sender_MT:1,FileName,1 . But I got an error says "Unknown structure 'ns0:Sender_MT' found in document'. I looked at the message monitoring. It shows payload <n0:Sender_MT>. not <ns0:Sender_MT>. I think that is why I got the error. Then I tried to use XSLT mapping. I set
<Receiver_MT>
<Record>
<xsl:value-of select="ns0:Sender_MT/Record"/>
</Record>
</Receiver_MT>
But I get an error says "XMLParser: No data allowed here: (hex) 32, 64, 66(:main:, row:1, col:3): ".
Could anybody help me out? Thanks!
Jack
Edited by: Jack Mathew on Jun 4, 2009 6:22 PMDude this looks purely like a variable reference error. Have you mapped the the Filename field in the target too? UR XSLT mapping dosent seem to indicate that... run ur mapping test to check that..
Second ... if ur source structure is hierarchcially similar then var 1 should be -
payload:Receiver_MT:1,FileName,1
Regards,
Arvind R -
Problems with content conversion in File Receiver Adapter
Hello, everybody.
I have a RFC-to-File scenario with file content conversion. Everything is working well except that my file is generated with 2 blank lines at the top of it.
The function module has 3 importing parameters (1 optional) and the file content comes from an internal table.
Is it caused by the function module parameters? If yes, how can I avoid this, once I really need them? If not, does anyone have any idea?
Thanks a lot,
Marcos.Hi, Raj.
Here they are the function module parameters:
Importing parameters:
ICARRIER TYPE CHAR1
FPATH TYPE IPATH
IFILE LIKE VBAK-BNAME
Tables
IYLASDS_RECPT LIKE YLASDS_RECPT
The structure YLASDS_RECPT has only one field with a single line of the file. I am using this field as the <i>Recordset Name</i> inside file adpater parameters.
There is no mapping between RFC and FTP messages.
Thanks a lot,
Marcos. -
Dynamic file name of the attachment in receiver mail adapter
Hi
I have configured a receiver mail adapter which receives the payload as an xml attachment.
Right now the file name of the attachment is hardcoded to "invoice.xml".
I want to set it to dynamic ie. instead of "invoice.xml"... i want it as "invoice<invoicenumber>.xml".
Invoice number is present in the payload.
please suggest a solution w/o the need to develop a custom adapter module.
Thanks!
Regards,
Faria MithaniHi,
Go through this thread..
Dynamic File Name for Receiver File Adapter
Regards,
Sarvesh -
Dynamic file name in communication channel
hello
is it possible to give in the communication channel, under the 'File Access Parameters', a dynamic file name?
to get it out of a table or something?
Thanks
KfirHi,
Yes its bit possible to use the dynamic file name at File access paramters
The dynamic filename generation concept is as follows.
In your filename field. just give a variable with % symbols. (eg: %file% ).
Now, under the option Variable Name Substitution, you can give how the value has to be created.
It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
For the former, your give
message:interface_name ,etc
and for the payload part you give,
Payload: "your element root which u wanna acecss"
Just check this link out,
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
And read the contents under variable substitution and it will help you understand the concepts better.
If you have any clarifications, do get back,
Refer below links for more in depth details about it
Re: Dynamic file name in Receiver File Adapter
http://help.sap.com/saphelp_nw2004s/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/frameset.htm
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
/people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Check out this URL
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Check these weblogs as well...
/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
Thanks
Swarup -
Dynamic file name in case of .txt output files
Hi all,
I have a query related to dynamic file name scenario.
In case of IDOC-XI-FILE sceanrio,
<b>Is it possible to generate .txt file name based on Plant number like</b>
<b>%<Plantname>%_%<BusinessDay>_filename.txt</b>
<b>Note:I have implemneted this for .xml output files but I am not able to implement it for .txt output files .</b>
PLEASE HELP ME .
Regards
PrabhatHi Prabhat,
I think, the normal Dynamic File Name generation should work fine in your case also. Even if you perform Content Conversion, you can use Variable Name Substiution to create your Destination file name as, the name of the file is determined first and only then is the content converison perfromed.
for info on content conversion, I would suggest that you go through this thread and check my reply,
Re: Dynamic File Name for Receiver File Adapter
Regards,
Bhavesh
Maybe you are looking for
-
Looking for a specific 8-bit synth plugin
There was one I found a while ago (maybe a year or so) that had a lot of Nintendo-type preset sounds. At the time, it wasn't Leopard compatible so I didn't keep it on my system. I've done some searching and checked out a couple plugins since includin
-
I honestly don't know which forum this belongs in but I"m gonna start here since it invovles my ipad. I have an ipad 2, iphone 4s and sync email/contacts/calendar with a microsoft exchange server. A few weeks ago the server blew up and all users info
-
IMac external monitor video connector, huh?
Apparently, there are at least FOUR different types of video connectors in use these days. WHICH one is used for External video on the iMac (tiny, rectangular) and is it analogue or digital?
-
Hello all, I have a system EBP and I customizing two systems back end.Then I have a good list for payment term if I'm going for vendor data if I put a company based in France (<b>back end</b> <b>system 4.5)</b> and I have a bad list if I choice a com
-
How can i add Document Header Text for s_alr_87012357
Hi Gurus How can i add Document Header Text for s_alr_87012357(Advance Return for Tax on Sales/Purchases).do i need change the standard program or is there any alternate to do this please help me out.