Ignore unwanted field in flat file

Hi experts,
If I am loading a flat file but one of the field has to be ignored. Do I need to add it in Datasource and not map in transformation.

You would need to add the field to the DataSource, so that reading the Flat File in would be correct. From that point forward, there would be no need to map it to target InfoProviders.
Edited by: Dennis Scoville on Nov 4, 2009 12:28 PM

Similar Messages

  • Fields in Flat File are separated by special characters

    hello every one,
       fIf fields in Flat File are separated by special characters
    and If Flat File is given in Excel sheet , how to handle this kind of issues.
    to Upload data into R/3 system, in BDC.
       If u have sample program ,please send it ot me and explain ?
    others give me hints...

    Hi,
    you can use the function module ALSM_EXCEL_TO_INTERNAL_TABLE .
    Check this sample code.
    hi,
    use the FM ALSM_EXCEL_TO_INTERNAL_TABLE.
    PARAMETERS:
    P_INFL like RLGRAP-FILENAME.
    DATA:
    BEGIN OF T_DATA1 OCCURS 0,
    RESOURCE(25) TYPE C,
    DATE(10) TYPE C,
    DURATION TYPE P DECIMALS 2,
    ACTIVITY(25) TYPE C,
    B_NBILL(1) TYPE C,
    END OF T_DATA1,
    T_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE,
    BEGIN OF T_FINAL OCCURS 0,
    RESOURCE(25) TYPE C,
    DATE(10) TYPE C,
    DURATION(15) TYPE C,
    ACTIVITY(25) TYPE C,
    B_NBILL(10) TYPE C,
    END OF T_FINAL.
    DATA : HEADER TYPE XSTRING.
    Work Variables Declaration.
    CONSTANTS:
    W_Y TYPE C VALUE 'Y',
    W_N TYPE C VALUE 'N'.
    Work area.
    DATA:
    WA_DATA LIKE T_FINAL.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INFL.
    PERFORM GET_FILENAME CHANGING P_INFL.
    START-OF-SELECTION.
    PERFORM UPLOAD_DATA_FROMEXCEL.
    FORM UPLOAD_DATA_FROMEXCEL.
    Downloading the data from presentation server
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    FILENAME = p_infl
    I_BEGIN_COL = 1
    I_BEGIN_ROW = 2
    I_END_COL = 8
    I_END_ROW = 1000
    TABLES
    INTERN = T_DATA
    EXCEPTIONS
    INCONSISTENT_PARAMETERS = 1
    UPLOAD_OLE = 2
    OTHERS = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " upload_data_fromexcel
    *& Form process_data
    text
    FORM PROCESS_DATA .
    T_FINAL-RESOURCE = 'Resource'.
    T_FINAL-DATE = 'Date'.
    T_FINAL-DURATION = 'Duration'.
    T_FINAL-ACTIVITY = 'Activity'.
    T_FINAL-B_NBILL = 'Billable'.
    APPEND T_FINAL.
    SORT T_DATA BY ROW COL.
    LOOP AT T_DATA.
    CASE T_DATA-COL.
    WHEN 3.
    T_DATA1-RESOURCE = T_DATA-VALUE.
    WHEN 4.
    T_DATA1-DATE = T_DATA-VALUE.
    WHEN 5.
    T_DATA1-DURATION = T_DATA-VALUE.
    WHEN 6.
    t_data1-activity = t_data-value.
    WHEN 7.
    T_DATA1-B_NBILL = T_DATA-VALUE.
    ENDCASE.
    AT END OF ROW.
    COLLECT T_DATA1.
    ENDAT.
    ENDLOOP.
    LOOP AT T_DATA1.
    T_FINAL-RESOURCE = T_DATA1-RESOURCE.
    T_FINAL-DATE = T_DATA1-DATE.
    T_FINAL-DURATION = T_DATA1-DURATION.
    T_FINAL-ACTIVITY = T_DATA1-ACTIVITY.
    T_FINAL-B_NBILL = T_DATA1-B_NBILL.
    APPEND T_FINAL.
    ENDLOOP.
    ENDFORM. " process_data
    *& Form get_filename
    FORM GET_FILENAME CHANGING P_FILENAME.
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
    DEF_FILENAME = SPACE
    DEF_PATH = P_FILENAME
    MASK = ',. ,..'
    MODE = 'O' " O = Open, S = Save
    TITLE = BOX_TITLE
    IMPORTING
    FILENAME = P_FILENAME
    EXCEPTIONS
    INV_WINSYS = 1
    NO_BATCH = 2
    SELECTION_CANCEL = 3
    SELECTION_ERROR = 4
    OTHERS = 5.
    CASE SY-SUBRC.
    WHEN 1.
    MESSAGE I999 WITH
    'File selector not available on this windows system'(046).
    WHEN 2.
    MESSAGE E999 WITH
    'Frontend function cannot be executed in background'(047).
    WHEN 3.
    MESSAGE I999 WITH 'Selection was cancelled'(048).
    WHEN 4.
    MESSAGE E999 WITH 'Communication error'(049).
    WHEN 5.
    MESSAGE E999 WITH 'Other error'(050).
    ENDCASE.
    ENDFORM. " get_filename
    <b>Kindly Reward points if you found the reply helpful.</b>
    Cheers,
    CHAITANYA.

  • How to ignore some fields on Receiver File?

    Hi folks,
    I have this inbound structure example:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_ObrasAdjud_Out xmlns:ns0="http://pt.edp/r3/obrasadjudicadas">
      <codforn>123543</codforn>
      <numdoc>000003</numdoc>
      <tipodoc>CAO</tipodoc>
      <encoding_scheme>UTF-8</encoding_scheme>
      <filetype>pdf</filetype>
      <filedata>01010101001001</filedata>
    </ns0:MT_ObrasAdjud_Out>
    Using File Conversion with my Receiver File Adapter I want to convert this xml file to a flat file, but only using the element <b><filedata></b> and ignore the others. However, I also need the others elements to use as variable substitution.
    Anybody knows how to do it?
    Thanks in Advance,
    Ricardo.

    Hi Ricardo,
    >>>>Using adapter specific attributes I can use the elements of source message to do it?
    or course!!! that's the idea and you do it all in message mapping
    (very small advanced function as shown in many blogs)
    >>>>But using variable substitution, I can’t ignore those fields with file conversion?
    don't know I stopped working with variable substitution
    as soon as I learned about adapter specific attributes
    as they are sooo much better
    >>>>I can do a map excluding all the others elements for target message, my target message will be one element <filedata>.
    that's the main idea
    Regards,
    michal

  • Short dump while reading a currency field from Flat file into internal tabl

    Hi,
    I am getting a short dump........saying number conversion dump (while reading a currency value into field in internal table from a fixed lenght flat file).........
    Do I need to use a string variable to get the value from flat file or how ??
    Please suggest.

    Santosh,
    Thanks for your inputs,
    But my internal table type is of DEC (5,2) , I am getting that... it needs to be of type 'C'. Can you suggest.
    Ex :
    MOVE wa_temp-infile_string+106(8)  TO wa_item-QT_PERCENT
    This didnt work
    so i tried moving into a seperate variable
    MOVE wa_temp-infile_string+106(8)  TO v_percent.
    and then write to
    WRITE v_percent to  wa_item-QT_PERCENT.

  • Selecting fields for flat file input

    I've built a scenario that uses the File adapter to load a flat file into SAP and fully understand the concepts. My problem is that I have fixed length file I need to load which has 50+ fields per row. I only need 10 fields per row and those fields are spread throughout the row. Using fieldFixedlengths I specify the length of each field - and it appears they must be consecutive fields. How can I specify the fields that I need.
    For example my input file may be as follows
    AAAAAAABBBBBBBCCCCCCCDDDDDDEEEEEEE
    I only need AAAAAAA CCCCCCC and EEEEEEE. Is there a way to do this?

    Hi Robert,
    I don't know why you want to upload all junk data there apart from importing only relevent fields. if i am concered to do so, i'll do this in outside the XI BOX. If that file is in come fixed format or lets say its in csv format, just open that file into excel and then try to remove the row you don't want and then save it again to the same file format. and then import and map inside XI it will be simple.
    Also if you don't wanna to do this, then tell us what logic you wanna use to find which rows you don't want. I don't think if you are not sure or you already know what rows/fields u want.
    Regards
    Aashish Sinha
    PS : reward points if helpful

  • Could not find the fields in Flat file, But able to see the fields in receiver Communcication channel

    Hi All,
    My scenario is Proxy to file, After testing my scenario the flatfile is getting generated without any errors.
    I can able to see all the fields in receiver communication channel payload. But some fields are missing in flatfile which is generated after conversion.
    This is my structure below
    Record
    ---Header
          a
          b
          e
          g
    ---Trailer
          c
          d
    ---Details
          e
          f
    And here is my content  conversion below
    Header.fieldFixedLengths   2,4,6,7
    Header.endSeparator         'nl'
    Trailer.fieldFixedLengths     3,5
    Trailer.endSeparator           'nl'
    Details.fieldFixedLengths    6,7
    Details.endSeparator          'nl'
    Actually in header there are nearly 34 fields, I can able to see all the 34 fields in reciever CC, But in generated flat file I can able to see only first 30 fields remaing 4 are missing in flat file.
    it is like in the above structure In Header there are a,b,e,g fields.I am getting a, b fields e and f are missing in flatfile.
    Thanks in advance.
    Please suggest me the solution.
    Thanks & Regards,
    Satish

    Hi Satish
    As you said 4 fields values are missing out of 34. Are those fields values are coming as blank in the file or not at all coming.
    Ex:
    you have 4 fields a,b,e,g and in channels you have defined length as 2,4,6,7
    If values for fields a,b,e,g are coming as 1,22,33,44444 respectively then the flat file is generated as
    1-22--33----4444--- (Consider - as space here)
    Now if you say e and g value then is the flat file generated as
    1-22---------------
    or
    1-22--
    Regards
    Osman

  • Need to read a field from flat file

    Hi All,
        In flat file i have  one field which may contain 100 enteries separated by delimanator ',' (comma).  There can be 1 , 10 or 100 enteries.   I need to put them in the internal table . Please suggest me .
        I have used the below logic .
    i split the field in 100 variables and then appending the internal table . the problem here is even if there is only one entry , the logic will append 99 blank enteries .  so can any one suggest , is there any other way do it . any Functon Modules available .
    Thanks.

    Hi Chetan,
    If i understand your requirement it is as below,
    Flat file.
    1,2,3,4,5,6,7,8,9,....
    1,2,3,4,5,6,7,8,9,....
    1,,,,,,,,,,,,,,,,,,,,
    Now you read the first line and split into an itab of type string, and you are worried about the third line where not all the fields have values and end up creating blank entries. to fix this, simply
    Sort the Itab, and use delete itab statement with the where clause as where column is ''.
    This should solve it.
    types: begin of t_data,
                line type string,
               end of data.
    data: li_file_line type standard table of t_data.
    split l_file_line at ',' into li_file_line.
    delete li_file_line where line = ''.

  • Field in Flat File DataSource

    I created a Flat File DataSource.
    In the DataSource, I enetered InfoObject 0OUTAGTARGT in the Fields tab ->InfoObject Template column. I want this InfoObject to be mapped
    into field KTWRT (Target Value) in R/3 table EKKO.
    However, when I enter the the InfoObject 0OUTAGTARGT and hit Enter key, system prompts me to copy the properties. I choose Copy.
    And then it says:
    Reference field 0DER_CURR was added automatically.
    Now I have ORDER_CURR entered in the Field column, with InfoObject Template 0ORDER_CURR.
    In the Field column, I replaced the field ORDER_CURR with WAERS (Currency field from R/3).
    When I save it, I hit the following:
    Missing currency field / unit field ORDER_CURR
    System expect the field ORDER_CURR to be entered in the Field column. But in my source file, there is no field call
    ORDER_CURR. It is actually WAERS.
    How can I overcome this?

    Maintain 0ORDER_CURR as it is needed by 0OUTAGTARGT.
    Next, simply map WAERS to the ORDER_CURR field.
    But it doesnt allow me to change. In DataSource ->Fields tab, I try to replaced the field ORDER_CURR with WAERS. When I click on Activate, I
    hit the following:
    Missing currency field / unit field ORDER_CURR
    Please help.

  • Date field in flat file

    I ve date filed in flat file, like this
    5/5/2007  12:00:00 AM
    1/1/2007  12:00:00 AM
    HOW could i take above date characteristic in my time dimension.
    I m new to bw.
    thanks
    KS

    Hi,
    The date format should be YYYYMMDD in flat file.
    IF the date format is not the above mentioned way, then you can change setting.
    Going to System in Menu
    System->User Profile->Own data.
    Under Owndata you can change the date format to your requirement.
    Check the below link also for detain info of coding:
    Mandatory for Date field
    Reg
    Pra

  • Download dynpro fields to flat file

    Hi,
    I have a requirement to capture the value of fields like customer, job name and functional location from a service notification (IW51-create/ IW52- change/ IW53 - display) and download them to a flat file.
    As it is a common requirement for create, change and display of service notification, placing the user exit for reading the required data, upon save, will not be the best option.
    Can someone suggest a better way to do this?
    Thanks,
    Rugmani.

    Hi,
    You can use dynp_values_read fn module to get all values during runtime.
    DATA : l_progname TYPE sy-repid,
          l_dynnum TYPE sy-dynnr.
    DATA : dynpread_tab LIKE STANDARD TABLE OF dynpread WITH HEADER LINE.
      l_progname = sy-repid.
      l_dynnum = sy-dynnr.
      CLEAR dynpread_tab.
      REFRESH dynpread_tab.
      dynpread_tab-fieldname = 'fieldname'.
      APPEND dynpread_tab. " apped all the fields in this table for which u want to get all the values at runtime.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = l_progname
          dynumb               = l_dynnum
        TABLES
          dynpfields           = dynpread_tab
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc <> 0.
      ENDIF.
    dynpread_tab-fieldvalue will get the value of the field.
    Once you get all the values - use GUI_Download fn module to download them to a flat file.
    Award me points if it helps.
    Thanks,
    Sheel

  • Loading Date fields from flat file to Oracle tables

    Hi,
    I have a flat file with a few date columns. I have given the format for the date field while creating the data store for the flat file. The format I used is 'YYYY-MM-DD'.
    But I get an error when I execute it after associating the module with LKM & IKM.
    The error message is as follows:
    org.apache.bsf.BSFException: exception from Jython: Traceback (innermost last):
    File "<string>", line 3, in ?
    OS command has signalled errors
    Can anyone help me out.
    Thanks

    At the time of DataStore creation. You take that date field as string.
    After this, in interface, when you map this date field with table field. You should use CONVERT(<field name>,DATE) in expression editor.

  • Mapping problem - trying to map lowerlevel field to flat file

    Dear experts,
    I have a rpoblem mapping my data.
    my input-xml looks like this:
    . orderheader
    ...orderdetail (1..n)
    .....delivery header (1..n)
    .......delivery detail (1..n)
    .........invoice header (always max 1 per delivery detail)
    ...........invoice detail (always max 1 per invoiceheader)
    .......delivery detail
    etc
    I have a flat file as output which looks like this
    . RECORD
    ...ORDERNR
    ...ORDERPOSITION
    ...DELIVERYNUMBER
    ...DELIVERYPOSITION
    ...INVOICENUMBER
    ...INVOICEPOSITION
    If there are 2 invoicelines in the input xml, the outputfile should contain 2 records with all same data except invoiceposition. For each delivery-detail line a line in the outputfile must be created. So I mapped "deliverydetail" to RECORD. No problems here.
    Further I mapped invoicenumber (within the invoice header tag) to INVOICENUMBER.
    But when for instance deliverydetail 1 and 2 don't have an invoice, and deliverydetail 3 does, I see this invoicenumber not in record 3 but in record 1. Record 2 and 3 contain no invoicenumber.
    What am I doing wrong here?
    Thanks in advance,
    William

    Hi William,
    One header has multiple items, so here you have to use the oneAsMany node function.
    first input for oneasmany node function is Invoice number and 2nd and 3rd input is InvoiceDetail node.
    Regards
    Ramesh

  • How to load a long flat file field into BW

    Hi all,
    I have a field from flat file with 256 characters to be loaded into BW. As we all know the max length an info object can take is only 60. How can I split the flat file field so that I can load that data into BW and how can I then concatenate them in the BEx.
    Can anyone suggest a way?
    Thanks in advance.
    Vinay

    Hi Vinay,
    we already had this discussion in this forum. In short:
    1. create a number range object
    2. create a table with a number field a key and a text field
    3. while loading the data check your text against the table. If the text already exist, get the number out of the table. If the text doesn't exist, get a new number out of your number range object and post this number + the text into your table.
    4. in your loaded data always work with the number you assigned to the text
    5. create a infoobject for the number-field
    6. create a variable that takes it's value out of the table.
    regards
    Siggi

  • Loading a field of length( 60 and up to 2048) from flat file to BW.

    Hello,
    Can you please suggests ways by which we can load a field in flat file which is of length greater than 60 and up to 2048 digits to BW.
    Facts:
    We cannot have more than 59 length digits in an infoobject
    Observations:
    The idea of using multiple infoobject,ie for 2048 max length it will be 35 infoobjects is not acceptable by my client.
    So, can anyone suggests other ways in BW3.5 for loading a text of length up to 2048 from flat file to BW.

    Hi,
    If you have source field DD/MM/YYYY format, please try this code in the field routine.
    Data : lv_date(8) type C.
    lv_date0(4) = <Source Field Name>6(4).
    lv_date4(2) = <Source Field Name>3(2).
    lv_date6(2) = <Source Field Name>0(2).
    RESULT = LV_DATE.
    Thanks,
    Saru
    Edited by: P. Saravana Kumar on Apr 19, 2009 2:38 PM

  • Standardize a flat file format w.r.t OWB

    Hi Pat,
    or anyone,
    Can u help me to standardize a flat file format with respect to OWB?
    I have 15 financial source systems. The client agreed in giving the data in csv format. Now I need to standardize the feed file so that it would be easy for me handle it in OWB. Please note depending on my standardization the client would give me the data and in turn it would be easy for me to handle it OWB External Tables. The records size for a single feed file is 1 million. So my questions are
    1.How should I standardize a date field in flat file?. Please note target date field is default date in Oracle.
    2.How should I standardize an address field? I.e. normally here I have 3 address fields. But I want the output in 1 field. What is the best possible methodology to do this? Or can I handle this issue in OWB front.
    3.How should I standardize a feed file name (generic)?
    4.How should I standardize a feed file folder (generic)? Please note the folder will reside in UNIX environment. The concept is, there would be respective folders in UNIX and the feed files would automatically fall into these respective folders in a fortnight basis. So what should I do to achieve this? I know I have to write a shell script for the automatic process. If so how will I do this and schedule it.
    5.And w.r.t above question, how will I tell OWB to go and fetch the files in those folders. I know it is done while mapping. But my question is Is that the only best way I can achieve it?
    6.If I left anything related to feed file, please tell me?
    Please note that based on my standardization, the client would extract the data and give it to me. So if I standardize the feed file which would be easy for me to handle it in OWB, then that would be a great success. And also note this is for a long run. Minimum 10 years.
    Regards,
    rem.

    Good afternoon Rem,
    It's all very theoretical indeed, talking about standards and all. I'll try to answer some of your questions according to my experiences.
    @1, Usually we load flat files into external tables using varchar2-fields only, occasionally number fields; dates however are always loaded into varchar2's and then when reading the external table into the staging area they are converted to Oracle dates using a simple TO_DATE transformation.
    @2, I don't think there's a real standard for that, it should simply meet YOUR needs, so when loading EXT into STG simply perform a transformation concatenating those 3 fields to form one.
    @5, you have to register the location where you have defined your flat files, this should be some Unix location; after that the connector between EXT and STG will know what to do when running the mappings from EXT to STG (thus: no other action is needed to 'tell OWB' where to fetch data from flat files).
    As far as I know there a no standards in naming conventions for files and folders, just go with what seems logical/practical in your situation.
    Regards, Patrick

Maybe you are looking for