Multiple IDOCs from one Flat file

HI Gurus,
Sender file is of such format
Header1,Item1 details
Header1,Item2 Details
Header2, Item1 Details
Header2,item2 Details
Header3, Item1 Details
I need to map this file format to IDOC strucutre, In Header there is a filed which is the Key value to identify the change in header.
Eg: Order Number is the field in the following file which identifies the change in header: First three fields are header details and following are the item details:
ABC,ON1,22,Item1,XX
ABC,ON1,33,Item2,FF
ABC,ON2,44,Item1,MM
ABC,ON3,66,Item1,LL
How would be the Data type strcuture to capture this type of falt file strcuture and FCC parameters?
I need to send a single IDOC per one header with multiple Items. is it possible to achieve?
Thanks
Rajeev

Hi Satish,
Do we need to do some configuration  to produce 3 IDOCs from the below strcuture?
ABC,ON1,22,Item1,XX
ABC,ON1,33,Item2,FF
ABC,ON2,44,Item1,MM
ABC,ON3,66,Item1,LL
From the above structure 3 IDOCs should be generated as below:
1st IDOC as
ABC,ON1 (Header Details)
22,Item1,XX (Item1 Details)
33,Item2,FF  (Item2 Details)
2nd IDOC as
ABC,ON2 (Header Details)
44,Item1,MM  (Item1 Details)
and 3rd IDOC as
ABC,ON3 (Header Details)
66,Item1,LL  (Item1 Details)
Do following Data type for the above file structure is valid? or I can use one flat DT?
Record
Header(1..Unbounded)
---F1 (Field 1)
---ON (Key Field Order Number)
Item Details(1..Unbounded)
---F1 (Field1)
---F2
---F3
If the above DT is correct then how would be the FCC parameters?
Thanks
Rajeev

