Infopackage Selections Tab-OLAP Variable/ABAP Routine

Hi Experts
In my Infopackage Selections Tab i had Cal Mon/Year field....
As per my requirment i have to write a selection condion that when we execute info package (it is a monthly data load)  it will extract data only for the months greater than or equal to current month
Please update me on how can i achieve this either by using OLAP Variable or ABAP Routine in infopackage...will be great if can provide the required ABAP Code
Thanks in Advance

here's an example that fills the fiscal year from last month (bold is customer code... the rest is standard):
  data: l_idx like sy-tabix.
  read table l_t_range with key
       fieldname = 'PARAM_P_GJAHR'.
  l_idx = sy-tabix.
  data:
  v_caldy type /BI0/OICALDAY,
  v_calmn type /BI0/OICALMONTH,
  v_calyr type /BI0/OICALYEAR.
  v_caldy = sy-datum.
determine first day*
  v_caldy+6(2) = '01'.
determine last month*
  subtract 1 from v_caldy.
  v_calyr = v_caldy(4).
  l_t_range-sign   = 'I'.
  l_t_range-option = 'EQ'.
  l_t_range-low    = v_calyr.
  modify l_t_range index l_idx.
  p_subrc = 0.

Similar Messages

  • " To Value " is  greyed out  in Infopackage Selection Tab ??????

    Infopackage Selection Tab has some <b>mandatory</b> selections to be fild in for loading.
    "From value" is excepting values but "To Value" is greyed out ???
    Its for a SAP extractor - FERC.
    Help SDNer's

    I see the Doc :
    Text
    Selection Options
    Definition
    Selection options that can be processed for a DataSource field.
    Note 1:
    The selection options defined here must be supported by the extractor.
    Note 2:
    If no other selection options are used for a DataSource field other than
    'EQ' and 'BT', no further definition is required. The value of the
    selection options can remain as the the default setting '0'.
    The selection option combinations are encoded into a binary string using the following schema and are saved as decimal figures:
    Selection option exponent (binary string)
    EQ 2^0
    BT 2^1
    CP 2^2
    GT 2^3
    GE 2^4
    LT 2^5
    LE 2^6
    NE 2^7
    NB 2^8
    NP 2^9
    Each character in the resulting binary string describes whether the corresponding selection option is allowed or not.
    That is:
    <b>
    1-allowed</b>
    <b>0-not allowed</b>
    For example:
    Selection options EQ and CP can be used to select in a field.
    The binary string is then: 0000000101
    The corresponding decimal value that sis saved as the DataSource definition is: 12^0 + 12^2 = 5
    <u>
    All the selections have 1 which is allowed but why To value is greyed out ?</u>

  • Add authorization check in Infopackage Scheduler for option 6-ABAP Routine

    We want to add an authorization check in routine rssm_routines_maintain.    This is in the Infopackage scheduler in the Data Selection tab  under the column Type after selecting type=6(ABAP Routine).    This is a core modification.   We have checked with our Security team with traces and found nothing available to help us.
    Two questions:
    1) Is there any other way we can control who can create/change ABAP code by this method ?
    2) Does anyone see this causing problems if we were to make a change to the routine to add code to do an authorization check.
    Your help would be appreciated.
    Robert Begin,
    450-677-9411 or
    514-924-4311
    or email at [email protected]

    Hi Chandran,  we need to restrict a certain group of BW Developers from writing code in the abap routine (option 6 ) in the Infopackage of the Data Selection Tab in column Type.
    The concern is that if having access to write abap code, a person can practically do as heéshe pleases with ABAP code and it is a concern.
    Do you have any solution/suggestions to lock this down?
    Much appreciated,
    Regards,
    Robert.

  • How to get id of selected Tab in WebDynpro abap

    HI,
        How to get id of selected Tab in WebDynpro for abap? THANKS!

    Hi,
    In the action method for onSelect try using,
      DATA:
        lv_select_tab type string.          "Selected tab value
      DATA:
        lt_events type WDR_EVENT_PARAMETER_LIST,
        ls_events type WDR_EVENT_PARAMETER.
      field-symbols: <fs_value> type any.   "Attribute value in events table
      lt_events = wdevent->parameters.
      read table  lt_events into ls_events with key name = 'TABSTRIPID'.
      if sy-subrc eq 0.
        assign ls_events-value->* to <fs_value>.        
        if sy-subrc eq 0.
          lv_select_tab = <fs_value>.                    "Tab selected
        endif.               
      endif.               
    Hope it helps!
    Regards,
    Radhika,

  • Use ABAP Routine in Selection Tab of Infopackage

    I am trying to use the ABAP routine in the InfoPackage SELECTION Tab to "EXCLUDE" a value. For example, I want to load all the Material types, except ZUN1. But, when I write in the ABAP, l_t_range-sign = 'E' instead of 'I' or l_t_range-option = 'NE' instead of 'E', I get an error saying these values are not permitted.
    Is there any way to exclude any value from Selection in the InfoPackage?
    Regards,
    Milind Vad

    Hi dear and welcome on board!
    You have two options:
    include everything you want in your IP
    load everything and exclude what you don't want in the start routine in transfer rules
    No other ways...
    Hope it helps!
    Bye,
    Roberto
    ...and please don't forget to reward the answers...it's THE way to say thanks here !

  • Can't find 0FYTLFP OLAP Variable in InfoPackage Data Selection tab on 3.5

    On BW 3.5, when generating an InfoPackage with the datasource as Purchasing Data(80PUR_C01), under Data Selection tab, for the InfoObject 0FISCPER, I selected 7 (OLAP variables)for the Type column, then click the button next to it and under the column of Details for Type to bring up a window, but when expending the OLAP Variable field list, can't find the following value in the list which shows up on BW 3.1:
    0FYTLFP     0FISCPER Cumulated to Last Fiscal Year/Period (SAP Exit)
    How to make the above value show up in the OLAP Variable list?   I thought maybe the variable 0FYTLFP needs to be installed in Business Contents, but there is no variable object type in Business Content.  It sounds like a SAP Exit, but how to make the SAP Exit value show up on BW 3.5?
    Thanks for everyone's input!

    hey Rohit,
    Besides the three variable values in the list on BW 3.5, now I find a new one in the list, called "0E_ROLE     0SR_ROLE     Role (SAP Exit)", I have no idea why this one shows up now.  Now all the four variables in the list are:
    1. 0CML12LM     0CALMONTH     Last 12 Months Excluding the Current Month
    2. 0CMONTH     0CALMONTH     Current Calendar Month
    3. 0E_ROLE     0SR_ROLE     Role (SAP Exit)
    4. 0S_RQMRC     0REQUID     Most Current Data
    0FYTLFP is still not in the list!   We can't try to create BEx query since our BW 3.5 system is just installed and we have not got to the step to ceate a query.  I try the 2nd way you suggested by pressing F6 on this variable with the typed in value 0FYTLFP, get the following msg "BEx variable 0FYTLFP could not be evaluated - No error message", that means it would not work on BEx query as well, right? 
    What could be the reason that we can't see 0FYTLFP variable in our new installed BW 3.5?  Do you think our BASIS missed installing sth?
    Thanks
    Message was edited by: Kevin Smith

  • ABAP Routine in InfoPackage for selection

    Hello,
    I have 2 InfoPackages for loading from ODS1 to ODS2. InfoPackage 1 is restricted via ABAP Routine to load only certain customer numbers.
    InfoPackage 2 is supposed to load all other customer numbers - therefore the ABAP Routine makes ranges that exclude the customer numbers selected in InfoPackage 1.
    Now I face the fact that the selection of InfoPackage 2 is much to small in numbers. Problem is, the ranges only work when entered manually - but via ABAP entry these ranges don`t work. I can`t understand why this problem happens. Do you have an idea?
    Example (first number is from, 2nd number is to)
    InfoPackage 1:       customer numbers     
    5| 5
    100|100
    999|999
    InfoPackage 2: customer numbers
    0|4
    4|99
    101|998
    1000|99999
    But selection of InfoPackage 2 does not work propberly...
                                                                                    Thanks for your help,
    Angelika

    Hi,
    no, that was just a typing mistake. Sorry.
    The problem is, that in Monitoring I can see the selection and it looks good.
    But when I check the number of datasets selected it is far to small. Therefore I don`t believe the selection works.
    I tried manually to put all the ranges selected by ABAP Routine in InfoPackage 2 in another InfoPackage 3 - the selection is identically to InfoPackage 2 (but not made via ABAP, but manually) and in Monitoring the selection looks absolutly alike.
    But the manuall InfoPackage 3 selects far more records than InfoPackage 2.
    I can`t understand the problem. Can you? Can you give me advice?
    Thanks,
    Angelika

  • ABAP Routine  for 0FISCPER  slect options in InfoPackage

    Hi,
    I am trying to write an ABAP Routine for 0FISCPER as select options (range) dynamically.
    Ex:
    0FISCPER selection for this year as 001.2008 to 012.2008
    0FISCPER selection for next year as 001.2009 to 012.2009.
    Now  we are changing InfoPackage every year manually, so I need to write a routine for 0FISCPER in InfoPackage to handle dynamically every year
    Thanks,
    SK.

    Hi
    write an ABAP routine to get that value..But are you getting any planned data(why you want till end of the year...till infopackage runs is o.k i think, if you don't have planned data)...Any way you can check the below code, which can be useful...
    You can see the below code at->your infopackage selections>Ty-->choose variable type as 6 and enter any ABAP routine name( to create) and then there is a button on the application tool bar called 'routine info'..this give you the following information...
    Definition
    You can define complex selections for InfoPackages and control the automatic deletion of requests from InfoCubes in the scheduler, by using routines.
    Routines are processing blocks in ABAP programs that consist of a pre-defined data declaration section and an ABAP subroutine (form routine). In the subroutine you can use all of the ABAP programming functions.
    You can use the following routines for making selections in InfoPackages:
    1. Selection routines for fields, on the Data Selection tab page
    2. Selection routines for file names, on the External Data tab page
    3. Selection Routines for selecting the from and to dates for time-dependent data, on tab page Update
    4. Selection routines for determining old requests to be deleted after successfully loading a new request, on the Data Target tab page
    Program frame:
    After you have called up the Editor for routine maintenance, you get the following program frame:
    1. Selection routines for fields, on tab page Data Selection:
    program conversion_routine.
    '$*$ begin of global - insert your declaration only below this line -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line    -
    FORM COMPUTE_<Fieldname>
      tables l_t_range structure rssdlrange
      changing p_subrc like sy-subrc.
    $$ begin of routine - insert your code only below this line       -
      data: l_idx like sy-tabix.
            read table l_t_range with key
                 fieldname = <Fieldname>.
            l_idx = sy-tabix.
            modify l_t_range index l_idx.
            p_subrc = 0.
    $$ end of routine - insert your code only before this line       -
    ENDFORM.
    2. Selection routines for file names, on tabstrip External Data:
    FORM compute_flat_file_filename
         changing p_filename like rsldpsel-filename
              p_subrc like sy-subrc.
    $$ begin of routine - insert your code only below this line-
              p_filename =
              p_subrc = 0.
    $$ end of routine - insert your code only before this line-
    ENDFORM.
    3. Selection routines for selecting the from and to date for time-dependent data, on tabstrip Update:
    form compute_time_dependent_dates
         changing p_datefrom type d
                  p_dateto   type d
               p_subrc like sy-subrc.
    $$ begin of routine - insert your code only below this line-
              p_datefrom =
              p_dateto   =
              p_subrc = 0.
    $$ end of routine - insert your code only before this line-
    ENDFORM.
    4. Routines for determining the old requests to be deleted after successfully loading a new request, on tab page Data Targets:
    form compute_<InfoCube-Name>
      tables l_t_request_to_delete structure rsreqdelstruc
      using l_request like rsreqdone-rnr
      changing p_subrc like sy-subrc.
    *Insert Source Code to decide if requests should be deleted.
    *All Requests in table l_t_request_to_delete will be deleted
    *from Infocube <InfoCube-Name>.
    *Add new requests if you want to delete more (from this cube).
    *Remove requests you did not want to be deleted.
    $$ begin of routine - insert your code only below this line-
         loop at l_t_request_to_delete.
         endloop.
         clear p_subrc.
    $$ end of routine - insert your code only before this line-
    ENDFORM.
    Note:
    Those fields flagged with <...> are dependent on the selection fields and are filled automatically by the system when you call up the Editor.
    Procedure
    Make the following entries:
    1. Between $$ begin of global ... and $$ end of global ... you can define data declarations. These are the declaration sections for the local data in the routine. This data is only visible in the routines.
    2. The subroutines begin with FORM and end with ENDFORM.
    The subroutines for the particular routines are:
    Selection routines for fields on tab page Data Selection: FORM COMPUTE_<Field name>
    Selection routines for file names on tab page External Data : FORM compute_flat_file_filename
    Selection routines for selecting the from and to dates for time-dependent data on tab page Update: FORM compute_time_dependent_dates
    Routines for determining old requests to be deleted after successfully loading a new request on tab page Data Target: FORM COMPUTE_<InfoCube-Name>
    The subprograms have the following parameters:
    Subprogram FORM COMPUTE_<Field name>:
    l_t_range
    In the table l_t_range the routines for all selection fields that are filled, or have a routine, are made available.
    The routines are executed in the scheduler last of all and therefore, you can change all the selections that you have carried out previously.
    p_subrc
    Using the variable p_subrc you can report errors to the scheduler. p_subrc <> 0 signals an error and means the data request is terminated.
    Subprogram FORM compute_flat_file_filename:
    p_filename:
    You give the name of the file that is to be loaded in parameter p_filename.
    This is useful if your file name contains date dependencies that should be determined by sy-datum and calculated during runtime.
    p_subrc
    You can inform the scheduler of an error with variable p_subrc. p_subrc <> 0 signals an error and means that the data request is terminated.
    Subprogram FORM compute_time_dependent_dates:
    p_datefrom and p_dateto
    Fill these parameters with the from and to dates for time-dependent master data and texts.
    p_subrc
    You can inform the scheduler about an error using variable >LS>p_subrc. p_subrc <> 0 signals an error and means the data request is terminated.
    Subprogram FORM COMPUTE_<InfoCube-Name>:
    l_t_request_to_delete
    You give the request number of the request that is to be deleted in parameter l_t_request_to_delete. You can also delete requests from the table. These are then not deleted.
    p_subrc
    You can inform the scheduler about an error with the variable p_subrc. p_subrc  signals an error and means the data request is terminated.
    3. Insert your program code for the routines between $$ begin of routine ... and $$ end of routine ... so that the respective subprogram variables are supplied with the corresponding values.
    4. Check the syntax of your routine with the Check function.
    5. You can then transfer the routine with the Save function.
    You end routine maintenance when you exit the Editor.
    Hope it helps
    Thanks,
    Teja

  • OLAP variable in the Infopackage

    Hi folks,
    I would like to use OLAP variable in the infopackage so I selected Type 7 in the infopackage and selected OLAP variable '0DAT' since I need the current date. By default, the current date is selected as 'From' in the infopackage selection. How can I change this so that
    1) the infopackage uses this OLAP variable for the 'To Value' field and not 'From Value'  and keeps the 'From Value' blank. 
    2) the infopackage uses this OLAP variable for the 'To Value' field and manually a date can be entered for the 'From Value'.
    Thanks for your help.

    Probably not possible via type 7 but possible via type 6
    use the code below
    data: l_idx like sy-tabix.
    data: lower_limit LIKE SY-DATUM.
    data: upper_limit LIKE SY-DATUM.
    upper_limit = sy-datum .
    lower_limit = sy-datum - 1000000.  This should set lower limit to a least possible value
    read table l_t_range with key
         fieldname = 'BUDAT'.
    l_idx = sy-tabix.
    l_t_range-low = lower_limit.
    l_t_range-high = upper_limit.
    l_t_range-sign = 'I'.
    l_t_range-option = 'BT'.
    modify l_t_range index l_idx.
    p_subrc = 0.
    Whenever you need to change your lower limit you have to enter inside the code and change it.
    Regards
    Anindya

  • Creation of OLAP Variable for Master data

    Dear BW Experts,
    How to Create OLAP Variable for Master data  in SAP BW? What is the use of OLAP Variable?

    The entry column Type (Variable) on the Select Data tabpage indicates a variable time frame in which the data should be requested. The variables are not replaced by concrete values until a request is made. There are eight options:
    Variable            Data request        Description
    0
                          Yesterday
                                            (12am – 12am)
    1
                         Last week
                                            (Monday-Sunday)
    2
                           Last month
                                            (1. (First day - last day of previous month)
    3
                           Last quarter
                                           (1. (First day - last day of previous quarter)
    4
                           Last year
                                          (01. (January 1 – Dec 31 of previous year)
    5
                      User time selection
                                               See below
    6
                       ABAP routines
                                               See below
    7
                         <b>OLAP variables</b>
                                                See below
    <b>Time selections with the help of the variables 0 to 4.</b>
    The variables 0-4 only refer to date fields of the data type DATS.
    <b>User time selection</b>
    Type 5 gives you a free selection of all fields.
    If you select this variable for a field, confirm the selection, and then choose Detail for Type, an additional dialog box appears. In this dialog box you can freely limit the values of the fields and determine the next period value and the number of periods until a repetition.
    Variables are placeholders for values and are not replaced by concrete values until a data request is made. You can also use a Variable for selections when requesting data for an InfoObject, if you choose type 7, confirm the selection, and then choose Detail for Type.

  • Creation of an OLAP variable

    Hai All,
               I need to create an OLAP variable in an infopackage for an object for picking up data from last two months. I mean to say that the object has to pickup all the data pertaining to the last two moths only from the system date without any manual intervention. I see that there is an option in info package where I can select 7-OLAP variable and another option ABAP program. Which one of these is a good way and how to doit? any advise or also any reference to documentationwill be appreciated.
    Thank you very much.
    Message was edited by: vasu vasu

    Hi Vasu,
    > I already created a
    > variable giving an offset but its not showingup in
    > the list of OLAP variable showed in the info package.
    > Is there any other place where I need to do this?
    I experienced the same problem. My solution was to edit the variable and deselect the 'ready for input' option. Also the variable has to be a SAP- or customer-exit variable so that it can run as a background job.
    Best regards,
    Christian Frier

  • 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

  • OLAP variable in ABAP Routine.

    In data selection of Infopackage, I have used a OLAP variable. Is it possible to access the routine for OLAP variable in a ABAP routine?? How to proceed for the same???

    Hi,
    There are function modules for SAP variables.
    -     RSVAREXIT_variablename
    -     RREX_VARIABLE_EXIT (for variables to be processed see include LRREXTOP).
    Customized variables with exit can be accessed by FM EXIT_SAPLRRS0_001.
    If you are able to transfer mandatory parameters, just implement call of required FM
    Into report. If not, you have to copy and adopt coding desired from the FMs.
    Hope this helps
    Joe

  • 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

  • OLAP Variable with user exit for Infopackage Selection 0fiscper

    Hi Frds/ Guru's ,
                    I have a requirement to use a OLAP Variable for Fiscal year period 0fiscper(Characteristic ) in the Infopackage Selection. . I need to extract the data for Previous Year and Current Year , that is to be automatically selected with a OLAP Variable . The standard one's provided by SAP are not satisfying my requirement,as they are getting populated with SAP Exit and I am not getting the ranges .I am planning to create a variable and use the processing type as Customer Exit and Populate it with ABAP code in respective Enhancement RSR00001.
    Even Can I create a ABAP Routine ? Please suggest me which is better to do in respect to performance of dataload  , will be really glad if anyone can provide some code for doing this as u might have faced the situation sometime .
    I have checked with all the threads available , could get some idea but will be really thankful if u gimme some hints in writing the code , at Exit level and routine level .
    Thanks,
    Krish

    thnx

Maybe you are looking for

  • Why do .pdf attachments in email show up differently

    I  am using Adobe Reader 10.0.3 on an iMac running on 10.5.8. Sometimes the .pdf attachment shows up in emails  I am sending as the full text and othertimes as just the icon. It doesn't affect the receiving by others. They can open either one. Why do

  • Sent Messages Show in Inbox

    Outlook 2007 SP2 and all current updates on Win7 Pro 32-bit Blackberry Curve IMAP'ing email via Internet Email setup New emails I send from Outlook properly show in my Sent Items folder only. Emails to which I Reply or Forward from Outlook show in my

  • IPad no longer charging

    My iPad is no longer charging via Apple chargers and cords that used to charge it very well.  The charging battery icon shows it is charging but the % keeps dropping.  Any suggestions are appreciated.  Thank you

  • Module pool- mandatory field

    hi all, i have got 3 radio buttons when i click first button it should ask me that,  enter the value in text field i.e it should be mandatory..... this is my code....... IF ADD = 'X'.    RES = VAR1 + VAR2.    ELSEIF SUB = 'X'.    if var1 > var2.     

  • Opening Raw and NEF files

    I just got PSE 10 and it will not open NEF, DNG or any RAW file it say the it is the wrong file type. Has anyone had a similiar problem?