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

Similar Messages

  • Using ABAP routines for data selection

    Hello,
    I want to use ABAP routine to determine value range of data selection in Data Package but when I use routine for one field, selection criterias for other fields are ignored, e.g.:
    in Data Package I have two selection fields:
    CPUDT     Accounting Document Entry Date
    AEDAT     Date of the Last Document Change by Transaction
    For CPUDT I wrote ABAP routine
    and for AEDAT I have just typed in period of time.
    I started data extraction and open Monitor for this Data Package.
    At Header tag I checked selections info and there is selection only for CPUDT.
    Could somebody explain me is it normal system behaviour?
    Thanks
    Andrzej

    Thanks for reply but that would be too easy...
    I have tried your advice but nothing changed.
    I think this is data extraction configuration problem.
    Andrzej

  • Routine for multiple selection in infopackage???

    hello guys
    I thought of creating one routine for Multiple selections aT Infopackage level....in Selections screen in infopackage,I found one option 'Use Conversion routine' with a check box and it is inactive.....Is it here I need to write my routine inorder to get multiple selection for a infoobject....or is it somehwhere else?How to activate thisoption?
    Thanks,
    Regards,
    S

    Hi,
    Conversion routines are used in the BI system so that the characteristic values (key) of an InfoObject can be displayed or used in a different format to how they are stored in the database. They can also be stored in the database in a different format to how they are in their original form, and supposedly different values can be consolidated into one.
    This will be there at info object level.
    Eg : ALPHA: Fills purely numeric fields from the left with zeroes (0).
    For multiple selections at info package , in data selection tab under type , u need to select 6 and write the code to select the value.When info package runs it takes the value from routine dynamically and extracts the data based on selection.
    Eg: There is a field FISCAL PERIOD For data selection, if u write the code to select current fiscal period. then whenever info package runs it extracts the data for current fiscal period from data source to PSA.
    Thanks,
    Joseph.

  • ABAP Routine  for 0FISCPER  select data in InfoPackage

    Hi all,
    I need to write a routine which has to return values from the last FISCPER to the current FISCPER in the data selection of the infopackage.
    Do somebody already do it?
    Thks

    Try this:
    Global Declarations
    CONSTANTS: c_1(1) TYPE n VALUE 1,
               c_fiscvarnt TYPE /bi0/oifiscvarnt VALUE 'Z1',  "Use whatever your default Fiscal Year Variant is"
               c_i(1) TYPE c VALUE 'I',
               c_bt(2) TYPE c VALUE 'BT'.
    DATA: l_tabix LIKE sy-tabix,
          l_fiscper3 TYPE /bi0/oifiscper3,
          l_fiscyear TYPE /bi0/oifiscyear,
          l_min TYPE /bi0/oifiscper,
          l_max LIKE /bi0/oifiscper.
    Routine
    CLEAR: l_fiscper3,
           l_fiscyear.
    CALL FUNCTION
      'DATE_TO_PERIOD_CONVERT'
    EXPORTING
      i_date  = sy-datum
      i_periv = c_fiscvarnt
    IMPORTING
      e_buper = l_fiscper3
      e_gjahr = l_fiscyear.
    CONCATENATE: l_fiscyear l_fiscper3 INTO l_max.
    l_fiscper3 = l_fiscper3 - c_1.
    IF l_fiscper3 LT 1.
      l_fiscyear = l_fiscyear - c_1.
      l_fiscper3 = c_1.
    ENDIF.
    CONCATENATE: l_fiscyear l_fiscper3 INTO l_min.
    READ TABLE
      l_t_range
    WITH KEY
      fieldname = 'FISCPER'.
    MOVE: sy-tabix TO l_tabix,
          c_i TO l_t_range-sign,
          c_bt TO l_t_range-option,
          l_min TO l_t_range-low,
          l_max TO l_t_range-high.
    MODIFY
      l_t_range
    INDEX
      l_tabix.
    p_subrc = 0.
    Edited by: Dennis Scoville on Dec 7, 2009 11:07 AM

  • 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

  • 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

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

  • Routine in data selection tab

    hi friends,
    i need to write routine in data selection tab , i need like when ever i open need to show current data.
    how can i write coding.
    i have code like this, please correct my code
    L_t_RANGE_IOBJNM = '0CALDAY'.
    L_t_RANGE-FIELD NAME = 'CALDAY'.
    L_t_RANGE-SIGN = 'I'.
    L_t_RANGE-OPTION = 'EQ'.
    L_t_RANGE-LOW = sy-datum .
    I DIDNT UNDERSTAND HERE WHAT IS ACTUALLY IOBJNM  WHAT DO U MEAN BY LOW AND HIGH ACTUALLY. FIELD NAME MEANS I NEED TO MENTION LIKE/BIC/ZMNO LIKE .
    THANKING U,
    SUNEEL.

    Check below link to understand the RANGE type objects in ABAP. The OBJNAM is the object name which is used for selection in the InfoPackage. l_t_range is the internal table which contains all the selections used in the InfoPackage. So, if you need dynamic selections you have to code to populate dynamic values for the corresponding InfoObject in this Internal table. Low/High are the fields which actually contains the "From" and "to" range in selection. 
    Option -  <,>,=, <> etc.
    Sign -Include/Exclude (I/E)
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/content.htm
    Regards,
    Sree

  • Data Selection at infopackage

    Hi BI Experts,
    I have created an ABAP routine for sales document type (0doc_type) on Data Selection Tab to restrict the volume of data extracting from transactional DSO to the cube and the infoobject is part of the selection table as well.
    In order to speed up the data extraction process, I also added an index (0doc-type) on the DSO. But, when I analysed the code on ST05, the database optimizer did not use the index on its SQL statement. It used the different document types specified in the ABAP routine on WHERE condition but did the TABLE FULL ACCESS /BIC/AZO_SOP_100.
    Do I need create index when defining selections at the infopackage? If so, why the database optimizer did not use it?
    Could you help me on this matter please?
    Thanks.

    Hi,
    if You use or have a full Table scann = read all the data in a table than an index makes obviously no sence.
    This is what the database thinks. All Data = no Index access necessary.
    You try to can overcome this  if You do not need all columns and build an index on the columns You need.
    Than, hopefully, you get a "full index scan".
    Best
    Martin

  • How to change date selections at Infopackage data selections in production sys

    Hi All ,
    we are loading data into Infocube from datasource ,one process chain for delta init with data transfor  ,which has data selections at infopackage say 06.2014 and other process chain for delta which has same selections at infopackage . Now I want change this data selections  at Infopackage level .
    I Have tried to change these dates in data selections at infopackage level , tho I have changed and saved to future date at delta initial with data transfor ,it's keep coming back to 06.2014. Of course data selection at delta Infopackage level is faded .
    I Want to set future date with delta int with disturbing delta loads . How to do it please .
    regards
    hari

    Hi Ram,
    We will  load delta Intial with data transfer every weekend , and we run delta everyday , because we do delta init with data transfer with selections say ( 01.20011 to 12.2003 ) every weekend , hope I need to create new delta infopack  with new data selections say ( 01.2004 to 12.9999) only  to get update data in Infocube.
    Please correct me if I am wrong .
    Regards
    hari

  • Can i have html code for date select options (SEARCH HELP)

    Hi frinds,
    I have a BSP Page with input as date.
    Can i have html code for date select options (SEARCH HELP)
    Moosa

    Hi
    Please find the sample code below.
    FROM DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X" <- Search help
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"
                            value     = "<%= w_FROMDATE %>" />
    TO DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X"
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"                      
    value     = "<%= w_TODATE %>" />
    Thanks
    kalyan

  • How to put up a calendar in VI for date selection?

    Hi all,
    I need to put up a calendar in my VI for date selection to view historical data like we find on websites of travel agents?
    & also guide me how to get this kind of calendar.....
    please guide me...
    Thanking You,
    Vaibhav Gandhi
    B.E. Instrumentation & Control,
    INDIA
    Solved!
    Go to Solution.

    Thank you so much GURU for your very quick & accurate reply.
    Further I need to know, that how I can remove the word 'value' from indicator? i.e. it is giving "Value -> 6/1/2009" on indicator.. I just need '6/1/2009' on indicator...
    Can it be possible?
    Thanks,
    Vaibhav Gandhi
    B.E. Instrumentation & Control,
    INDIA

  • What bean for date selection should I choose?

    I need bean for date selection with folowing features:
    1) Period selection
    2) Internatioanization
    I foung some components:
    1) http://www.java-calendar.com/
    (+) supports all need features
    (-) 50$ :(
    2) http://www.toedter.com/
    (+) free, interationalization
    (-) no period selection
    3) http://sourceforge.net/projects/jdatechooser
    (+) free, supports all need features
    (-) project is too young, i'm searching more mature project
    I have no time for long searches, so advise me component please.

    From your own findings it's between 1 and 3, but 3 is "too young" so it looks like 1. Spend the 50.

  • Popup window for data selection in maintenance view

    Hi,
    How to create popup window for data selection in maintenance view. For example when you go to view v_t510 in se16, there you will see a popup window to enter values. after you enter the values in that window, then data related to those values that you entered in the popup window will displayed.
    How can we do that for the custom maintenance view?
    Thanks in advance for your help guys.
    Regards,
    Srinivas.

    In your custom maintainace view, if you select the Data browser / Table view maintainace under the tab "Maint Status" as "Dispaly maintanence allowed with restriction" than system will give you popup to restrict by selection.
    Regards,
    Naimesh Patel

  • OLAP variable for data selection

    hi all ,
    can any own explain how the OLAP variable is used for data selection in the info package. how the value is changing in the Variable.
    thanks in advance
    rajan

    Hi Rajan,
    You will not be entering any date value. As Dirk mentions, the value will be filled into the variable by way of an exit, i.e. automatic processing according to some code.
    Like your date variable can get you the first of the previous month from the exit processing.
    Hope this helps...

Maybe you are looking for