Routine at info package level

Hi Friends,
i have seen routine option at extraction tab of info provider.
Pls can any one explain me in which secenario we can write this one.
Thanks in advance,
Thanks& Regards,
Ramnaresh.
Edited by: ramnaresh porana on Dec 16, 2008 3:28 AM

Hi Ramnaresh,
Infopack level routine is gen used to calculate selection at runtime... for eg a very basic eg wud be running an infopack for the current month. Now every month, value for current month will change and hence we can write a small routine to calculate current month...
to write infopack level routine u enter 6 in Variable Change type... and start writing routine
Fill below variables in routine to get desired result!!
L_T_RANGE-SIGN
  L_T_RANGE-OPTion
  L_T_RANGE-low
  L_T_RANGE-high
  modify l_t_range index l_idx.
regards
Aadil

Similar Messages

  • Routines for File name at External Data in Info Package level.

    Hi All,
    Can any one give the example codes of how to write the routine for Files at External Data in Info Package level.
    Regards
    srinivas

    Hi Srinivas
    Here iam attaching a sample code in the infopackage level this code is used to select the Current version from TVARV table ..based on the version from variable the data is loaded into the ods..
    data: l_idx like sy-tabix.
              read table l_t_range with key
                   fieldname = 'FISCPER'.
              l_idx = sy-tabix.
    tables tvarv.
    data: v_prever(6)   type c,
          v_fiscper(7)  type n.
      clear tvarv.
      select single low
       from tvarv
       into v_prever
      where name = 'ZBSK_PREVIOUS_RELEASED_VERSION' and
            type = 'P' and
            numb = '0000'.
    concatenate v_prever(4) '0' v_prever+4(2) into v_fiscper.
       concatenate  '0' v_prever+4(2) v_prever(4) into v_fiscper.
            l_t_range-low = v_fiscper .
              modify l_t_range index l_idx.
    Hope the above code helps you..
    let me know in case of any concerns.. and further help needed..
    bye
    Shu Moh..

  • ******Creation of a loading selection for cube in info package level

    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.
    Regards
    lekha

    hi Lekha,
    try
    data: l_idx like sy-tabix,
    l_month(6) type c,
    l_dtlast6month like sy-datum.
    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
    current month
    concatenate sy-datum3(2) sy-datum0(4) into l_month.
    L_t_RANGE-HIGH = l_month.
    last 6 month
    clear l_month.
    l_dtlast6month = sy-datum - 180.
    concatenate l_dtlast6month4(2) l_dtlast6month0(4) into l_month.
    L_t_RANGE-LOW = l_month.
    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.
    Re: routine as selection in infopackage
    Re: routine as a selection in infopackage 2. Paolo Siniscalco and A.H.P
    Re: abap routine

  • Routine in Info Package, Debug in Info package.

    Hi All,
    Requirement is to include multiple ranges in Info Package based on the Conditions.
    I want to check whether it is working fine by going into debug mode.
    Can any help in this regards.
    thanks in advance,
    srinivas

    Hello Sirnivas,
    your programm contains a little error. You forgot the index!
    You wrote...
    read table l_t_range with key fieldname = 'ITM_CAT'.
    l_t_range-sign = 'I'.
    l_t_range-option = 'NE'.
    l_t_range-Low = '2'.
    clear l_t_range-high.
    modify l_t_range index l_idx.
    This will work better...
    read table l_t_range with key fieldname = 'ITM_CAT'.
    <b>l_idx = sy-tabix.</b>
    l_t_range-sign = 'I'.
    l_t_range-option = 'NE'.
    l_t_range-Low = '2'.
    clear l_t_range-high.
    modify l_t_range index l_idx.
    You can also add more selections by adding lines to l_t_range.
    example:
    data: l_idx like sy-tabix.
    data: l_t_range2 like l_t_range.
              read table l_t_range with key
                   fieldname = 'ITM_CAT'.
              l_idx = sy-tabix.
              l_t_range-sign = 'I'.
              l_t_range-option = 'NE'.
              l_t_range-Low = '2'.
              clear l_t_range-high.
              modify l_t_range index l_idx.
              move-corresponding l_t_range to l_t_range2.
              l_t_range2-sign = 'I'.
              l_t_range2-option = 'NE'.
              l_t_range2-Low = '3'.
              clear l_t_range2-high.
              append l_t_range2 to l_t_range.
    I hope this helps you!
    Regards
    Message was edited by: Vazquez Dominik

  • Selection routine in info package

    Hi gurus,
    I need to load last month's data in to BW if I am executing the IP in this month.
    that is if Iam executing in Feb 2009 then it should load Jan 2009,
    and if Iam executing on JAn 2009 then it should pick data for Dec 2008,
    For this logic I had written like,
    data: TEMP_DATE TYPE DATE,
          TEMP_MONTH TYPE CHAR(6).
    TEMP_DATE = SY-DATUM.
    TEMP_MONTH = sydatum+2(6).
    L_T_RANGE-IOBJNM = 0CALMONTH.
    L_T_RANGE-SIGN = 'I'.
    L_T_RANGE-OPTION = 'EQ'.
    L_T_RANGE-LOW = TEMP_MONTH - 1.
    L_T_RANGE-HIGH = TEMP_MONTH.
    APPEND L_T_RANGE.
    Is this OK or I need to change,
    Thanks,
    Pavan

    Hi Pavan,
    This is an example How to ... Write Infopackage selection Routine
    1.Create an Infopackage
    2. Go to selections tab and choose Type: 6 u2013 ABAP Routine.You can see following available options(F4 Help).
    3. Give disruption, and hit enter, now you will move to following screen.
    4. Write Code between begin of Routine and End of Routine.
    5. See below sample code to select date range from Previous 6 days to Current date.
    6. L_T_Range table is of Type structure RSSDLRANGE.
    a. RSSDLRANGE contains SIGN, OPTION, LOW, HIGH
    We need to populate these fields to pass range dynamically.
    Sample Code:
    ***$$ begin of routine - insert your code only below this line -
    Data: l_idx like sy-tabix.
    Data: date_low like sy-datum.
    Date_low = sy-datum u2013 6.u201D(To get 6 days back).
    read table l_t_range with key
    fieldname = 'CRDAT'.
    l_idx = sy-tabix.
    Pass Range values to L_T_Range Table.
    Move date_low to L_T_Range -Low.
    Move sy-datum to L_T_Range -High.
    L_T_Range -Sign = u2018Iu2019. *****(Here: I u2013 Include, E u2013 Exclude)
    L_T_Range -Option = u2018BTu2019.****( Here: BT u2013 Between )
    modify l_t_range index l_idx.
    p_subrc = 0.
    Regards
    Sudheer

  • Process chain failed at info package level

    hi experts,
    i have a process chain for IS_QLTMR, it is loading data to IC_QLTMR, every day it is running successfully, but today at infopackage it has failed in details tab it is showing bellow error message.
    Object requested is currently locked by user ALEREMOTE
    what is it mean, how can i solve my problem,
    please advice me to solve this,
    thanks in advance,
    venkat

    This time its correct. As last time , it was locked, so may be it has picked only 18000 records before lock occures.
    However, to know the correct data, go to your source system and check in RSA7 how many records are there.
    For active update rule, check your update rule whther its active. If not, then you have to activate the update rule. If you are in production and you dont have authorization, then raise a ticket for this.
    Thanks...
    Shambhu

  • Info Package ABAP Routine

    Hi
    For FIGL_4 there is both open items and closed items. i want to filter only Open Items Accounting doc no's records for Customers,Vendors,GL account at info package level.
    There are 3 ODS's in BW side for Open items Customers,Vendors,GL accounts. i want to filter open items based on these 3 ODS's Active data table.But i am getting error when i execute the request in Info Package.
    *Error Message "For sel. field 'BELNR ', no selection with SIGN = ' '; OPTION ' ' allowed     RSM1     607     *
    Below is the Info package Routine code
    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: ...
    TABLES: /BIC/AZOCFFIGL00,/BIC/AZOCFBSID00,/BIC/AZOCFBSIS00
            ,/BIC/AZOCFBSIK00.
    DATA:   ...
    TYPES : BEGIN OF TY_ZOCFBSID,
            /BIC/ZMCFADCNO LIKE /BIC/AZOCFBSID00-/BIC/ZMCFADCNO,
            END OF TY_ZOCFBSID.
    TYPES : BEGIN OF TY_ZOCFBSIS,
            /BIC/ZMCFADCNO LIKE /BIC/AZOCFBSIS00-/BIC/ZMCFADCNO,
            END OF TY_ZOCFBSIS.
    TYPES : BEGIN OF TY_ZOCFBSIK,
            /BIC/ZMCFADCNO LIKE /BIC/AZOCFBSIK00-/BIC/ZMCFADCNO,
            END OF TY_ZOCFBSIK.
    DATA : TB_ZOCFBSIS TYPE TABLE OF TY_ZOCFBSIS WITH HEADER LINE,
           WA_ZOCFBSIS TYPE TY_ZOCFBSIS.
    DATA : TB_ZOCFBSID TYPE TABLE OF TY_ZOCFBSID WITH HEADER LINE,
           WA_ZOCFBSID TYPE TY_ZOCFBSID.
    DATA : TB_ZOCFBSIK TYPE TABLE OF TY_ZOCFBSIK WITH HEADER LINE,
           WA_ZOCFBSIK TYPE TY_ZOCFBSIK,
           FLAG TYPE I.
    $$ end of global - insert your declaration only before this line   -
        InfoObject      = ZMCFADCNO
        Fieldname       = BELNR
        data type       = CHAR
        length          = 000010
        convexit        = ALPHA
    form compute_BELNR
      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 = 'BELNR'.
              l_idx = sy-tabix.
           SELECT
           /BIC/ZMCFADCNO
           FROM /BIC/AZOCFBSID00
           INTO TABLE TB_ZOCFBSID.
            SELECT
            /BIC/ZMCFADCNO
            FROM /BIC/AZOCFBSIK00
            INTO TABLE TB_ZOCFBSIK.
            SELECT
            /BIC/ZMCFADCNO
            FROM /BIC/AZOCFBSIS00
            INTO TABLE TB_ZOCFBSIS.
           LOOP AT TB_ZOCFBSID INTO WA_ZOCFBSID.
           l_t_range-sign = 'I'.
           l_t_range-option = 'EQ'.
           l_t_range-low = WA_ZOCFBSID-/BIC/ZMCFADCNO.
           Append l_t_range.
           CLEAR l_t_range.
           ENDLOOP.
           LOOP AT TB_ZOCFBSIK INTO WA_ZOCFBSIK.
           l_t_range-sign = 'I'.
           l_t_range-option = 'EQ'.
           l_t_range-low = WA_ZOCFBSIK-/BIC/ZMCFADCNO.
           Append l_t_range.
           CLEAR l_t_range.
           ENDLOOP.
           LOOP AT TB_ZOCFBSIS INTO WA_ZOCFBSIK.
           l_t_range-sign = 'I'.
           l_t_range-option = 'EQ'.
           l_t_range-low = WA_ZOCFBSIS-/BIC/ZMCFADCNO.
           Append l_t_range.
           CLEAR l_t_range.
           ENDLOOP.
              modify l_t_range index l_idx.
              p_subrc = 0.
    $$ end of routine - insert your code only before this line         -
    Edited by: AtulMohan Mishra on Dec 27, 2010 1:11 PM

    Hi
    Now i am facing an error during data extraction from Source system
    error message in BW system "Error occurred in the data selection " Data Package 1 : arrived in BW ; Processing : 2nd processing step not yet finished
    when i checked in  SM37 (R3 system) i found the job has been cancelled and Log of this job says
    "Asynchronous sending of InfoIDOCs 2 in task 0001 (0 parallel tasks) DATASOURCE = 0FI_GL_4 
    ABAP/4 processor: SAPSQL_WHERE_CANT_SCAN                                   
    Job cancelled      "   
    it seems to me the Problem in Routine at Info Package level.
    My Requirement is to fetch only those Accounting Doc. No. RECORDS from 0FI_GL_4 data source which are present in Active data table of BSID,BSIK,BSIS ODS's.
    So i want to put logic at Info Package routine .
    1) fetch all Accounting Doc. No.  from Active data table of BSID,BSIK,BSIS Ods's and Match those Accounting Doc. No.'s with the 0FI_GL_4 data source Accounting Doc. No's.if a Accounting Doc. No. match with 0FI_GL_4 data source Accounting Doc no then that corresponding record from 0FI_GL_4 will go to the ODS
    Regards
    Atul

  • 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

  • Specific Values in Info Package

    Hi All,
    I want to load the data into BW by giving the specific values in Info Package Level.
    For example i want to load data for a sales number = 1,6,10,2000 etc. Instead of giving the intervals, i want to load the data specific to the sales Order Number
    I have seen From and TO values over there. Can i write any ABAP Code to pull the data by hard coding the above values over there.
    Pls suggest.
    Thanks,
    Jelina.

    Hi,
    You can achieve it in both the ways.
    You can hardcode in the infopackage through multiple single values instead of range.
    Please the cursor on the Sales Order number and Click the green color '+' button.
    It will create an additional line.  You can enter the second Sales order number.
    You can also write an ABAP routine.
    But if the sales order numbers are available, then it is better to enter in the data selection sceen.
    Thanks.

  • Varaible in Info Package

    HI Experts,
    I need to create a variable in Info Package for field Fiscalyear/Period, so that we can pull the data for current quarter and for future 3 quarters.
    We can do this by OLAP variable and by ABAP Routine in Info Package.
    If we go with option ABAP Routine (Type - 6) in Info Package can you please provide me the sample code (for field Fiscalyear/Period to tirgger for current quarter and for future 3 quarters.)
    Millions of thanks in Advance
    Warm Regards,
    Reddi

    I'm suggesting an adjustment to that, because what has been presented here will get you the current fiscal period and subsequent 11 months, assuming that the fiscal period is the same as the calendar month.
    To get the current and 3 subsequent quarters as requested by xys redd, I'd modify this to something like the following.  I've also given a bit of code to determine the current fiscal period if you have a fiscal year variant that does not line up with calendar dates.
    DATA: l_per LIKE t009b-poper, "Period
          l_year LIKE t009b-bdatj, "Year
          l_fisc TYPE /BI0/OIFISCPER,
          l_fisc1 TYPE /BI0/OIFISCPER.
    * Determine the fiscal period.  Use this if the fiscal
    *   calendar difers from the month in SY-DATUM
    *  CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
    *   EXPORTING
    *      i_date         = SY-DATUM
    *      i_periv        = '<YOUR FISCAL YEAR VARIANT HERE>'
    *    IMPORTING
    *      e_buper        = l_per
    *      e_gjahr        = l_year
    *    EXCEPTIONS
    *      input_false    = 1
    *      t009_notfound  = 2
    *      t009b_notfound = 3
    *      OTHERS         = 4.
    * Take the easy way out if the fiscal calendar is simple.
    l_per = sy-datum+4(2).
    l_year = sy-datum+0(4).
    * Move back to the beginning of the quarter (assuming 3-month quarters)
    l_per = ( ( ( l_per - 1 ) DIV 3 ) * 3 ) + 1 .
    CONCATENATE l_year l_per into l_fisc.
    * Figure out the ending period.
    CASE l_per.
      WHEN '001'.
        l_per = '012'.
        l_year = l_year.
      WHEN others.
        l_per = l_per - 1.
        l_year = l_year + 1.
      ENDCASE.
    CONCATENATE l_year l_per INTO l_fisc1.
    DATA: l_idx LIKE sy-tabix.
    READ TABLE l_t_range
      WITH KEY fieldname = 'FISCPER'.
    l_idx = sy-tabix.
    l_t_range-low = l_fisc.
    l_t_range-high = l_fisc1.
    l_t_range-sign = 'I'.
    l_t_range-option = 'BT'.
    MODIFY l_t_range INDEX l_idx.
    p_subrc = 0.

  • Info package Routine - How to write

    Hi ,
    Can any body give me the step step by process on how to write Info package routine. Actually my requirement is to load the current month Data automatically through infopackge . I can write the ABAP code , but i am told to write in Infopackage level.
    Thanks in advance..

    Hi,
    In our case we had a requirement to load the data for the transactions occuring in the last 15 days only, so we have write the routine on the last modified date feild  in the infopackage.so as to select only records modified or created in the last 15 days..
    attached is the sample code....
    data: l_idx like sy-tabix.
      read table l_t_range with key
           fieldname = 'LAST_MODIFIED_DA'.
      l_idx = sy-tabix.
      data : w_cdate type d .
      l_idx = sy-tabix.
      w_cdate = sy-datum.
      w_cdate = w_cdate - 15 .
      L_t_RANGE-LOW  = w_cdate .
      L_t_RANGE-HIGH = sy-datum .
      L_t_RANGE-SIGN = 'I'.
      L_t_RANGE-OPTION = 'BT'.
      append l_t_range.
      modify l_t_range index l_idx.
      p_subrc = 0.
    Hope it helps...
    Regards,
    Umesh.

  • ABAP Routine in selection of Info package in 3x

    Hello Experts
    We need to load distinct PO data in 3x server.
    I have added this distinct po values in range table of info package abap routine.
    However its not loading for range table values more than two selections/pos.
    If I try to append more than 2 values,only last one is uploaded.
    However after load, in monitor tab-header , selection paramenters I can see all PO values in selection.
    Some how it works only for two inputs (rows) in range table of ABAP routine in infopackage.
    Anybody has faced such issue? any help is appreciated!
    Edited by: Kanchan Angalwar on Jan 30, 2010 9:59 AM

    Hi,
    Please post your ABAP code here

  • 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.

  • Info package routine

    If I want to delete a line of data in say an update rule start routine, I can write for example the following:
      DELETE DATA_PACKAGE WHERE <field> NE 'ABC'.
    I am wondering if I can write the same in an info package and if so rather than DATA_PACKAGE what should I be referencing? Thanks

    Hi Nitin,
    Please note that is is not possiable to delete any data in InfoPackage routine, but surely you could ignore the value of a field when it is not equal to ABC or just load data for a field for value ABC. If that field is not present in the selection screen, you could get it into the selection screen by selecting it in RSA6, datasource maintenance.
    No need to write a routine, it is just a simple selection is what you need to give.
    Hope this helps.
    Regards,
    Pankaj

  • Info Package Routine issue.

    Hi I was working on an info package routine. I have to load somw documents based some some criterias. My question is how may values can i append for loading Document No. i have somwhere about 400,000 records. I'll have all those doc no's in an Internal table... Can i append all those and load or is there any limit for doing so.
    Thanks in Advance.

    Hi Siva,
    I would suggest to use range instead of appending the document numbers one by one. Its not best of approach.
    You can maintain a transparent table with different range values if you don't have sequential values. Write a routine in the info-package to restrict the document number to the ranges.
    Hope it helps.
    Thx.
    Soumya

Maybe you are looking for