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

Similar Messages

  • Sender Adapter - Content Conversion Key Field Query

    Hi,
    I have a flat file of the following structure I am attempting to convert to XML using a file sender adatper:
    H1,H2,H3,H4
    D1,D2,D3,D4,D5,D6
    D1,D2,D3,D4,D5,D6
    D1,D2,D3,D4,D5,D6
    T1,T2,T3,T4
    Within the Content Conversion tab I have a Recordset Structure of:
    Header,1,Detail,*,Trailer,1
    i.e one header record, multiple detail records and one trailer as per the above example.
    It would seem that according to errors generated via Communication Channel Monitoring that this sort of Recordset Structure requires the Key Field Name to be set. I have searched around the forum and looked at the help.sap.com site and I'm struggling to understand what is required here.
    Anyone help ?

    >>It would seem that according to errors generated via Communication Channel Monitoring that this sort of Recordset Structure requires the Key Field Name to be set. I have searched around the forum and looked at the help.sap.com site and I'm struggling to understand what is required here.
    Yes you need to set key field value for your Header, Detail and Trailer
    Example:
    Header.keyFieldValue    H1
    Detail.keyFieldValue     D1
    Trailer.keyFieldValue   T1

  • File Content Conversion. Default Value of beginSeparator

    HI All
    I have a scenario where i am using file Content Conversion to create a text file.
    my structure is as following
    MessageTypeName
    FirstElement           1..1         
    SecondElement       1..1
    Data               1..Unbounded
    In the text file i just need the Content of  Data to appear  in each row.
    So i gave the following CCP
    SecondElement.fieldSeparator  = 'nl'
    SecondElement.endSeparator = 'nl'
    But i am getting the first line as a blank line .
    I do not need the first line as a blank line. Can someone suggest how to avoid the default blank first line.
    regards
    Nilesh.

    Hi,
    Just check the below parameter's defined in the below example.
    Below is the example when you have HEADER & ITEM structure.
    FCC is case sensitive, give all the names in FCC same as your Data Type.
    In <b>Recordset Structure</b> = Header,1,Item,*
    Header.fieldFixedLengths = (field lengths) e.g. 1, 4, 7
    Header.fixedLengthTooShortHandling=ignore
    Header.endSeperator='nl'
    Item.fieldFixedLengths = give the item field length as shown above
    Item.endSeparator = 'nl'
    Item.lastFieldsOptional = YES
    Regards,
    Sarvesh
    ****Reward points, if found helpfull.

  • 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 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

  • 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

  • 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

  • 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: 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

  • 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.

  • Content Conversion without key field value

    Hi all,
    I want to do a content conversion which includes a record structure Header,1,Detail,*
    I dont have any key field value in the header nor in the detail. Can this be achived using FCC or should i go for Java.
    Rgds
    Aditya

    Hi Aditya,
    I think if u having multiple records then one shud hav key fields,
    pls check 4th point in this guide
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/troubleshooting%2bthe%2bfile%2badapter
    Also check this discussion::File Content Conversion(SenderFileadapter) fields parameters
    Thanks,

  • Key Field Value for File Adapter Sender Wildcard

    Hello everybody, is there a way to use a wildcard for the property of NamA.keyFieldValue in the cc for a Fils Sender????, here's an example why, I need to take some Files via PI 7.0 and my key filed can change according to the file an example is that in a file can be HF28 and in another file can be HF29, the only character that is going to be constant is the H, I would really appreciate any suggestions, thanks in advance.
    Regards,
    Julio Cesar

    Hi Julio
    File sender adapter will read the file using FCC
    Key Field Value entry is mandatory if the key field name is set. Otherwise, the entry can be ignored
    http://help.sap.com/saphelp_nw70/helpdata/EN/34/393071e9b998438ddb8ce97cd617a1/frameset.htm
    Content Conversion ( The Key Field Problem )
    Thanks
    Gaurav Bhargava

  • 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

  • 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

Maybe you are looking for