ABAP Program to split the records

Hi Experts,
As i am new to ABAP please update me with the required ABAP Code or atlease with the skeleton Code
Source & target fields
Emp_ID ZEMP_ID (CHAR)
Start Date: ZESTA_DT (DATS)
End Date : ZEEND_DT (DATS)
My requirment is to write a start routine that split the record in to 2
Emp_ID-Start_Date-Termination Date
0001----01/01/2005---01/01/2008
0002----01/01/2007---
(Termination date will be blank if emp is still working)
As per my requirment i would like to see data in DSO as
Emp_ID-Start_Date-Termination Date
0001----01/01/2005---
0001----01/01/2005---01/01/2008
0002----01/01/2007---
I want to split the records of an employee
Please let me know if u need any information
Thanks

Hi Srinivas,
Thanks for the update....
Please correct me my if i was wrong
Data:
Emp_ID-Start date------Termination Date
0001----01/01/2005---01/01/2008
0002------01/01/2005
Loop at itab.
if itab-ZEEND_DT is initial.
itab1 = itab.
append itab1.
else. " split the records ... based on termination ..
itab1 = itab.
clear itab1-ZEEND_DT
append itab1.
itab1 = itab.
append itab1.
endif.
endloop.
My requirment is for the above example data
For the employee 0001 as Termination date is not initial i need that record to be split in to 2
Emp_ID-Start date------Termination Date
0001------01/01/2005
0001----01/01/2005---01/01/2008
Please update

