Function module to predict the date for a given date

hi friends,
is there any function module to predict the date
means  for example if i enter one date  , what will be the date
after 4 months(say)  to the given date.
my requirement is when a person is hired today (10.06.2008)
and if he is under probationary for 6 months, then on what date he comes into the permenant employee's list(predicted date after date 6 months)

Date calculations
DATE_COMPUTE_DAY Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.
DATE_IN_FUTURE Calculate a date N days in the future.
RP_CALC_DATE_IN_INTERVAL Add days/months to a date
RP_CALC_DATE_IN_INTERVAL Add/subtract years/months/days from a date
SD_DATETIME_DIFFERENCE Give the difference in Days and Time for 2 dates
MONTH_PLUS_DETERMINE Add or subtract months from a date. To subtract a month, enter a negative value for the 'months' parameter.
DATE_CREATE Calculates a date from the input parameters:
Example: DATE_CREATE
CALL FUNCTION 'DATE_CREATE'
EXPORTING
   anzahl_jahre  = 1
   anzahl_monate = 2
   anzahl_tage   = 3
   datum_ein     = '20010101'
IMPORTING
   datum_aus     = l_new_date.
   Result:
   l_new_date = 20020304
Example: MONTH_PLUS_DETERMINE
data: new_date type d.
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
months = -5 " Negative to subtract from old date, positive to add
olddate = sy-datum
IMPORTING
NEWDATE = new_date.
write: / new_date.

