ABAP Routine to duplicate data

Dear Experts:
             I need to duplicate data in a cube, changing the time characteristics. Can I do this with an ABAP Routine. This duplication has to be done each time the infopackage is executed. If this is posible, where should I write this routine? In the Start Routine of the Update Rules of the cube? or in the Update Rules inside the time characteristics?
Thanks in advance.
Pablo.

So something has gone bump somewhere inthe Export DataSource creation.  The cube name ZBALANCE should not be an issue.
One thing that might be an cause, although I think you get a message about it is a missing Factview when you try to run the InfoPkg, but it's worth a look.  Each cube should have a Factview created.  It is a union view of both the F and E fact tables.  Normally, the export datasource uses this view to extract tdata form the cube.
In SE12, search Views to see if you have the FactView - /BIC/VZBALANCEF.  If you are missing it, search OSS notes on "Missing Factview".  There is a pgm you can run - SAP_FACTVIEWS_RECREATE that recreates all teh Factviews.

Similar Messages

  • ABAP routine for loading data of current month in InfoPackage

    Hello experts,
    I want to load data of current month. Therefore I implemented the following ABAP-Routine for field 0CALDAY in the InfoPackage's data selection:
    data: lv_datum_l like sy-datum,
             lv_datum_h like sy-datum. 
      concatenate sy-datum(6) '01' into lv_datum_l.
      call function 'RP_LAST_DAY_OF_MONTHS'
      exporting
      day_in = sy-datum
      importing
      last_day_of_month = lv_datum_h.
      l_t_range-sign = 'I'.
      l_t_range-option = 'BT'.
      l_t_range-low = lv_datum_l.
      l_t_range-high = lv_datum_h.
    But function 'RP_LAST_DAY_OF_MONTHS' cannot be found!
    Any other suggestions for getting last day of current month?
    regards
    hiza

    Hi,
    Add this code. When u complete execution of this code, ZDATE will have ur month end date.
    data : zdate_c(2) type c,
           zyear_c(4) type c,
           zmonth_c(2) type c.
    data :  zdate like sy-datum.
    data :  zday(2) type n.
    zdate = sy-datum
          zyear_c = zdate(4).
          zmonth_c = zdate+4(2).
          zdate_c = '01'.
          concatenate zyear_c zmonth_c zdate_c into zdate.
          CALL FUNCTION 'FIMA_END_OF_MONTH_DETERMINE'
          EXPORTING
            I_DATE         = zdate
          IMPORTING
            E_DAYS_OF_MONTH = NO_OF_DAYS.
          zday = NO_OF_DAYS.
          concatenate zyear_c zmonth_c zday into zdate.

  • Info package ABAP Routine to populate date from and To filed

    Hello Experts,
    I have requirement to populate the From and To dates with the: T-1 to T (Current Date u2013 1 to Current Run Date aka Sy-Datum) at info package level.I have written a code for this but see that From filed is not getting populated but TO filed is filled with current date.Can someone please tell me wats wrongwith my code?It is a delta info pacakage.
    data: l_idx like sy-tabix.
    read table l_t_range with key
         fieldname = 'CPUDT'.
    l_idx = sy-tabix.
      l_t_range-sign = 'I'.
      l_t_range-option = 'BT'.
      l_t_range-low = sy-datum - 1.
      l_t_range-High = sy-datum.
    modify l_t_range index l_idx.
    p_subrc = 0.
    Thanks,

    Was able to tackle this using the following code.
    data: l_idx like sy-tabix.
    data: V_date type sy-datum.
    v_date = sy-datum - 1.
    read table l_t_range with key
         fieldname = 'CPUDT'.
    l_idx = sy-tabix.
      l_t_range-sign = 'I'.
      l_t_range-option = 'BT'.
      l_t_range-low = v_date.
       l_t_range-High = sy-datum.
    modify l_t_range index l_idx.
    p_subrc = 0.
    Thanks,
    I am closing this thread

  • Abap routing in infopackage data selection

    Hi guys
    I'm using an ABAP routin for the Data selection in my infopackage. I want to fetch all the records which is having value Less than 'IN14' for company code.I have modifuied the l_t_range as shown
              l_t_range-sign = 'I'.
              l_t_range-option = 'LT'.
              l_t_range-low = 'IN14'.
              modify l_t_range index l_idx.
    But while executing, its giving the followinf error message.
    "For sel. field 'COMP_CODE', no selection with SIGN = 'I'; OPTION 'LT' allowed"
    Does anybody knows what should be done for this?
    Regards
    Sriram

    Hi Sriram,
    Instead use an OLAP variable to achieve the results you want.
    But first check what are the selection oprions supported by your data source in the table <b>ROOSFIELD</b> in your source system.
    Bye
    Dinesh
    Message was edited by: Dinesh Lalchand
    Message was edited by: Dinesh Lalchand

  • Abap routine to NOT to allow only one value

    Hello Everyone,
    I am trying to filter out one PO Number from WBS costs load.  I wrote an abap routine as the data selection.  The data source does not allow the 'NE'.  Any suggestions?
    Below is the code.
    read table l_t_range with key
                   fieldname = 'REFBN'.
              l_idx = sy-tabix.
             l_t_range-SIGN = 'I'.
             l_t_range-OPTION = 'NE'.
             l_t_range-low = '786587543'.
             modify l_t_range index l_idx.
              p_subrc = 0.

    Hi Shilpa,
    We had a similar problem..
    The way we solved it was by loading by PO number..
    Say if you want to skip PO number 5000,
    Load first load using selection 1-4999 and second load from 5001-999999.
    Hope this helps
    Ashish

  • ABAP Routine BW 3.1

    Hi,
    I need to create an ABAP routine that takes data from 0fiscpers: 004.2008 and 005.2008.
    How could that be coded?
    data: l_idx like sy-tabix.
              read table l_t_range with key
                   fieldname = 'FISCPER'.
              l_idx = sy-tabix.
    Br,
    Sonni

    Hi,
    I found a solution:
    program conversion_routine.
    Type pools used by conversion program
    type-pools: rsarc, rsarr, rssm.
    tables: rssdlrange.
    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:  per(3) TYPE n,
           year(4) TYPE n.
    $$ end of global - insert your declaration only before this line   -
        InfoObject      = 0FISCPER
        Fieldname       = FISCPER
        data type       = NUMC
        length          = 000009
        convexit        = PERI7
    form compute_FISCPER
      tables   l_t_range      structure rssdlrange
      using    p_infopackage  type rslogdpid
               p_fieldname    type rsfnm
      changing p_subrc        like sy-subrc.
          Insert source code to current selection field
    $$ begin of routine - insert your code only below this line        -
      DATA: l_idx LIKE sy-tabix.
      READ TABLE l_t_range WITH KEY
           fieldname = 'FISCPER'.
      l_idx = sy-tabix.
      l_t_range-sign = 'I'.
      l_t_range-option = 'BT'.
    concatenate sy-datum(4) '0' sy-datum+4(2) into
       l_t_range-high.
      per = l_t_range-high+4(3).
      year = l_t_range-high(4).
      IF per = '001'.
        per = '012'.
        year = year - 1.
      ELSE.
        per = per - 1.
      ENDIF.
      CONCATENATE year per INTO l_t_range-low.
      MODIFY l_t_range INDEX l_idx.
      p_subrc = 0.
    $$ end of routine - insert your code only before this line         -
    endform.

  • Data selection in info package using ABAP routine.

    Hi,
    when we are  scheduling the info package(Infp package name is like XYZ),we want to load past 6 months data from the current date(INFO OBJECT(0CREATEDON) BETWEEN (Sy-Datum - 6 months TO  Sy-Datum),in the selection tab in schedule i want to write the abap routine (type 6).please can any one have this type of code please sedn to me asap.
    this is very urgent.delivery is tomorrow.

    hi Lekha,
    try following code.
    seems you post the same question twice, one posting is sufficient. and please don't forget to reward helpful answers.
    data: l_idx like sy-tabix.
    read table l_t_range with key
    iobjnm = '0CREATEDON'.
    l_idx = sy-tabix.
    DELETE l_t_range
    WHERE iobjnm = '0CREATEDON'.
    L_t_RANGE-SIGN = 'I'.
    L_t_RANGE-OPTION = 'EQ'.
    if not work, try
    L_t_RANGE-OPTION = 'BT'.
    BT = between
    last 6 month
    L_t_RANGE-LOW = sy-datum - 180.
    current date
    L_t_RANGE-HIGH = sy-datum.
    append l_t_range.
    modify l_t_range index l_idx.
    p_subrc = 0.
    $$ end of routine - insert your code only before this line -
    endform.

  • ABAP ROUTINE AT INFOPACKAGE FOR DATE RANGE

    hi all,
    I want to Schedule my infopackge with selection options 
    0DATE  infoobject with First date of current month( 01.02.2008)  to last date of current month ( 29.02.2008).
    this i have to get automatically bcoz i have to use this in process chain.
    so I want to write a routine for this at the infopackage level with ABAP Routine -6 option.
    So please suggest me how to write the code for this case.
    thanks,
    kiran manyam.

    Hi Kiran,
    Please paste the following code there and also check for syntax error.
    data first_date type d.
    data last_date type d.
    first_date = sy_datum.
    first_dat+6(2) = '01'.
    CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
    Exporting
    DAY_IN = first_date
    Importing
    LAST_DAY_OF_MONTH = last_date.
              read table l_t_range with key
                   fieldname = 'DATE'.
               if sy-subrc = 0.
                   l_idx = sy-tabix.
                   l_t_range-sign = 'I'.
                   l_t_range-option = 'BT'.
                   l_t_range-low = first_date.
                   l_t_range-high = last_date.
                   modify l_t_range index l_idx.
                else.
                   move 'DATE' to l_t_range-fieldname.
                   l_t_range-sign = 'I'.
                   l_t_range-option = 'BT'.
                   l_t_range-low = first_date.
                   l_t_range-high = last_date.
                   append l_t_range.
                   endloop.
                endif.
              p_subrc = 0.

  • Sample ABAP routine code to load only previous month data in INFOPACKAGE

    Hi all,
    I want to create one ABAP routine in InfoPackage (Variables change to selection values with background processing) for 0CALMONTH ( Calender year month) so that whenever this infopackage is executed it should fetch only previous month data.
    Can anyone please provide any sample code for that.
    Thanks in advance.
    Uday shankar.

    Hi
    Please check with below code, hope this will resolve your issue
    WHEN: 'ZLASTP'.
         CLEAR: h_period, h_gjahr.
         CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
           EXPORTING
             i_date               = sy-datum
       I_MONMIT             = 00
             i_periv              = 'AF'
          IMPORTING
            e_buper              = h_period
            e_gjahr              = h_gjahr
    EXCEPTIONS
       INPUT_FALSE          = 1
       T009_NOTFOUND        = 2
       T009B_NOTFOUND       = 3
       OTHERS               = 4
         IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
         IF h_period = '001'.
           h_gjahr = h_gjahr - 1.
           h_period = '012'.
         ELSE.
           h_period = h_period - 1.
         ENDIF.
         CLEAR l_s_range.
         CONCATENATE h_gjahr h_period INTO l_s_range-low.
         l_s_range-sign = 'I'.
         l_s_range-opt  = 'EQ'.
         APPEND l_s_range TO e_t_range.

  • ABAP Routine in the Infopackage data selection

    All,
    I have requirement where i need to write a routine on a Date field(Activity Year Month) which has to return values from the first to the last day of the Previous month in the data selection of the infopackage.
    I know that on Date there is a STD that can be used but my requirement is on Year Month.
    there are 3 vartypes available
    5. free temporal selection
    6. ABAP routine
    7. OLAP variable
    when i pick ABAP routine it asks me to create a routine i need some help with the code here
    Can someone help.
    Thanks

    Hi there
    If the Data field is 0FISCPER you can use the OLAP variable 0P_PRFP1. If you have developed the field yourself i think you need to write code. The code could look something like this.
    DATA:  sysdat TYPE d.
      sysdat = sy-datum.
      sysdat4(2) = sysdat4(2) - 1.
      IF sysdat+4(2) = '0'.
        sysdat+4(2) = '12'.
        sysdat(4) = sysdat(4) - 1.
      ENDIF.
      CONCATENATE sysdat(4) '0' sysdat+4(2) INTO l_t_range-low.
      MODIFY l_t_range INDEX l_idx.
      p_subrc = 0.
    This code returns the previous months as a single value.
    Chris

  • How to debug a ABAP Routine which is in Infopackage Data selection Tab

    Hi ,
       Please let me know How to debug a ABAP Routine which is in Infopackage Data selection Tab.

    Hi,
    You can try to create infinite loop:
    DATA: STOP.
    WHILE STOP IS INITIAL. ENDWHILE.
    Start InfoPackage and then go to SM50 and swich on debugging for your process. Then in debugger you can change value of STOP variable to skip the loop.
    Krzys

  • Hi loading last 2 months data using abap routine

    we are planning to write a routine in infopackage level,
    using the option 6-ABAP routine, to select the last 2 month data ,
    we have the time characteristics 0CALMONTH, At present we managing the load by manually changing the selection for last 2 month every time ,
    It would be a great help if anybody can show a sample code to select last 2 month data,
    Thanks,

    Hi,
    data: l_idx like sy-tabix.
    DATA: lv_calmonth LIKE /BI0/SCALMONTH-CALMONTH.
    DATA: lv_day TYPE DATS.
    "previous month
    lv_day = SY-DATUM.
    lv_day+6(2) = '01'.
    lv_day = lv_day - 1.
    lv_calmonth = lv_day(6).
    READ TABLE l_t_range with key fieldname = 'CALMONTH'.
    l_idx = sy-tabix.
    MOVE lv_calmonth TO l_t_range-low.
    MODIFY l_t_range INDEX l_idx.
    "previous month - 1
    lv_day+6(2) = '01'.
    lv_day = lv_day - 1.
    lv_calmonth = lv_day(6).
    MOVE lv_calmonth TO l_t_range-low.
    APPEND l_t_range.
    p_subrc = 0.
    let me know if this works.... not sure about the last append.
    Olivier.

  • Abap Routine for Date selection in Infopackage

    Hi
    I have to write an abap routine for date selections in the infopackage,
    There are two date begda and enda.
    Do i code for BEGDA and fill in the begin date using routine and use another routine to fill the ENDA.
    JPJP

    Hi JP,
      If you have two info objects BEGDA and ENDA in the Info package for selection
      then you will have to write seperate routine for each of them.
      If you want to give single value for each date field then update only the field l_t_range- low otherwise if you want to give range then you can update the internal table fields l_t_range-low and l_t_range-high .
    Regards,
    Prakash

  • Load data only for current month using ABAP Routine

    Hi Everyone,
    I am loading data from R/3 using the 0HR_PA_OS_1 extractor. This requirement is to load the position numbers from R/3. Using the extractor for a given position 28 I get the following dataset results.
    CALMONTH  POSITION
    11-2004           28
    12-2004           28
    01-2005           28
    02-2005           28
          |
    07-2007          28     CURRENT DATE
    Now when I pull data in BW I only want to load the record for most current i.e. 07-2007. I DO NOT want that ALL the records since the day the position was created should be loaded.
    Now I do understand this can be achieved using a ABAP routine in the INFOPACKAGE. Below is the routine that I am using and what it is doing is that it is only bringing in the first record.
    data: l_idx like sy-tabix.
      clear: l_idx.
      read table l_t_range with key
           fieldname = 'CALMONTH'.
      l_idx = sy-tabix.
    Current month only
      l_t_range-low = sy-datum(6).      "Current month
    l_t_range-high.
      l_t_range-option = 'EQ'.                           "equals
    l_t_range-sign = 'I'.
      modify l_t_range index l_idx.
      p_subrc = 0.
    Can anyone suggest a solution as to why this is happening?
    Thanks,
    Rahul

    One explanation would be
    - If there is no CALMONTH selection values specified in the selection tab, l_t_range would be empty. This would mean there would be no line for CALMONTH selection, and the code won't modify the l_t_range.
    If this is true, you need to check sy-subrc after reading from the itab.
    data: l_idx like sy-tabix.
    clear: l_idx.
    read table l_t_range with key fieldname = 'CALMONTH'.
    if sy-subrc = 0.
    l_idx = sy-tabix.
    * Current month only
    l_t_range-low = sy-datum(6). "Current month
    * l_t_range-high.
    l_t_range-option = 'EQ'. "equals
    * l_t_range-sign = 'I'.
    modify l_t_range index l_idx.
    else.   
    move 'CALMONTH' to l_t_range-fieldname.
    l_t_range-low = sy-datum(6).
    l_t_range-sign = 'I'.
    l_t_range-option = 'EQ'.
    append l_t_range.
    endif.
    p_subrc = 0.

  • InfoPackage ABAP Routine for Date Range - Only Start Date Extracted

    I am using an ABAP Routine in an InfoPackage to select data for a 2 year period.  The routine converts SY-DATUM into the Current Fiscal Year and Period, and then calculates the Starting and Ending Fiscal Year / Period of a 24 month period.  The Start and End values are passed to the InfoPackage as l_t_range-low and l_t_range-high.
    The Source and Target are both Basic Infocubes.
    The InfoPackage executes successfully, and the Selection values on the Header tab of the monitor reflect a 24 month period.  Unfortunately, on closer review of the data in the cube, only data for the first month appears to have been loaded.  I’m guessing that the extract was only performed with the From value, even though a To value was also provided.
    I created a simple Infopackage and manually input the selection parameter values just to be sure I wasn’t overlooking something. The InfoPackage performed as expected, loading more data which spanned the selection time period.
    I can provide the code if it helps, but the fact that the monitor reflects a Start and End value suggests that the problem is with the InfoPackage, not the ABAP routine.
    Has anybody ever experienced this before ?  Any ideas would be greatly appreciated ?
    Thanks,
    Lyle

    We can write ABAP routine in Infopackage with a range of values (From & To). Make sure you fill all the following information while building the final range information as below,
       l_s_range-sign    = 'I'.
       l_s_range-option  = 'BT'.
       l_s_range-low     = lowvalue.
       l_s_range-high    = highvalue.
      MODIFY l_t_range FROM l_s_range INDEX l_idx.
    As you can see the key is passing the "BT" information for capturing range.
    Hope it helps..
    thanks
    Kumar

Maybe you are looking for

  • J2SDK1.4 Installation problem on Linux

    After downloading J2sdk 1.4 from Java Sun site, it was stored on my windows system as j2sdk-1_4_0_01-linux-i586-rpm.bin file. I did ftp to this file to a location in my Linux box. But I am unable to extract the .bin file to .rpm file.Somebody please

  • How to customize the data selection on a standard 2LIS_08TRTLP

    Hi All, on the datasource '2LIS_08TRTLP Shipment delivery per stage', I would need to filter on  '0DEL_TYPE delivery type' but it is not part of the standard 'data selection' for this datasource. I have some initial loading issue if I cannot filter d

  • Not able to log into (IR,ID,SLD,RWB) j2EE Engine.

    Dear Experts, We have SAP PI 7.0 installed in our landscape. Clients 110 and 100 are created. User ABCD is created in 110 with all (SAP_XI, SAP_SLD, SAP_BC_AI* and SAP_NEW, SAP_ALL) privileges. I am able to log into 110 with user ABCD. But, I am not

  • Cant get finder to run

    Hello, I have a black macbook which I bought a while ago (more than a year) and in december I installed leopard. It runs great but I realized it made my computer a bit slower, when I started the computer it took an unusual amount of time for the bar

  • Can texturiser filters be applied without the tiling grid effect over an image?

    i am working with fairly small images, 30 x 20 centimeters ...12 x 8 inches... @ 300 dpi...and want to apply the Canvas Texturiser filter over the image.  but when i do the texture comes up as a grid-like tiled surface which looks very unprofessional