Idoc to File -- Records will depend on repetition of particular segment.

Hi Experts,
Iam doing a Idoc to file scenario.
Based on the sales organization(VKORG),i need to create the multiple records in the file.
For example :
E1MARAM  0..Unbounded
     |
     |E1MARMM   0..Unbounded
     |
     E1MARMM
     |
     E1MARMM
     |
     E1MARMM
     |
<b> E1MVKEM   0..Unbounded
     |
     E1MVKEM</b>           
When E1MVKEM-VKORG = Z200 then i need to create a file with 4 records (for 4 E1MARAM segments 4 records will be created)
When one more E1MVKEM-VKORG  = Z201 present then we need to create 4 more records for Z201 in the same file.
So now i will be getting a single file with 8 records.
Please suggest me how to approach these kind of scenario.
PS: we are not using BPM in our scenario.
Thank You.
Regards
Seema.

Hey seema,
This can be achieved using node function <b>createif</b>.
Refer this link which help you doing the same
http://help.sap.com/saphelp_nw04/helpdata/en/d9/3033f96c79674f90e3ab8d101a595b/frameset.htm
and also refer stefan's blog
/people/stefan.grube/blog/2006/01/09/the-use-of-suppress-in-the-xi-30-graphical-mapping-tool
Hope it helps you
Regards,
Ramesh P

