Flat file to Idoc : Last line empty in payload

Hello everyone,
I'm trying to import Flat File from an external partner, and insert it in our SAP System as Idoc.
It works fine, after a small change in the flat file.
In the normal version, I have a last record with value 'OK'.
I have add the close record.lastFielsOptional in the FCC.
But after checking the payload, I have seen that I have at the end the following thing :
<ns:File xlmns:ns="http://world.com/file">
<record>
</record>
<record>
</record>
<record />
</ns:File>
Can someone explain me how to avoid to have this last <record/>, or checking it in mapping ?
Thanks a lot

Hello Greg,
The problem is that the key in the flat file is 3 digit numeric field, and OK is 2 char.
If I try to use the key, I have an error on the last record because we have only 2 char for the key, and when I put the parameter record.lastFiledsOptional : yes, i have no more error on the FCC, but the last record of the payload is empty.
Have you a possibility to avoid this error.
Thanks and regards
JC

Similar Messages

  • IDOC Flat File-- XI-- IDOC

    Hi,
       I have a requirement wherein we have to read the IDOC flat file and post it as IDOC to SAP using XI. I understand we have to use the Flat File Sender adapter and the IDOC Receiver Adapter. On the Sender Side we have to define the Content Conversion to convert the IDOC Flat File to IDOC XML. Writing File Content Conversion for the IDOC Flat File would be very tedious because of the number of fields and fixed structure of the flat file.
      I have don through the following guide Section 3.2 where it talks abt converting IDOC to IDOC XML using reportRSEINB00.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20convert%20between%20idoc%20and%20xml%20in%20xi%203.0.pdf
    I am not clear how to invoke this report in the Flat File Sender adapter. Also is there any other approach.
    Thanks
    Rajeev Gupta

    Hi Rajeev
    You have a flatfile at the sender side so you dnt  have any feasiable option to do other than FCC....FCC is not a tediuos one...if you can provide the strucutrre we will help you out...
    Check out you have a fixedlength file or piple separated one....
    In the functional design how many fields re present and buil the DT,MT MI accoprdingly.....
    you have to just use some conecnt conversion parameters that's it...
    item.fieldSeparator
    item.endSeparator
    item.fieldNames
    here item is your recordset name
    let us know your strucutre
    regards
    Nisar

  • Flat file having multiple header lines , how to separate the same and pushit into my intrnal table

    Hi Guys,
                    I got an issue , My flat file having multiple header lines
    TPS27RPR  MOME                                      THRIFT (SAVING) PLAN SYSTEM                                           Page    2
    09:54 05 JAN 2014                          List of Contributors w/Company Contributions                           Phase DAY Unit TRE
    Company No: xxxxxxxx - xxxxxxxxxxxxx.
                                                                            Employee/       Employee/
    Employee Full Name/                                                       Company         Company                        Allocation
    Number  ID Number                           PS  PN  End Date        Contribution          Profit        Total Balance   Percentage
    some lines of data and again
    TPS27RPR  MOME                                      THRIFT (SAVING) PLAN SYSTEM                                           Page    2
    09:54 05 JAN 2014                          List of Contributors w/Company Contributions                           Phase DAY Unit TRE
    Company No: xxxxxxxx - xxxxxxxxxxxxx.
                                                                            Employee/       Employee/
    Employee Full Name/                                                       Company         Company                        Allocation
    Number  ID Number                           PS  PN  End Date        Contribution          Profit        Total Balance   Percentage
    in this case how could I separate the header lines from the flat file and update the details to my internal table.
    kindly help me on this issue.
    Thanks and regards,
    M.S.Amirtharajvijay.

    Hi Amirthraj,
    If the flat file is static (if the content within it is same for all) then use the offset concept. First get the contents of the flat file into an internal table and later find the field that has to be in final internal table within the line, calculate the offset for the line and get the value into an workarea. Finally modify/append the work area into an internal table. Also wait for other experts answers for any other hassle free way to achieve the requirement.
    With Regards,
    Giriesh M

  • Converting a flat file to IDOC

    Greetings to All,
    I have a requirement where i need to convert an IDOC (flat) file to IDOC.
    the idoc is SHPMNT04.Presently i am trying to implement it using FCC at the sender side as the flat file is fixed length type.
    Can any one suggest me a better method like using XSLT or Java mapping which could make my work smarter as i am Finding it very difficult to count and write the FCC for the IDOC which is have more than 60 segments.
    Any help will be greatly admired.
    Thnaks,
    Anika.

    Hi
    I am still having a doubt if this method will work on real time scenario.I mean i have to pick files
    from an 3rd party FTP location (polling and picking as and when i get a file starting with say
    ABC*.txt).Added to this there will be issue related to the volume of file(1000 per day),will that create
    any performance issues.
    It is now that you are sharing the complete scenario/ problem , just have a glance from your first post at the top & the replies, because its the problem statement that steers the discussion.
    Making the files available for the Report is a seperate task. You have to develop FTP-to-File XI scenario (or regular ftp process to send files across, which normally will not be allowed in XI server), I dont see any other way, if any, I 'assume' that it might complicate the situation.
    Performance - it is not something to do with your scenario alone, but the overall system load, configuration etc. (b.t.w 1000 is normal)
    Can we schedule a job for running the report periodically?
    Yes, scehdule a batch job calling this Report (with necessary variants) with required frequency or exact time (if there is any agreement with sender)
    I have started a POC
    I appreciate that, best way at this moment. you can reverse engineer from the errors to configure your scenario. for any reason,if you think it does not work, you can always stop and/or look for different solution.
    need your help
    - Definitely I will share my thoughts, if time permits
    how will i get the flat file xml(IDOC) in the source side
    do you mean the source structure, you can use the same structure as your target.
    once you are convinced with your solution approach, then it is better to close this thread & start a new one with new issues, for more views & suggestions and better readability.
    @Rajesh - I appreciate your efforts to solve the issue , but the below is not correct & possible, w.r.t this issue
    Here what you need is to do configure File Sender CC with NFS protocol.
    Regards
    Vishnu

  • IDOC to Flat file and Flat file to IDOC

    Hello Experts,
      I have the following requirement in my current project:
    Third Party Sender sends the data in the in the below XML format via HTTP:
    <?xml version="1.0"?>
    <fxEnvelope>
      <header>
        <message>
          <exchangeID></exchangeID>
          <messageID></messageID>
          <subject></subject>
          <payloadType>IDOC</payloadType>
        </message>
        <from>
          <orgID></orgID>
          <locationID></locationID>
          <messageID></messageID>
        </from>
        <to>
          <orgID></orgID>
          <locationID></locationID>
        </to>
      </header>
      <body>
        <Opaque>
          <DataType></DataType>
          <DataStream></DataStream>
        </Opaque>
      </body>
    </fxEnvelope>
    In the above XML, the Tag <DataStream> is a string which contains the IDOC flat file.
    Now, the scenario is HTTP to IDOC, where the sender sends the above XML payload and PI needs to convert <DataStream> to IDOC XML and pass it on to the receiver R/3.
    But the challange i am facing is converting this <DataStream> tag which contains the IDOC flat file to IDOC XML using a Mapping program.Since both adapters are running on ABAP stack i can not go for Adapter Modules available(We are using PI 7.10).
    Looking for some guidance on the same.
    Thanks in advance.
    Cheers,
    Manasa.

    There are 2 options for you
    In either case, you might need a java mapping to convert the DataStream into String. Use a file adpater to write this string to IDOC-File.
    1) Option1: Write the content of DataStream into IDOC-Flatfile.(java mapping) Pick it from PI to convert IDOC-flat file inot IDOC-XML (using std features of PI) & send it to ECC.
    2) Option2: Write the Content of DataStream to IDOC-Flatfile (accessible to ECC system). Configure WE21 to pick the file from a file port.
    If the datastream was IDOC-XML, then it would have been simpler, it will be a direct communcation from PI to ECC (using java mapping & IDOC adapter).
    Regards,
    Siva Maranani

  • IDoc flat file to IDoc

    I am receiving flat file in SFTP Server which need to be posted into SAP (No mapping involved)
    What will be the best approach ?
    1. I tried using IDOCFlatToXmlConvertor (The limitation in the format of source file. The parent and child node relationship should be explicitly mentioned in IDoc flat file which legacy system is not able to do) - Any workarounds ?
    2. I moved the Idoc flat file into SAP application server. Now need to schedule job using program RSEINB00
    3. File Content Conversion
    Any other better solution ? Appreciate your help.
    Thanks and regards,
    Jose Augastine

    For converting Idoc Flat file to idoc xml, ABAP mapping is one of the feasible option.

  • Flat File to IDOC- didn't get data into IDOC

    Hi All,
    Our scenario is Flat File to IDOC....
    working fine... didn't get any errors... IDOC also generated but didn't get any data in that IDOC....
    for details see the attachment...
    Thanks In Advance,
    vishnu.........

    Hi Rajesh,
    I am getting payload in RWB from sender Cc like below:
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns:MT_File xmlns:ns="http://mouritech.com/file2idocsender"> 
    - <MT_File> 
    <Value>1</Value>  
    <Reason>test</Reason>  
    </MT_File>
    </ns:MT_File>
    If i test with this payload in mapping i am getting a pop up with this message and mapping not completed ...
    Could you please let me know what i have to do now?
    Pop Up: 
            The processing instruction target matching "[xX][mM][lL]" is not allowed.
    See error logs for details    

  • Copy one text file to another text file and delete last line

    Hi all wonder if someone can help, i want to be able to copy one text file to another text file and remove the last line of the first text file. So currently i have this method:
    Writer output = null;
             File file = new File("playerData.xml");
             try {
                   output = new BufferedWriter(new FileWriter(file, true));
                   output.write("\t" + "<player>" + "\n");
                   output.write("\t" + "\t" + "<playerName>" + playerName + "</playerName>" + "\n");
                   output.write("\t" + "\t" + "<playerScore>" + pointCount + "</playerScore>" + "\n");
                   output.write("\t" + "\t" + "<playerTime>" + minutes + " minutes " + seconds + " seconds" + "</playerTime>" + "\n");
                   output.write("\t" + "</player>" + "\n");
                   output.write("</indianaTuxPlayer>" + "\n");
                  output.close();
                  System.out.println("Player data saved!");
             catch (IOException e) {
                   e.printStackTrace();
              }However each time the method is run i get the "</indianaTuxPlayer>" line repeated, now when i come to read this in as a java file i get errors becuase its not well formed. So my idea is to copy the original file, remove the last line of that file, so the </indianaTuxPlayer> line and then add this to a new file with the next data saved in it. So i would end up with something like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <indianaTuxPlayers>
         <player>
              <playerName>Default Player</playerName>
              <playerScore>0</playerScore>
              <playerTime>null minutes null seconds</playerTime>
         </player>
         <player>
              <playerName>Default Player</playerName>
              <playerScore>0</playerScore>
              <playerTime>null minutes null seconds</playerTime>
         </player>
         <player>
              <playerName>Default Player</playerName>
              <playerScore>0</playerScore>
              <playerTime>null minutes null seconds</playerTime>
         </player>
    </indianaTuxPlayers>
    However after all day searching the internet and trying ways, i have been unable to get anything working, could anyone give me a hand please?

    I would go the XML route too, but for fun, open a file as a BufferedWriter and do this:
    void copyAllButLastLine(File src, BufferedWriter tgt) throws IOException {
        BufferedReader in = new BufferedReader(new FileReader(src));
        try {
            String previous= in.readLine();
            for (String current = null; (current = in.readLine()) != null; previous=current) {
                tgt.write(previous);
                tgt.newLine();
        } finally {
            in.close();
    }

  • Sender File Adapter Ignore Last Line

    Hi All,
    Like in Sender File Adapter configuration like we have Document Offset to specify the number of starting lines to be ignored,
    Like the same way can we ignore the last line of a text file .
    Regards,
    Rahul

    Rahul,
    ><i>I somehow wait for your answer,</i>
    Is that a compliment
    I guess there is no standard way to ignore the last line . Like you pointed out, read the line and ignore it in the mapping!
    ><i>btw ..
    suppose in a flat file..
    i just want to read the 4th line??
    is there any way i can do this?</i>
    Again no straight forward way to do this. You can use KeyFields etc , but there is no direct way to do this and every solution would depend on the exact requirements!
    Regards
    Bhavesh
    PS Are the alerts issues resolved?

  • Flat file to idoc mapping issue

    Hi Gurus,
    i had a flat file format in sender side as below:
    H_ID     TYP_CODE    line_elemet      Quantity
    5896  STANDARD                       1.transmitter    1
    5896                  STANDARD       2.xxxxxxxxx           1
    5896                   STANDARD      3.yyyyyyyyy  2
    6895                  STANDARD       1.aaaaaaaaa        1
    9436                  STANDARD       1.bbbbbbbbb          4
    9436                  STANDARD       2.ggggggggg          3
    The above file need to be send to an Idoc.
    for which same header_ID values should create only one header segment, under that many a line segments should create as many line items appear on that header_id value.
    Here my query is how to suppress the repetetive header values to create onlyone header segment. And how to create as many line_item segments as the number of line items appear.
    points obvoius for the response
    Thanks in advance,
    Sekhar.

    About map problem I suggest youn to see the following link that are really helpful to improve knowledge about mapping:
    /people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    I suggest you to see the following link to learn more about mapping:
    Mapping functionality in XI
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
    SAP Exchange Infrastructure - Graphical_Mapping
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6658bd90-0201-0010-fbb6-afe25fb398d3
    SAP Exchange Infrastructure - Graphical Mapping Exercise
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/fd5ebd90-0201-0010-d697-91374d5b5190
    SAP Exchange Infrastructure - Graphical Mapping - Advanced
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e55f9548dd
    SAP Exchange Infrastructure: Mapping Patterns - Understand Context Handling in Message Mapping - Webinar Powerpoint
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f59730fa-0901-0010-df97-c12f071f7d3b
    SAP NetWeaver Exchange Infrastructure Mapping Troubleshooting - Webinar Powerpoint
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e01e9400-9e81-2910-20a5-a862945a5e98
    Mapping Lookups a RFC API
    Mapping lookups - RFC API
    XI 3.0 New Mapping Features
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8a57d190-0201-0010-9e87-d8f327e1dba7
    I hope these links will be usefull.
    Regards,
    Salvatore

  • File content conversion - flat file to Idoc error

    Dear Experts,
    I have a situation where im using FCC in the sender adapter The data is in flat file with multiple fields separated by space .
    (*header444456    line4445758 header343434 line445687*) sample falt file data . should be divided as below
    header - 44456 , 343434
    *line    -  44457578 , 445687
    So i want to read the header items and pass it into header data of the IDoc and line items into line item data of the Idoc . And the header items and fields items are mixed up in the flat file . How do i read from the position 20 to 26 , 37 to 56 intermittently .And im not using any key field name . as the whole data is in one line . Any solution would be of great help .
    Thanks in advance
    Ganga
    Edited by: N.Ganga on Jan 28, 2012 3:30 PM
    Edited by: N.Ganga on Jan 28, 2012 3:30 PM

    Dear Grzegorz ,
    Yes i totally agree with you it can be separated by comma . But it is as below
    Header       - (once ).............................................. Flat file example :
         Field 1    -
    >order    line no 1   plant        material 1  code 1  quantity 1 
          .......................................................................order    line no 2   plant        material 2  code 2  quantity 2
         Field 2  (plant vlaue shuld come........................................................|
    Line          -  repeats (0-unbounded)                                      |                                     |                             |
       field 1 (line no 1)----
    |                                     |                             |
       field 2(material1)----
    |                             |
       field 3 (quant 1)----
    |
       field 1 (line no 2)----
    |                                     |                             |
       field 2(material2)----
    |                             |
       field 3 (quant 2)----
    |
    So i need to read the data intermittently and map them in the line items ignoring the order and plant data in every line apart from the first line. The order and plant remains the same in the flat file only line items keep changing .
    Hope my question is clear .
    Regards
    Ganga

  • Flat File to IDOC

    Hi,
    I have to post the data from Flat File to SAP using IDOC. Please help me out with all the posibilities.
    Regards,
    Kiran.L

    Hi,
    Step 1 Read flate file into internal table.
    step 2  Follow below program to create a idoc through Z program,
    REPORT ZOUTBD_IDOC_TEMPLATE NO STANDARD PAGE HEADING.
    *************************START OF DECLARATIONS**********************
    *eject
    Table Declarations
      TABLES:  ZIDOC_TAB_EX1,  "Equivalent to an SAP Master table.
               ZIDOC_TAB_EX2.  "Equivalent to an SAP Master table.
    *eject
    Types Declarations with data work Areas / Internal tables.
      TYPES: begin of ty_idoc_par,
               werks      LIKE   ZIDOC_TAB_EX1-werks,
               c_rec_ind  LIKE   ZIDOC_TAB_EX1-c_rec_ind,
               name1      LIKE   ZIDOC_TAB_EX1-name1,
               name2      LIKE   ZIDOC_TAB_EX1-name2,
               stras      LIKE   ZIDOC_TAB_EX1-stras,
               pfach      LIKE   ZIDOC_TAB_EX1-pfach,
               ort01      LIKE   ZIDOC_TAB_EX1-ort01,
               counc      LIKE   ZIDOC_TAB_EX1-counc,
               pstlz      LIKE   ZIDOC_TAB_EX1-pstlz,
               telf1      LIKE   ZIDOC_TAB_EX1-telf1,
               regio      LIKE   ZIDOC_TAB_EX1-regio,
            end of ty_idoc_par.
      TYPES: begin of ty_idoc_chd,
               werks     LIKE    ZIDOC_TAB_EX2-werks,
               eroed     LIKE    ZIDOC_TAB_EX2-eroed,
               schld     LIKE    ZIDOC_TAB_EX2-schld,
             end of ty_idoc_chd.
      TYPES: begin of ty_message,
               OBJNR      LIKE    MCMAILOBJ-OBJNR,
               OBJLEVEL   LIKE    MCMAILOBJ-OBJLEVEL,
               OBJTYPE    LIKE    MCMAILOBJ-OBJTYPE,
               OBJNAM     LIKE    MCMAILOBJ-OBJNAM,
               OBJDES     LIKE    MCMAILOBJ-OBJDES,
               OBJLINE    LIKE    MCMAILOBJ-OBJLINE,
             end of ty_message.
      TYPES: begin of ty_mess_output,
               v_err_out(1000)     TYPE  C,
               v_err_out_2(1000)   TYPE  C,
             end of ty_mess_output.
    *eject
    Data Declarations
    Essential declarations for populating the IDOC:
      DATA:  begin of itab_idoc_data occurs 0.
               include structure edidd.                    "Data record.
      DATA:  end of itab_idoc_data.
      DATA:  begin of itab_comm_idoc_control occurs 0.
               include structure edidc.                    "Control record.
      DATA:  end of itab_comm_idoc_control.
    Internal Table for Mail Recipient.
      DATA: BEGIN OF ITAB_RECIPIENT OCCURS 0.
              INCLUDE STRUCTURE  ZINT_RECEIVER.
      DATA: END OF ITAB_RECIPIENT.
    Declare an internal table for Parent segment.
      DATA:  itab_idoc_par TYPE ty_idoc_par occurs 0 with header line.
    Declare an internal table for child segment.
      DATA:  itab_idoc_chd TYPE ty_idoc_chd occurs 0 with header line.
    Declare variables for Parent and Child Segments
      DATA:  i_z1parseg  LIKE   z1parseg,     "PARENT SEGMENT DATA.
             i_z1child   LIKE   z1child.      "CHILD  SEGMENT DATA.
    Internal table to process function to send error mails.
      DATA: itab_err_mess  TYPE   ty_message     occurs 0 with header line.
      DATA: itab_mess_output TYPE ty_mess_output occurs 0 with header line.
    Variables for sending error mails.
      DATA: objnr                 LIKE   SOOD1-ACNAM, "Name of object.
            V_ERR_DESC_1          LIKE   SOOD1-OBJDES,
                        "Error message on pop up box after program executes.
            V_OBJLINE             LIKE   ITAB_ERR_MESS-OBJLINE,
            V_MESSAGE_1(60)       TYPE   C,
            V_MESSAGE_2(120)      TYPE   C,
            V_MESSAGE_3(75)       TYPE   C,
            V_MESSAGE_4(150)      TYPE   C,
            V_MESSAGE_5(150)      TYPE   C,
            V_MESSAGE_6(150)      TYPE   C,
            V_RDATE(10)           TYPE   C,
            V_RTIME(8)            TYPE   C,
            V_RECIPIENT(12)       TYPE   C,
            v_itab_idoc_par_lines,
            v_itab_idoc_chd_lines,
            child_counter         TYPE   C,
            parent_counter        TYPE   C,
            idoc_counter          TYPE   C,
            v_mess_output(1000)   TYPE   C,
            v_error_detail(88)    TYPE   C,
            v_final_detail(1000)  TYPE   C,
            V_DUMMY               TYPE   C.   "Dummy File Indicator.
    *eject.
    Constant Declarations
      CONSTANTS:
    BASIC IDOC TYPE AS CREATED FROM TRANSACTION CODE we30.
      C_Segment_type1(8)         TYPE C  VALUE  'Z1IDOCOB',
      C_mestyp(11)               TYPE C  VALUE  'ZSAMPLEMESS',
      C_SENDMODE                 TYPE C  VALUE  'B',   "Sending Mode
      C_EXPRESS                  TYPE C  VALUE  'E',
      C_LANGUAGE                 LIKE sy-langu   VALUE  'E'.
    **********************END OF DECLARATIONS*****************************
    *eject
    Initialisation
    INITIALIZATION.
    Assign the initial settings for sending error mails.
      v_err_desc_1   = 'Message from processing ZOUTBD_IDOC_TEMPLATE.'.
                       "Error message in pop up box after program executes.
      v_error_detail = 'A complete set of detail records is not held for'.
      idoc_counter   = '0'.   "No of Idocs processed.
      parent_counter = '0'.   "No of parent segments selected.
      child_counter  = '0'.   "No of child segments selected.
    *************************BEGIN OF PROCESSING**************************
    Call form to initialize standard structures
      PERFORM clear_Structures.
    Fill report to tell user when the interface was run.
      PERFORM fill_mail_report.
    Call function to populate parent structure:
      PERFORM select_parent_data.
    Call function to populate child structure:
      PERFORM select_child_data.
    Inform the user of the number of records that were selected.
      PERFORM fill_record_selected.
    Loop at contents of parent structure:
      LOOP AT itab_idoc_par.
    Populate the control structure with the partner and port sending and
    receiving details.
       REFRESH itab_idoc_data.
       PERFORM populate_Control_structure USING  c_mestyp
                                                 c_SEGMENT_type1.
       PERFORM transfer_Parent_data_to_seg.
    Loop at the children structure - retrieving the children segments
    for this parent.
       LOOP AT itab_idoc_chd WHERE WERKS = itab_idoc_par-WERKS.
    Call form to transfer data to child Idoc.
       PERFORM transfer_Child_data_to_seg.
    ENDLOOP.      "Stop looping through the children structure.
    Call SAP function to transfer data.
       PERFORM master_idoc_distribute.
    Form to close logical unit of work.
       PERFORM COMMIT_WORK.
    ENDLOOP.   " Stop looping through the parent structure.
    Fill the number of articles processed for online mail.
       PERFORM fill_process_record.
    Write to online mail report on data interface has processed.
       PERFORM FILL_ERR_MESSAGE USING  V_OBJLINE
                                       V_MESSAGE_1
                                       V_MESSAGE_2
                                       V_MESSAGE_3
                                       V_MESSAGE_4
                                       V_MESSAGE_5
                                       V_MESSAGE_6.
    Send online mail with contents of message fields.
       PERFORM SEND_MAIL.

  • Extract to flat file or IDOC

    Does anybody know how to use BW Datasources in R3 (found in transaction RSA5) to extract data to a flat file for the purpose of loading a non-SAP data warehouse?
    The export file may be an IDoc.
    I tried RSA3, but it seems you have to specify a "target system" which is a BW system. I simply want to use the BW extractors to extract to a file.
    Thanks - I will reward points.

    Hi,
    If it is function module based extractor then you can use the copy/modify the code (copy in case you are authorized to change it). Now at the end of the extractor write an ABAP code to download the data into a flatfile using GUI_DOWNLOAD or any suitable function module. You can use this extractor fn module in an ABAP program and schedule it everyday to create the flatfile.
    If it view/table base extractor then use that in an ABAP program to create the flatfile.
    Revert if you need more info.
    You can find the type of extractor in RSO2 and also in the tabel ROOSOURCE.
    Bye
    Dinesh
    Message was edited by: Dinesh Lalchand

  • Mapping FLAT File to Idoc

    Hi,
    I have to implement a flatfile --> XI ---> IDOC scenario and I have a question about the mapping.
    Suppose I have a Flat Fiel as following with the first 2columns as key:
    100991;001;text1;posting date
    100991;002;text2;posting date
    100992;001;text4;posting date
    100992;002;text6;posting date
    I have to pass this items to a IDOC strucutured  with header and positions.
    By mapping how can I group  key data to pass to single Idoc?
    Thanks
    marco

    Hi ,
    I have done it with ORDERS IDOC Structure .
    Since the source is a flat file you could take a simple structure with row and all the fields following it ( say filed1 , field2, field3).
    Take a bottom up approach for the child :
    Change the context of all the individual fields to the root then apply split by value on field3 ( this introduces context changes )
    Then format its parents Queue (Field2) based on Field3 Queue for this use the function Format By Example .
    Use the resulting queue  as one of the argument and Field1 to generate the link .
    Using Graphical this requirement is achievable . How ever it is upto your ease to choose which way you want to do it .
    Thanks & Regards
    Kavitha

  • Unsorted Flat File into IDoc with multiple use of nodes

    Hi Experts!
    I am facing a little problem. I have a source flat file for a classification where some fields appear several times.
    My source flat file looks like this:
    item1; field1a
    item2; fieldA
    item3; fieldxa
    item1; field1b
    as you can see the item1 exists twice (further appearances are also possible).
    Now i have to map the flat file into an IDoc structure
    My target IDoc looks like this
    Header
    -- node1
    attribute1
    -- node2
    the "field1a" and "field1b" has to be mapped into the "attribute1" in "node1". "node1" has to be duplicated for each time an "item1" appears (.. and if item2, item3 etc. appears twice, three ... four times...).
    So how can i reach it that the node1 will be duplicated automatically when an item appears twice or more times? I know that it could be possible to work with "SplitByValue"... but for this i need all item1 in an straight order.... but i dont have them in a correct order.
    I am looking forward to your suggestions.
    Thank you in advance.
    Udo

    Complex sorting is not or not easy possible with the grafical mapping tool.
    Use a sequence mapping. The first mapping is a simple XSLT which does the sort. The second mapping works as usual.
    I have an example XSLT which I used for a different purpose:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="/">
        <ORDERLIST>
          <xsl:for-each select="ORDERLIST/ITEM">
            <xsl:sort select="ID"/>
            <xsl:copy-of select="."/>
          </xsl:for-each>
        </ORDERLIST>
      </xsl:template>
    </xsl:stylesheet>
    Regards
    Stefan

Maybe you are looking for

  • Java.sql.SQLException: ORA-00979: not a GROUP BY expression in a query

    I am getting java.sql.SQLException: ORA-00979: not a GROUP BY expression when I run select count(*) from ( select count(rec_no) AS REC_NO_NUM,created_by AS CREATED_BY,to_char(created_dt,'Mon YYYY') AS CREATED_DT,to_date(to_char(created_dt,'Mon YYYY')

  • How do I set up my MacBook Pro to view on my HDTV?

    I connected my TV to my MacBook Pro with the hdmi cable and changed the display to mirror and changed the source on my TV to PC. What am I missing? Thanks!

  • Advice wanted: 17" 2006 iMac or current 1.83GHz Mini?

    I'm thinking of either buying a 2006 17" iMac or a current issue 1.83GHz mini. They'd both be right around the same price when all is said and done (total price outlay is an important factor here), and apple-history dot com shows that they're almost

  • Define default JVM plug-in

    After an automatic update of JVM, the plug-in is now JAVA 1.6. I would like to define JAVA 1.5 as default plug-in and I didn't find the option in the Java Control Panel. I made searchs on Internet without find a right solution (MIME type are not the

  • Test driven development with JSF possible?

    Hi, I got two questions: Is it possible to just make use of the HTML generation part of JSF, meaning creating the component tree and somehow triggering the generation of HTML for that view, without using a custom view handler? Second, is it possible