Need an error for no keyFieldValue during File Content Conversion
Hi Gurus,
I am working on a scenario where I have to convert a CSV file structure.
Each sender file is having "END" in the last so that the structure looks like as follows:
I,103468,-No Entry-,299103468002,0.010,50.000,1.000,-49.990,None,,0,Diab
S,3101,100.125,abc,abc
END
Now the requirement is, if file does not contain "END" in the last then PI should not pick this file.
This is only possible if I make "END" as a Key Field and for "keyFieldValue" I assign value "END" with either end separator or field fixed length functions.
But the default behaviour of PI is, even if I create key field value, if it is not available in the file, PI would ignore that record.
I tried all possible combination in the following link:
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
but for key field value it is clearly written that:
"Specify the value of the key field for the structure. This entry is mandatory if the key field name is set. Otherwise, the entry is ignored."
Is there any way by which I get error if "END" is not available?
One of the alternatives which I see is to create OS level scripts and read the content. If I don't get "END" in the last then put the same file in a different, temporary directory. And once processing is done I pull it back to original directory
Any suggestion on this would be highly appreciated.
Thanks in advance.
Vikash
Dear Mickael,
I tried putting "1" in the last and executed but it did not helped. File is executing successfully even if there is no END in the last.
so the current behaviour is: whatever written or even blank in the last, if it is not "END", it is ignored. If I mention "END" in the last, it is always picked by FCC and inserted in the XML.
Do you think some other way of proceeding?
Thanks in advance.
Regards,
Vikash
Similar Messages
-
Trailing spaces problem during file content conversion
I have developed a proxy to file scenario.And am using file content conversion for creating the file. The file is to be a fixed length file.
File Structure
<Header>
<Item>
<Item Trailer>
<File Trailer>
Each tab in the file has the last character mapped to spaces.
Eg: Header00000001 2006011700000000020060<blank space>
Item00000001 2006011700000000020060<blank space>
The problem is that during file content conversion. XI does not preserve trailing spaces at the end of the line i.e.if a particular line in the file ends with space. It terminates the line at the last non-space character (in this case at 060).
However we are required to maintain these trailing spaces at the end of each line.
I have tried preserve white space in data type that does not work.
I know that xslt mapping may solve the problem but I am looking for a workaround with my current graphical mapping.
Looking for suggestions !!
Thanks,
RashidaHi,
I have the problem quite opposite to this where we are getting the trailing spaces at end of each record which should not come.
File structure is
<Record>
- <Data>
<Content>11/09/2007@210@ZACSL007@GBB-56436@PS01@29@1044@19@646@0</Content>
</Data>
</Record>
............. n records
<Header>
<File_Name>UK01</File_Name>
</Header>
Record structure in communication channel used is
Header, Data
Data.fieldFixedLengths 1024
Data.addHeaderLine 0
Header.addHeaderLine 0
Header.fieldFixedLengths 0
Header.fixedLengthTooShortHandling Cut
Data.fixedLengthTooShortHandling Cut
Header.endSeparator '0'
Actually if the length of record is less than 1024, rest of the length is being filled with spaces which should not occur.
Many advanced thanks.
Jitender -
File-Sender: Verification of file content during file content conversion
Hello,
I have a question regarding file verification when using the file-sender adapter.
I got a flat file (.csv) that I convert into XML with the file-sender adapter and file-content-conversion.
In the file there is a column RecTyp that is my KeyFieldValue. Possible values for RecTyp are B, D, U, T.
So far so good. All this works perfectly.
If (due to an error) there is another value in RecTyp than the 4 mentioned above (B;D;U;T) the file adapter ignores this row today. And here begins my issue:
I want to change this behavior. That means in detail, I want to check if there is another value in my KeyFieldValue RecTyp than specified. If this is the case an exception should be thrown. The whole message should not be delivered.
We had the idea to use the module-processor for this verification .
But may be there are other suggestions. Or may be some one can provide an appropriate module that is already written, etc .
Does anyone have an idea?
Kind regards,
TobiasHi,
It is better to pick the file in generic way i.e Row by Row and then go with the validation with the help of Adapter Modules or in the Mapping.
For more-
/people/sravya.talanki2/blog/2005/08/16/configuring-generic-sender-file-cc-adapter
Thanks,
Moorthy -
Error in mapping and in file content conversion
Dear All,
I am configuring one file-xi-rfc scenario in which the structure of the input file is as follows:
EDI_DC40 2 DELVRY03 SHPCON
E1EDL20 020 <b>0083710164</b>
E1EDL18 020 PIC
E1EDL18 020 PGI
E1EDL18 020 GWT
I want to pick only VBELN from the segment E1EDL20 and post ot to the RFC. In the input file, the above structure is getting repeated for different VBELN.
Please help in configuring the sender DT, MM and in doing File Content Conversion.
Waiting for your reply.
Warm Regards,
N.JainHi,
Check Below Links which will help u to do content convertion at Sender side and Receiver side.
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Regards,
Phani
Reward Points if Helpful -
File Receiver Adapter(File Content Conversion)
Hi All,
If i open my file using notepad after File Content Conversion i am seeing a BOX kind of Symbol after Every Row ..
but the same file if i open using word i am not seening that BOX ,,and the file is perfect ..can any plz tell what is the reason ... ?
i gave<b> filedfixedlenght & Endsaparator</b> only
is that i need to add any thing in the File Content Conversion parameters...
thanks
shakifHi Mohammad,
If I am not wrong "Box kind of symbol" would be "Symbol" for end of the line(EOL).
In win-word if you click on "Show/Hide tab" You will see same symbols.
Does it makes any problem while processing file?
Let us know more details.
Nilesh -
Module processor enhancement with file content conversion
Hi All,
I have a bean (module processor) that converts the a PDF doc to text. I need to use the same bean with file content conversion. Module processor processing sequence is as follows:
1) My Bean: localejbs/myBean
2) Default: localejbs/CallSapAdapter (Bean for file content conversion).
When I tried the same (myBean + File adapter with file content conversion) , it was not working as expected. But the same bean works fine with normal file adapter (myBean + File adapter without file content conversion).
Couldn't figure out the reason. Please help.
Regards,
Ajay.As the content conversion of the file adapter is done before calling the customer module, it is not possible to use both.
As workaround you can do the file content conversion with help of the MessageTransformBean. In the module chain you put the MessageTransformBean after your module.
Note that the configuration of the MessageTransformBean has to be done like the J2SE sender file adapter:
http://help.sap.com/saphelp_nw04/helpdata/en/0d/00453c91f37151e10000000a11402f/frameset.htm
You find an example here:
https://websmp206.sap-ag.de/~sapdownload/011000358700001186732005E/HowToConveModuleJMS.pdf
Regards
Stefan -
Receiver File Content Conversion - Multiple Hier. Levels, Several Files
you can create several files using single message execution.
one source message structure and target multiple messgae types(0..1) occurance
and same thing you can implement in your Interface mapping.
1 -> Multiple Inbound interfaces
your target final strcture would be with Header,lineitems.
your JDBC->XI Intermedicate.
XI Intermediate ->XI final (this final structure will create the your file)
that way you can design your scenario.
Regards,
Venu.Hello Venu, thanks for answering,
When you talk about intermediate structure you are referring to the approach I mentioned in the link above or to something that can be done using the same scenario structure I have right now?
I am going I little bit deeper in my scenario just in case I havent been so clear in my first explanation:
Lets suppose I have 3 stores: 1001,1002,1003
For each store there are 2 items: 999,888
So XI retrieves the information from the DB thru a stored procedure. This is the output:
STORE--PLU
1001--999
1001--888
1002--999
1002--888
1003--999
1003--888
Please note the information is coming in a flat structure. In the beginning I tried to separate it into several outputs (selects) as shown below but I relaized that was not possible to be handled by XI:
STORE--PLU
query 1
1001--999
1001--888
query2
1002--999
1002--888
query
1003--999
1003--888
That would have been the best approach as I would have generated one single file for each message and thats it, but unfortunately, Xi does not work that way with MSSQL Queries. So I had to made something up based on the answers I got from the SDN experts (Link is below in first message). There was when I used context handling for generating the structures myself within one single message.
In the scenario shown above I would have just needed to generate the following structure for creating messages from the source:
Level1: Main Node
Level 2: Header
Level 2: Body
But now, As I am forced to generate my 3 structures within 1 single message, I had to insert one more node to wrap header and body in per iteration (as a file would do):
Level1: Main Node
Level2: File
Level3: Header
Level3: Body
And that is the problem I am asking help for, that allegedly, XI File Content conversion can just handle up to 2 levels.
Thanks again for answering Venu.
Regards.
Edited by: Anibal Granado on May 12, 2010 11:34 PM -
Needed a code for Creating a Log File in java so that its size is limited
Hi
I need the code for developing a log file using threads so that the log file size is limited
and if the size of the log file is increasing above 1Mb,another log file has to be created automatically and the log have to be printed into that new file.
Thanks in advancepackage cms.web.log;
import java.io.*;
import java.util.Calendar;
import cms.web.WebUser;
* Log is generated by JEditor 1.0.0
* @Project : cms
* @Version : 1.0.0
* @Created date : 11:07:40 PM Thursday, 25/07/2002
* @Author :
* @Organization :
* @Copyright : (c) 2002
* An utility class used to write information, especially error messages, to
* log file so that they can be viewed at later time by administrators.
* Extra information such as date & time they occures & where they are thrown...
* are automatically included and append to the end of log file.
* Log files will increase with the format "name_n" where n is file counter
public class Log implements Serializable
* logs marker
static final String START= "\n\0";
* parent directory that contains log files
private static File parent;
private PrintStream out;
private String name;
* to count how many log for the current stream
int counter;
* maximum number of logs for each log file
int max;
public static void init(File parent)
if (!parent.exists())
parent.mkdirs();
Log.parent= parent;
public Log(String name, int max)
this.name= name;
this.max= max;
file= getLastFile();
counter= countLogs(file);
out= openStream(file);
public synchronized void appendLog(String log)
if (log == null || log.length() == 0)
return;
count();
try {
out.println(START+ counter+ " | "+ getCurrentTime()+ " | "+ log);
out.flush();
} catch (Exception e) {}
* Append the given log to log file.
synchronized void appendLog(String msg, WebUser user)
if (msg == null || msg.length() == 0)
return;
count();
try {
out.println(START+ counter+ "----------------------------------------------------------");
out.println(getCurrentTime());
out.println(user != null? "User:"+ user.getFullName(): "User: public user");
out.println(msg);
out.println("\n----------------------------- end -----------------------------\n");
out.flush();
} catch (Exception e) {}
* Append the given exception to log file
synchronized void appendLog(Throwable error, WebUser user)
if (error == null)
return;
count();
synchronized (out)
try {
out.println(START+ counter+ "----------------------------------------------------------");
out.println("Exception occured at "+ getCurrentTime());
out.println(user != null? "User: "+ user.getFullName(): "User: public user");
error.printStackTrace(out);
out.println("----------------------------- end -----------------------------\n");
out.flush();
} catch (Exception e) {}
private String getCurrentTime()
Calendar c= Calendar.getInstance();
return
parse(c.get(Calendar.HOUR_OF_DAY))+ ":"+ // 0 --> 23
parse(c.get(Calendar.MINUTE))+ ":"+ // 0 --> 59
parse(c.get(Calendar.SECOND))+ " "+ // 0 --> 59
parse(c.get(Calendar.DAY_OF_MONTH))+ "/"+ // 1 --> 31
parse(c.get(Calendar.MONTH)+ 1)+ "/"+ // 1 --> 12
c.get(Calendar.YEAR); // yyyy
private String parse(int n)
return n< 10? "0"+ n: ""+ n;
private void count()
counter++;
if (counter> max)
incrementFile();
counter= 1;
private void incrementFile()
File file= null;
int n= 0;
while ((file= new File(parent, name+ n+ ".log")).exists())
n++;
if (out != null)
out.close();
out= openStream(file);
private PrintStream openStream(File file)
try {
if (file.exists())
return new PrintStream(new FileOutputStream(file.getPath(), true));
else
return new PrintStream(new FileOutputStream(file.getPath()));
} catch (IOException e) {
throw new RuntimeException(e.getMessage());
private int countLogs(File file)
int count= 0;
InputStream in= null;
try {
in= new FileInputStream(file);
int n;
while ((n= in.read()) != -1)
if (n == '\0')
count++;
} catch (IOException e) {
} finally {
if (in != null)
try {
in.close();
} catch (IOException e) {}
return count;
private File getLastFile()
File file= new File(parent, name+ "0.log");
File curr;
int n= 1;
while ((curr= new File(parent, name+ n+ ".log")).exists())
file= curr;
n++;
return file;
protected void finalized()
if (out != null)
out.close(); -
WRT54GX Version1 Firmware Error "Error(12) about length during file upgrade"
Does anyone know how to solve the following firmware upgrade problem. About 1/10 the way into the firmware upgrade I get the following error message "Error(12) about length during file upgrade".
THanks
Jim
Message Edited by NasoShow on 01-27-2008 07:55 AMYes, I have an original that doesn't list the version number, but I chose version 1.
-
File content Conversion Paramter Errors for Footer
Hi, I have a text file, which I working for File to IDoc process. I have to ignore the last line in the file, that is footer... the footer has a value " *FOOTER* Data Rows: 24 ". But the file has a different field length with values... how to do this... I wondering this in File Content Conversion paramter. Please explain clearly how to pass the paramter values...
I attached my file here... now please tell me how to do this.... in File content conversion.... I have Client barcode (field length 11), quantity (11), item bar code(11) and price(11). I have to ignore the header first 5 lines and last footer 1 line... please let me know how to do this in FCC....
*HEADER* Houston Billing Asst - SAP MDS Charges Invoice File
*HEADER* Run date :20100106 124500 Raymond, Dahlman
*HEADER* Invoice date : 20100115
*HEADER* Field layout (fixed width): Client barcode 1-11, quantity 12-22, item barcode 23-33, price 34-44
*HEADER* All prices in USD
401721 75ATP003 125
401721 82ATP001 125
14823 95ATP003 125
*FOOTER* Data Rows: 247 -
File is not creating on the Receiver for File Content Conversion
Hi,
i have created a scenario with this blog
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
for sender side i am using File Content Conversion to read .txt file and on receiver side i need xml file i have done that.
when i placed the file in the sender folder it gets picked up and i checked in Communication Channel monitporing in Runtime WorkBench it is processed Successfully. but no XML File is created on the Receiver side. i am unable to see the messages on SXMB_MONI also.
Please suggest some ideas to solve this.
Thanks,
Giridhar.CHi Giridhar.
unable to see the messages on SXMB_MONI also
If the file got picked and in Communication Channel monitoring RWB you can see that it is processed without any errors ,, then i feel it should come in come.Please check the Audit log in RWB, there you can see the error message if any.
Please check the connection parameters in FTP and make sure that the same sender folder is
not being used by any other scenario.If you have done any recent changes then do a cache refresh .
Please post if you see any error in content conversion.
Regards
Srinivas -
Error in configuring File Sender Adapter with File Content Conversion
Hi
i am designing a File to File scenario using file content conversion in which the input is comma separated file and output is a XML document.
mentioned below are the configuration information:
Recordset Name: Substr
Substr.fieldSeparator: ,
Substr.endSeparator: 'nl'
Substr.fieldNames: Name, Password
Substr.keyFieldValue: Name
and the error i can see in adapter framework is:
Sender Adapter v0830 for Party '', Service 'FileContentConversion':
Configured at 14:30:45 2005-04-07
Initialization error: Conversion initialization failed with java.lang.Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
Mandatory parameter 'Substr.fieldNames': no value found
plz help me ASAP.
thanks and regards,
Varun JoshiHi Varun...
Regarding ur error.....the name and password u send in csv is not getting recognised.. so u have to check the data type structure.
there must be a recordset name and subelement must be recordset structure..the data type must be
<datatypename>
<recordsetname>
<recordsetructurename>
<name>
<password>
please try in this format and ur name and password will get recognised -
File content conversion in Sender Adapater for multiple occurances
Hi ,
I am mapping from flat file to idoc .
My flat file is a tab demilited
Since the idoc would have structure
like header , lineitem , schedule
in my flat file conversion
i am giving recordset structure
as header,1,lineitem ,,schedule,
since lineitem would be repeated many times
Bt if i give * i need to give a keyfieldname
which would mean that keyfieldname has to appaer in header and schedule .
since in my case my Column values in header , lineitem and schedule are different
how can i do the file conversion in this case
i can doing something like this
header.keyFieldValue ""
schedule.keyFieldValue ""
header.keyFieldInStructure ignore
schedule.keyFieldInStructure ignore
i am not even sure if thats the correct way
Thanks
AmitHi Amit,
Take a look at these...
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
cheers,
Prashanth
P.S Please mark helpful answers -
Error in Receiver File adapter using File content Conversion
Hi,
I am getting the following error in the receiver file adapter.
Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'statement.fieldFixedLengths' or 'statement.fieldSeparator' is missing
I am using the below parameters for FCC:
Recordset Structure - statement
statement.endSeparator - 'nl'
statement.fieldSeparator - '0X09'
statement.fieldNames -xblnr,wrbtr,newbs,kostl,newko,prctr,xref1,rke_wwfud,rke_wwst3,blart,bukrs,bldate,budat,gjahr,monat,ctype,waers,bktxt,posnr,wbs_element,mwxkz,businessplace,businessplace,c_waers,c_wrbtr,g_ctype,g_waers,g_wrbtr,h_ctype,h_waers,h_wrbtr,trade_id,lob,sgtxt,zuonr,reason_rev,ldgrp,tcode,lifnr
ignoreRecordsetName - true
Please let me know where i am going wrong.
Thanks,
AparnaHi Aparna,
I feel the problem in your content conversion parameters is with
statement.fieldNames and ignoreRecordsetName
When you are confirguring receiver file adapter for file content conversion the above one is not required. Please refer below link for details on configuring content conversion in file adapter
[http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm]
Hope this helps !!
Regards,
Amit -
Error in reciever file content conversion
Hi
I have the following error in the file content conversion
Could not process due to error: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure '' found in document', probably configuration error in file adapter (XML parser error)'
my content conversion is :
Recordset Structure : FI_Banks_Header_MT,Line
FI_Banks_Header_MT.fieldSeparator = 'nl'
FI_Banks_Header_MT.fieldSeparator = ;
my xml is :
<FI_Banks_Lines_MT>
****<Line>
<FIELD1>12799</FIELD1>
<FIELD2>721042</FIELD2>
<FIELD3>0620</FIELD3>
<FIELD4>20.06.06</FIELD4>
<FIELD5>5575688</FIELD5>
****</LINE>
</FI_Banks_Lines_MT>
The file gets ok !!! but I still get this error in adapter monitor after the file is converted all the time
any1 managed to solve it ? thx , ShaiHey sorry for the previous one...
try out this...
Recordset Structure : FI_Banks_Lines_MT
FI_Banks_Lines_MT.endSeparator = 'nl'
FI_Banks_Lines_MT.fieldSeparator = ;
hope this helps !!!...
Cheers.,
Esha
Maybe you are looking for
-
No constructor in JFrame matches init (String)
Hello, I am using Forte for Java 2.0 build 1160 to compile my Java code. Upon compilation I get the following error message: DemoShape.java [33:1] No constructor in JFrame matches <init>(String) super("DemoShape Applet"); ^ 1 errorThe
-
Discoverer 10g and Java 7- Anyone Document Incompatibilities
Hi All, To provide a clearer picture to my IT steering committee, I am documenting Discoverer 10g / Java 7 incompatibilities. As a company we are on Java 6 because of our Oracle Apps 12.1.3 implementation (we are not ready yet to make the jump to Ja
-
Hello, I cannot extract a jar file's contents. The jar tool just hangs. Is my jar file corrupted? Thanks.
-
My iPod has been stolen. How do i find the serial number if i cannot find the box?
My iPod was stolen and the police want my serial number in order to try and trace it. I can't find the original box and obviously i can't sync my iPod to my computer in order to get the serial number. Is there another way to get the serial number?
-
The error 034 when calling BAPI_XBP_JOB_START_IMMEDIATELY
Hi,dear all, When I call the function 'BAPI_XBP_JOB_START_IMMEDIATELY' to start all jobs, the 'RETURN' type 'BAPIRET2', 'NUMBER' is 034, 'TYPE' is E. Do you have some idea about what's the potential problem on it? Thanks a lot.