Similar Messages

  • Idoc to file -- Records based on the segment repitition. Urgent..Pls.!!

    Hi Experts,
    Iam doing a Idoc to file scenario.
    Based on the sales organization(VKORG),i need to create the multiple records in the file.
    For example :
    E1MARAM 0..Unbounded
    |
    |E1MARMM 0..Unbounded
    |
    E1MARMM
    |
    E1MARMM
    |
    E1MARMM
    |
    E1MVKEM 0..Unbounded
    |
    E1MVKEM
    When E1MVKEM-VKORG = Z200 then i need to create a file with 4 records (for 4 E1MARMM segments 4 records will be created)
    When one more E1MVKEM-VKORG = Z201 present then we need to create 4 more records for Z201 in the same file.
    So now i will be getting a single file with 8 records.
    Each E1MVKEM segment will be having only one VKORG value.
    I tried with <b>oneasmany</b> function,but its creating only for VKORG=Z200 with 4 values but its not providing the values for VKORG=Z201.
    Please suggest me what to do.. I need to write UDF's or can i achieve without using them.??
    PS: we are not using BPM in our scenario.
    Thank You.
    Regards
    Seema.

    Hi Prabhu,
    I need to display the records in the file for each sales organisation (MVKEM-VKORG) .
    MARAM is the parent node and MARMM,MVKEM are child nodes.
    MARAM                                                  
             MARMM                                              
             MARMM                                              
             MARMM                                              
             MVKEM                                                               
             MVKEM                    
    Consider that first MVKEM has VKORG = Z200 then 3 records has to display in file (for 3 MARMM segments 3 records has to display)
    Simillarly consider second MVKEM has VKORG = Z201 then 3 more records has to display in file. ( same as above for 3 MARMM segments = 3 records in file)
    So for the above structure i will be getting a total of 6 Records in my output file.
    Iam trying with different Node functions but it is taking only for first VKORG and not taking the second one.so iam getting only 3 records in my file.
    Please help me in cracking this.
    Regards
    Seema.

  • IDOC-File - records in Idoc to file based on some condition

    Hello experts,
    I have a idoc to file scenario. the incoming Idoc can have multiple records in it and i have to map these records to a csv file. Now the problem is not all records has to be mapped to the file. Based on the value of a perticular file (which is not root), i need to decide if the entire record has to be processed or not. Like the idoc structure is say:
    IDOC
       E1WPA01            0....9999
          E1WPA04         0...99
              KONDART     0..1
    Now for all valid E1WPA01 where the value of KONDART equals to some spacified value (known) , there has to be one record in the target csv file.
    How can this be done at the root level?
    One way of doing is we give empty values in the target file where the condition of KONDART is not fulfilled. Say if there are 10 records of E1WPA01 and only 4 satisfies the condition, we will ahve 10 records in the output file but only 4 records will have value and the rest 6 will be blank like (,,,,,,,). But I dont want this. I want only 4 records in the output file.
    I tried mapping like this:
    E1WPA01----
    >Advanced -
    > Root
    E1WPA04-KONDART---->UDF
    The problem i am facing here is if 4 records fulfill the condition, the first 4 are taken and the revelent 4.
    Please help.
    Regards,
    Yash

    Hi Chirag,
    I wrote the following code in UDF:
    for(i=0;i<a.length;i++)
    if(a{i}.equals("Specified Values"))
    result.addValue("a{i}");
    else
    result.addValue(ResuktList.SUPPRESS);
    And its working partially. I mean the queue of the UDF looks like
    1. AAAA                      SUPPRESS
    2. <Specified value>     <Specified value>     
    3. AAA                        SUPPRESS
    4. AAA                        SUPPRESS
    5. AAA                        SUPPRESS
    6. AAA                        SUPPRESS
    7. <Specified value>     <Specified value>
    8. AAA                        SUPPRESS
    9. AAA                        SUPPRESS
    and it creates 2 ROOT nodes. But the root nodes are created for line 2 and line 8 insteed of 7.
    What can be problem??
    Yash

  • IDOC to File multiple segments to one record

    Hello,
    I have an xi scenerio where I am going from IDOC to flat file.   I have an issue where a segment can occur multiple times and I want to take the last segment of that multiple occuring segment as my record to flatfile.
    for example
           EDI_DC
              EMPLOYEE
                   EMPLOYEE_PERSONAL_INFO
                   EMPLOYEE_ADDRESS_INFO
                   EMPLOYEE_ADDRESS_INFO
                   EMPLOYEE_ADDRESS_INFO
                   EMPLOYEE_BENEFIT_INFO
    in the above example, i want to take the last occurance of the EMPLOYEE_ADDRESS_INFO in my message mapping without any logic around dates or statuses.
    is there an easy way to do this?
    thank you

    use this logic;
    source -> COUNT-
                              |--- EqualsS -> pass the source to target
    source -> INDEX -
    the logic is count function will give you the number of occurrences and Index will return the current occurrence.

  • My audio files no longer sync to the in the 5d in camera audio. It did when I bought the program but no longer does  I reinstalled and it still will not sync the files recorded on the H4N with the Canon 5D Mark Ii

    My audio files no longer sync to the in the 5d in camera audio. It did when I bought the program but no longer does  I reinstalled and it still will not sync the files recorded on the H4N with the Canon 5D Mark II  Camera. 
    The program used to import and transcode the Can 5D footage but no longer does.   The program freezes often and looses my projects as well.  Hard to make a living when your editing program is on strike!

    My audio files no longer sync to the in the 5d in camera audio. It did when I bought the program but no longer does  I reinstalled and it still will not sync the files recorded on the H4N with the Canon 5D Mark II  Camera. 
    The program used to import and transcode the Can 5D footage but no longer does.   The program freezes often and looses my projects as well.  Hard to make a living when your editing program is on strike!

  • Mapping issue: FCC: Idoc for each record in file

    Hi,
    I have file to Idoc scenario.
    I receive csv file with multiple records.
    The requirement is to create an Idoc for each record.
    For eg.
    source file
    A1,B1,C1
    A2,B2,C2
    A3,B3,C3
    After FCC
    <MT>
    <TRANS>
    <ROW>
    <A>A1</A>
    <B>B1</B>
    <C>C1</C>
    </ROW>
    <ROW>
    <A>A2</A>
    <B>B2</B>
    <C>C2</C>
    </ROW>
    <ROW>
    <A>A3</A>
    <B>B3</B>
    <C>C3</C>
    </ROW>
    </TRANS>
    <MT>
    I have first tested it with only 1 record to test end to end connectivity. It works as expected and Idoc is posted to target system.
    Now when I am trying to send multiple records, I am getting some issues.
    Below are the steps that I have taken to process multiple records:
    1. Changed the cardinality of ROW (child of RecordSet) from 1 to Unbounded.
    2. Changed the occurance of Idoc to Unbounded.
    3. Mapped ROW to Idoc root.
    I have tested the mapping in IR and it generates multiple IDOCs.
    When I send the test file, it fails with error Tag found instead of tag IDOC BEGIN=
    I can see the xml message created with multiple ROWs in XI by File adapter in sxmb_moni.
    When I do Test Configuration in ID, with the XML message extracted from sxmbmoni, the result that I got was:_
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1></ns0:Message1></ns0:Messages>
    This means that idoc was not created while mapping.
    But the same sample message works OK in IR!
    Pls help where I have missed.
    Regards,
    Anirudh.

    Sudhir,
    Thanks for your response.
    FCC is working fine. I have taken the XML message in XI created after FCC from csv sample message.
    I have tested this message in IR by placing it between
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
    </ns0:Message1>
    </ns0:Message>
    It is working fine and Idocs are created in mapping in IR.
    But the same sample message is creating below output ID!
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1></ns0:Message1></ns0:Messages>
    Regards,
    Anirudh.

  • IDoc to file - how to delete a blank record at the end of the file.

    Hi,
    My senario is IDoc to file.  I have successfully implemented this using FCC. But when i checked the flat file, it has a blank record at the end of the file( i think PI adds one blank line/record at the end of the file).  Please suggest me What i need to do, to delete the blank record .
    Thanks & regards
    Sreeni

    Kindly Check below.
    Check whether the problem is at mapping level of  adapter level.. to do this count no. of rows/IDOC before mapping and after mapping in IE and no. of rows in the output file.
    Thnx
    Subbu

  • How count number of item records in a File: Idoc to File scenario

    Hi All,
    I am configuring an IDOC to File scenario.
    Once all the IDOC data is dumped on a File, I need to calculate the number of Item records in this file and write this number at the end of the trailer record in the file.
    Is theer a way to calculate the item data records(or say number of lines in the file) in the message mapping area. Or any other simple way to do it.
    Appreciate your help on same.
    Thanks
    Shirin

    hi,
    Use the count function for ITEM node the assign this count value to the receiver field , keep the ITEM context to header!
    Thanks,
    Vijaya.

  • How to send 100 records from an IDOC to File Scenario without using BPM?

    Hi All,
    I have a requirement that i need to send 100 records from sap to file by using the scenario IDOC to File. Can you suggest how can i achieve this?
    Regards,
    Ramvilas.

    Hi,
       Create a H type RFC destination.Tagert host and port give  Xi system host and port.Path give the
       /sap/xi/adapter_plain?namespace=<NameSpcae>&interface=<Interface> &service=<SenderBusinessSystem>&qos=EO or EOIO.
    Go to we21 find xmlhttp port.give the port name and assign RFC.Give the port in we20 your idoc and change to collective.
    In Xi export the IDOC and change the occurance to 0-unbounded and import it.
    Regards,
    Prakasu.M

  • IDOC to File scenario Configuraton settings

    hi,
       I am doing IDOC to FILE scenario.I am sending IDOC from R/3 to XI and then to XML file.That mean smy scenario is as Follows (  R/3XIfile ) These are my queries
    -->I have created RFC Destination from R/3 to XI.should I need to create RFC destination from XI to R/3 ( i mean In  XI )??
    -->I have created one Port in R/3 and I have linked that port with RFC Destination that i have created.here i am sending IDOC from R?# to XI...SO we call this PORT as SENDER PORT or RECEIVER PORT??
    -->and DO we need to create PORT in XI also??is it require for my scenario??
    -->DO we need to create Partner Profiles in XI also??
    -->DO we need to create LOgical system in XI to represent the XI system?? (as we created LS in R/3 to represent sender system)
    --->Here is my big doubt..
                   when we test IDOC ..by sing we19 TCODE,
       We need to fill the corresponding details as below,
    Receipent                                  Sender
    Port                                              Port
    PartnerNo                                      PartnerNo
    PartnerType                                   PartnerType
    my Doubt is,
    -->>In which field we need to specify the Port that we have created in R/3..Receipent side OR Sender Side..?? and Why??
    -->>Same for ParnerNo..where we need to specify the Logical system which we have created in R/3 should specify??Why??
    Please give reply ASAP..with detailedexplanation..
    points will be rewarded..
    regards,
    murali

    HI
    SLD-
    1) Create a Product/Software Component
    2) Technical System pointing to R/3 system
    3) Business System for the above technical system
    In the Repository
    1) Import the Software component created in the sld
    2) Create a namespace,
    3) import the idoc and then create sender data type/message type etc and mapping
    4) Mapping Rules is depends on the requirement
    In the Directory
    1) Create a Scenario /import the business system
    2) Create Receiver/Interface determination
    3) Create communication channels for sender and receiver
    4) Sender Agreeement and Receiver Agreement.
    Then the file adapter configuration is depend on the input file format.
    Also you need to have Logical destionation created in the XI , and the IDX1 entry
    In R/3 Port, Partner profiles etc should be created
    Have a look into this document~
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/877c0d53-0801-0010-3bb0-e38d5ecd352c
    While doing an File -> XI -> IDoc scenario, The Points to noted are:
    1. You donu2019t need a DT, MT or a message interface for the IDOC as it itself acts as the Message Interface.
    2. You import the IDOC and use the same in your mapping.
    3. In this configuration note that you will need a sender agreement for the file.
    4. In this configuration note that you will also need a receiver agreement for the IDOC.
    For any File -> XI -> IDoc scenario ref:
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    While doing an File -> XI -> IDoc scenario, The Points to noted are:
    1. You donu2019t need a DT, MT or a message interface for the IDOC as it itself acts as the Message Interface.
    2. You import the IDOC and use the same in your mapping.
    3. In this configuration note that you will need a sender agreement for the file.
    4. In this configuration note that you will also need a receiver agreement for the IDOC.
    For any File -> XI -> IDoc scenario ref:
    /people/sravya.talanki2/blog/2006/12/27/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-iii
    /people/sravya.talanki2/blog/2006/12/25/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-i
    /people/sravya.talanki2/blog/2006/12/26/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-ii
    SAP XI
    1) RFC Destination (SM59)
    a) Choose create.
    b) Specify the name of the RFC destination
    c) Select connection type as 3 and save
    d) In the technical settings tab enter the details SAP SID/URL and system number#.
    e) Enter the Gateway host as same details above SID/URL.
    f) Gateway service is 3300+system number#.
    g) In the Logon /Security tab, enter the client user & Password details of Destination system.
    h) Test the connection and remote logon.
    2) Create Port (IDX1)
    a) Select create new button
    b) Enter the port name as SAP+SID (The starting char should be SAP)
    c) Enter the destination client.
    d) Enter the RFC Destination created in SAP R/3 towards other system.
    e) Save
    3) Load Meta Data for IDOC (IDX2)
    a) Create new
    b) IDOC Message Type
    c) Enter port created in IDX1.
    SAP R/3
    1) RFC Destination (SM59)
    a) Choose create.
    b) Specify the name of the RFC destination
    c) Select connection type as 3 and save
    d) In the technical settings tab enter the details SAP SID/URL and system number#.
    e) Enter the Gateway host as same details above SID/URL.
    f) Gateway service is 3300+system number#.
    g) In the Logon /Security tab, enter the client user & Password details of Destination system.
    h) Test the connection and remote logon.
    2) Create Port (We21)
    a) First Select Transactional RFC and then click create button
    b) Enter the destination port name as SAP+SID (The starting char should be SAP)
    c) Enter the destination client.
    d) Enter the RFC Destination created in SAP R/3 towards other system.
    e) Save
    3) Create Partner Profile (WE20)
    a) Create New
    b) Create the Partner no. name as same the logical system name of the destination system.
    c) Select Partner type LS
    d) Enter details for Type: US/USER, Agent, and Lang.
    e) Click on the + button to select the message type.
    f) Select Partner no. and LS which ever create above.
    g) Select Message type
    h) Select Process code related to the Message type.
    I) save.
    In SLD u2013 System Landscape Directory
    TS for R/3 (Logical system):-Assign the client name created in R/3 as Logical system Name.
    Ts for Third Party (Logical system):-
    BS for SAP R/3 (Logical system):- Assign the client name created in R/3 as Logical system Name.
    BS for Third Party (Logical system):-Enter the XI logical system name.
    In Transaction SALE
    Define and Assign the logical system names
    cheers
    reward poins if found useful

  • ABOUT DATA SENDING IN idoc TO file SCENARIO

    How the data is sended in idoc to file scenario?
    what is the difference in sending data through BD10, BD14 and WE19 ?
    Is the data is sended through XI OR R/3 SYSTEM?

    Hi Rammohan
    >> How the data is sended in idoc to file scenario?
         Makeing settings in SAP R/3 side then based on the RFC
         destination,port,parterner profiles.....
         Idoc can hold the data with out any direction but RFC port will direct where to
        go ...based on the partner profiles (Out buond IDOCS)
    >>what is the difference in sending data through BD10, BD14 and WE19 ?
        BD10,BD11,BD12,BD13,BD14 will be to send the master data automatically
        generally will be in the production(But not for testing) and this will be depending
        on the declaration of profiles in the BD64
        --- But we19 will be used to test the Idocs with any data
            but here we need to give all the parameters like senders,receivers,ls,idoc...
    >>  Is the data is sended through XI OR R/3 SYSTEM?
         Data will send through XI  i.e XI will receive the Idoc and Convert into XI specific
         SOAP XML message and process all the pipe line steps ...based on the target
         it will send
         Here target is file so choose the file adapter as target and give all parameters
         it will work fine
    I hope this will answer your question
    regards
    --- prasad

  • Mapping Error- In IDoc to File scenario

    Hi Experts,
    Got the Mapping error for one interface (IDoc to file). After comparing with successful message found that the field value (TDLINE) is not availbale in first segment (E1EDT10) in idoc for this failed one.
    Mapping is :
    TDLINE -- Exists --- Creatif --- Receiver field(in the file)
    But here due to the the empty value in first segment the message is failed in XI system, next segment values is not trasmitted to the recever end(maping is the same above). To overcome this issue please suggest the suitable mapping design in IR.
    Regards
    Mahesh

    Hi,
    After your CreateIf, use a "IfWithoutElse" by selecting the properties "Keep SUPPRESS Values". To do that, do a right click on IfWithoutElse, choose "Properties".
    With this option, you will keep the fact that you have nothing in the source, and so the target context will have a "SUPPRESS" line.  I have not THE solution, so do your own test.
    If it's not enough, see also about the "mapWithDefault" (but that depends of your real rule).
    Regards.
    Mickael

  • Context handling in message mapping  for an IDoc to File Scenario

    Hi,
    Can somebody help me with this issue. I have an Idoc to file scenario. heres my idoc structure. Its a custom Idoc
    Header (1..1)
    Detail (0..Unbounded)
             DependentDetail (0...Unbounded)              Note: This dependentdetail is a subelement of Detail
    Trailer(1...1)
    I  created my target structrure the same way as the Idoc structure.
    My output is a simple text file. I need the output in this format
    Header
    Detail1
       Dependentdetail1
       DependentDetail2
       DependentDetail3
    Detail2
       DependentDetail1
       Dependentdetail2
    Detail3
    Detail4
    Trailer
    Since the Detail and Dependent Detail records are unbounded .
    But right now i m getting my output like this:
    Header
    Detail1
    Detail2
    Detail3
    Detail4
    Trailer
    But the DependentDetail record in not showing up in the output file. I didnot do any context change in my mapping. So do I need to do any context handling??...If so can somebody explain me with this.
    Thanks,
    Adam
    Edited by: hymanroth on Apr 29, 2011 11:11 PM

    Thanks Kenneth foryour quick reply,
    Yes, I see the payload for Dependent detail in SXMB_MONI. So as you said earlier there's a problem with my content conversion.
    my content conversion is as follows:
    Header.fieldNames                             
    Header.fieldFixedLengths                
    Header.endSeparator                        
    Detail.fieldNames                               
    Detail.fieldFixedLengths                    
    Detail.endSeparator
    DependentDetail.fieldNames
    DependentDetail.fieldFixedLengths                   
    DependentDetail.endSeparator
    Trailer.fieldNames                             
    Trailer.fieldFixedLengths                
    Trailer.endSeparator  
    So As I told  earlier. With the above content conversion. I am not able to get the Dependent detail record in my output file. So If there is a change in my content conversion can u check it and tell me where I went wrong.
    Thanks,
    Harsh
    Edited by: hymanroth on May 2, 2011 7:03 PM

  • Graphic Mapping:IDOC to File-Avoid Error in Adapter Engine

    Hi all,
    I'm using Graphic Mapping in my IDOC to File scenario in which each segment in source IDOC will generate a ROW in target File with the condition: DATBI >= currentdate (and some other conditions)
    I have a UDF and use the mapping function CREATEIF for this purpose:
                                 DATBI -> UDF -> CREATEIF -> ROW
    Problem scenario: In the source IDOC if all the segments have DATBI < currentdate then there is no ROW created, and I get the error in Adapter Engine
    Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure ...
    How can I avoid this?
    I've tried to put this condition using XPATH in Interface Determination and got the error.
    There is a way to use function current-date() in XPATH condition?
    Thanks for your help,
    Elaine

    Hi all,
    How can I "suppress the row node if condition fails"? I'm new in PI, so please give more details.
    My FCC as follows:
    Record Structure: Record, Row
    Row.addHeaderLine 0
    Row.fieldSeparator ,
    Record.fieldSeparator 'nl'
    Row.endSeparator ; 'nl'
    It works fine if the condition satisfied.
    In Message Mapping, I've use Test to double check my mapping, and in the scenario that conditions fails, there is no Row in the target message.
    Please advise.
    Thanks,
    Elaine

  • Batching of multiple IDOCs into 1 IDOC-XML file

    Hi PI experts,
    I would like to send all idocs from the same payment run (based on run date & run id) as 1 idoc-xml file to PI.
    The number of idocs is variable depending on the payment run.
    Is this possible without using ccBPM?
    I understand it can be achieved according to /people/stefan.grube/blog/2006/09/18/collecting-idocs-without-using-bpm by using FILE adapter. But I don't want to save the idocs into a file system and the number of records in a file is also fixed.
    Is there other alternative solution?
    Thanks,
    Ken.

    Hi Michal,
    Yes, I have seen your blog and also would like to use the IDoc packaging feature which comes with 7.0 EHP1 onwards, but I am not sure whether the IDoc collecting can be based on the payment run date and run id.
    The sending of the collected IDocs is based on when the program RSEOUT00 is executed.
    If we perform 2 separate payment runs before the RSEOUT00 is executed, would PI receive 2 Idoc-XML files or 1 combined Idoc-XML file. We would like to receive 2 separate XML files.  
    Hope you can confirm this.
    Thanks.

Maybe you are looking for