Similar Messages

  • ABAP Program Name CHanging the PSA Load status

    Hi,
    Our Scenario is Non-SAP -> PI -> BI.
    Every Day PI reads the file from source and it will directly upload to PSA in BI.But in PSA the status will show as yellow only it is not turning to green.But I am able to see the data in PSA but status is yellow.
    When we activate the Data source manually the load status is turning to green.
    I heared there is an ABAP Program to change the status.If anybody knows pl provide me the details.
    Regards
    Ram.

    Hi Ramakanth,
    Yes, that right. I have mistaken here because our pos dispatcher pumps data source every 15 mins thats why its in yellow status. I am sorry about that.
    Usually there are some reasons why the PSA in yellow.
    1. If the data is being loaded from PSA to data target, it will be in yellow
    2. If the data is loaded into PSA then it will be in yellow
    3. If we make any changes in the PSA for example deleting few records in psa and then added and transferred records doenst match then it will be yellow. In this case we have to manually change the status.
    In your case I am not sure y its not getting into green once is done. We never had any issue. Pos dispatcher runs and uploads the data into PSA and then we upload into targets.
    Thanks
    Srikanth

  • ABAP Program to delete the WDSO contents from active data table & Manage Re

    Hi,
    We have requirement where we have to delete the request id from manage screen and data from Active table of WDSO.
    I have gone through this weblink where we have to hardcode the DSO name in the table (Deletion of WDSO (Write-optimized DataStore object) Load requests and active table data without deleting it from targetSAPNetworkWeblogs%2528SAPNetworkWeblogs%2529)
    Apart from that is there any suggestions or input where i can have selection screen for DSO and execute that will help us to delete the Request IDs and content of active table from WDSO.
    Suggestions or input programs really appreciated.
    Kindly do the needful.
    Regrads,
    Prem
    Edited by: pannalde on Nov 22, 2011 8:24 AM

    Hi,
    http://help.sap.com/saphelp_nw04/helpdata/en/2d/677b3c513d3311e10000000a114084/content.htm
    With program RSSM_DELETE_WO_DSO_REQUESTS it is possible to delete old requests in the Write-Optimized DSO, exactly like we are used to do with PSA requests via a Process Chain.
    This program is available as of SAP NetWeaver BW 7.01 SP07. See note 1437407 for details.
    You can automate the deletion of old WO requests by using the ABAP program step in the Process Chain.
    Regards,
    rvc

  • ABAP Program to delete the update rules

    Hi guys,
            Is there any ABAP Program to delete the update rules if any body knows.

    Hi dear,
    try with FM RSAU_UPDR_DELETE...
    Hope it helps!
    Bye,
    Roberto
    ...and please dont forget to reward the answers...it-s THE way to say thanks here !

  • To split the records of the internal table and send in Packets to XI

    Hi All,
    I am executing the program in SAP. Program will send the material numbers to Oracle through XI and in turn we will get the corresponding data back to SAP. and this all data is written into the file.
    if records are more than 700 then XI will not able to get the data fully.
    So, solution for this is to send the data in packets.
    I want to write the logic like whenever the recods are more than 700, the first 700 records  will got to XI and rest of the records will go to XI after that. we are sending the material numbers to xi through proxy.
    Problem is : how to write the logic for this.
    suppose we have  executed the report for 1000 records, then it should generate 2 excel file in which first file shud contain 700 records, AND 2nd will contain rest of the 300 records.
    Regards,
    Mamta

    Hi Mamta,
    Please try this code. This is to split records as 255 length and u can change it as ur requirement by simply changing l_offset value as 700.
    DATA: l_length TYPE i,                               
          l_lines TYPE i,                                
          l_pos TYPE i VALUE 0,                          
          l_offset TYPE i VALUE 255,                     
          l_part TYPE i,                                 
          l_lastpart TYPE i.                             
    CLEAR i_etabfinal.                                   
    REFRESH i_etabfinal.                                 
    *Split etab line as multiple 255 char length of lines
    LOOP AT i_etab INTO x_etab.                          
    l_length = STRLEN( x_etab-result ).                  
    l_lines = l_length DIV l_offset.                     
    l_lines = l_lines + 1.                               
    l_part = l_offset.                                   
    DO l_lines TIMES.
    *To avoid spaces                                    
    IF l_part LT l_length.                               
    x_etabfinal-line = x_etab-result+l_pos(l_offset).    
    APPEND x_etabfinal TO i_etabfinal.                   
    l_pos = l_pos + l_offset.                            
    l_part = l_pos + l_part.                             
    ELSE.                                                
    l_lastpart = l_length - l_pos.                       
    x_etabfinal-line = x_etab-result+l_pos(l_lastpart).  
    APPEND x_etabfinal TO i_etabfinal.                   
    ENDIF.                                               
    endloop.
    Regards,
    Subbu

  • Abap program to find the list of reports in complete

    I know we can get from sap easy access in
    information system but that is not all reports as I always find some report
    which is not listed there so we want to freeze the list and we want to know
    if we have any abap program If  u can send me the code or any standard
    program that find and list the reports
    soniya

    Check the table TRDIR and write the select statements to display.
    Check the fm  :F4_PROGRAM:  code.
    Message was edited by: Eswar Kanakanti

  • Abap program to list the status of BW infocubes

    Hi experts,
    I am an SAP BW consultant. My BW environment has around 20 cubes and dataloads are carried out every 2 hours. I need to write an ABAP program which when run anytime returns the list of all BW cubes which are reportable at that point in time.Similarly it should also list which cubes are not reportable.
    Could you please tell me how I should approach the solution to this requirement.
    Thanks Ankit

    Hi ,
          Copy paste below mentioed Code and try  .
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0b4bd31-7771-2910-41b4-ff762238a857
    Salil....

  • Abap program to find the list of SAP STANDARD reports in complete

    Please send me if you have any program since when i run TRDIRT Table in se16 it gives all the program now how to distinguish by business area like sd mm fi its tedious to open every program and check what it is . is there any ABap program that put together the list of all the reports for FI, AP, AR and MM
    Soniya Kapoor

    Hi,
      IN the table TRDIR give the application (TRDIR-APPL) and check the results..
    Cross-Application            
    A Asset Accounting             
    B Business Information Warehouse
    C PPC                          
    D DASS (control station)       
    E RIVA                         
    F Financial accounting         
    G General ledger               
    H Personnel Planning           
    I Plant maintenance            
    J Publishing                   
    K Cost accounting              
    L Inventory management         
    M Materials management         
    N Hospital                     
    P Human Resources              
    Q QSS (Quality assurance)      
    R Unknown application          
    S Basis                        
    U Enterprise Data Model        
    V Sales                        
    W MMS (Merchandise mgt. system)
    Y Customer head office         
    Z Customer branch              
    Thanks,
    Naren

  • How to split  the records into two parts

    Hi experts,
    I have a field with 75 char length, this field have records also, Now i want to split the field into two differnt fields. That means upto first 40 char goes to one field, from 41st char to 70 char goes to another field, for that how to split record into two parts.
    Plz advice this,
    Mohana

    Hi,
    Do the following:
    f1 = fsource(40).
    f2 = fsource+40(30).
    where fsource is the 70 character original string and target strings are f1 (length 40) and f2 (length 30).
    Cheers,
    Aditya
    Edited by: Aditya Laud on Feb 22, 2008 2:10 AM

  • Split the records of interanl table and upload it to fields

    Hi All,
    I have a internal table filled with records in following format.
    XXXXXXXX~~Export the invoice
    2~19980501~19980531
    // The first invoice:
    0~00130698114000010004119980512059611000276233.350.1711076.66????321000789010005???????????????????130601000000000??????????18? 3352051????532611-3357211???~~~
    0~????????176233.350.1711076.6676233.350~1510
    // The second invoice:
    0~00130698114000010007219980512059611000440482.000.175882.00????110108078901007?????????61? 68744479?????????????462088-07?????130601000000000??????????18? 3352051????532611-3357211???????????~~~
    0~????????139780.000.175780.0039780.000~1510
    0~????3.5"10702.000.17102.0070.20~1510
    I want to sort this out field by field and fill it to the respective fields.
    If i try to do so with work area
    read table itgt_frmgto into  waitgt_frmgto index 4.
    i have a out put of one line that is 4th.Butbbecause these are random records,i cannot count on lines .So i have to go by fields.
    Could anybody tell me how to do this with multiple lines coming in without using
    index concept.
    Thank you,
    Priya

    hi,
    loop the table and inside the loop split each line into other variables if the line has a fix structure or split into an another itab if not.
    SPLIT <line> AT '~~' INTO <f1> ... <fn>.
    or
    SPLIT <line> AT '~~' INTO <itab>.
    you might want to take a look at the syntax of SPLI statement.
    br

  • FM for splitting the records and then processing

    Hi all
    i have this requirement that there are records to be picked in my background job and to be processed. now the background job has to pick number of records first and process them e.g it has to pick the first 5,000 records, process them and then pick the next 5,000 records and so-on. now this is called a functionality of threading i think... and i have heard that there ia a standard FM in SAP to do this. but i am not coming across it. can anybody help me in this.
    please ask questions if doubt any.
    helpful answers will be rewarded.
    thanks
    jai

    Hi,
    try this short example.
    REPORT ZGRO_TEST.
    TABLES: BKPF.
    DATA: I TYPE I.
    START-OF-SELECTION.
      SELECT * FROM BKPF.
        I = SY-DBCNT MOD 5000.
        IF I = 0.
      do what you want.
          WRITE: / SY-DBCNT.
        ENDIF.
      ENDSELECT.
    END-OF-SELECTION.
    Hope it helps
    Regards, Dieter

  • ABAP program is not working

    I am using ABAP stage in Datastge job and new requirement is only add a new column where the column length is 25.
    Previously the program was below
       IF d_len < 16000.
          d_pack+d_offset(77) = it_1.
          d_offset = d_offset + 77.
          d_len = d_offset + 77.
    but now after adding new column
    change the program as
       IF d_len < 16000.
          d_pack+d_offset(102) = it_1.
          d_offset = d_offset + 102.
          d_len = d_offset + 102.
    it's not working if I use below code then it works but getting data small amount with some data is shift from one colum to another.
       IF d_len < 16000.
          d_pack+d_offset(102) = it_1.
          d_offset = d_offset + 102.
          d_len = d_offset + 102.
          d_pack+d_offset(77) = it_1.
          d_offset = d_offset + 77.
          d_len = d_offset + 77.
    Ant idea how to solve the issue

    Hi,
    Just a wild guess... is this code normally not something that is generated by some IBM solution..? Meaning - something not to be messed with..? Because:
    "D_LEN – Is a variable used during generation of the ABAP program. The value is set automatically based on the total length of columns in the SQL query. If this value is less than 16000, the ABAP program will concatenate the record before making an RFC call. If it is greater than 16000, each line will be a RFC call, which will create many RFC calls that will negatively effect performance." --Understanding ABAP extract data processing with InfoSphere DataStage Pack for SAP R/3 and it's performance
    cheers
    Jānis

  • What are the major situations  to go to the short dump in abap programming?

    What are the major situations  to go to the short dump in abap programming?

    Hi,
    The major situations that an ABAP Program can result a dumb are as follows...
    1) Poor coding i.e., if the data in the data base is less, then even a poor code can give you the result.  But when you transport the program into Production, then there the same program will give you a dump, resulting 'TIMED OUT' error.  So performance tunning is required for each and every program.
    2) while calling a function module.
    3) extracting of data into fields which are not type casted.
    4) in case of x/y value, one should check the value of 'y' should not be zero, else a dump will result.
    these are few which i can give for time being........

  • Generation of program code for the ABAP Query

    Dear all,
    In the creation of the ABAP query, in the final step of SQ01, Query- more functions- generate program is made.
    Why the program code is generated for the ABAP query? please  give the logical explaination for the same.
    Thanks and Regards,
    Prash

    Prash,
    a) Do you mean Program code does not have significance in query creation?
    No it does not mean this.  All queries run based on an ABAP program.  In the standard query editing process, when you save and execute the query, you will automatically re-build the existing ABAP program as necessary.  You do not need, though, to execute the menu steps you outlined in order to build, maintain, or execute the query.  It is only there for special purposes, as outlined above by Jürgen
    b) Can we see the program code generated in any transaction?
    From any screen, System > Status.  Place your cursor on the field in "Program (screen)".  Double click.
    Rgds,
    DB49

  • Where does Abap Dataflow create the Abap program

    Within Abap dataflow properties i have to give program name: which i gave as : Z_MaraXtract
    The abap dataflow extracted data perfectly fine. it created a dat file in working folder and also populated data to template table.
    Where does this Abap program "Z_MaraXtract: gets created?
    Thanks a lot for the helpful info.

    Hi Raj,
    You are probably looking for Z_MaraXtract on your DS box. This is the same thing I was looking for, for a long time.
    This is the Abap program name. The file that DataServices uses is in the folder you defined in the data store, advanced,  Generated ABAP directory.
    To the the OS filename on your DS server , rightclick on the ABAP Dataflow, properties, select the tab options and you will see a "Generated Abap filename" field. The name you put there is the physical filename on, say Windows. If you open that file (with notepad) you will see the ABAP program name  Z_MaraXtract.
    Norbert

