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

Similar Messages

  • Selection option in info package

    Hello Friends,
    While loading data in BW system (3.5 Version).
    I would like to use selection option in info package for one particular field.
    I can see only range options (Selection From and Selection To) which does not satisfy my requriement.
    I need to select nearly 5000records which are in one specific number range, so, how can i select these records in infopackage.
    Thanks
    Tony

    Did you think of InfoPackage routine?
    Try to write a routine under data Selection tab based on your data selection scenarios. I think you can achieve your goal.
    1) Data selection tab - Type column, choose ABAP routine.
    Whendo we use this?
    when we cannot extract data selectively by giving direct conditions in selection tab, eg: "list all the employees who joined on the current date". here current date value changes every day when we run the query. In such cases we cannot give direct condition, we need to write routine to get the current date
    Check this if it helps to proceed:
    ABAP ROUTINE AT INFOPACKAGE FOR DATE RANGE
    InfoPackage Routine

  • Maximum number of selections in an info package

    Hi friends,
    i want to load an ODS with data from MSEG. Due to the great number of records I've to select by
    0ATERIAL. Selection criteria are provided by a routine I'll write for this selection, reading a different
    ODS. Estimated number of records for selection is about 80,000.
    My question:
    Is there any restriction regarding the number of selection criteria of an Infoobject in info packages?
    Will a selection work with 80,000 criteria?
    Any input is highly appreciated.
    Thanks in advance and regards
    Joe

    Hello,
    If I understood correctly...you will compare the values from a DSO and then pass these values in the infopackage selections..
    but how are you planning to do it...will it be interval or single value??
    Also I think you can assign only one value or range in the infopackage at a time for selection through routine...
    More the number of selections more the number of AND in the where clause.
    I am not sure if there is any limitations on where clause but after 100 selection the select queries become complex and overflow the memory...so thats the limitation.
    Thanks
    Ajeet

  • Data selection options in info package

    hi,
    I am using filter for current month while loading data into info provider (let us say 0calmonth). I am using below code in info-package after selecting type '6'  (ABAP editor),
    data: l_s_range type rssdlrange,
    l_date type d.
    l_date = sy-datum.
    l_year = l_date+0(4).
    l_mth = l_date+4(2).
    concatenate l_year l_mth into l_month_high.
    concatenate l_year '01' into l_month_low.
    loop at l_t_range into l_s_range where fieldname = 'CALMONTH'.
    if dy-subrc = 0.
    l_s_range-low = l_month_low.
    l_s_range-low = l_month_high.
    modify l_t_range from l_s_range.
    endif.
    endloop.
    But now I would like to use created date as filter instead of calmonth/year (yyyymm). please note that calmonth has only one value but calendar day will have both from and to values. Please give me code to use created date (mm/dd/yyyy).
    please help me with your code.
    thanks,

    I have got the solution by myself (trial and error method). Solutions: there is a SAP delivered variable to calculate current month (Variable name is 0CMONTH).
    Is there any variable to calculate both previous month and current month as filter value? pls reply.

  • Adding a field in data selection tab of Info Package

    Hello,
    how can I add a field for selection in the data selection tab of the info-package in BW 3.5.
    Thanks,
    SD

    Hi,
    You need check Selection in RSO2 in ECC then that field is available for Selectgion in InfoPackage.
    Here I'm giving 0CUST_SALES_ATTR DataSource Example for Selection Change, so see the logic and accordingly you can change your DataSource Selections.
    See the properties of that field in RSA2 in ECC and you can also make it for selection, use the following program and see it.
    In ROOSFIELD table give the datasource 0CUST_SALES_ATTR and see , select only Active version Fields.
    For the following fields you can find FIELD = X, it indecates that it is abailable for selections, so in this way you try to do it by using following program and check.
    KUNNR
    SPART
    VKORG
    VTWEG
    REPORT ZBI_ROOSFIELD NO STANDARD PAGE HEADING .
    tables ROOSFIELD.
    Update ROOSFIELD set SELECTION = 'X' where
    OLTPSOURCE = '0CUST_SALES_ATTR' and
    FIELD = 'FAKSD '.
    Also see SAP Note : 1033847
    Re: Field Selection in Datasource 0CUST_SALES_ATTR
    Thanks
    Reddy

  • 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 Conditions on Info Package

    Hi Experts
      Please advise me on how to proceed
    My requirment is to include selection condition in INFOPACKAGE as the total data that data source is extracting is nearly 200 million records to minimize the extraction of data to be loaded to DSo...my requirment is include selection conditions at infopackage level
    Condition 1: On Fiscal Year/Period
    To load data from  2005 to current....
    Condition 2: to exclude particula Cost Center
    and data source is delta capable
    Please update me how to include these selection conditions do i need to write any ABAP Code and
    Do i need to include selection conditions on INIT & DELTA info package as well
    I need to load data from FY 2005 to........
    Thanks in advance

    Hi Siegfried Szame
    Thanks for the update...apologies for multiple posts
    One question as you said Parallel Inits
    If i created about 9 different INIT info packages  ( My requirment is to initilize data from FY 2006)
    IP1: 001.2006 to 004.2006
    IP2: 005.2006 to 009.2006
    IP3: 010.2006 to 001.2007
    IP4: 002.2007 to 005.2007
    IP5: 006.2007 to 009.2007
    IP6: 010.2007 to 001.2008
    IP7: 002.2008 to 005.2008
    IP8: 006.2008 to 010.2008
    IP9: 011.2008 to 002.2009
    How about delta....what are the selection conditions i need to use
    and
    Can i execute the above packages one after another...that is after completion of IP1 then IP2..then IP3
    Please update
    Thanks in advance

  • 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

  • Very Urgent!...regarding selection criterion in Info Packages

    Hi all,
         This is very urgent requirement for the project now. Is there any way to indicate a field in selection criterion of a IP as blank.
    Like if I want to select all the records which have a field 0WBS_element as blank from one ODS into another ODS. How do I indicate it in the IP( any solution apart from writing a routine!)
    cheers
    Sudhir

    Hi Sudhir,
      Pls. refer to the earlier posted forums :
    Rotuine in Infopackage for Data Selection---- Urgent
    Thanks,
    Raj

  • Data selection tab from Info package.

    dear all,
    I'm using BI7 for my project. I have 1 simple question, how do you un-select a data target from the data selection tab?
    e.g.
    in the data selection i have 2 DSO
    0DSP_1 and ZDSP_1... how do i remove DSO 0DSP_1 from the selection tab?

    If you are using an infopackage...
    under Data Target tab you are seeing 2 DSO.
    in order to select only one: select the option "Select Data targets"
    and then select the DSO which you want to load.
    If you compeltly doesn't want to use the 2nd DSo then delete the update rules between the infosource and DSO.

  • 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

  • Language key in info-package selection

    Hi,
    Just wondering on the language key selection in the info-package. This topic was raised a number of times in the forum and what i have found is no matter what you do 'Language Key' will not appear in the info-package selction as its a srevice API feature and BW will automatically assign the language key based on the installed languages.
    If i need to filter out on any particular language then i need to use some formula / routines etc (of course this is the last option).
    Is my understanding correct ? or Do we have some workarounds to make the language key available in the info-package ?
    Points will be assigned to value added answers.
    Thanks,
    Soumya

    Hi Soumya,
    Hope you would have checked these:
    1. Datasource for text is lang-dependent. If not make it lang-dependant.
    Also check:
    look in OSS Note 324684 'Selections for language and time-dependence'...
    "If a field of a DataSource - typically with field name 'LANGU' or 'SPRAS' - is assigned to InfoObject '0langu', the field is not provided in the selection fields although the field actually can be selected. In this case, all languages of the language vector active in the BW System are requested by the source system but the language selection cannot be defined in the Scheduler.
    Check for more details:
    Re: Infopackage Language Selection
    Bye
    Dinesh

  • Issue withe Info Package Selection for the CRM Datasource

    Hello,
    I have a custom CRM data-source which has the Selection option as CRM-GUID as the Selection option in the RSA3.
    I have replicated the Same Data-source in BI system and Created the Info Package ,but i could not see that GUID Selection in the Info Package.
    To Be Noted:
    I went to RSA6 enabled the selection option( check Box ) , there is no hide option in the datasource , only the Selection option check box is enabled in the RSA6 .
    Replicated again , and activated again , logged out and logged in again . But the Info Package does not show the CRM - GUID selection option.
    I found something not sure this might be the issue:
    1) The Data type is RAW with length 16.
    2) The Datasource in the BI side has SS conversion Routine Blank for this field and the Selection has X.
    But no Selection option in the Info Package.
    Any suggestion and inputs are welcome.
    Thanks in advance.
    Adhvi.

    similar issue is disussed in the below thread...
    Info package Selection were hidden
    Info Package Selection Language key is not diplaying while this is checked
    search for any SAP Note which explains about data type RAW ....

  • Info-package setting: Data selection tab

    Hi,
    I have to give selection conditions in info-package.
    The need is to restrict the values of a particular field to start with BP and BQ.
    i.e i need only values starting with BP and BQ.
    I gave from and to values in the selection screen of info-package as BP* and BQ*
    But the error says CP(Compare Pattern) is not allowed.
    How else can i make the info-package to select values starting only with BP and BQ
    Regards,
    Yeshwanth

    Hi Yeshwanth,
    If this is a character string, then check the length and start from BP0000, as per the length of the feild till the end which in our case would be BQ0000.
    Let me know, if this doesnt work.
    Naveen.A

  • Selection Option question in Info Package

    We would like to stop update Master Data if no master data exists for a characteristics. I found there is a selection options in Info Package Update Tab called "Do not update data if no master data exists for a characteristic"
    I added a row in one of the InfoObject which has been used in another InfoObject as an Attribute. I selected this option in the IP and tried to re-load Master Data, and it didn't fail.
    What does this option do?
    Thanks!

    For example:
    InfoObject ITEM and ITMPLN. ITEM is an Attribute in ITMPLN.
    ITEM has
    Item    Description
    001     Test 1
    002     Test 2
    ITMPLN has
    Project No            Item         Description
    A                         001          Test A
    B                         002          Test B
    <b>C                         004          Test C</b>
    After I load the last row to ITMPLN, I would like to see the error message instead of adding <b>004</b> into ITEM InfoObject. Do you know how to do it?
    Thank you!

