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.

Similar Messages

  • IDOC with Multiple Segment to One Single Record Mapping

    Hello
    I have a problem mapping the values of the segment <E1CSKTM>
    which occurs two times in my source IDOC to a single record.
    My requirement is to get one field (LTEXT) from the first E1CSKTM segment and map it to Name and take the same field (LTEXT) but from the second E1CSKTM segment and map it to OrgDescription
    The source message:
    <?xml version="1.0" encoding="UTF-8"?>
    <COSMAS01>
       <IDOC BEGIN="1">
          <EDI_DC40 SEGMENT="1">
             <TABNAM>EDI_DC40</TABNAM>
             <MANDT>300</MANDT>
             <DOCNUM>0000000000750131</DOCNUM>
             <DOCREL>700</DOCREL>
             <STATUS>30</STATUS>
             <DIRECT>1</DIRECT>
             <OUTMOD>2</OUTMOD>
             <IDOCTYP>COSMAS01</IDOCTYP>
             <MESTYP>COSMAS</MESTYP>
             <STDMES>COSMAS</STDMES>
             <SNDPOR>SAPQAE</SNDPOR>
             <SNDPRT>LS</SNDPRT>
             <SNDPRN>QAE300</SNDPRN>
             <RCVPOR>SAPQAX</RCVPOR>
             <RCVPRT>LS</RCVPRT>
             <RCVPRN>QAX304</RCVPRN>
             <CREDAT>20080308</CREDAT>
             <CRETIM>090820</CRETIM>
             <SERIAL>20080211134325</SERIAL>
          </EDI_DC40>
          <E1CSKSM SEGMENT="1">
             <MSGFN>005</MSGFN>
             <MANDT>300</MANDT>
             <KOKRS>1000</KOKRS>
             <KOSTL>0105012501</KOSTL>
             <DATBI>99991231</DATBI>
             <DATAB>19000101</DATAB>
             <ERSDA>20060219</ERSDA>
             <USNAM>HAMEED</USNAM>
             <BKZER>X</BKZER>
             <BKZOB>X</BKZOB>
             <PKZER>X</PKZER>
             <MGEFL>X</MGEFL>
             <BUKRS>1000</BUKRS>
             <GSBER>20</GSBER>
             <KOSAR>N</KOSAR>
             <VERAK>TBA</VERAK>
             <WAERS>SAR</WAERS>
             <KHINR>105012001</KHINR>
             <KOMPL>X</KOMPL>
             <OBJNR>KS10000105012501</OBJNR>
             <PRCTR>0105012000</PRCTR>
             <FUNC_AREA>Z240</FUNC_AREA>
             <FUNC_AREA_LONG>Z240</FUNC_AREA_LONG>
             <E1CSKTM SEGMENT="1">
                <MSGFN>005</MSGFN>
                <SPRAS>A</SPRAS>
                <KTEXT>&#1605;&#1583;&#1610;&#1585; &#1575;&#1604;&#1583;&#1575;&#1574;&#1585;&#1577; &#1608;&#1605;&#1608;&#1592;&#1601;&#1608;&#1607;</KTEXT>
                <LTEXT>&#1605;. &#1583;. &#1608;&#1605;&#1608;&#1592;&#1601;&#1608;&#1607;/ &#1581;&#1587;&#1575;&#1576;&#1575;&#1578; &#1605;&#1606;&#1591;&#1602;&#1577; &#1575;&#1604;&#1605;&#1583;&#1610;&#1606;&#1577;</LTEXT>
                <SPRAS_ISO>AR</SPRAS_ISO>
             </E1CSKTM>
             <E1CSKTM SEGMENT="1">
                <MSGFN>005</MSGFN>
                <SPRAS>E</SPRAS>
                <KTEXT>DvM and Stff/AOD-Mad.</KTEXT>
                <LTEXT>Div Mgr and Staff/AOD-Madinah</LTEXT>
                <SPRAS_ISO>EN</SPRAS_ISO>
             </E1CSKTM>
          </E1CSKSM>
       </IDOC>
    </COSMAS01>
    The Target Message:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CostElementMT xmlns:ns0="http://se.com.sa/materials">
       <INSERT>
          <COSTELEMENT_DATA action="INSERT">
             <TABLE>usmuser.OrganizationCodes_test</TABLE>
             <access>
                <OrgCode>105012001</OrgCode>
                <CostCenter>0105012501</CostCenter>
                <OrgDescription> English Name<OrgDescription/>
                <Name>Arabic Name</Name>
             </access>
          </COSTELEMENT_DATA>
       </INSERT>
    </ns0:CostElementMT>
    is this possible using the graphical mapping?

    Hi Baheej,
    If in your input "E1CSKTM" segment always occurs twice than u can go with the above UDF mentioned by Chirag and also u need to take care that field (LTEXT) also always occurs.If the field does not occur always than you need to check it using exists functions.
    Andmoreover if the "E1CSKTM" segment does occur more than twice than u need to create a UDF where u need to pass the values alternatively.
    Please check the above details and let us know if any furthur enhancements are to be made.
    Thanks,
    Bhargav
    Note:Award Points if found useful.

  • IDOC to FIle multiple records

    HI Experts,
    My scenario is IDOC-FILE and i need to collect idocs and send it to XI. So i am using XML PORT.
    The vendor master file is reaching the directory that i specified in receiver communication channel.but only one record is existing in that even i send multiple idocs.
    i had configured the messege mapping  with the external message  that i imported as XSD(changed the idoc occurence max= unbounded) and i used the same for interface mapping.
    what can be the problem .
    Thanks in Advance,

    HI,
    This problem due to occurance mapping, check sender and receiver structure occurance fields mapping.
    In sender partner profile outbound configuration select collection idoc option
    source                 target
    segment (0..un)-----> row(0..un)
                 field1................field1
                 filed2................field2
    this mapping will sort out your problem

  • Challenge involving creating a file on GUI & seeing one record at a time...

    Hi,
    If anyone can help me with this project I'd be most appreciative. I'll try and explain the problem the best I can. I'm adding students to a database at a university they're either a Graduate or an Undergraduate. I'm taking in first, lastname's, ssn, & ACT/SAT/GMAT test results. I have a GUI called StudentRecord that has all the JTextFields, JButton's, etc. I'm also writing it to a .txt file called StudentDA. For this I used a BufferedFile reader.
    What I really need is on my StudentRecord when I click the display button I want it to show one record at a time in another JFrame. This other JFrame I named it display. I'm trying to create an instance of JFrame inside of the actionPerformed for StudentRecord but when I click display nothing happens.
    I adding the students with a vector that I'm calling v. I want the Display to read from the .txt file and display one at a time hence next, and previous. I'm going to post the tidbit of relevant code. If anyone can help me you'd be my hero for the day for all time I've tried to get this to work.
    Here's the StudentRecord (GUI) display part:
          public void actionPerformed( ActionEvent event )
         try {
              Display d = new Display(StudentDA.v);
             }//end try
            //catch right here no problems with this..Here's the DataAccess part:
    public class StudentDA{
      static Vector v = new Vector();;
      static String pathName = "a:/Final Project/test1.txt";
      static File studentFile = new File(pathName);
      static String status;
      public StudentDA() {}
      public static void initialize() {
        if (studentFile.exists() && studentFile.length() !=0) {
         try{
          BufferedReader in = new BufferedReader(new
          FileReader(studentFile) );
          do{
             status = in.readLine();
              if(status.equals ("uGrad")) {
                uGrad u = new uGrad();
                u.setFName(in.readLine() );
                u.setLName(in.readLine() );
                u.setssNum(Integer.parseInt(in.readLine()) );
                u.setACT(Integer.parseInt(in.readLine() ));
                v.add(u);
                System.out.println(u + "inside ugrad");
              }//end if uGrad
              else{
                if(status.equals("Grad")) {
                //same process as uGrad
                v.add(g);
              }//end else Grad
          }while (status != null);
        }//end try statement
        catch (Exception e) {
          }//end catch
        }//end if there's something there
      }//end method initialize
      //creating the terminate method
      public static void terminate() {
        try{
          PrintStream out = new PrintStream ( new
          FileOutputStream (studentFile) );
          for (int i = 0; i < v.size(); i++) {
            Student s = (Student) v.elementAt(i);
            String p = s.printRecord();
            StringTokenizer rt = new StringTokenizer(p, "\t");
            while (rt.hasMoreTokens() ) {
              out.println(rt.nextToken() );
              }//end while
          }//end for loop
        }//end try loop
        catch (Exception e){
        }//end catch
      }//end terminate
    public static void add(Student s){// throws DuplicateException{
              boolean duplicate = false;
              for(int i = 0; i < v.size(); i++){
                   if(s.getssNum() == ((Student)(v.elementAt(i))).getssNum()){
                        duplicate = true;
                        break;
                   if(duplicate){
                        throw new DuplicateException("Student Already Exists");
                   else{
                        v.add(s);
    }//end add method
    }//end classHere's the display class:
    public class Display extends JFrame {
         private JButton Next, Previous;
         private JTextField statusField, firstField, lastField, socialField, advPlacementField, actField;
         private JLabel statusLabel, firstLabel, lastLabel, socialLabel, advPlacementLabel, actLabel;
         private JPanel fieldPanel, buttonsPanel;
         private JTextArea displayArea;
         static int count = 0;
         static String status;
         public Display(){}
    public Display(Vector v){
         //setting up the GUI components for the display class here
         //JTextAreas & JLabels
         buttonsPanel = new JPanel();
         buttonsPanel.setLayout(new GridLayout(1,2));
        Next = new JButton("Next");
        buttonsPanel.add(Next);
        Next.addActionListener(
        new ActionListener() {
          public void actionPerformed( ActionEvent event )
              //try to catch display errors
           try {
                        count++;
                     displayData(count);
                     //displayData();
          }//end try
              catch {
             }//end catch
          } // end actionPerformed
        } // end anonymous inner class
        ); // end call to addActionListener
        buttonsPanel.add(Next);
        Previous = new JButton("Previous");
        buttonsPanel.add(Previous);
        Previous.addActionListener(
        new ActionListener() {
          public void actionPerformed( ActionEvent event )
              //try to catch display errors
              try {
                   count--;
                   displayData(count);
                   //displayData();
             }//end try
              catch {
             }//end catch
          } // end actionPerformed
        } // end anonymous inner class
        ); // end call to addActionListener
    }//end display() constructor
    public void displayData(int count) {
         StudentDA.initialize();
           if (status.equals ("uGrad")) {
           //these are all part of the StudentRecord GUI not Display GUI
                fieldPanel.setVisible(true);
                buttonsPanel.setVisible(true);
                actLabel.setVisible(true);
                actField.setVisible(true);
                advPlacementLabel.setVisible(false);
                advPlacementLabel.setVisible(false);
           }//end if
           else {
                if(status.equals ("Grad")) {
                 fieldPanel.setVisible(true);
                 buttonsPanel.setVisible(true);
                 actLabel.setVisible(false);
                 actField.setVisible(false);
                 advPlacementLabel.setVisible(true);
                 advPlacementLabel.setVisible(true);
                  }//end if
           }//end else
    }//end method displayData()
    public static void main ( String args[] )
        Display application = new Display();
        application.addWindowListener(
              new WindowAdapter(){
                   public void windowClosing( WindowEvent e)
                        System.exit(0);
        application.setSize( 300, 200);
        application.setVisible( true );
    };//end main
    }//end class Display{}I know this is long but if anyone can help I'd greatly appreciate it. Please ask me if you need me to clarify something, I tried to not make it way too long. --rockbottom01
         

    I'm not really too sure what it is that you are after, but here is some code, that loads up an array with each line of a .txt file, then displays them. I hope you can make use of a least some of it.
    just ask if you don't understand any of the code.
    String array[];
    int i;
    public Test() {
              readFile("file.txt");
              i = 0;
              nextEntry();
         public void nextEntry() {
              Display display = new Display();
              display.show();
         class Display extends JFrame implements ActionListener {
              JLabel label1;
              JButton button;
              public Display() {
                   label1 = new JLabel(array);
                   button = new JButton("OK");
                   getContentPane().setLayout(new FlowLayout());
                   getContentPane().add(label1);
                   getContentPane().add(button);
                   button.addActionListener(this);
              public void actionPerformed(ActionEvent e) {
                   setVisible(false);
                   i++;
                   if(i < array.length) {
                        nextEntry();
         public void readFile(String fileName) {
              String s, s2 = "";
              int lineCount = 0;
              BufferedReader in;
              try {
                   in = new BufferedReader(new FileReader(fileName));
                   while((s = in.readLine()) != null) {
                        lineCount++;
                   array = new String[lineCount];
                   in.close();
                   in = new BufferedReader(new FileReader(fileName));
                   int j = 0;
                   while((s = in.readLine()) != null) {
                        array[j] = s;
                        j++;
              catch(IOException e) {
                   System.out.println("Error");

  • Mapping multiple Segments to one output

    Hi,
    The issue is that I have a segment which would be a text type that contains multiple segments, each segment would contain a line of text.
    The issue is that the output is only the last segment of text.  I want to be able to concatenate all of the lines into one.
    I feel I need to use a UDF but not quite sure how to do the mapping.

    I think you should try with this udf ... let's say your source segments are as shown below
    <A1>
       <E1>a</E1>
       <E2>b</E2>
       <E3>c</E3>
    </A1>
    <A1>
       <E1>1</E1>
       <E2>2</E2>
       <E3>3</E3>
    </A1>
    And let's say expected output is a,b,c,1,2,3
    Create the UDF and set the Cache to Queue. While mapping the source fields to UDF set the context to very top node (or use RemoveContext after each source field).
    String output = " ";
    for( int i = 0; i< A1.length; i++ )
    output =  output+ E1<i> + "," + E2<i> + "," + E3<i>;         //Concatenation of fields.
    /*if ( i !=A1.length - 1 )
      output  = output + ";" ;         //Concatenation of semicolon.
    result.addValue(output);
    Here is the mapping ..
    A1------->|
    E1------->| -------->UDF------->Taret
    E2------->|
    E3------->|

  • Multiple Errors for one record in RFC

    Hi,
    Iam creating RFC.In RFC i have defined output structure in tables.In that structure one field ZMSG and its length is 500.so want to display mutliple errors for one record in ZMSG field output.
    Using concantenation...but How to do that?send me Example code...
    Regards,
    Raj.

    clear v_error.
    loop on return where type = 'E'.
    concatenate v_error  return-ZMSG into v_error saperated by spaces respecting blanks.
    endloop.
    Edited by: Pranu Pranu on May 21, 2010 9:31 AM

  • Data Transfer using LSMW IDOC processing with multiple segments

    we need to post the document data (Header structure, BP item structure, G/L item structure..etc) using LSMW IDOC processing.
    is it possible to transfer data for all these structures (Segments) in single file?

    Thanks for the reply.
    I am assuming when we are specifying the file in LSMW we are going to give the option to generate the file with include all structures.
    could you please elaborate further is there any thing specific we need to do while configuring LSMW to get the file for all segments in the IDOC with field names which we are going to populate with data, so that we can use it for data transfer.
    any help document will  be helpful.

  • Multiple information into one record in rms

    Hey all,
    I am developing a Calendar application and currently implementing a Notes system for the user to store notes for a particular day.
    A sample note would consist of:
    Title: Dinner at Mark's
    Content: Dinner at Mark's house, 6pm sharp. Bring Joseph along.
    Each Note has a title and a content, but I have no idea how to store these 2 information into 1 record in a record store.
    I thought of 2 ways, one is to delimit them by some funny characters, 2nd is to use two record stores(bad idea).
    Can any body guide me along for this? I have seen examples but they only use 1 single string to store.

    What about a DataInput- and OuptutStream and using read/writeUTF()?
    Should work just fine for reading multiple string items without using a delimiter.

  • Return and combine multiple rows in one record

    Hi friends,
    I have these cursors,
    DECLARE
    CURSOR plaintif_cur IS
    SELECT personel_id, sp_sfs_id
    FROM siv_plaintif
    WHERE SP_SFS_ID IN(70, 74, 182)
    ORDER BY personel_id;
    -- defendan cursor all defendan for a dept number
    CURSOR defendan_cur (v_sp_sfs_id siv_plaintif.SP_SFS_ID%TYPE) IS
    SELECT personel_id, sd_sfs_id
    FROM siv_defendan
    WHERE sd_sfs_id = v_sp_sfs_id
    AND SD_SFS_ID IN(70, 74, 182);
    BEGIN
    FOR plaintif_rec IN plaintif_cur LOOP
    dbms_output.put_line('Plaintif in Sivil '||TO_CHAR(plaintif_rec.sp_sfs_id));
    FOR defendan_rec in defendan_cur(plaintif_rec.sp_sfs_id) LOOP
    dbms_output.put_line('...plaintif is '||plaintif_rec.personel_id);
    END LOOP;
    END LOOP;
    END;
    The output generated was
    Output:
    Plaintif in Sivil 182
    ...plaintif is 38
    Plaintif in Sivil 70
    ...plaintif is 1257
    Plaintif in Sivil 74
    ...plaintif is 1277
    Plaintif in Sivil 74
    ...plaintif is 1278
    However, I want the output to be like this, especially for the record where there are many plaintifs in one Sivil file
    Desired Output:
    Plaintif in Sivil 182
    ...plaintif is 38
    Plaintif in Sivil 70
    ...plaintif is 1257
    Plaintif in Sivil 74
    ...plaintif is 1277, 1278
    I would like to thank those everyone helping.. Thank you.

    Instead of declaring two cursors and doing it in slowest possible manner, possibly you can combine it into one SQL. Search for string aggregation to get some queries in this regard.
    For more specific answer, please post your table structure (CREATE TABLE) and sample data (INSERT statement) with sample output desired. Format your code with tag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need help with a SQL qurey that returns multiple rows for one record?

    I have the following query where I use a CASE WHEN clause to determine the date of a shift that begins with "FRLO" on day1 - day14 of the pay period. It works great if a schedule record contains one day that begins "FRLO", but if more than one day is "FRLO" then it only returns the first day it finds and not the others. Is there some way to get the query to return a ron for every day 1 - 14 that begins "FRLO"? System if Oracle 11G
    Order of the results is not important as this is part of a larger query that orders the results.
    Thanks in advance for any help,
    George
    SELECT s.empid,
    CASE
    WHEN UPPER (SUBSTR (s.Day1, 0, 4)) = 'FRLO'
    THEN
    pp.startpp
    WHEN UPPER (SUBSTR (s.Day2, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 1
    WHEN UPPER (SUBSTR (s.Day3, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 2
    WHEN UPPER (SUBSTR (s.Day4, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 3
    WHEN UPPER (SUBSTR (s.Day5, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 4
    WHEN UPPER (SUBSTR (s.Day6, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 5
    WHEN UPPER (SUBSTR (s.Day7, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 6
    WHEN UPPER (SUBSTR (s.Day8, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 7
    WHEN UPPER (SUBSTR (s.Day9, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 8
    WHEN UPPER (SUBSTR (s.Day10, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 9
    WHEN UPPER (SUBSTR (s.Day11, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 10
    WHEN UPPER (SUBSTR (s.Day12, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 11
    WHEN UPPER (SUBSTR (s.Day13, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 12
    WHEN UPPER (SUBSTR (s.Day14, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 13
    END
    startdate,
    NULL starttime,
    NULL endtime,
    8 hours,
    0 minutes
    FROM schedules s
    JOIN
    payperiods pp
    ON pp.periodid = s.periodid
    WHERE UPPER (SUBSTR (s.Day1, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day2, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day3, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day4, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day5, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day6, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day7, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day8, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day9, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day10, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day11, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day12, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day13, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day14, 0, 4)) = 'FRLO';
    CURRENT OUTPUT
    EMPID STARTDATE STARTTIME ENDTIME HOURS MINUTES
    753738, 3/25/2013 , , ,8 ,0
    753740, 3/25/2013 , , ,8 ,0
    753748, 3/25/2013 , , ,8 ,0
    DESIRED OUTPUT
    EMPID STARTDATE STARTTIME ENDTIME HOURS MINUTES
    753738, 3/25/2013 , , ,8 ,0
    753740, 3/25/2013 , , ,8 ,0
    753748, 3/25/2013 , , ,8 ,0
    753738, 3/26/2013 , , ,8 ,0
    753740, 3/26/2013 , , ,8 ,0
    753740, 3/28/2013 , , ,8 ,0
    753748, 1/1/2013 , , ,8 ,0
    753738, 4/3/2013 , , ,8 ,0
    753748, 4/3/2013 , , ,8 ,0
    CREATE TABLE SCHEDULES
    SCHEDULEID NUMBER(12) NOT NULL,
    EMPID NUMBER(12) NOT NULL,
    PERIODID VARCHAR2(6 BYTE) NOT NULL,
    AREAID NUMBER(12) NOT NULL,
    DAY1 VARCHAR2(50 BYTE),
    DAY2 VARCHAR2(50 BYTE),
    DAY3 VARCHAR2(50 BYTE),
    DAY4 VARCHAR2(50 BYTE),
    DAY5 VARCHAR2(50 BYTE),
    DAY6 VARCHAR2(50 BYTE),
    DAY7 VARCHAR2(50 BYTE),
    DAY8 VARCHAR2(50 BYTE),
    DAY9 VARCHAR2(50 BYTE),
    DAY10 VARCHAR2(50 BYTE),
    DAY11 VARCHAR2(50 BYTE),
    DAY12 VARCHAR2(50 BYTE),
    DAY13 VARCHAR2(50 BYTE),
    DAY14 VARCHAR2(50 BYTE),
    NOPTIND1 INTEGER DEFAULT 0,
    NOPTIND2 INTEGER DEFAULT 0,
    NOPTIND3 INTEGER DEFAULT 0,
    NOPTIND4 INTEGER DEFAULT 0,
    NOPTIND5 INTEGER DEFAULT 0,
    NOPTIND6 INTEGER DEFAULT 0,
    NOPTIND7 INTEGER DEFAULT 0,
    NOPTIND8 INTEGER DEFAULT 0,
    NOPTIND9 INTEGER DEFAULT 0,
    NOPTIND10 INTEGER DEFAULT 0,
    NOPTIND11 INTEGER DEFAULT 0,
    NOPTIND12 INTEGER DEFAULT 0,
    NOPTIND13 INTEGER DEFAULT 0,
    NOPTIND14 INTEGER DEFAULT 0
    CREATE TABLE PAYPERIODS
    PERIODID VARCHAR2(6 BYTE) NOT NULL,
    STARTPP DATE,
    ENDPP DATE
    Insert into SCHEDULES
    (SCHEDULEID, EMPID, PERIODID, AREAID, DAY1,
    DAY2, DAY3, DAY4, DAY5, DAY6,
    DAY7, DAY8, DAY9, DAY10, DAY11,
    DAY12, DAY13, DAY14, NOPTIND1, NOPTIND2,
    NOPTIND3, NOPTIND4, NOPTIND5, NOPTIND6, NOPTIND7,
    NOPTIND8, NOPTIND9, NOPTIND10, NOPTIND11, NOPTIND12,
    NOPTIND13, NOPTIND14)
    Values
    (3693744, 753738, '082013', 2167, 'X',
    'FRLO<1530>', 'FRLO<1530>', '1530', '1530', '1530',
    'X', 'X', '1530', '1530', 'FRLO',
    '1530', '1530', 'X', 0, 0,
    0, 0, 0, 0, 0,
    0, 0, 0, 0, 0,
    0, 0);
    Insert into SCHEDULES
    (SCHEDULEID, EMPID, PERIODID, AREAID, DAY1,
    DAY2, DAY3, DAY4, DAY5, DAY6,
    DAY7, DAY8, DAY9, DAY10, DAY11,
    DAY12, DAY13, DAY14, NOPTIND1, NOPTIND2,
    NOPTIND3, NOPTIND4, NOPTIND5, NOPTIND6, NOPTIND7,
    NOPTIND8, NOPTIND9, NOPTIND10, NOPTIND11, NOPTIND12,
    NOPTIND13, NOPTIND14)
    Values
    (3693745, 753740, '082013', 2167, 'X',
    'FRLO<1530>', 'FRLO<1530>', '1530', 'FRLO', '1530',
    'X', 'X', '1530', '1530', '1530',
    '1530', '1530', 'X', 0, 0,
    0, 0, 0, 0, 0,
    0, 0, 0, 0, 0,
    0, 0);
    Insert into SCHEDULES
    (SCHEDULEID, EMPID, PERIODID, AREAID, DAY1,
    DAY2, DAY3, DAY4, DAY5, DAY6,
    DAY7, DAY8, DAY9, DAY10, DAY11,
    DAY12, DAY13, DAY14, NOPTIND1, NOPTIND2,
    NOPTIND3, NOPTIND4, NOPTIND5, NOPTIND6, NOPTIND7,
    NOPTIND8, NOPTIND9, NOPTIND10, NOPTIND11, NOPTIND12,
    NOPTIND13, NOPTIND14)
    Values
    (3693746, 753748, '082013', 2167, 'X',
    'FRLO<1530>', '1530', '1530', '1530', '1530',
    'X', 'X', 'FRLO<1530>', '1530', 'FRLO',
    '1530', '1530', 'X', 0, 0,
    0, 0, 0, 0, 0,
    0, 0, 0, 0, 0,
    0, 0);
    COMMIT;
    Insert into PAYPERIODS
    (PERIODID, STARTPP)
    Values
    ('082013', TO_DATE('03/24/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    COMMIT;

    Do you have the opportunity to change the data model to have one day per row ? It would make this easier to get this result without the need for a 14-way CASE or UNION.
    If not...
    The case statement will return as soon as it matches one of the conditions. Since you want a match when any column in the row starts with FRLO you can use a UNION ALL treating each column as a separate result. There may be more efficient ways to do this, but here is one way:
    Select S.Empid,       Pp.Startpp Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day1, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+1 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day2, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+2 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day3, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+3 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day4, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+4 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day5, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+5 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day6, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+6 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day7, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+7 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day8, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+8 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day9, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+9 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day10, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+10 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day11, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+11 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day12, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+12 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day13, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+13 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day14, 0, 4)) = 'FRLO'

  • Actual Assessment Cycle - Multiple Segments for one Cost Center

    Dear experts,
    I've got one very important (for me) question:
    I want to distribute a cost centers (primary) cost in two ways - at the same time:
       First: as a fixed value to three other cost centers and
       Second: the remaining cost shall be distributed to all cost centers of a cost center group
                    with an statistical key figure.
    Is it possible to distibute the remaining cost after a first distribution??
    If yes, how is the procedure to do so?
    Thank you very much in advance.
    Ralf

    Hi Ralf,
    It's certainly possible; just create two steps, one after another, and you will achieve your goal.
    Regards,
    Eli

  • Idocs getting posted as segments

    Hi all,
    I have a scenario where in there are mutilpe idocs in a message (XI output) but when its getting posted to SAP(r/3) its posting as multiple segments in one idoc instead of multiple idocs.
    I would be glad if someone help me in resolving this.
    Thanks in Advance.
    Regards,
    Satish.

    HI Pola
    Problem is with mapping somewhere.
    You have mapped multiple occurring segment to 0.1 target thats the reason it is generated more than once.
    Check again.
    Thanks
    Gaurav

  • IDOC TO FILE SETTINGS

    hi all
    I am doing idoc to file scenario. can any one tell what is the basic requirements and what is the basic ale settings need to be done.
    How can i see the Successful message. how can i send the idoc to the xi without we19. i.e., as soon as the idoc is created in my r3 system then the file is generated in my receiver system. is it possible ...
    it is very urgent requirement
    help me please
    Vasu

    Hi Vasu,
    WE19 is the test tool used to create idocs. You have to manually run this txn. to post the IDOC.
    Other ways to send the idoc directly are via:
        1)Change pointer for master data.
        2)Output control (or message control) for transaction data.
    Say for output control you can do the settings (txn. NACE) so that on save of purchase order the idoc gets triggered and sent to XI system.
    For Change pointer you can use txn. BD10 to send material master idoc as per change pointer principles.
    Regards,
    Gajendra.

  • Creation of multiple Records in the file as per multiple segments in IDOC

    Hi SapAll.
    i have got a requirement to create a multiple records in a file based on multiple segments at sending Idoc in a File To Idoc Interface.
    the Scenario  is the reciever message type is mapped with fields of 3 segments in sending IDOC.
    SEG01   1.....1(PARENT SEGMENT)
      SEG02  0...999999(CHILD SEGMENT)
      SEG03 0...9999999(CHILD SEGMENT)
    in an instance where if the SEG01 exists for one time and SEG02 exists for 2 times and Seg03 Exists for 2 times PI is creating the file with 2 records in it but
    when if the SEG01 exists for one time and SEG02 exists for 2 times and Seg03 Exists for 1 time it is raising the error in message mapping where it is supposed to create 2 records in a file with empty values in the fields (mapping with seg03) segment.
    can anybody help me in this.
    regards.
    Varma

    you can create a UDF after you validate if the count match. if match you create the message if not, call de UDF.
    this UDF should receive two parameters -->Queue SEG2 and queue of SEG3.
    then you should loop by the count of SEG2. if you find a Supress Value in the queue of SEG3 add a "" to result. for example.
    for(i=0;i<=SEG2.count;i++){
    If SEG3<i>.equals(ResultList.SUPPRESS) {
           result.addValue(" ");
    }else{result.addValue(SEG3<i>);
    the result of UDF is a queue which should map to target field directly coz it has context changes
    I think that is what you are needing. if no let me know.
    RP
    Edited by: Rodrigo Alejandro Pertierra on Jun 17, 2010 11:56 AM

  • Flat File to IDOC Mapping requirement to generate Multiple Segments

    Hi Experts,
    I got a requirement were i have 2 records in a file and i need to generate 2 IDOCs  with  multiple segments in it.
    FILE :
    10/01/2010     101  KRNA     ic_quantity          30-0257     3526     1     1     ea     110000     10
    10/01/2010     101     KRNA     ic_quantity          90-0005     3526     1     2     ea     110000     10
    Idoc should generate 2 IDOCs with multiple segments as shown below
    I have imported the IDOC and changed the occurrence to " unbounded "
    The Basic  IDOC Type :  WMMBID02
    I need to generate Multiple segments of  E1MBXY1
    i.e..,  First IDOC should contain two  E1MBXY1 segments
             Second IDOC should contain Four  E1MBXY1 segments
    IDOC1 :   WMMBID02
    Segment :   E1MBXY1( 2 segments)                                                       
    10/01/2010     101     KRNA     ic_quantity          30-0257     3526     1     1     ea     110000     10
    10/01/2010     101     KRNA     ic_quantity          90-0005     3526     1     2     ea     110000     10
    IDOC2 : WMMBID02
    Segment :  E1MBXY1 ( 4 segments)                                                  
    10/01/2010     101     KRNA     ic_quantity          30-0257     3526     1     1     ea     110000     10
    10/01/2010     101     KRNA     ic_quantity          30-0257     3521     1     1     ea     110000     10
    10/01/2010     101     KRNA     ic_quantity          90-0005     3526     1     2     ea     110000     10
    10/01/2010     101     KRNA      ic_quantity          90-0005     3521     1     2     ea     110000     10
    Can anyone suggest me how to generate IDOCs with multiple segments
    what are multiple ways of generating it
    Whether it can be achieved using Multi-mapping or I need go for UDF
    If any one has done has done this type of requirement ,please share the points.
    Thanks
    Sai

    Basically you need to generate idoc per record in the flat file. During fcc conversion you convert flat file to xml structure at the sender side. In the mapping use xml file structure source and idoc as receiver structure. You just export idoc and update the idoc segment 1 to unbounded.  Please follow the michael blog for file to idoc multimapping without bpm. Yes without bpm it is possible.
    see this link... This will answer your requirement.
    https://wiki.sdn.sap.com/wiki/display/XI/File%20to%20Multiple%20IDOC%20Splitting%20without%20BPM
    >Whether it can be achieved using Multi-mapping or I need go for UDF
    you dont need udf for this.

Maybe you are looking for

  • Voice memos folder syncing issues

    (I'm on Windows 7 64-bit, iTunes 11, iPhone 4S) I deleted all the voice memos from my iTunes library by mistake but did not delete the files from my computer. Now, trying to restore them to the library this is what happened: - I dragged and dropped t

  • I installed win 8.1 on my iMac on the bootcamp partition and can't access OSX anymore. What am I doing wrong?

    Ever since I installed Windows I don't have an option to switch to Mac.I installed it on the bootcamp partition with the lastest OSX and Windows versions. I did this a few years ago with an older Mac and Vista and remembered a prompt to choose OS dur

  • Forms11g Installation-Error starting OPMN server-216.34.131.135:BIND error

    Hi, I am getting an error while installing Forms 11g. As in the installation manual, i have installed Weblogic server and then installed the forms/reports (select only Forms Server, Report Server, Forms Builder, Report Builder and HTTP Server). The s

  • How do I modify the size limitation on images in PSE 12?

      I frequently use panorama tools in Photoshop CS6 & CC and PSE 12 to generate large images (several sunsets/sunrises reach as much as 370 MB or more --- PNG or TIF without layers).  It apears that PSE 12 (and previous) have a limit less than a tenth

  • Horizontal DIV Scroll: Safari vs iPhone

    I need some help ASAP! I coded a very basic website with a horizontal scroll. It works beautifully on Safari, Chrome, Firefox, etc. But for some reason, I can't scroll past about 1400px on any give page in the site with my iPhone, at which point, the