Maybe you are looking for

  • Error in using Custom Page Layout

    Hi all, I have created some customs page layouts, and they are working fine in the Portal (EP 6.0 SP2). Now I have imported them to another Portal (same version than the first one), I made an EPA pakage with the PCD objects for the new page layouts a

  • 11.5.10.2 to 12.1.1 upgrade workers hang

    I am performing the 11.5.10.2 to 12.1.1 upgrade. My DB version is 10.2.0.4 I have the process down to 46000 workers (on the main 6678700 patch merged with two other small ones) however as the process goes along workers seem to hang randomly and I hav

  • How do i get the songs i purchased off of my phone back onto it after restoring it?

    i had to get a new iphone4, before going to the store i updated and saved all my stuff onto my computer. i came home to restore it, none of my songs were on my phone. i got my songs back onto my phone after i plugged it in again. now, none of the son

  • How to use certain symbols

    Hello, this is probably a stupid question, but I was wondering how to type the '{' and '}' signs on my macbook. I still haven't figured that one out . Thanks in advance

  • Escape key stopped working in Lion (wired keyboard)

    I upgraded my 27" iMac to Lion a few weeks ago, and over the last week or so I've noticed that the Escape key does not work. At all.  I am using a wired apple  aluminum keyboard with number pad. My problem appears to be system-wide, as none of the us