How to get planning function in customized data slice?

Hi all,
we are using a customized data slice which implements IF_RSPLS_DATASLICE. Now we have the requirement that the data slice only protects the data when it calls via query. The data slice will not protect data if a planning function is executed. How can we implement this requirement? Is it possible in the method IF_RSPLS_DS_METHODS ~ IS_PROTECTED to read this information from an instance of the planning function (CL_RSPLS_CR_CONTROLLER?) or the buffer or something else? Or can we find some information about the query?
At the moment we only check if a planning sequence is called by a process chain. This works fine
IF sy-batch IS NOT INITIAL.
    e_noinput = rs_c_false.
    EXIT.
  ENDIF.
Thanks for your help!

Hi,
I think this topic was already discussed in this forum.
By design, it should not matter whether a query or a planning function is not allowed to change records. This is what data slices were designed for.
OK, you need a different behaviour.
1. Maybe you can detect from the planning function filter or query filter whether you run function or a query. If this is the case use the method IS_OVERLAPPING of the data slice. There you get the filter as a I_TSX_SELDR or as a range table when you call SELDR_TO_RANGE. When you return r_is_overlapping = rs_c_false. the data slice will not be called.
2. Another option is to call the factory of the data slice and to use a flag in the data slice that indicates that the data slice is used in the context of a planning function. The factory method is GET_INSTANCE. Set a break point there to find out how the system calls this method. But when to call the factory? Check note 1101726. This note provides infrastructure to change the filter of a planning function at run time. But you can use this exit to call the factory method mentioned above. The nice thing is that you can raise the excpetion EMPTY in the exit, thus the function will not be called. So use a planning sequence with dummy1, your function, dummy2. For dummy1 switch on flag on, raise EMPTY, dummy1 will not be executed (almost no run time is needed), then 'your function' will be called (do nothing in the exit', then function dummy2 will be called, here switch the flag off again.
Check also the following link where the above technique is used to for the conditional execution of planning functions:
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0785271-1446-2d10-6987-d1e44f08e97c
Regards,
Gregor

Similar Messages

  • How to get planned date withrespect to Equipment

    How to get planned date from maintenance plan withrespect to equipment
    I.e when I pass Equipment number I need to have planned date and maintenance Plan and call number

    I am sending screen shot of VIMHIS Table and also Maintenance plan Table

  • How to get a reference for custom controller

    Hi All,
         I am working with the custom controller but i dont know how to call the functionality of custom controller into a view controller.For accessing component controller functionality we have a attribute wd_comp_controller in view controller.Like this how to get a refernce for the custom controller.
    Thanks in Advance.

    hi,
    Lets say view1 has the event ONACTIONNAVIGATE and you want to call a method 'start_navigation' in the custom controller named 'navigation'.
    Use the following code.
    METHOD onactionnavigate .
    DATA lo_navigation_controller TYPE REF TO ig_navigation.
    lo_navigation_controller = wd_this->get_navigation_ctr( ).
    CASE navigation_type.
    WHEN 'BACKWARD'.
    lo_navigation_controller->start_navigation( if_fitv_fpm_api=>gc_navigate_backward ).
    WHEN 'FORWARD'.
    lo_navigation_controller->start_navigation( if_fitv_fpm_api=>gc_navigate_forward ).
    ENDCASE.
    ENDMETHOD.
    Thanks,
    Rajkumar.S

  • How to get a time part from Date datatype

    Hi,
    I would like to know how to extract the timestamp alone from DATE datatype? If my input is '27-SEP-2011 23:59:00' I need the output as 23:59:00. I am surprised to see that there are no in-built functions for this or may be I am wrong. Basically I need to remove the date part from DATE data type and get the time.Please assist.
    -Thanks
    Edited by: user9546145 on Sep 27, 2011 2:24 PM
    Edited by: user9546145 on Sep 27, 2011 2:25 PM

    Hi,
    user9546145 wrote:
    Hi,
    I would like to know how to extract the timestamp alone from DATE datatype? Be careful! In Oracle, TIMESTAMP means a datatype, similar to but distinct from DATE. You'll avoid confusion if you don't use the word "timestamp" to mean anything else.
    There is a built-in function, TO_CHAR:
    TO_CHAR (dt_col, 'HH24:MI:SS')Depending on how you plan to use the time, TRUNC is another handy built-in function:
    dt_col - TRUNC (dt_col)is a NUMBER (not less than 0, but less than 1) which is suitable for many tasks, such as finding the average time.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.

  • How to get internal table from SAP Data Provider C#

    Hello.
    ABAP:
       DATA: lt_t001 TYPE TABLE OF t001.
       DATA: url(1000) TYPE c.
      SELECT * INTO TABLE lt_t001 FROM t001.
      CALL FUNCTION 'DP_CREATE_URL'
        EXPORTING
          type                 = 'APPLICATION'
          subtype           = 'X-R3TABLE'
        TABLES
          data                 = lt_t001
        CHANGING
          url                    = url
        EXCEPTIONS
          OTHERS           = 4.
    C#:
    using SAPDataProvider;
    using SAPTableFactoryCtrl;
    public void SetDataFromUrl(string url)
                SAPDataProviderClass p = new SAPDataProviderClass();
                p.SetDataFromURL("APPLICATION", "X-R3TABLE", url);
                ISapDPR3Table tbl = p.GetDataAsR3Table("APPLICATION", "X-R3TABLE");
                SAPTableFactoryClass tf = new SAPTableFactoryClass();
                Table tb = (Table)tf.NewTable();
                tb.ISAPrfcITab = tbl.DataTable; // Exception !!!!!!
    How to get internal table from SAP Data Provider ?

    Hi Sergey,
    I'm trying to do the same, have you found a solution to solved it?
    thanks for your help.
    Regards.
    Jonathan

  • How to get the function name/ID  of the current page

    HI,
    I searched the forum and google, but it is not clear on how to get the function name of the current page.
    I have 4 functions in my self service A ,B,C,D (seeded page links ) they all have to go to a page called hhhPG. Based on which function user is clicks I have to show the data in hhhPG.
    so my question is how to get the function name ? I mean I need to know if user click on link A , B, C or D link and came to this page.
    I found below in one forum and also there is getfunctionID in pageContext , but I do not know what to pass to getfunctionid("???") to get value.
    FunctionSecurity funcSecurity = pageContext.getFunctionSecurity();
    Or is there a better way of know where user is coming from ? like geturl....
    Please help, I need this ASAP.
    Thank you.

    Use below to find out how the user came into the page
    FunctionSecurity funcSecurity = pageContext.getFunctionSecurity();
    boolean isFunc1 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME1"));
    boolean isFunc2 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME2"));
    boolean isFunc3 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME3"));
    boolean isFunc4 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME4"));
    So one of them will be true based on the function the user came in.
    Write your logic based on these flags.
    Regards,
    Peddi.

  • How to get the name of a Data Element of a generic Table!

    Hi guys!
    In my function i have the following import paramenter
    i_outtab type standard table
    now i import a table and i want to get the dataelement of the fields.
    is there a way to do this??

    Hello Thomas
    Perhaps the following sample report may be useful for you.
    *& Report  ZUS_SDN_RTTI_STRUCT_COMPONENTS
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1145711"></a>
    *& Thread: How to get the name of a Data Element of a generic Table!
    REPORT  zus_sdn_rtti_struct_components.
    TYPE-POOLS: abap.
    TYPES: BEGIN OF ty_s_outtab.
    TYPES: bukrs    TYPE bukrs.
    TYPES: kunnr    TYPE kunnr.
    TYPES: END OF ty_s_outtab.
    DATA: gdo_data    TYPE REF TO data.
    DATA: gs_outtab   TYPE ty_s_outtab.
    DATA: go_typedescr  TYPE REF TO cl_abap_typedescr,
          go_structdescr  TYPE REF TO cl_abap_structdescr,
          go_datadescr    type ref to cl_abap_datadescr.
    DATA: gs_comp        TYPE abap_compdescr,
          gd_dtel        type string,
          gt_dfies        type ddfields.
    FIELD-SYMBOLS:
      <gs_struct> TYPE ANY.
    START-OF-SELECTION.
      BREAK-POINT.
      GET REFERENCE OF gs_outtab INTO gdo_data.
      ASSIGN gdo_data->* TO <gs_struct>.
      go_typedescr = cl_abap_typedescr=>describe_by_data( <gs_struct> ).
      go_structdescr ?= go_typedescr.
      BREAK-POINT.
      LOOP AT go_structdescr->components INTO gs_comp.
        go_datadescr = GO_STRUCTDESCR->GET_COMPONENT_TYPE( gs_comp-name ).
        gd_dtel = go_datadescr->get_relative_name( ).
        write: / syst-tabix, 'Data element =', gd_dtel.
      ENDLOOP.
    END-OF-SELECTION.
    Regards
      Uwe

  • How to get fiscal period based on date and Fiscal year?

    Hi Guys,
               Can anybody tell me how to get Fiscal period based on date and Fiscal Year or fiscal year variant?
    Thanks,
    Gopi.

    Hi,
    Please refer the code below:
    *: Report:  ZFISCALYR                                                  :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to return the corresponding fiscal    :
    *:              year and posting period for a company code and posting :
    *:              date or posting date and fiscal year variant.          :
    REPORT  zfiscalyr NO STANDARD PAGE HEADING.
    TABLES: ekko.
    PARAMETERS:     p_bukrs TYPE ekko-bukrs,
                    p_bedat TYPE ekko-bedat.
    DATA: gd_fiscalyr  TYPE bapi0002_4-fiscal_year,
          gd_fiscalp   TYPE bapi0002_4-fiscal_period.
    DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
          gd_fiscalp2  TYPE bapi0002_4-fiscal_period.
    DATA: gd_periv     TYPE t009-periv.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * get fiscal year and period - (requires date and company code)
      CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
        EXPORTING
          companycodeid = p_bukrs
          posting_date  = p_bedat
        IMPORTING
          fiscal_year   = gd_fiscalyr
          fiscal_period = gd_fiscalp.
    * Alternative fiscal year function module
    * - (requires date and fiscal year variant code from T009 table)
    * gets first entry in fiscal year variant table (will need to choose
    * correct one from table rather than just using first entry)
      SELECT SINGLE periv
        FROM t009
        INTO gd_periv.
    * get fiscal year and period
      CALL FUNCTION 'DETERMINE_PERIOD'
        EXPORTING
          date                      = p_bedat
    *    PERIOD_IN                 = '000'
          version                   = gd_periv
       IMPORTING
          period                    = gd_fiscalp2
          year                      = gd_fiscalyr2
       EXCEPTIONS
          period_in_not_valid       = 1
          period_not_assigned       = 2
          version_undefined         = 3
          OTHERS                    = 4.
    *END-OF-SELECTION.
    END-OF-SELECTION.
      WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr,
            / 'Fiscal period is:', gd_fiscalp.
      SKIP.
      WRITE:/ 'From function module: DETERMINE_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr2,
            / 'Fiscal period is:', gd_fiscalp2.
    Thanks,
    Sriram Ponna.
    Edited by: Sriram Ponna on Apr 17, 2008 8:59 PM

  • How to get maximal value from the data/class for show in Map legend

    I make WAD report that using Map Web Item.
    I devide to four (4) classes for legend (Generate_Breaks).
    I want to change default value for the class by javascript and for this,
    I need to get maximal value from the class.
    How to get maximal value from the data/class.
    please give me solution for my problem.
    Many Thx
    Eddy Utomo

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • How to get client IP in custom UCM Service

    how to get client IP in custom UCM Service ?

    have you tried
    binder.getLocal("REMOTE_ADDR");
    Let us know how you get on
    Tim

  • I-photo:  I used 2 cameras to take pictures on a trip --- i have put the pictures from both cameras into an album --- when i click on view and then sort by date, the pictures do not sort by date --- any ideas on how to get the pics sorted by date?

    I-photo:  I used 2 cameras to take pictures on a trip --- i have put the pictures from both cameras into an album --- when i click on view and then sort by date, the pictures do not sort by date --- any ideas on how to get the pics sorted by date?

    Select all the photos that you need to change, then click the "Photos" menu and choose "Adjust Date and Time".
    If you add a year, it will adjust all the photos that you selected by adding a year (so if you accidentally select one of the photos that already has "2012", that will change to "2013"). 

  • How to get the difference of two dates in years,months and days

    Hi friends,
    how to get the difference of two dates in years,months and days
    for ex 2 years 3 months 13 days
    select (sysdate-date_Start) from per_periods_of_service
    thanks

    Something like this...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('17-nov-2006','dd-mon-yyyy') as c_start_date, to_date('21-jan-2008','dd-mon-yyyy') as c_end_date from dual union all
      2             select to_date('21-nov-2006','dd-mon-yyyy'), to_date('17-feb-2008','dd-mon-yyyy') from dual union all
      3             select to_date('21-jun-2006','dd-mon-yyyy'), to_date('17-jul-2008','dd-mon-yyyy') from dual
      4             )
      5  -- end of test data
      6  select c_start_date, c_end_date
      7        ,trunc(months_between(c_end_date, c_start_date) / 12) as yrs
      8        ,trunc(mod(months_between(c_end_date, c_start_date), 12)) as mnths
      9        ,trunc(c_end_date - add_months(c_start_date, trunc(months_between(c_end_date, c_start_date)))) as dys
    10* from t
    SQL> /
    C_START_D C_END_DAT        YRS      MNTHS        DYS
    17-NOV-06 21-JAN-08          1          2          4
    21-NOV-06 17-FEB-08          1          2         27
    21-JUN-06 17-JUL-08          2          0         26
    SQL>But, don't forget that different months have different numbers of days, and leap years can effect it too.

  • How to get the function name in controller class

    Hi experts ,
    I am new to the OAF framework.
    i have created the two functions and bot he the function have the same controller class .i want to capture the function name or function id in the controller class.
    can you please let me know how to get the function id or function name in the controller class.

    Hi apurba,
    Thanks for the quick reply.
    i am trying to get the function name from the FunctionSecurity class,
    However in FunctionSecurity class there is no such method defined as getFunctionName();
    my requirement is ,i have two functions functionA and functionB defined.
    both the function has the same controller class.in controller class ,i need to get the function name ,based on the function name
    i will redirect the page to respective page.
    looking forward for you response.
    appreciate your help
    Thanks,
    KT

  • How to get the today's julian date in java?

    how to get the today's julian date in java?
    hi can any one tell me how to get the todays julian date using Calender class or GregorianCalender class....
    Julian date for 2006.November.01 AD 05:54 PM : 2454041.0
    i have tryied with
    calJ.setGregorianChange(new Date(Long.MAX_VALUE));
    System.out.println(sdf2.format(calJ.getGregorianChange()));
    thanks
    Tushar
    Message was edited by:
    lad_tushar

    thanks a lot....for intrest....
    I have found some details about the Julian calendar as follows:
    The Julian date for 2006: JAN: 01:12:01:59 is 2453737.00138
    245 represent the year digits for year 2006
    3737 represent the date fir 1 Jan
    .00138 represents the time for 12:01:59
    Julian date change as per every day 12 noon it increase one digit in it.
    As per ref from
    http://www.aavso.org/observing/aids/jdcalendar.shtml
    Also chk this calendar where Julian date is 20. October 2006 for 02 November 2006
    As per ref from
    http://www.calendar.sk/julian_calendar-en.php
    I have tried the pure �GregorianCalendar� class from jdk1.4 API and its setGregorianChange method but not getting as per the expected Julian date format. Using the �setGregorianChange()� i have setting the cutover date to Long.MAX_VALUE it means GregorianCalendar now have to act as per the Julian calendar ...so after setting the cutover date it return me changed date using �getGregorianChange()� but that was not the Julian date of the current date...as expected or as per above both scenario. Even though the last two digits are nowhere equal to the actual Julian date.
    Program
    GregorianCalendar cal = new GregorianCalendar();
    cal.setGregorianChange(new Date(Long.MAX_VALUE)); // setting the calendar to act as a pure Julian calendar.
    // cal.set(Calendar.DATE, new Date().getDate()); // seting the current date
    // Date todayJD = cal.getGregorianChange(); // getting the changed date after the setGregorianChange
    Date todayJD = cal.getTime(); // getting the calculated time of today�s Julian date
    SimpleDateFormat sdfJulianDate = new SimpleDateFormat("yyDDD");
    SimpleDateFormat sdfJuliandayOfYear = new SimpleDateFormat("DDD");
    System.out.println("today Date = " + new Date());
    System.out.println("Today as julian date = " + sdfJulianDate.format(todayJD));
    System.out.println("Today as day of year = " + sdfJuliandayOfYear.format(todayJD));
    OUTPUT:
    USING : Date todayJD = cal.getGregorianChange();
    Today Date = Thu Nov 02 15:17:05 IST 2006
    Today as julian date = 94229
    Today as day of year = 229
    USING : cal.set(Calendar.DATE, new Date().getDate());
    Today Date = Thu Nov 02 15:19:22 IST 2006
    Today as julian date = 06319
    Today as day of year = 319
    USING : Date todayJD = cal.getTime();
    Today Date = Thu Nov 02 15:17:59 IST 2006
    Today as julian date = 06306
    Today as day of year = 306
    There is one another concept i found to get the Julian day of the year as per the Julian day chart mention on nasa site (http://angler.larc.nasa.gov/armsgp/JulianDayChart.html) and i m getting the moth of the year that is 306 for nov 02 2006 using getTime() method in above code then the out put is right for Julian day. But it was not as per the expected Julian date format. So in conclusion we can only able to retrieve the day of year for the Julian calendar. hope their will be a solution for this problem in java api ....else we allways have to depend upon the third party api that was not accepteble some times.....
    Kindly chk chart on the site
    http://angler.larc.nasa.gov/armsgp/JulianDayChart.html
    http://weather.uwaterloo.ca/julian.html
    http://www.fs.fed.us/raws/book/julian.shtml
    Thanks,
    Tushar Lad

  • How to get pivot table by using dates

    Hi,
    How to get pivot table by using dates in column.
    Below is the sample table and its value is given.
    create table sample1
    Order_DATE       DATE,
    order_CODE       NUMBER,
    Order_COUNT   NUMBER
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),1,232);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),2,935);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),3,43);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),4,5713);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),5,11346);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),1,368);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),2,1380);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),3,133);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),4,7109);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),5,14336);
    select * from sample1;So how to get the data like below.
              order_date
    order_code 30-sep-12 29-sep-12
    1 232 368
    2 935 1380
    3 43 133
    4 5713 7109
    5 11345 14336

    Using the extra data I inserted in my previous reply:select ORDER_CODE,
    SUM(DECODE(extract (month from ORDER_DATE),1,ORDER_COUNT,0)) JAN,
    SUM(DECODE(extract (month from ORDER_DATE),2,ORDER_COUNT,0)) FEB,
    SUM(DECODE(extract (month from ORDER_DATE),3,ORDER_COUNT,0)) MAR,
    SUM(DECODE(extract (month from ORDER_DATE),4,ORDER_COUNT,0)) APR,
    SUM(DECODE(extract (month from ORDER_DATE),5,ORDER_COUNT,0)) MAY,
    SUM(DECODE(extract (month from ORDER_DATE),6,ORDER_COUNT,0)) JUN,
    SUM(DECODE(extract (month from ORDER_DATE),7,ORDER_COUNT,0)) JUL,
    SUM(DECODE(extract (month from ORDER_DATE),8,ORDER_COUNT,0)) AUG,
    SUM(DECODE(extract (month from ORDER_DATE),9,ORDER_COUNT,0)) SEP,
    SUM(DECODE(extract (month from ORDER_DATE),10,ORDER_COUNT,0)) OCT,
    SUM(DECODE(extract (month from ORDER_DATE),11,ORDER_COUNT,0)) NOV,
    SUM(DECODE(extract (month from ORDER_DATE),12,ORDER_COUNT,0)) DEC
    from SAMPLE1
    where trunc(order_date, 'YY') = trunc(sysdate, 'YY')
    group by order_code
    order by order_code;
    ORDER_CODE JAN FEB MAR APR MAY JUN JUL AUG   SEP   OCT NOV DEC
             1   0   0   0   0   0   0   0   0   600   600   0   0
             2   0   0   0   0   0   0   0   0  2315  2315   0   0
             3   0   0   0   0   0   0   0   0   176   176   0   0
             4   0   0   0   0   0   0   0   0 12822 12822   0   0
             5   0   0   0   0   0   0   0   0 25682 25682   0   0Now a bit of explanation.
    1) Whenever you pivot rows to columns, no matter what version of Oracle and no matter what method you use, you have to decide in advance how many columns you are going to have and what the names of the columns are. This is a requirement of the SQL standard.
    2) I use the WHERE clause to get just the data for this year
    3) With EXTRACT, I get just the month without the year.
    4) Using DECODE, I put every month's data into the correct column
    5) Once I do all that, I can just GROUP BY order_code while SUMming all the data for each month.

Maybe you are looking for