Split and reformat single record into multiple records

Hi ,
I need to split 1 record in to  2 records with 1 new field(event)
I have one internal table in this format
No country stdate          enddate
1    us        12/01/2006  10/07/2007
i need to reformat this record like ;
NO country  event    pldate           acdate 
1     us          ga      12/01/2006   12/01/2006
1     us          es      10/07/2007   10/07/2007
Can any one resolve this issue?

Check the example.
report zrich_0001 .
data: begin of itab occurs 0,
      no type i,
      country(3) type c,
      stdate  type sy-datum,
      enddate type sy-datum,
      end of itab.
data: begin of itab2 occurs 0,
      no type i,
      country(3) type c,
      event(2) type c,
      stdate  type sy-datum,
      enddate type sy-datum,
      end of itab2.
itab-no = 1.
itab-country = 'US'.
itab-stdate = '20061201'.
itab-enddate = '20071007'.
append itab.
loop at itab.
  clear itab2.
  move-corresponding itab to itab2.
  itab2-event = 'GA'.
  itab2-enddate = itab-stdate.
  append itab2.
  clear itab2.
  move-corresponding itab to itab2.
  itab2-event = 'ES'.
  itab2-stdate = itab-enddate.
  append itab2.
endloop.
loop at itab2.
  write:/ itab2-no, itab2-country, itab2-event,
          itab2-stdate, itab2-enddate.
endloop.
Regards,
Rich Heilman