Maybe you are looking for

  • HT5137 Words with Friends has frozen. After double clicking the home button, swiping or pressing the icon does not bring up the minus sign.

    On my IPad Words With Friends has frozen. I have double clicked on the home button and identified the WWF icon. When I press and hold or swipe vertically the icon darkens but does not shake or bring up the minus sign. Any suggestions?

  • S video output on windows 7

    Hi All, i have HP Pavilion dv5131eu. i have upgraded to windows 7. i have connected to s video cable to the appropriate s video output. now i try to change display to s video and i cannot define it seems that windows 7 does not recognize this output.

  • Has anyone been able to get a repair/proper fix from Apple for their LCD?

    The more I use my Macbook Pro while traveling the more i notice the 'sparkly/grainy' display. Compared to the White/Black Macbook it is obviously noticable what i'm talking about - especially on white backgrounds. My question is - has anyone been abl

  • How do I delete a preloaded icon

    I have no use for some of the preloaded icons and wish to delete those I do not use. Specifically I'd like to delete the STOCKS icon. Any ideas? I've tried holding it however when I do there is no "X" that appears on the icon. Thanks

  • Reverse Excsie duty ???

    hii Can anybody explain me about the cancel or reversal of excise duty after part2 posting . Please explain me with transaction code . Because i have posted so many threads reg this , but still i m not clear about the excise invoice reversal in Procu