Similar Messages

  • Multiple idocs from single flat file

    Hi All
    I want to send data from a flat file to SAP(file to idoc)
    My flat file structure is
    id,name,number,city
    2,R1,234,SD
    2,R2,457,MD
    3,R4,789,HG
    3,R6,235.HG
    The Field 'id' will change..after  every change in 'id' ,seperate idoc should be created.
    I have checked the following thread.
    Re: Content conversion for seperate idoc
    In the above thread ,it is asked to map v.no with remove context and use SPLIT BY VALUE on value change then do the mapping accordingly ,you can create 3 idocs for the same.
    I'm confused about how to do these mappings.
    Please explain the mapping in detail.
    Please help
    Regards
    Reema

    if  your source data type is like
    MT_Source
        Record           0-unbounded
           id                    ----1
           name              -----1
           number           -----1
           city               -------1
    then in the sender file communication channel you have to specify  file content conversion parameters as
    Parameter name               parametervalue
    Document Name                 MT_Source
    Recordset Structure           Record,*
    choose + to add more parameters
    Name                                  Value
    Record.fieldSeparator                      ,
    Record.fieldNames                        id,name,number,city
    Record.endSeparator                      'nl'
    then do the maping
    as
    id ---->removeContext---->SplitByValue(Value change)---->Target Idoc
    map according to your requirement for other fields

  • Export multiple tables into one flat file

    I have data in multiple tables on a processing database that I need to move up to a production database. I want to export the data into a flat file, ftp it to the production server and have another job pick up the file and process it. I am looking for
    design suggestions on how to get multiple tables into one flat file using SSIS?
    Thank You.

    Hey,
    Without a bit more detail, as per Russels response, its difficult to give an exact recommendation.
    Essentially, you would first add a data flow task to your control flow.  Create a source per table, then direct the output of each into an union all task.  The output from the union all task would then be directed to a flat file destination.
    Within the union all task you can map the various input columns into the appropriate outputs.
    If the sources are different, it would probably be easiest to add a derived column task in-between the source and the union all, adding columns as appropriate and setting a default value that can be easily identified later (again depending on your requirements).
    Hope that helps,
    Jamie

  • BAPI_PO_CREATE1 not able to create PO's for multiple rows from the flat fil

    Hi
    i am uploading PO's from a flat file into SAP using the BAPI_PO_CREATE1. Everything works fine if the flat file hast only one record.
    if the flat file has more than one record then while loading the second record the BAPI returns a error message. I am calling the BAPI in a loop.
    The strange thing is that if i load the second record individually the program is able to create the PO. So only when i have multiple records in the flat file i am unable to load the PO into SAP. I debugged and checked all the internal tables passed to the BAPI. All seems to have the data correctly but still the BAPI fails.
    any idea where i am going wrong?
    the code looks something like this.
    LOOP AT HEADER_ITAB.
       PERFORM FILL_HEADER_RECORDS.
    LOOP AT ITEM_ITAB WHERE EBELN eq HEADER_ITAB-EBELN.
         PERFORM FILL_ITEM_RECORDS.
    ENDLOOP.
      PERFORM CERATE_PO_VIA_BAPI.
    ENDLOOP.

    What is the error message. Are you trying something like this:
        LOOP AT T_DATA1.
          AT NEW LIFNR.
            READ TABLE T_DATA1 INDEX SY-TABIX.
            PERFORM INIT_TABLES.
            PERFORM FILL_DATA.
    --Call the BAPI to create PO
            PERFORM CREATE_PO.
          ENDAT.
        ENDLOOP.
    FORM CREATE_PO .
      CALL FUNCTION 'BAPI_PO_CREATE1'
        EXPORTING
          POHEADER                     =   POHEADER
          POHEADERX                    =   POHEADERX
        POADDRVENDOR                 =
        TESTRUN                      =
        MEMORY_UNCOMPLETE            =
        MEMORY_COMPLETE              =
        POEXPIMPHEADER               =
        POEXPIMPHEADERX              =
        VERSIONS                     =
        NO_MESSAGING                 =
        NO_MESSAGE_REQ               =
        NO_AUTHORITY                 =
        NO_PRICE_FROM_PO             =
       IMPORTING
         EXPPURCHASEORDER             =  EXPPURCHASEORDER
         EXPHEADER                    =  EXPHEADER
         EXPPOEXPIMPHEADER            =  EXPPOEXPIMPHEADER
       TABLES
         RETURN                       =  RETURN
         POITEM                       =  POITEM
         POITEMX                      =  POITEMX
        POADDRDELIVERY               =
         POSCHEDULE                   =  POSCHEDULE
         POSCHEDULEX                  =  POSCHEDULEX
         POACCOUNT                    =  POACCOUNT
        POACCOUNTPROFITSEGMENT       =
         POACCOUNTX                   =  POACCOUNTX
        POCONDHEADER                 =
        POCONDHEADERX                =
         POCOND                       =  POCOND
         POCONDX                      =  POCONDX
        POLIMITS                     =
        POCONTRACTLIMITS             =
        POSERVICES                   =
        POSRVACCESSVALUES            =
        POSERVICESTEXT               =
        EXTENSIONIN                  =
        EXTENSIONOUT                 =
        POEXPIMPITEM                 =
        POEXPIMPITEMX                =
        POTEXTHEADER                 =
          POTEXTITEM                   = POTEXTITEM
        ALLVERSIONS                  =
         POPARTNER                    =  POPARTNER
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT   = 'X'
        IMPORTING
          RETURN = RETURN1.
      DATA: L_NAME TYPE LFA1-NAME1.
      CLEAR L_NAME.
      SELECT SINGLE NAME1
               FROM  LFA1
               INTO L_NAME
               WHERE LIFNR = POHEADER-VENDOR.
      LOOP AT RETURN.
        WRITE : / RETURN-TYPE,
                  RETURN-ID,
                  RETURN-MESSAGE.
        WRITE : '--> For vendor:',
                 POHEADER-VENDOR,
                 L_NAME.
      ENDLOOP.
    ENDFORM.                    " CREATE_PO

  • Creation of Inbound IDOC from a flat file.

    Hi all,
    I hav to create Purchse Order using inbound IDOC in which I hav to take data from a .xls or any flat file.
    Can any one help me with this. i.e wat r the steps involed to do so.
    Regards.
    Rahul

    Hello,
    Why do u want to create a Idoc for creating PO from flat file - you can simply use BAPI. Ok if you want to create PO only using Idoc.
    I think message type is ACC_PURCHASE_ORDER0.
    I just made one sample program to you how to create a PO with Idoc method. Here i am doing for Material Master Creation. Let me know if want any clarification.
    ********Poorna********
    TABLES : MARA, MAKT, EDP13.
    DATA : I_EDIDC LIKE EDIDC OCCURS 0 WITH HEADER LINE,
          I_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.
    PARAMETERS : P_MATNR LIKE MARA-MATNR.
    START-OF-SELECTION.
      REFRESH I_EDIDC.
      SELECT * FROM EDP13 WHERE MESTYP = 'ZMATMASTER'.
        MOVE-CORRESPONDING EDP13 TO I_EDIDC.
        I_EDIDC-IDOCTP = EDP13-IDOCTYP.
        APPEND I_EDIDC.
      ENDSELECT.
      READ TABLE I_EDIDC INDEX 1.
      I_EDIDD-SEGNAM = 'ZMATMASTER'.
      SELECT SINGLE * FROM MARA WHERE MATNR = P_MATNR.
      SELECT SINGLE * FROM MAKT WHERE MATNR = P_MATNR
                                  AND SPRAS = SY-LANGU.
      I_EDIDD-SDATA+0(18) = MARA-MATNR.
      I_EDIDD-SDATA+18(40) = MAKT-MAKTX.
      I_EDIDD-SDATA+58(4)  = MARA-MTART.
      I_EDIDD-SDATA+62(1)  = MARA-MBRSH.
      I_EDIDD-SDATA+63(3)  = MARA-MEINS.
      APPEND I_EDIDD.
      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
        EXPORTING
          master_idoc_control                  = I_EDIDC
       OBJ_TYPE                            = ''
       CHNUM                                = ''
        tables
          communication_idoc_control          = I_EDIDC
          master_idoc_data                    = I_EDIDD
    EXCEPTIONS
       ERROR_IN_IDOC_CONTROL                = 1
       ERROR_WRITING_IDOC_STATUS            = 2
       ERROR_IN_IDOC_DATA                  = 3
       SENDING_LOGICAL_SYSTEM_UNKNOWN      = 4
       OTHERS                              = 5
      COMMIT WORK.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • Loading multiple tables from one xml-file

    I've got one xml-file containing information which should be loaded into multiple database tables. How can I do that?

    Please use XSLT to tranform to XML file with XSU recognized format and separated for different table input.
    You may refer to Example in book "Building Oracle XML Applications".
    null

  • Create two identical idocs from one input file with BPM

    Hello all .
    My issue is the following.
    I have a scenario where an input file is mapped to an IDOC .
    The problem is that i need to create a second - almost identical - mapping to the same IDOC type and when the input file is receive both of them should be sent .
    I suppose that BPM is needed for this scenario, but are there any examples or tips i should follow?
    Thank you all in advance .

    Rucinski and Sarvesh, thank you both for your answers , they are very helpful.
    I have started trying Rucinski's method, because I would better avoid redoing the mapping on the second IDOC (it is pretty hard and critical) . But I have a problem.
    When i run the senario, the system replies (for the second IDOC)
    "Unable to interpret IDoc interface NEW_IDOC_MI"
    The reason for this is that in the Interface Determination i have two entries for the inbound interface,
    Orders.orders05 and
    NEW_IDOC_MI,
    which is wrong. I should be using the original  Orders.orders05. But this can't be done, because in tha case the Interface Determination, requests a Condition to be entered. Any suggestions on this ?
    Sarvesh, is there any way to duplicate the IDOC, keeping the mapping that is allready done ?

  • Possible to move multiple layers from one Illustrator file to another?

    I have 2 large illustrator files (lets say version 1 and version 2). If I have 40 layers on version 2 that I want to send/add to version 1, is this possible (without copy/pasting in place each individual layer?)
    thanks

    in the layers panel flyout menu: make sure "paste remembers layers" is checked. Select  the artwork, copy paste in new document. It will recreate the layer structure as prev doc.
    G

  • How to genereate multiple IDOCs from multiple rows in a single flat file

    HI,
    I am working on a scenario where I need to genereate a IDOC per one row in a flat file.
    I created DT of following strcuture:
    DT_TYPE
    --DETAILS -
    0..Unbound
    F1------0..Unbound
    F2------0..Unbound
    F3------0..Unbound
    IDOC is
    ZIDOC
    IDOC----1..1
    -BEGIN-Required
    -SEGMENT1---1..1
    -SEGEMENT2-1..1
    -SEGMENT3-1..999
    To create multiple IDOCs if there are multiple rows in a flat file in MM i choosed occurances as 0..unbound in Signiture tab
    Source structure:
    Messages------1...1
    -Message1--1....1
    DT_TYPE------0..Unbound
    DETAILS -
    0..Unbound
    F1------0..Unbound
    F2------0..Unbound
    F3------0..Unbound
    Target Strcuture:
    Messages----1....1
    -Message--1....1
    ZIDOC----1....1
    IDOC------1..1
    BEGIN---Required
    SEGMENT1-----1..1
    SEGEMENT2---1..1
    SEGMENT3---1..999
    I am unable to generate two IDOCs if there are two rows:
    Am I missing some thing?
    Thanks
    Rajeev

    HI,
    I am working on a scenario where I need to genereate a IDOC per one row in a flat file.
    I created DT of following strcuture:
    DT_TYPE
    --DETAILS -
    0..Unbound
    F1------0..Unbound
    F2------0..Unbound
    F3------0..Unbound
    IDOC is
    ZIDOC
    IDOC----1..1
    -BEGIN-Required
    -SEGMENT1---1..1
    -SEGEMENT2-1..1
    -SEGMENT3-1..999
    To create multiple IDOCs if there are multiple rows in a flat file in MM i choosed occurances as 0..unbound in Signiture tab
    Source structure:
    Messages------1...1
    -Message1--1....1
    DT_TYPE------0..Unbound
    DETAILS -
    0..Unbound
    F1------0..Unbound
    F2------0..Unbound
    F3------0..Unbound
    Target Strcuture:
    Messages----1....1
    -Message--1....1
    ZIDOC----0....unbound
    IDOC------1..1
    BEGIN---Required
    SEGMENT1-----1..1
    SEGEMENT2---1..1
    SEGMENT3---1..999
    I am unable to generate two IDOCs if there are two rows:
    Am I missing some thing?
    It isnt possible with out BPM?
    Thanks
    Rajeev

  • Problems with multiple idocs in one file ( Inbound file )

    HI,
    Thanks in Advance for your suggestions.. Highly appreciated.
    We have problems with multiple IDocs in one file.
    We are using XIB ( Amtrix ) as Middleware to receive the files.
    Curretenly When the file contains one IDoc then there is no problem. IDoc is created and everything is ok.
    If file contains two IDocs ( for example two messages ORDERS and DELVERY ) then it is creating two IDocs but both IDocs contains ORDERS plus DELIVERY segements information. That is the problem. Some how SAP unable to differentiate the IDocs in the file.. But it knows that how many idocs are there in the file..because it is creating exact number of idocs.
    We are using TRFC port ... Do I need to change it to File port..
    When we have more than one idoc do we need set any parameter in the file ...

    Thanks for the swift response. Always ideas are useful.
    As of now , Middleware cannot split the file.
    Thing is SAP is creating two Idocs with different message types. Problem is First IDoc contains ORDERS message type but also DELIVERY segments as well. Second IDoc with DELIVERY message tyoe but ORDERS segments as well... This is the problem... I think we are missing some field activation in file for EDIDC record.
    As far as I know file port supports the number of IDocs in one file.. Hope TRFC port also supports that

  • Multi-Mapping without BPM (Multiples IDoc To one EDI output?)

    Hi all,
    We are currently working for a client that want us to create, based on a multiple IDoc (an idoc that contains data of more than one idoc) only one output
    Meaning that we have to do a mapping that based in this multiple input generates only one output that cointains all that data in only one flat file
    example:
    Idoc: PERX2002.PAYTEXT generates an EDI 820 with this structure:
    LIST
    /S_ISA (first input)
    /S_ISA (second input)
    At this moment we tried to use "Collect IDoc" option in SAP, and as seen in other blogs we changed the ocurrency of the message mapping to "0.unbounded", but when we release several idocs (WE14) we only get multiples output files (3 idoc collected and released give us 3 different edi files) instead only one edi file with all the data gathered together as ISA segments
    In this required process possible???
    Thanks in advance

    As you can see in the following pics..
    http://img201.imageshack.us/img201/8352/process1xz1.jpg
    http://img244.imageshack.us/img244/4954/processvc9.jpg
    i already made those changes, the multi-mapping is set, and also the option for collecting the IDocs and the "enhanced" option in the Integration Directory, but when i release all the idocs i still get multiple outputs (2 files), instead one file with all the gathered data
    Could someone tell me if  i'm missing some step?
    Thanks for your time
    Edited by: Alexis Alanis on Jan 7, 2008 7:24 PM

  • What are the advantages of idoc compare to flat file. how data is secure

    what are the advantages of idoc compare to flat file. how data is secure in idocs compare to flat file

    Hi Ramana,
    In simple words, Main advantage with idoc over flat file is security....
    I will explain you some scenario here U got a flat file with all the data...Now u r having the flat file if you want u can modify the data in it, or somehow any one can modify the data in it  if they were able to access this file. That means u maintained the file in the presentation server
    One level of higher security to the above level is maintaining the flat file in application server, at point also even though lot of people r not having the access to that file, super user who is  having  the access may modify the data or delete the data from it rite....
    so in both of those levels u don't have 100% security...
    So there come to the picture of idocs, Idocs simply data carriers, those r generated by a program but not manually...data will be divided into number of segments based upon ur program. So manually its not so easy to modify the data in these idocs. If any changes to be made in the data then u have to modify the data in the application and then u have to update the idoc or you have to generate the new idoc with that corresponding data. so in this case not even super user can manipulate the data directly in the idoc....
    I think u got my point what I mean to say.....
    If you find it useful mark the points
    ~~Guduri

  • Data from a Flat file int a Cube

    Hi experts!
    Just a quick one, could we load data from a flat file directly to an infocube?
    Or we woud need to create a ODS to load that from the flat file there and later on form the ODS to the cube?
    Thanks you very much for your time!!

    Hi,
    You can directly load the flat data into the info cube. This should not be a problem.
    Create a flat file datasource according to the structure of the flat file. Create Transformations and DTP to the Cube.
    Load the flat file data into the PSA and then DTP the request into the cube.
    If the flat file load is a full load and one time load and data has to be deleted and loaded on the next load then above approach is fine.
    But if your load is every day load and delta then it would be appropriate to have a DSO in between the data flow.
    Hope it helps.

  • Uploading Data from a Flat File

    Hi
    I am trying to Upload data from a Flat File to the MDS. I have a few questions on the Process.
    a) XI would be the Interface, and one end would be a file adapter with the Flat File format. On the other end, which Interface should I use - ABA Business Partner In or MDM Business Partner In. I do not understand the differences between them and where should which one be used?
    B) At the moment,I want to map the data to standard Object type, Business Partner  BUS1006. This also has a staging area already defined in the System. Can I view the data which is imported into the Staging area ? How so ?
    C) The struture (or data) that I wish to upload has few fields, and does not map to the BP structure easily. In such a scenario does it make sense to
    Create a new Object type
    (ii) Create a new Business Partner type with the appropriate fields only ..
    What I need to know is if either of these options is feasible and what are the pros & cons of doing this, in terms of effort, skillset & interaction with SAP Development ?
    Kindly do reply if you have any answers to these questions.
    Regards,
    Gaurav

    Hi Markus,
    Thanks for your inputs.
    I have tried uploading some dats from a Flat file to the Business Partner Onject type, BUS1006. I initially got some ABAP Parsing errors on the MDM side, but after correcting that, I find my message triggers a short dump - with the Method SET_OBJECTKEYS, not finding any keys in the BP structure that has been created.
    Q1 - How do I get around this problem ? Is it necessary for me to specify Keys in the PartyID node of the Interface ABABusinessPartnerIn. or is it something else ?
    Q2 - How is this general process supposed to work? I would assume that for staging, I would get incomplete Master data or data from flat files, which need not neccesarily contain keys. The aim is to use the matching strategies in the CI to identify duplicates and consolidate them.
    Thanks in advance for your reply.
    Regards,
    Gaurav

  • How to read data from a specified line from a flat file

    hi all
    im having a filat file like as follows
    (eg)
    1.aaa
    2.bbb
    3.ccc
    4.ddd
    5.eee
    using gui_upload i need to read the data from the flat file from the line number 2 into an internal table.
    (eg)
    2.bbb
    3.ccc
    etc
    can any one help with this

    Hi,
        First u upload the data from flat file into the internal table.Once u uploaded read the internal table.
    Read table itab index 2.
    Thank u,
    Manjula Devi.D

Maybe you are looking for