Similar Messages

  • Split Single IDOC into Multiple IDOC's Based on Segment Type

    Hi Experts,
    I have a scenario IDOC to FILE ,  Split Single IDOC into Multiple IDOC's based on Segment Type
    Outbound:
    ZIdocName
    Control Record
    Data Record
    Segment 1
    Segment 2
    Segment 3
    Status Record
    I should get output like below
    Inbound:
    ZIdocName
    Control Record
    Data Record
    Segment 1
    Status Record
    ZIdocName
    Control Record
    Data Record
    Segment 2
    Status Record
    ZIdocName
    Control Record
    Data Record
    Segment 3
    Status Record
    Please suggest me step by step process to achieve this task.
    Thanks.

    Thanks a lot Harish for reply.
    I have small doubt. According to your reply , If we have N number of segments in single IDOC with same fields in all segments then for splitting Single IDOC into Multiple IDOC's based on Segment Type we need to duplicate N number of target IDOC tree structure.
    Is that possible to Split single IDOC into Multiple IDOC's based on Segment Type using only one Target IDOC structure without duplicating the Target IDOC structure tree.

  • Can we split and fetch the records in Database Adapter

    Hi,
    I designed a Database Adapter to fetch the records from oracle Database. Some time, the Database Adapter need to fetch around 5000, or 10,000 records in single shot. In that case my BPEL process is choking and getting error as
    java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2882) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
    Could someone help me to resolve this?
    In Database Adapter can we split and fetch the records, if number of records more then 1000.
    ex. First 100 rec as one set and next 100 as 2nd set like this.
    Thank you.

    You can send the records as batches useing the debatching feature of db adapter. Refer documentation for implementation details.

  • Splitting single video into multiple files - workflow improvements?

    I regularly need to split a single video into multiple separate files that are used by other programs.  I'm using Premiere Pro CS4 for a number of reasons including the ability to easily and accurately select a scene by individual frames, native audio and video effects/filters, and the ability to import and export various video types.  I'm open to using other tools, but I haven't yet found one that is even close to Premiere Pro when it comes to accurately selecting split points.
    I'm not a Premiere Pro expert.  I have been doing this for about four months and have read many resources (books, forum posts, help guides) to refine the workflow I'm currently using.  My question:  does anyone know any improvements that might save me time/keystrokes.
    Current workflow:
    I've bound F8 to File > Export > Media
    Import video file
    Open in source monitor
    Set In and Out points for scene in source monitor
    Ctrl-drag from source monitor to Project Panel (creates a subclip)
    Repeat 3 and 4 for all scenes/subclips
    Select all subclips from Project Panel and drag to timeline
    Set work area bar to first subclip in timeline by the following four keystrokes:  Home, Alt-[, PageDown, Alt-]
    Type F8 (File > Export > Media shortcut).  Type output file name, click OK and the first subclip is put in the AME queue
    For the remaining subclips, type: Alt-[, PageDown, Alt-], F8, output file name, OK and repeat until done
    Any thoughts/ideas on workflow improvements?
    Thank you!

    Thank you Hunt.
    For the sake of brevity, I didn't include all of the details about the various aspects of the projects.
    Early on I was doing what you suggested and yes, it is a little quicker.  I learned (painfully) a couple of months later that I sometimes have to go back and adjust the clips and this method (trim to timeline with no subclips) resulted in quite a bit of duplicate effort (to reobtain start/stop points).  I've since learned that managing the "scenes" as subclips in topical bins allows me to go back and make adjustments, long after I've totally forgotten about the project content, without a lot of unnecessary reworking.

  • Can I drag and drop single photos into Events?

    Hi guys. I've very recently ordered a new Mac that will have iLife 08 on it. Before I get started with it I've got a question about Events. I've been using iPhoto for the last several years, organizing my photos into albums. I've cleaned up my images to around 1,000 photos, and I plan to only use events for organization. (I don't want to use Events AND albums, don't see the point, I'm going to try using ONLY Events.) But I've got a few scenerios that I'd like to throw by you all, to see if they would work, as I'm hoping that they will...
    I don't shoot photos into pre-defined "Events", I shoot photos by what I feel like shooting. "Hey, my dog is doing something funny" - There's 3 pictures, or "Wow that's a big spider!" - 1 picture, or "My little neice is doing something cute" - There's 4 pictures. I do not want 450 events, each containing 1 - 5 pictures.
    Can I drag and drop single pictures into different events? For example, have an Event called "Friends" with pictures of my friends in it, that I put there? Or an event called "Concerts" with photos taken throughout the years?
    I hope I've made it clear what I'm looking to get out of Events!
    Thanks in advance for any help.

    Exactly - I think he will want to matain his existing structure -- people are making too much of the name change from rolls to events.
    I have events with one photo and events with as many as 2000 photos -- I like this better than rolls but albums, folders and keywords are still the key to granular organization - events are ust the library to hold my photos
    To me it is a small step forward that makes organization much easier (and it was not that hard before)
    Larry Nebel
    PS - now if I could just get all of my edits to save - where are TD and OT to solve that one for me?

  • Split single row into multiple rows containing time periods

    Hi,
    I have a table with rows like this:
    id, intime, outtime
    1, 2010-01-01 00:10, 2010-01-3 20:00
    I would like to split this row into multiple rows, 1 for each 24hr period in the record.
    i.e. The above should translate into:
    id, starttime, endtime, period
    1, 2010-01-01 00:10, 2010-01-02 00:10, 1
    1, 2010-01-02 00:10, 2010-01-03 00:10, 2
    1, 2010-01-03 00:10, 2010-01-03 20:00, 3
    The first starttime should be the intime and the last endtime should be the outtime.
    Is there a way to do this without hard-coding the 24hr periods?
    Thanks,
    Dan Scott
    http://danieljamesscott.org

    Thanks for all the feedback, Dan.
    It appears that the respective solutions provided will give you: a) different resultsets and b) different performance.
    Regarding your 'truly desired resultset' you haven't answered all questions from my previous post (there are differences in the provided examples), but anyway:
    I found that using CEIL or ROUND makes quite a difference, using my 'simple 3 record testset' (30 records vs. 66 records got initially returned, that's less than half of the original). That's quite a difference. However, I must call it a day (since it's almost midnight) for now, so there's room for more optimizement and I haven't thoroughly tested.
    But this might hopefully make a difference performancewise when compared to my previous 'dreaded example':
    SQL> drop table t;
    Table dropped.
    SQL> create table  t as
      2  select 1 id, to_date('2010-01-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-01-03 20:00', 'yyyy-mm-dd hh24:mi') outtime from dual union all
      3  select 2 id, to_date('2010-02-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-02-05 20:00', 'yyyy-mm-dd hh24:mi') outtime from dual union all
      4  select 3 id, to_date('2010-03-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-03-03 00:10', 'yyyy-mm-dd hh24:mi') outtime from dual;
    Table created.
    SQL> select id
      2  ,      max(intime)+level-1 starttime
      3  ,      case
      4           when level = to_char(max(t.outtime), 'dd')
      5           then max(t.outtime)
      6           else max(t.intime)+level
      7         end outtime
      8  ,      level period      
      9  from   t
    10  connect by level <= round(outtime-intime)
    11  group by id, level
    12  order by 1,2;
            ID STARTTIME           OUTTIME                 PERIOD
             1 01-01-2010 00:10:00 02-01-2010 00:10:00          1
             1 02-01-2010 00:10:00 03-01-2010 00:10:00          2
             1 03-01-2010 00:10:00 03-01-2010 20:00:00          3
             2 01-02-2010 00:10:00 02-02-2010 00:10:00          1
             2 02-02-2010 00:10:00 03-02-2010 00:10:00          2
             2 03-02-2010 00:10:00 04-02-2010 00:10:00          3
             2 04-02-2010 00:10:00 05-02-2010 00:10:00          4
             2 05-02-2010 00:10:00 05-02-2010 20:00:00          5
             3 01-03-2010 00:10:00 02-03-2010 00:10:00          1
             3 02-03-2010 00:10:00 03-03-2010 00:10:00          2
    10 rows selected.
    SQL> By the way: I'm assuming you're on 10g, is that correct?
    Can you give us some information regarding the indexes present on your table?

  • Search for and edit single record in database

    I am creating a few forms that access an Access database that will be used to enter data into the database.  I am able to open records from the database and scroll through records one at a time and have added features to be able to search for and display a single record.  The problem that I am having  is when I load a single record and then edit that record, I am unable to save any changes made to the record, in other words, the record doesn't update on the database.
    I can add new records and edit records as long as I scroll to them using .next(), .last(), .first(), and .previous() commands; however, when I load a single record I can't figure out how to save changes to that record in the database.

    Ok...so I think i can get it to work by doing something like:
    xfa.sourceSet.DataConnection.open();
    xfa.sourceSet.DataConnection.first();
    var oRecordList = ???????????
    var nCount = oRecordList.length;
    for (var i = 0; i < nCount; i++){
        if (CurrentRecord.rawValue != SearchField.rawValue){
            xfa.sourceSet.DataConnection.next();
    where CurrentRecord is a text field that shows the index of the current record and SearchField is the field where a user enters the record that they are searching for.
    I think I just need to figure out how to count the number of records in the database.  Any ideas?

  • How to Split java.util.Set object into multiple objects?

    Hi All,
    I'm having a collection of items in a Set. Assume that i'm having 10,000 items in Set A.
    Now i like to split the Set into multiple Set or Array such as each set or array consist of 100 records. i.e whenever
    i get more items i want to split them into mutiple set or array.
    Is there is any Java Api doesn't this function? or any other way to achieve this?
    Thanks,
    J.Kathir

    Iterate through them, placing them into different new collections.
    It may be easier to add the Set to a List, and then call sublist() a few times on the resulting List.

  • Splitting comma seperated column data into multiple rows

    Hi Gurus,
    Please help me for solving below scenario. I have multiple value in single column with comma seperated values and my requirement is load that data into multiple rows.
    Below is the example:
    Source Data:
    Product         Size                                 Stock
    ABC              X,XL,XXL,M,L,S                 1,2,3,4,5,6
    Target Data:
    Product         Size                                 Stock
    ABC              X                                     1
    ABC              XL                                   2
    ABC              XXL                                 3
    ABC              M                                    4
    ABC              L                                      5
    ABC             S                                        6
    Which transformation we need to use for getting this output?
    Thanks in advance !

    Hello,
    Do you need to do this tranformation through OWB mapping only? And can you please tell what type of source you are using? Is it a flat file or a table?
    Thanks

  • How do I split a Large CSV file into Multiple CSV's Using Powershell

    I am a novice at powershell but this looks to be the best tool to do this task. have a csv file that looks like this:
    Date,Policy,Application
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    11/14/2013,Yes,AppBiz
    11/14/2013,Yes,AppBiz
    11/14/2013,Yes,AppBiz
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    Is it possible to split this CSV into multiple CSV's based on "Application".
    Lets say the output might look like:
    None.csv
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    10/13/2014,No,None
    AppBiz.csv
    11/14/2013,Yes,AppBiz
    11/14/2013,Yes,AppBiz
    11/14/2013,Yes,AppBiz
    PeopleBiz.csv
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    07/04/2013,No,PeopleBiz
    Any help would be greatly appreciated

    I think this might be what you want:
    Import-Csv applications.csv |
    Group Application |
    foreach {
    $_.Group | Export-Csv "$($_.Name).csv" -NoTypeInformation
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    Very nice! 4x faster..
    I doubt the OP will get what you just did there..
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • Split flat file column data into multiple columns using ssis

    Hi All, I need one help in SSIS.
    I have a source file with column1, I want to split the column1 data into
    multiple columns when there is a semicolon(';') and there is no specific
    length between each semicolon,let say..
    Column1:
    John;Sam;Greg;David
    And at destination we have 4 columns let say D1,D2,D3,D4
    I want to map
    John -> D1
    Sam->D2
    Greg->D3
    David->D4
    Please I need it ASAP
    Thanks in Advance,
    RH
    sql

    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
    Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
    Imports System.IO
    Public Class ScriptMain
    Inherits UserComponent
    Private textReader As StreamReader
    Private exportedAddressFile As String
    Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
    Dim connMgr As IDTSConnectionManager90 = _
    Me.Connections.Connection
    exportedAddressFile = _
    CType(connMgr.AcquireConnection(Nothing), String)
    End Sub
    Public Overrides Sub PreExecute()
    MyBase.PreExecute()
    textReader = New StreamReader(exportedAddressFile)
    End Sub
    Public Overrides Sub CreateNewOutputRows()
    Dim nextLine As String
    Dim columns As String()
    Dim cols As String()
    Dim delimiters As Char()
    delimiters = ",".ToCharArray
    nextLine = textReader.ReadLine
    Do While nextLine IsNot Nothing
    columns = nextLine.Split(delimiters)
    With Output0Buffer
    cols = columns(1).Split(";".ToCharArray)
    .AddRow()
    .ID = Convert.ToInt32(columns(0))
    If cols.GetUpperBound(0) >= 0 Then
    .Col1 = cols(0)
    End If
    If cols.GetUpperBound(0) >= 1 Then
    .Col2 = cols(1)
    End If
    If cols.GetUpperBound(0) >= 2 Then
    .Col3 = cols(2)
    End If
    If cols.GetUpperBound(0) >= 3 Then
    .Col4 = cols(3)
    End If
    End With
    nextLine = textReader.ReadLine
    Loop
    End Sub
    Public Overrides Sub PostExecute()
    MyBase.PostExecute()
    textReader.Close()
    End Sub
    End Class
    Put this code in ur script component. Before that add 5 columns to the script component output and name them as ID, col1, co2..,col4. ID is of data type int. Create a flat file destination and name it as connection and point it to the flat file as the source.
    Im not sure whats the delimiter in ur flat file between the 2 columns. I have use a comma change it accordingly.
    This is the output I get:
    ID Col1
    Col2 Col3
    Col4
    1 john
    Greg David
    Sam
    2 tom
    tony NULL
    NULL
    3 harry
    NULL NULL
    NULL

  • Split Contents of a Cell into multiple cells

    I have a large spreadsheet where all of the data imported into one column but I need it separated into multiple columns for sorting purposes. The other formula's I've found online are not working in my spreadsheet.
    Here is an example of my data:
    I need the designer name (all information before the word Level) in the first column
    Level 3 (or whatever level it states) in the 2nd column
    The # in Red in the 3rd column
    and some but not all of the data fields have the 4th bit of info and if it's there, I would like it to appear in the 4th column. There are only 2 things that 4th item says throughout the entire document and it's "SOLE" or "TMRW".
    Any help is GREATLY appreciated.
    Thanks

    Building on Jerry's base, here is a set of formulas that will extract each piece to the correct column.
    Each is inserted into row 2 of its column, then filled down through the table. The red triangles in the bottom row occur because of the absence of data in tht row of Data, the table on the left. Two ways of avoiding them are described after the formulas.
    A2: This is Jerry's formula, modified to use the data in a separate table (named "Data").
    A2: =LEFT (Data::A, FIND(" Level ", Data::A)-1)
    B2: This extracts Level, a space, and a single digit from the string in Data::A. The problem is simplified by the number following the word "Level" is never greater than 9.
    B2: =MID(Data::A,LEN(A)+2,7)
    C2: While there may be other ways to extract the next part, I took the approach attributed to Michaelangelo when asked how he would carve an elephant: “I would take a large piece of stone and take away everything that was not the elephant.”  The carving tool here is SUBSTITUTE.
    C2: =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(Data::A," SOLE","")," TMRW",""),A&" "&B&" ","")
    D2: The easiest part of all. If the string ends with either of the four letter sets SOLE or TMRW, extract it. If not, insert a null string to maintain the blank appearance of the cell.
    D2: =IF(OR(RIGHT(Data::A,4)="SOLE",RIGHT(Data::A,4)="TMRW"),RIGHT(Data::A,4),"")
    Each of the four formulas is filled down the rest of its column.
    The Error triangles: These are caused by the lack of a string for the first three formulas to act on. The fourth does not show an error as the initial part of that formula just wants to know if the last four characters in the cell match either of the four character strings specified. Since thare aren't enough characters to match either, the comparisons both return False, and IF returns a null string ( "" ).
    You can get rod of the error triangles by eliminating any rows beyond the number of filled rows in the referenced table, Data.
    Or you can trap the errors by enclosing the current formula in each of the cells in an IFERROR function:
    IFERROR(current-formula,"")
    Regards,
    Barry

  • Automator workflow to TAR multiple files in a single directory into multiple TAR archives, in succession?

    Good afternoon,
    I have set up an automator service that TAR's a folder into an archive for me and it works quite nicely. Idealy however, I would like to be able to highlight several folders, right click and have automator tar each folder into it's own TAR archive, but do it one by one.
    Example:
    FOLDER 01
    FOLDER 02
    FOLDER 03
    Highlight all - Right Click - "TAR Folder" - Automator takes over at this point and TARs each one into:
    FOLDER 01.tar (Once complete moves onto:)
    FOLDER 02.tar (Once complete moves onto:)
    FOLDER 03.tar (Finished)
    I'm not 100% sure so I guess it would be a good time to verify, is there a problem with having the system try to TAR multiple folders at one time? If it is not a problem then I guess this discussion itself is pointless and I can simple right click on each folder and select "TAR Folder" and just wait until they're all finished. I would think that it would be ideal for the system to do each one individually and not try to do them all at one time.
    Any help would be appreciated.
    Thank you!!

    I don't think I have the following totally fleshed out but you probably can extrapolate on it.   This is a service which you can right click a set of folders  and it will tar the files within those selected folders with then file names "name xxx.tar", where name is the tar'ed file/folder and xxx is a count within the folder.
    I think that is what you originally specified so I am a bit confused by your script with the bit about Archive.tar. 
    Anyway here the basic idea:
    I ran the script directly with a folder argument just to see it indeed tar's up all the stuff inside, one tar per item.

  • 8500 adf scan Breaking a single page into multiple pages

    I have a 8500A Premium. Lately when I am scanning multiple sheets via the ADF, the scan will take each sheet and break it into multiple sheets on the scan.  i.e., if I am scanning 5 sheets, I may end up with 20 partial sheets in my scan. 

    Hello there @coolhandluke2 ,
    I read about the unusual scanning issue you are facing when you scan with your Officejet 8500A. I would suggest trying a multiple copy for starters to see the copies will also show irregularities.
    If the copies work fine, the issue is most likely within the software.
    Here are some steps to try!
    Power reset:
    Press the Power button to turn on the product.
    With the product turned on, disconnect the power cord from the rear of the product.
    Unplug the power cord from the wall outlet.
    Wait at least 15 seconds.
    Plug the power cord back into the wall outlet.
    Reconnect the power cord to the rear of the product.
    If the product does not turn on by itself, press the Power button to turn it on.
    Uninstalling the Printer Software, restarting the computer and reinstall the printer HP Officejet Pro 8500A Premium e-All-in-One Printer - A910n Drivers
    Let me know the results, good luck!
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • Can I export a single file into multiple files?

    Is there an option or a plugin that would allow me to set markers in the audio, and then have Soundbooth export the audio into multiple files?
    As an example, let's say I have a 1 minute audio file. I place a marker at 0:00 and another marker at 0:10 and a third marker at 0:30. I then would select Export Multiple and I would end up with three seperate wav files, one 10 seconds long, the second 20 seconds long and the last one 30 seconds long.
    Thanks

    Hi laforcej
    Open the PDF In Acrobat ...
    Go to Tools -> Pages -> Extract
    Now Select the Page Number you Want to Extract and Save them

Maybe you are looking for

  • Organizer defect creates and leaves temporary files in the open directory.

    I'm using Photoshop Elements 11 Organizer and Adobe Bridge CS6 concurrently.  If I have Bridge open to the same folder as PSE Organizer and I do an "Add captions ..." operation to a group of files selected in the Organizer, then there is a very good

  • IPhoto Libary cannot be open

    I have recently returned from a trip and tried to organise my photos in order to publish, print, etc. My MBP has a 256Gb SSD and the MacOS partition is pretty small (dumb choice from me, I know) so I created a new library on the NTFS partition. After

  • Duplicated

    It duplicated....sorry Can a Moderator delete it for me? ty

  • Looking for Solution(How to wait some particular time in pi7.1)

    Hi Experts, We have a source folder with a number of files in it, same name but with date time stamp. PI reads the files and sends them to the target folder with one unique name. From the target folder the file is picked up and processed by SAP, whic

  • Panasonic GH2 Raw hot spots/dead pixels trouble

    Hi, Like explaining in this link , I have bright green spots on my picture in Lightroom. My old camera Panasonic G1 didn't have this problem. How these spots is removed by Adobe raw processing ? Is it a problem with the raw file from my camera (somet