File Content Conversion ignore fields

HI ,
I need to ignore some rows in the middle of the data in File content conversion for exaple
H1,Field1,Field2,Field3
A,GB07,MICHEL,1000
H2,Field3,Field4,Field5
B,GB08,andrew,2000
The above is the sample text file from the source , I need to parse in the below
RECORDset1
<Field1>A</Field1>
<Field2>MICHEL</Field2>
<Field3>100</Field4>
RecrodSet2
<Field4>A</Field4>
<Field5>andrew</Field5>
<Field6>200</Field6>
I need to omit or ignore the H1 and H2 rows from the File Content conversion.,
Please guide me how to achive this using File Content conversion

Hi Krishna,
In case if H1 and H2 is your record type or line type then to ignore line for this type... just do not handle "keyFieldValue" in the content conversion for H1 and H2 record type.
Thanks,
Binod

Similar Messages

  • File Content Conversion - Key Field Value

    Hi Experts,
    I am using File to Idoc scenario for my mapping. In the receiver Communication channel, I am using File Content Conversion. My scenario is as follows :
    I have a recordset with Header and Line items with Key Field Indicator as 'H' and 'L'. In some cases, the value for this Key Field is coming in as something other than 'H' and 'L'. I need to throw an exception when this Key Field is not 'H' or 'L'.
    In the 'Content Conversion' tab, my attributes are as:
    Header_Structure.keyFieldValue = 'H' and Line_Structure.keyFieldValue = 'L'. Is there any more attributes that I need to add ?
    Please advise. Thanks a lot.
    Regards,
    Freddy.

    >>multiple key field values in FCC configuration i.e Line_Structure.keyFieldValue = H or L
    AFAIK it is not possible but lets wait for other experts to comment on this...
    >>Can keyFieldInStructure (add, ignore) parameter help me in this case ?
    No. this parameter is only used when you want to include key filed in ur XML structure(add) or not (ignore)...
    Chk this:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

  • File Content Conversion ( avoid fields in conversion)

    Hi all
                        An IDoc to File scenario , I am doing file content conversion in receiver File adapter.
    my message type for file  2 HEADER each having its own substructure
    Like    1header
                       fieldA               
              2header
                       fieldC
                       fieldD
    I want the "<b>1header and its 1 subelement not be converted in file content conversion"  </b>   
    because  its used for dynamic file name configuration, so i do'nt want it to be written on file.
    Regards
    Ashutosh.r

    Rawat,
    Yes I know you will get that error. That is the reason why I have told you to add another parameter fixedLengthTooShortHandling as Cut. So add one more parameter in your file receiver communicaion channel: Also I hope ASFD0101 is your strcuture not the field in the strcuture.
    ASFD0101.fixedLengthTooShortHandling :  Cut
    Then I think it should work like a boom.
    ---Satish

  • File content conversion without field separator

    Hi experts,
    in my scenario I'm sending a txt file to an external receiver.
    Each field of the file must be separated from the others with differents field separators according with the requirement of the receiver, for example:
    field1;field2:field3, field4; ecc....
    For this reason I've created in the source message many "FieldSeparator" fields. These fields will be populated by ABAP program.
    I thought that it was possible to omit parameter fieldSeparator in content conversion, but testing the interface I receive an error because fieldSeparator is missing.
    Is possible to omit fieldSeparator or to specify a fieldSeparator null?
    The fields in the target file must be of variable lenght, so I cannot use FieldFixedLenght.
    The only solution I found is to create in the target message structure a single string with each field concatenated, is the only possible solution?
    Thanks
    Fabio Boni
    Edited by: Fabio Boni on Oct 21, 2010 5:47 PM

    Sorry...posting error earlier..
    The seperator can be concatenated at the end of each field in mapping.So seperator will be part of field value.
    But with receiver FCC, you need to either mentione fieldfixedlenght or fieldseperator.Please check if space is going to to work for you as separator.
    Edited by: nagarjuna _s on Oct 21, 2010 6:36 PM

  • Flat file content conversion repeating fields

    Hello,
       I have a flat file where the first three fields are fixed; the rest of the file line is made up of 1 .. n analysis characteristic results. The name of the field (Result) is always the same, but I never know how many results I will have on one line. Could anyone tell me how I might define this in content conversion ? Thanks in advance.
    Peter DOUGHERTY.

    Sorry,
       Of course ... here it is
    10059514     22/09/08 8:29:02     20,2     0     0     0     0,30     0     133     0     0     0     0     0     0     0     0     0     0     0     
    The first field is the Id of the sample
    Second field Date
    Third field Time
    The 4th ... 21st fields a (varying) number of results (here there are 18, but there could be any number from 1 upwards)
    Hope it is clearer
    Thanks
    Peter

  • File Content Conversion some fields are missing

    Hello Friends,
    I am trying to convert a fixed length flat file to XML.
    Here are my parameters
    CompanyCodeRecord.fieldNames = field1,field2,....field50
    CompanyCodeRecord.fieldFixedLengths = 1,4,15,20...,50 (for all 50 fields)
    CompanyCodeRecord.processFieldNames = fromConfiguration
    CompanyCodeRecord.lastFieldsOptional = YES
    CompanyCodeRecord.endSeparator = nl
    If I do not use lastFieldsOptional=YES then the adapter is throwing an exception Error: <b>Conversion of complete file content to XML format failed around position 0 with java.lang.Exception: ERROR converting document line no. 1 according to structure 'CompanyCodeRecord':java.lang.Exception: Consistency error: field(s) missing - specify 'lastFieldsOptional' parameter to allow this
    last retry interval started 19:31:08 2005-07-11</b>
    If I use lastFieldsOptional=YES then the message does not contain last 8 columns (That means each record is containing only 42 columns).
    Please help.
    Thanks
    SKM

    Hi SKM
    Go through this blog on sending fixed length flat file
    <b>/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    and
    >><i>lastFieldsOptional=YES then the message does not contain last 8 columns</i>
    <b>lastFieldOptioanl parameter specifies whether the last fields can be omitted (YES) or not (NO) in a CSV structure. If you do not make a specification, the default value is NO</b>.
    So i think u should use <b>NO</b> in this parameter.
    Hope it helps.
    Regards
    Arpit Seth

  • File Content Conversion(SenderFileadapter) fields parameters

    Hi all
               I am doing aFile to File scenario,
    Using content Conversion at SENDER FILE adapter
    my source message type is as :  
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Cnet_Source xmlns:ns0="http://abc.com/Cnet">
       <<b>HeaderPayment</b>>
          <First_Payt_Doc/>
          <Beneficiary_email_id/>
       <<b>/HeaderPayment</b>>
       <<b>AdviceFormat</b>>
           <Client_Code/>
          <Payment_Document_No/>
          <Document_Date/>
       <<b>/AdviceFormat</b>>
       <<b>LineItem</b>>
         <Title1/>
          <Title3/>
       <<b>/LineItem</b>>
       <<b>FILENAME</b>>
          <FNAME/>
       <<b>/FILENAME</b>>
    </ns0:MT_Cnet_Source>
    it has 3 structures :HeaderPayment(0,1),AdviceFormat(0,1),LineItem(0,unbounded)
    in Recordsetstructure i gave= HeaderPayment,1,AdviceFormat,1,LineItem,1
    in FCC parameters i used
    HeaderPayment.fieldname... =First_Payt_Doc,Beneficiary_email_id
    HeaderPayment.fieldseperator ='nl'
    HeaderPayment.endseperator ='nl'
    ignorerecordset = true
    similarly for rest 2 structure also
    my source text  file is type :
    we0023
    [email protected]
    xyc
    acd
    21/05/2007
    10034
    acccd
    payment
    i tried alot of options,refering sdn..still on reading the file value are not coming in the designated fields...
    Thanks &Regards,
    ajay

    You are Right i correct it but i sxmb_moni
    i get as <HeaderPayment>
    <First_Payt_Doc/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <HeaderPayment>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <HeaderPayment>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <HeaderPayment>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <HeaderPayment>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <HeaderPayment>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <HeaderPayment>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <HeaderPayment>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <HeaderPayment>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    <HeaderPayment>
    <First_Payt_Doc/>
    <Beneficiary_email_id/>
    </HeaderPayment>
    <AdviceFormat>
    <Client_Code/>
    <Payment_Document_No/>
    <Document_Date/>
    </AdviceFormat>
    <LineItem>
    <Title1/>
    <Title3/>
    </LineItem>
    <FILENAME>
    <FNAME/>
    </FILENAME>
    the header payment should not repeat....
    Regards
    Ajay

  • Content Conversion - Ignore Fields

    Hi,
    Is it possible to ignore fields when converting from XML to a flat file ? For example if my input XML is:
    <RecordSet>
    <Record>
       <f1>a</f1>
       <f2>b</f1>
        <f3>c</f1>
    </Record>
    <Record>
       <f1>d</f1>
       <f2>e</f1>
       <f3>f</f1>
    </Record>
    </RecordSet>
    Is it possible to produce an output file of:
    a,b
    d,e
    ...where f3 is ignored.
    Cheers,
    PaulC.
    Edited by: paul clements on Aug 23, 2011 3:21 PM
    Edited by: paul clements on Aug 23, 2011 3:22 PM

    hi,
    then move the extra field in a separate node/substructure  and dont mention that node in recordset structure in FCC parameter.
    Mention those substructure which you want to see in target file. Other substructuure will be ignored.
    Under Recordset Structure, enter the substructures using the pattern NameA,NameB,....
    If you want to convert all substructures using the same parameters, you only have to specify one structure. The entries are automatically applied to all substructures.
    If you specify more than one structure, the list must contain all the structures occurring in the document. The list must be complete, otherwise a processing error will be triggered at runtime.

  • File content conversion: Target Field is optional

    I am using FCC in receiver file adapter.
    My file is getting generated.
    In target structure one field is optional and hence target xml element doesnt have value. hence that field is not there in txt file. with this what happens next subsequent field gets shifted to my optional field place and then i get error field length is not correct.
    I want to put 2 spaces if that optional field length is 2 char and then there should be field separator(space) and the subsequent column.
    I am already giving fixedfieldlegnth of all the fields.
    Pl can anyone suggest how to do this.
    thanks,
    sharada

    Hi Sharada,
    Do your normal mapping to the target field that is optional.
    Use a If function before mapping the field.
    Check if the node is created in usual mapping, else map a constant with 2 spaces.
    DO something like this:
    Mapping ---------------->
                               equalsS ----> if
    constant(empty Value)--->
                      constant(2 spaces)--> then -> tgtField
                       Mapping -----------> else   
    regards,
    P.Venkat

  • Skip field in file content conversion (file adapter)

    hy guys,
    I have a log file and want to convert it into xml. that works fine.
    the problem is: can I skip some fields that I do not need in the xml with file content conversion
    the fields I want to skip are the same in every record of the log file.
    thanks.

    Ralf,
    You can only ignore lines in the begiining of the file using Document Offset option.
    If you have the unwanted field in the end of the record and you are in SPS12 (PI 7.0), you can use the option additionalLasstFields in FCC parameters. have a look into the blog /people/sukumar.natarajan/blog/2007/06/12/content-conversion-in-sender-file-adapter--2-new-useful-parameters
    Easier, is to ignore those fields in mapping.
    Also, you can try to remove those fields using a shell script which can be called from the File adapter.
    Regards,
    Jai Shankar

  • File Content Conversion - Error in keyfield Value

    Hello experts,
    I am doing file content conversion for a file to file scenario. The input file is a csv file which is converted to xml using the file content conversion. The key field of input file is used for implementing conversion.
    While testing the FCC, I noticed that if the keyfield value is wrong for a record in the file, the record is ignored altogether without throwing any errors or warnings. Is there any way to notify if any records have been ignored as a result of incorrect keyfield value??
    Thanks in advance!
    RR

    There seems to be NO way to handle it in FCC.
    File Content Conversion - Key Field Value
    u can think of work arounds by handling it in mapping....
    -santosh.

  • Error in Sender File content Conversion - how to ignore keyfieldName

    Dear Frndz,
    I'm new to SAP PI. I want to post a flat file to ECC.
    The Souce Structure is:
      Record(1-unbounded)
        |_Header(1.1)
              field1
              field2
              field3
        |_Detail(1.unbounded0
            field4
            field5
            field6
    Sample File:
    first header - xx,yy,zz
    Detail 1 -      1,b,c
    Detail 2  -     2,e,f
    second header - aa,bb,cc
    Detail 1 -     1,g,d
    I wrote the file content conversion as follows
       Recordset name - Record
       Recordset Structure - Header,1,Detail,*
    Header.fieldNames  field1,field2,field3
    Header.feldseparator  ,
    Header.endseparator  'nl'
    Detail.fieldNames  field4,field5,field6
    Detail.fieldseparator  ,
    Detail.endseparator  'nl'
    Conversion initialization failed: java.lang.Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Mandatory parameter 'xml.keyfieldName': no value found
    It's asking me to give the input to keyfieldname. But I dont have such field in my record. Ther's no common field . no field is repeating like record type or doc_type as in other cases.
    So, Coud you please guide me to proceed with this.
    Thanks in advance.....

    Hi,
    Please, take a look to these Blogs related to FCC
    Troubleshooting the File Adapter (Last Updated on 02 July'10)
    Content Conversion (Pattern/Random content in input file)
    File Content Conversion for Unequal Number of Columns
    The specified item was not found.
    Content Conversion ( The Key Field Problem )
    NAB the TAB (File Adapter)
    Rgds
    RP-.

  • File  Content  Conversion for ignoring the entire line

    Hi,
       I'm getting a CSV file from that i want to skip some  records based on some validation.. for example:
    I'm getting the following  data :
    EmpNo                   EmpName                   EmpDept
    E101                       ABC                               ABAP
    E102                       XYZ                                BW
    E103                       GFC                               XI
    E104                       BVM                               ABAP
    E105                       ASD                               BW
    E106                       YFC                                XI
    SO, here  where ever i'm getting  EmpDept = XI  .. i want to skip those all the  records( that entire line  i want to skip).. .. this can be possible through Message Mapping.. but i wnat to do this in the File Content Conversion..  how can we do this..
    any  helpful answers   will  appriciated..
    Thanks
    babu

    Hi,
    FCC is used to generate the XML structure so that XI can understood properly. You can not do any kind of validations or Skip the records based on Element value condition in FCC.
    There are scenarios where you want to skip the lines that time you can use the below option in FCC but this is again not based on condition.
    Under Document Offset, specify the number of lines that are to be ignored at the beginning of the document.
    This enables you to skip comment lines or column names during processing. If you do not make an entry, the default value is zero lines.
    The best way to do is use the UDF:
    Write an UDF on target root node.
    take input in one context:
    input a= Emp Dept:
    for(i=o,i<a.length;i++)
      if(a{i}.equals("X"))
       result.addValue(SUPPRESS); this will supress the target root node if condition is equal to X
      else
      result.addValue("Constant"); this will generate the target root node.
    Thnx
    Chirag

  • Key field values for file content conversion at sender communicationchannel

    Hi all,
    I am working on  scenario File to Idoc.In this scenario at the sender side we configure the file content conversion for .CSV file.
    In the flat file i am having more than one orders, XI will pick the file and creates a separate Idoc for each sales order at r/3.
    We have similar fields "Order Item Number" both header and item.
    If we got '00000' on the Header item then it should create a new idoc at the r/3 side other wise it will create line item.
    Order item number will be 00000 for header but it will differ from order item to item.
    source structure
    Order Header
    Order type
    Sold-to-code
    PO number
    Order item number
    Order date
    AdresName1
    AdresName2
    Street and House number
    Postal Code
    City
    Country Code
    Filler
    Order Item
    Order type
    Sold-to-code
    PO  number
    Order item number
    Order date
    Product code
    Order quantity
    Item text
    Filler
    Now I have some questions....
    I don't have standard filed values to give the key fileds at source structure.
    I need to create the Idoc at r/3 system for each individual record.
    Is it possible to create new idoc with out using the Key filed value?
    If it is possible then how can i proceed with fcc?
    please give me your valuable suggestions
    Best Regards,
    satya
    Edited by: satyatanuku on Mar 3, 2010 1:41 PM
    Edited by: satyatanuku on Mar 3, 2010 1:42 PM
    Edited by: satyatanuku on Mar 3, 2010 1:44 PM

    Hi,
    Just check the Content Conversion Parameters-  Recordset Structure.
    If you have filled in this parameter with
    Header,1,Item,1
    then change it to
    Header,1,Item,3
    Regards
    Chandra

  • Duplicate field names in File content conversion

    Hi,
    I need some details for csv to xml file conversion.I have configured the file content conversion adapter for these conversions.In source CSV file we will receive below details in single line.
    0020000001000       0020000002000       0020000003000       0020000004000
    Now i can successfully generate
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns:MT_GLMast_out xmlns:ns="http://sap.com/PI/GLMast">
    - <GLMasterData>
    - <GLMAST>
      <Customer1>0020000201000</Customer1>
      <Customer2>0020000200000</Customer2>
      <Customer3>0020000199000</Customer3>
      <Customer4>0020000198000</Customer4>
      </GLMAST>
      </GLMasterData>
      </ns:MT_GLMast_out>
    with following parameters
    GLMAST.fieldSeparator     ,
    GLMAST.fieldNames     Customer1,Customer2,Customer3,Customer4
    GLMAST.endSeparator     'nl'
    Now the issue is customer wants to send 3000 customer number in single file.How to maintain the parameter to duplicate filednames just customer instead of customer1,customer2,customer3 etc...
      <Customer>0020000201000</Customer>
      <Customer>0020000200000</Customer>
      <Customer>0020000199000</Customer>
      <Customer>0020000198000</Customer>
    This can be done if customer sends file like one customer number in one line.please help me how to process multiple customer number in single file separated with comma.
    Thanks,
    Vijay

    For this what you can do is, create the source and target data types as shown below
    Source Data Type
    <DTO_Customer>
    <Records> 0..unbounded
       <Customers> </Customers>0..1
    </Records>
    </DTO_Customer>
    Target Data Type
    <DTI_Customer>
    <Records> 0..1
       <Customer> </Customer> 0..unbounded
    </Records>
    </DTI_Customer>
    Now since your data will come in a single string therefore do the FCC in sender channel as shown below
    Records.fieldNames = Customers
    Records.fieldSeparator = 'nl'
    ignoreRecordsetName = true
    So by doing this you will get the data into XI mapping in as single string. Now you need to write an UDF which will split this string into individual customers based on your delimiter in the string.
    Now map the output of this UDF to <Customer> field.
    You may need to do some other small fixes accordingly.
    I hope this will solve your problem.

Maybe you are looking for