Similar Messages

  • Function module  which changes the Storage Unit (SU) Block Data like LS32

    Hi,
    Is there any Function module  which changes the Storage Unit (SU) Block Data as done in  LS32.
    Thank you,
    Prashanth A.

    Hello Pablo.
    Yes we did run LT04 and it does encounter that same error message after clicking the Stock Removal button.  But eventually error msg will be removed by entering the value at the Storage Unit Type field because it directly fills in LTAP-LETYP.
    We have resolved that the function module will not really fill the desired Storage unit type therefore TO background creation is not feasible in our scenario (non-SU managed transfer to SU-managed storage type).  And I found this thread too:  http://scn.sap.com/thread/1947358
    So issue is still open but we have considered of changing the process since this is still just a new scenario for us.
    Thanks a lot for your inputs!

  • Function module to choose the file for download and upload

    what is the function module to choose the file for download and upload  for presentation server.
    give me with example

    Please search in SCN.
    This has been discussed so many times.

  • Function module to get the posting period based on date

    Hi to all,
    Is there any function module to get the posting period based on date?
    Regards,
    Nagesh

    hi,
    CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
          EXPORTING
            I_GJAHR        = GV_GJHAR
            I_PERIV        = GC_24
            I_POPER        = GV_POPER
          IMPORTING
            E_DATE         = S_FKDAT-LOW
          EXCEPTIONS
            INPUT_FALSE    = 1
            T009_NOTFOUND  = 2
            T009B_NOTFOUND = 3
            OTHERS         = 4.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
          EXPORTING
            I_GJAHR        = GV_GJHAR
            I_PERIV        = GC_24
            I_POPER        = GV_POPER
          IMPORTING
            E_DATE         = S_FKDAT-HIGH
          EXCEPTIONS
            INPUT_FALSE    = 1
            T009_NOTFOUND  = 2
            T009B_NOTFOUND = 3
            OTHERS         = 4.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    ags.

  • How to get start date of the period for a given date from cube

    I have a situation where i need to find the start day of the period for a given date. is there a way to know that. i want to use that in my report. i enter the date from my report(i have date parameter), depends on the date, i want to display the start day
    of the period. how can i write expression for that in my report?
    ram

    Hi ramprasad74,
    According to your description, you are using Analysis Services as a data source for the report, the cube has hierarchy: Fyear, FQuarter, FPeriod, fweek, Fdate. You want to add a date parameter to the report, after you changed value of the parameter, the
    report will return the first day of FPeriod.
    To achieve your goal, we need to add a parameter to the report, then use the parameter in mdx query. For detail information, please refer to the following steps:
    In the Report Data pane, right-click on a dataset created from a SQL Server Analysis Services data source type, and then click Query. The MDX query designer opens in Design mode.
    On the toolbar, click Design to toggle to Query mode.
    On the MDX query designer toolbar, click Query Parameters symbol. The Query Parameters dialog box opens.
    In the Parameter column, click <Enter Parameter>, and then type the name of a parameter.
    In the Dimension column, choose a value from the drop-down list.
    In the Hierarchy column, choose a value from the drop-down list.
    In the Default column, from the drop-down list, select a single value.
    Click OK. 
    In query designer dialog box, type the mdx query like below:
    with member [Measures].[FirstChild]
    as
    [Date].[Fiscal].currentmember.parent.firstchild.name
    select {[Measures].[FirstChild]} on 0,
    [Date].[Fiscal].[Date].members on 1
    from
    ( SELECT ( STRTOSET(@ParameterName, CONSTRAINED) ) on 0
    from
    [Cube]
    Here are relevant threads you can reference:
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/c7146ac3-40ea-4d53-b321-c707aebbd405/how-to-pass-date-parameter-to-mdx-query
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/fd12a865-bc90-4a65-af42-ce38a8cfa29b/pass-date-time-parameter-to-mdx-query-ssrs
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

  • Find the 'DAY' for a given 'DATE'

    Hi Folks,
    I need a help regarding finding the day for a given date.
    My requirement is that..,
             If I enter a date using 'parameters', it should write the 'day' for the corresponding date.
    To be more specific.....,
    if I enter date as ' 07/15/2008 ' it should return me  the day as 'Tuesday'.
    Regards,
    Naveen G

    HI,
    FM LIST WITH RESPECT TO DAY, WEEK, AND MONTH.
    CALCULATE_DATE : Calculates the future date based on the input .
    DATE_TO_DAY : Returns the Day for the entered date.
    DATE_COMPUTE_DAY : Returns weekday for a date
    DATE_GET_WEEK : Returns week for a date
    RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
    MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
    END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
    HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
    FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
    MONTH_NAMES_GET : Get the names of the month
    WEEK_GET_FIRST_DAY : Get the first day of the week
    HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format
    SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
    HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months
    LAST_DAY_OF_MONTHS : Returns the last day of the month
    DATE_CHECK_PLAUSIBILITY :Check for the invalid date.
    Reward points if useful,
    siri

  • Find 3rd friday of the month for a given date

    how to find out 3rd friday of the month for a given date? I can always pass the first day of the month as input
    eg, input date is 01-JAN-09. need to get the 3rd friday 16-JAN-09 (Jan has 5 fridays 02, 09, 16,23,30)
    input date : 01-feb-09, need to get 20-feb-09
    Edited by: user520824 on Apr 1, 2009 12:30 PM

    NLS independent solution:
    SELECT  DT,
            TO_CHAR(DT,'FMDay') day,
            CASE
              WHEN TRUNC(TRUNC(DT,'MM') + 7,'IW') - 3 < TRUNC(DT,'MM') THEN TRUNC(TRUNC(DT,'MM') + 7,'IW') + 18
              ELSE TRUNC(TRUNC(DT,'MM') + 7,'IW') + 11
            END THIRD_FRIDAY_OF_THE_MONTH
      FROM  (
             SELECT  TO_DATE(LEVEL || '/2009','MM/YYYY') DT
               FROM  DUAL
               CONNECT BY LEVEL < 13
    DT        DAY       THIRD_FRI
    01-JAN-09 Thursday  16-JAN-09
    01-FEB-09 Sunday    20-FEB-09
    01-MAR-09 Sunday    20-MAR-09
    01-APR-09 Wednesday 17-APR-09
    01-MAY-09 Friday    15-MAY-09
    01-JUN-09 Monday    19-JUN-09
    01-JUL-09 Wednesday 17-JUL-09
    01-AUG-09 Saturday  21-AUG-09
    01-SEP-09 Tuesday   18-SEP-09
    01-OCT-09 Thursday  16-OCT-09
    01-NOV-09 Sunday    20-NOV-09
    DT        DAY       THIRD_FRI
    01-DEC-09 Tuesday   18-DEC-09
    12 rows selected.
    SQL> SY.

  • Function module to get the month name when start date and end date given

    Hey Experts,
                       I am creating a employee bonus report. In this report each and every employee's month wise working days have to be calculated and displayed in the report. I need to find a function module which helps me split the given dates into that particular month. Please help me with the same.
    Regards,
    G. Shankar

    Hi Shankar,
    I think there are two Function Modules.
    First One is 'HR_RU_MONTH_NAME_IN_GENITIVE' in this u need to pass month number and for that u have extract month number from date.
    And Second One is 'ISP_GET_MONTH_NAME' in this u need to pass date or month number, it directly accepts date.
    Check this two and let me know.
    Cheers,
    Parth Parikh

  • Function module to change the value for pricing condition type

    Hello experts,
    I want to change the value for pricing condition type for an item in the transaction CRMD_ORDER.
    I used many function modules but none are working.
    Please kindly suggest a function module that will change the value for a condition type .
    I have used the following function module but its not working, please correct the coding if anything needs to be changed or added. Please help me .
    Thank you.
    CLEAR PRCD_COND.
         SELECT SINGLE * FROM PRCD_COND WHERE KPOSN = WA_ORDERADM_I-GUID AND
                                              KSCHL = COND_TY.
      IF SY-SUBRC = 0.
    *    MOVE-CORRESPONDING PRCD_COND TO L_COND_CHG.
    *    CLEAR L_COND_CHG-KBETR.
        L_COND_CHG-STUNR = PRCD_COND-STUNR.
        L_COND_CHG-KBETR = COND_PRC.
    *    L_COND_CHG-KSCHL = COND_TY.
        INSERT L_COND_CHG INTO TABLE T_COND_CHG.
    L_HEAD_GUID = CRMD_ORDERADM_H-GUID.
    L_ITEM_GUID = WA_ORDERADM_I-GUID.
    INSERT L_HEAD_GUID INTO TABLE HEAD_GUID.
    INSERT L_ITEM_GUID INTO TABLE ITEM_GUID.
        CALL FUNCTION 'CRM_ORDER_READ'
         EXPORTING
           IT_HEADER_GUID                    = HEAD_GUID
           IT_ITEM_GUID                      = ITEM_GUID
         IMPORTING
           ET_ORDERADM_H                     = LT_ORDERADM_H
           ET_ORDERADM_I                     = LT_ORDERADM_I
           ET_PRIDOC                         = IT_PRIDOC_RD
           ET_DOC_FLOW                       = T_DOC_FLOW
    *     CHANGING
    *       CV_LOG_HANDLE                     =
    *     EXCEPTIONS
    *       DOCUMENT_NOT_FOUND                = 1
    *       ERROR_OCCURRED                    = 2
    *       DOCUMENT_LOCKED                   = 3
    *       NO_CHANGE_AUTHORITY               = 4
    *       NO_DISPLAY_AUTHORITY              = 5
    *       NO_CHANGE_ALLOWED                 = 6
    *       OTHERS                            = 7
        IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    MOVE-CORRESPONDING LS_PRIDOC_RD TO L_PRI_COND.
    INSERT L_PRI_COND INTO TABLE PRI_COND.
    LOOP AT IT_PRIDOC_RD INTO LS_PRIDOC_RD.
    MOVE-CORRESPONDING LS_PRIDOC_RD TO L_PRIDOC_CHG.
    L_PRIDOC_CHG-PRIC_COND = PRI_COND.
    L_PRIDOC_CHG-REF_GUID = LS_PRIDOC_RD-GUID.
    L_PRIDOC_CHG-COND_CHANGE = T_COND_CHG.
    INSERT L_PRIDOC_CHG INTO TABLE PRIDOC_CHG.
    ENDLOOP.
    LOOP AT LT_ORDERADM_H INTO LS_ORDERADM_H .
    MOVE-CORRESPONDING LS_ORDERADM_H TO L_HEADER.
    INSERT L_HEADER INTO TABLE HEADER.
    ENDLOOP.
    LOOP AT LT_ORDERADM_I INTO LS_ORDERADM_I.
    MOVE-CORRESPONDING LS_ORDERADM_I TO L_ITEM.
    INSERT L_ITEM INTO TABLE ITEM.
    ENDLOOP.
    L_FIELD-FIELDNAME = 'STUNR'.
    INSERT L_FIELD INTO TABLE FIELD.
    L_FIELD-FIELDNAME = 'KBETR'.
    L_FIELD-CHANGEABLE = 'X'.
    INSERT L_FIELD INTO TABLE FIELD.
    L_INPUT-FIELD_NAMES = FIELD.
    L_INPUT-REF_KIND = 'E'.
    L_INPUT-REF_GUID = LS_PRIDOC_RD-GUID.
    L_INPUT-OBJECTNAME = 'PRIDOC'.
    INSERT L_INPUT INTO TABLE INPUT.
        CALL FUNCTION 'CRM_ORDER_MAINTAIN'
         EXPORTING
           IT_PRIDOC                     = PRIDOC_CHG
         IMPORTING
           ET_EXCEPTION                  = EXCEPT
         CHANGING
           CT_INPUT_FIELDS               = INPUT.
        IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    REFRESH EXCEPT.
    CALL FUNCTION 'CRM_ORDER_SAVE'
      EXPORTING
        IT_OBJECTS_TO_SAVE         = HEAD_GUID
    *   IV_UPDATE_TASK_LOCAL       = FALSE
    *   IV_SAVE_FRAME_LOG          = FALSE
    *   IV_NO_BDOC_SEND            = FALSE
    *   IT_ACTIVE_SWITCH           =
    IMPORTING
       ET_SAVED_OBJECTS           = SAVED
       ET_EXCEPTION               = EXCEPT
       ET_OBJECTS_NOT_SAVED       = UNSAVED
    * CHANGING
    *   CV_LOG_HANDLE              =
    * EXCEPTIONS
    *   DOCUMENT_NOT_SAVED         = 1
    *   OTHERS                     = 2
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    COMMIT WORK AND WAIT.

    Hi,,
    To be able to call a function module in an update work process, you must flag it in the Function Builder. When you create the function module, set the Process Type attribute to Update with immediate start
    Alternatively u can use this function module.
    CRM_STATUS_DATA_SAVE_DB
    BAPI_CUSTOMERCRM_CHANGE (If u wish to use a bapi for this).
    Also , Let me know what error you got when implementing other function module.Does the function module didnt return any error but still the value is not changed for pricing condition type?

  • Function modules to create the relationship for Reference Personnel IT0031

    I tried using BDC recording PA30 to create the relationship for reference personnel but it dun seems to work. Anyone knows of any standard function module to create that relationship instead.

    I have tried both and it doesnt work. The behaviour of this reference personnel number is different from the normal object relationships. Does anyone have experience using function module to create reference personnel relationship instead of giving the stand FM to create the records.

  • Is there any Function Module  to delete the  Responsibility for buyer

    Hi,
            I am able to insert a responsibility for a buyer using the FM, BBP_UPDATE_ATTRIBUTES. Can any one can tell me is there any FM to delete the responsibity for buyer. The BBP_UPDATE_ATTRIBUTES is not working for deletion and It is taking lot of time when i am trying to delete rsponsibility by using  the transactio code PPOSA_BBP .
    I found one badi, HRBAS00INFTY but there are no exporting or changing parameters in that badi to write some logic to delete.
    The  FM ,RH_BASE_UPDATE_DB_DIALOG is getting executed and updating the data base tables after the above badi got executed. can i use this FM ,RH_BASE_UPDATE_DB_DIALOG directly to delete the responsibility?I think it is not recomended.
    can any one give me some idea.

    Hi. You can use transaction PP01 instead of PPOMA_BBP.
    You might have to make some settings in table T777I to allow the responsibility to be maintained from PP01, but it it a lot faster than PPOMA_BBP, and you could use an ECATT or call transaction on PP01.
    You can also delete all the infotype using PP01, basically delete all the responsibility in 1 go if that is any use? Try all this in a test system first toget used to it though.
    Regards,
    Dave.

  • Functional module to get the File from a given Directory

    Hi all,
    I am using a FM name 'subst_get_file_list' to get the file from a given directory but it is accepting only 40 Character length file only my requirement is to accept file name other than 40 char,
    give me good sugestion
    regards
    paul

    Hi Paul,
    Check the Function Module Gayathri has given. ie. 'SO_SPLIT_FILE_AND_PATH'.
    In the exporting parameter FULL_NAME , give the path name and in the importing parameter stripped_name , you will get the filename.
    Check this code.
    REPORT ZSHAIL_SPLITFILE.
    data: it_tab type filetable with header line,
          gd_subrc type i.
    tables: rlgrap.
    data: path type string,
          file_name type string.
    parameters file_nam type rlgrap-filename .
    data: user_act type i.
    at selection-screen on value-request for file_nam.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      EXPORTING
        WINDOW_TITLE            = 'select a file'
       DEFAULT_EXTENSION       = '*.txt
        DEFAULT_FILENAME        = ''
        FILE_FILTER             = '*.txt'
        INITIAL_DIRECTORY       = ''
        MULTISELECTION          = abap_false
       WITH_ENCODING           =
      CHANGING
        file_table              = it_tab[]
        rc                      = gd_subrc
        USER_ACTION             = user_act
       FILE_ENCODING           =
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    if user_act = '0'.
    loop at it_tab.
    file_nam = it_tab-filename.
    endloop.
    endif.
    path = file_nam.
    CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
      EXPORTING
        full_name           = path
    IMPORTING
       STRIPPED_NAME       = file_name
      FILE_PATH           =
    EXCEPTIONS
      X_ERROR             = 1
      OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    at selection-screen.
    message i001(zmess) with file_name.
    Regards,
    SP.

  • Code or function to generate next working date for a given date

    hi,
    First lets see the table struncture and table data.
    CREATE TABLE LT_CA_HOLIDAYS
      HOLIDAY_DATE            DATE                  NOT NULL,
      IS_BANK_HOLIDAY         CHAR(1 BYTE)          NOT NULL,
      DISPLAY_NAME            VARCHAR2(35 BYTE)     NOT NULL
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('12/25/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Christmas Day');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('01/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'New Years Day');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('01/17/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Martin Luther King Jr');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('02/21/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Washington s B-Day');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('05/30/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Memorial');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('07/04/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Independence Day');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('09/05/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Labor Day');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('10/10/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Columbus Day');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('11/11/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Verterans Day');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('11/24/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Thanksgiving Day');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('12/25/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Christmas Day');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('12/26/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Bank Observed Christmas');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('01/01/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'New Years Day');
    Insert into LT_CA_HOLIDAYS
       (HOLIDAY_DATE, IS_BANK_HOLIDAY, DISPLAY_NAME)
    Values
       (TO_DATE('01/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 'Bank Observed New Years Day');
    COMMIT;.
    The requirement goes something like this:
    Weekend days SATURDAY and SUNDAY ARE CONSIDERED holidays.
    The list of holidays are in LT_CA_HOLIDAYS.
    We will be given a date as p_processdate.we need to check if p_processdate is a holiday or a working day,
    if p_processdate is a holiday then we need to generate the next working day .
    If p_processdate is a working day we need to test whether p_processdate +1 is a working day, IF p_processdate+1 is a holiday then
    we need to generate the next working day near to p_processdate + 1.
    Regards

    DECLARE
    day_param date:=TO_DATE('01/16/2011','MM/DD/YYYY');--- SET your input date 
    n_yes number;
    BEGIN
         LOOP
                 day_param:=day_param+1;
                 select count(*) into n_yes from LT_CA_HOLIDAYS WHERE TO_CHAR(HOLIDAY_DATE,'MM/DD/YYYY')=TO_CHAR(day_param ,'MM/DD/YYYY') ANd IS_BANK_HOLIDAY='Y' ;
              IF(to_char (day_param,'DY') NOT IN ('SAT','SUN')) AND n_yes=0 THEN
                   EXIT;
              END IF;
         END LOOP;
         DBMS_output.put_line('output'||day_param);
    END;OUTPUT
    output18-JAN-11
    Edited by: Leonard on Aug 26, 2011 5:13 AM

  • How to get XLR to show BPs with no transaction data for a given date range

    Hi -
    I am building an XLR report that does a comparison of net sales data across two periods for a given sales employee's BPs.
    The report has the row expansion:
    FACT BPA(*) SLP(SlpName = "ASalesPersonNameHere") ARDT(Code = "ARCreditMemo", "Invoice") Group by BPA.CardName
    and column expansions:
    FIG(SO_TaxDate = @StartDate:@EndDate)
    and
    FIG(SO_TaxDate = @StartDate2:@EndDate2)
    where @StartDate, @EndDate, @StartDate2, @EndDate2 are parameters that define the two ranges of dates.
    The column formulas are, from left to right:
    =ixDimGet("BPA", "CardName")
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for first date range
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for second date range
    The report works fine except for one problem, I would like it to include BPs for which no transaction occurred in either date range as well.
    Any help is greatly appreciated!
    Thanks,
    Lang Riley

    Really appreciate your feedback!  Those are good suggestions. I should have mentioned that I had already tried both those suggestions.
    Removing FACT on BPA in this case ends up returning all the BPs and not respecting the SLP(SlpName = "aName") part of the query. 
    Using **, i.e., * or #NULL, makes no change in the resulting data in this case.  I had thought that ** would be the solution, but it didn't change the outcome.  I still have BPs for which when their sales employee is used as the filter and they have no transactions for either date range, and yet they still do not appear. 
    I should further mention that the IXL query, as it now stands, does return BPs for which one of the periods has no data, just not both, and I have verified that applicable BPs with no transaction data for both periods do exist in my data set.  It seems that perhaps the IXL query needs to be restructured?  Please keep the suggestions coming including how this query might be restructured if necessary.

  • Function module to find the attachment list for an accounting document?

    Is there a function module to find the attachment list for an accounting document? Or which table stores such references?
    I know I can find this info from the transaction FB03, but is there a function module to find the attachments for an accounting document? So far I only found the attachments are stored in the table SOOD, and archived documents in table TOA03, but I can't find the table that stores the links between the accounting document and its attachments?
    <b><REMOVED BY MODERATOR></b>
    Thanks,
    Ning
    Message was edited by:
            Alvaro Tejada Galindo

    Hi,
      i_object1-typeid = 'YARSATTA'.  "<<< Give your Object id name
      i_object1-catid  = 'BO'.
      i_object1-instid = i_yarsitem-docno.    "<<<< Document Number
      call method cl_gos_attachment_query=>count_for_object
        exporting
         is_object = i_object1
         ip_arl    = space
        receiving
         rt_stat   = i_stat1.
      read table i_stat1 into wa_stat1 index 1.
      if sy-subrc eq c_0.
         move wa_stat1-counter to v_attno1.
      endif.
    For link you need to check for table SRGBTBREL
    and also please check class CL_GOS*

Maybe you are looking for

  • Set the color of a row depending the value of the column in JTable?

    Hi All, I have a JTable that add rows when the user clicks on the button. In this way there can be any no. of rows in my table. My table contains five columns. When a new row is added , it is added with new data each time. Also the data of the rows k

  • Add new fields using BADI DNO_EVENT_SAVE in Solution Manager

    Hi, I would like to add new fields using BADI DNO_EVENT_SAVE. How can I add new fields? Thanks.

  • Error in web.xml of Bookstore application...

    Hi guys, i'm a new user of jsf. i've a question for you. I'm trying to start the bookstore6 example included in java5ee example dir. I've builded the application as said into the tutorial but my application gives me an error in web.xml Severity     D

  • Line 8060 of the INF file\i386\txtsetup.sif

    Hi ! I have problems throw the formating.. after partioning the disk...i want to formmat , but i can't do format iwith a sturtup disk...  when i write A:>/ format C: (i take) bad command in a dos line (or somthing like this it doesn't work) 2. throw

  • Habe Photoshop CS6 Extended in der Student

    Ich habe die Student&Teacher Edition des ADOBE PHOTOSHOP CS6. Ich bin bei Adobe angemeldet. Nun warte ich bereits seid 1 Monat auf die Übermittlung der Serien-Nummer. Was kann da los sein? Wer weis Rat?