Function Module to get date wise weekly offday of employee

Hi all,
Is there any standard function module which imports PERNR and DATE and returns the weekly off dates on the basis of
the work schedule (IT0007)?
If there is no such Fn Mo, please let me know what tables to look for to do this.
<<Text removed by moderator>>
For your information I have already found function module HRPERSONAL_WORK_SCHEDULE.But it is not returning for entire period (say 01.10.2010-31.10.2010)._
I have also found table relationship but it is not serving my purpose. Table T552A for monthly work schedule.
Thanks
Sourav

Hi Anand,
Thanks for your reply.
This fn mo is returning the first three days(01.10.2010,02.10.2010,03.10.2010).
Rest days of the month (Oct 2010) are not coming.
According to display work schedule(transaction PT03) this func module is returning the first row bcoz first row contains
01.10.2010,02.10.2010,03.10.2010.
Here is my code snippet.
DATA: it_ptpsp TYPE STANDARD TABLE OF ptpsp INITIAL SIZE 0,
      wa_ptpsp TYPE ptpsp.
DATA : gd_warning LIKE sy-subrc.
CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'
EXPORTING
  pernr             = '00100007'
  begda             = '20101001'
  endda             = '20101031'
*          KUG               =
*          REFRESH           = 'X'
*          WORKING_HOURS     = 'X'
*          SWITCH_ACTIV      =
*          MODIFY_ENTRIES    = 'X'
*          I0001_I0007_ERROR = '0'
*          READ_CLUSTER      =
IMPORTING
  warning_occured   =   gd_warning
TABLES
*          I0000             =
*          I0001             =
*          I0002             =
*          I0007             =
*          I0049             =
*          I2001             =
*          I2002             =
*          I2003             =
  perws             = it_ptpsp   "Stores employees work schedule
*          I0003             =
EXCEPTIONS
  error_occured     = 1
  abort_occured     = 2
  OTHERS            = 3.

Similar Messages

  • Any function module for getting fiscal year week numbers

    can any one provide me function module for getting fiscal year week numbers ? if no function module please let me know work around.
    Thanks!
    Lakshmikandh

    hi,
    Use FM <b>'DATE_GET_WEEK'</b>...
    parameter D1 LIKE SCAL-DATE.
    Data w like scal-week.
    CALL FUNCTION <b>'DATE_GET_WEEK'</b>
    EXPORTING
    date = D1
    IMPORTING
    WEEK = W
    EXCEPTIONS
    DATE_INVALID = 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.
    write W+4(2).
    Regards,
    Santosh

  • Function module to get 'Date one year in the past' in APO

    Hi,
    Required function module to get date one year in the past in APO.
    Thanks and regards,
    M.R.Reddy.

    Hi Reddy,
    Try these function modules
    /SAPAPO/DATE
    /SAPAPO/FISCAL_BDATE
    /SAPPO/MAPI_MAP_CREATDATE
    /SAPPO/MAPI_MAP_POSTDATE
    /SAPAPO/LCP_CALC_DATE
    /SAPAPO/VS_ORDER_GET_DATES
    /SAPAPO/PERIOD_CONVERT_DATE
    /SAPAPO/PERIOD_DATE_GET_FROMTO
    /SAPAPO/PERIOD_GET_DATE_RANGE
    /SAPAPO/PERIOD_GET_FOR_DATE
    /SAPAPO/PERIOD_GET_FROM_TODATE
    Regards
    R. Senthil Mareeswaran.

  • Required function module to get date one year in the past.

    Hi,
    Required function module to get date one year in the past.
    Thanks and regards,
    M.R.Reddy.

    Hello,
    You can check this:
    DATA:
    V_DATE1 TYPE D,
    V_DATE2 TYPE D.
    V_DATE1 = SY-DATUM.
    TRY.
        CALL METHOD CL_HRPAD_DATE_COMPUTATIONS=>SUBTRACT_YEARS_FROM_DATE
          EXPORTING
            START_DATE = V_DATE1
            YEARS      = 1
          RECEIVING
            DATE       = V_DATE2.
      CATCH CX_HRPA_VIOLATED_POSTCONDITION .
    ENDTRY.
    WRITE:
    / V_DATE1, / V_DATE2.
    Hope this helps.
    Br,
    Suhas

  • Function Module to convert date to week from Sunday to Saturday

    Hi,
    In BW the convertion date to week always give week from Monday(1) to Sunday(7)
    I'm looking for a function module to convert date to week from Sunday(1) to Saturday(7)
    Thanks
    Sebastien

    Hi,
    I think this SAP standardized. Maybe you need to create custom FM.
    You can copy SAP FM DATE_GET_WEEK. in the FORM FIRSTWEEK, I see below case,
    CASE start_weekday.
        WHEN if_calendar_definition=>c_monday.
          start_weekday_number = 1.
        WHEN if_calendar_definition=>c_tuesday.
          start_weekday_number = 2.
        WHEN if_calendar_definition=>c_wednesday.
          start_weekday_number = 3.
        WHEN if_calendar_definition=>c_thursday.
          start_weekday_number = 4.
        WHEN if_calendar_definition=>c_friday.
          start_weekday_number = 5.
        WHEN if_calendar_definition=>c_saturday.
          start_weekday_number = 6.
        WHEN if_calendar_definition=>c_sunday.
          start_weekday_number = 7.
      ENDCASE.
    Maybe you can play something here.

  • Function Module to get the Direct manager to an employee in a period?

    Function Module to get the Direct manager to an employee in a period of time?

    Hi,
    try these FM
    /MRSS/SQP_EMP_PROF_GET_API
    /MRSS/SQP_EMP_PROF_GET_HISTORY
    Thanks
    Viquar Iqbal

  • Any Function Module to get date by passing week and year

    Hi,
       Is there any Function Module available to get date by passing week and year. For example, Week 24, Year 2005 and you get the date.
    Regards,
    Mira

    WEEK_GET_FIRST_DAY
    pass 'YYYYWW' (200524) to WEEK parameter it will give you the week start date
    Raja

  • Function module to get last fiscal week

    Hi Gurus,
    Can anybody give me the function module to go back to few fiscal weeks.
    For example ,
    if the current fiscal week is 2008030,
    I need to get the value 2008024.
    This can be done with ABAP code. But I am looking for function module.
    Thanks,
    Rajani.
    Points will be assigned.

    Hi Rajani,
    Please try this:
    REPORT Z_CAL_WEEK .
    DATA: Z_DATE TYPE SY-DATUM.
    DATA: Z_WEEK TYPE SCAL-WEEK.
    Z_DATE = SY-DATUM
    Z_DATE = Z_DATE - 42. "CORRESPONDING DATE 6 WEEKS in the past
    CALL FUNCTION 'DATE_GET_WEEK'
      EXPORTING
        DATE = Z_DATE
      IMPORTING
        WEEK = Z_WEEK.
          EXCEPTIONS
         DATE_INVALID       = 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.
    WRITE :Z_WEEK.
    Regards
    Joe

  • Function module to get Fiscal year/week

    Hi,
    I searched SAP forum but could not find specific answer to this question.
    I want to find Fiscal year week (YYYYWW) for a date using Fiscal year variant.
    Can you suggest some function module/method to get the info?
    E.g., if todays date is 06/23/2010
    then Fiscal year week should be 201034. (Depending on Fiscal year variant XX)
    Calendar year week is 201025.
    Thanks,
    Chirag

    >
    Chirag Mistry wrote:
    > C'on guys, help me out!
    That's what the other's have been doing all along!
    AT some point, you have to take responsibility yourself. The forum isn't here to provide people with complete packaged solutions. You have to do some work yourself.
    You either have the fiscal year variant in your system as Brad has suggested, or you will have to develop some logic to figure out what week you are in based on the start date of your fiscal year and the date you are interested in.
    Rob

  • Function module to get data into internal table from Excel file sheets

    Hi,
    I have to upload customers from excel file.
    we are donloading customer data excel file sheets.
    Customer data in 1 sheet, tax data the other sheet of same excel file, Customer master-Credit data in other sheet of same excel file.
    so i have 3-4 sheet in one excel file.
    now my requirement is to get the data from excel file into internal table.
    is there any function module.
    Thanks & Regards

    I am sending you the idea with an example how you can upload data from an EXCEL file into an internal table. I am not sure if you can take data from different sheet in the same EXCEL file. I think that this is not possible (try it )
    Upload the data into an internal table, like the way that I am describing in the above:
      DATA: L_MAX_COL_NB TYPE I.
      DATA: l_file_name LIKE RLGRAP-FILENAME.
    Just to be sure that is the correct type for the FM.
      l_file_name = P_FILE_NAME.
      L_MAX_COL_NB = 58.  "Maximum nb of colums that the FM can read.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                FILENAME                = l_file_name
                I_BEGIN_COL             = 1
                I_BEGIN_ROW             = 2
                I_END_COL               = L_MAX_COL_NB
                I_END_ROW               = 9999
           TABLES
                INTERN                  = PT_EXCEL
           EXCEPTIONS
                INCONSISTENT_PARAMETERS = 1
                UPLOAD_OLE              = 2
                OTHERS                  = 3.
      IF SY-SUBRC <> 0.
      ENDIF.
    Now you should upload the data into your own itab. The Function Module will return to you all the an itab
    from all fields and columns. Define the structure of the uploading file into SE11 - Data Dictionary. Then read the fieldcatalog of this structure. In the code that I am sending to you, I am insearting an empty line into the internal table and then I am assigning this line into a corresponding field-symbol. Then I am able to change the working area - so and the line of the itab. Propably you could you the statement APPEND INITIAL LINE TO (your_table_name) ASSIGNING <your_field_symbol>, but the example was written in an old SAP version.
      FIELD-SYMBOLS:
                     <F_REC> LIKE WA_UPLOAD_FILE,      "working are of the uploading file
                     <F_FIELD> TYPE ANY.
      DATA: COLUMN_INT TYPE I,
            C_FIELDNAME(30) TYPE C.
      PERFORM GET_FIELDCATOLG TABLES FIELDCAT
                               USING 'ZECO_CHARALAMBOUS_FILE'.
      LOOP AT PT_EXCEL.
        AT NEW ROW.
          ASSIGN WA_UPLOAD_FILE TO <F_REC>.
        ENDAT.
        COLUMN_INT = PT_EXCEL-COL.
        READ TABLE FIELDCAT INTO WA_FIELDCAT INDEX COLUMN_INT.
        CONCATENATE '<F_REC>-' WA_FIELDCAT-FIELDNAME INTO C_FIELDNAME.
        ASSIGN (C_FIELDNAME) TO <F_FIELD>.
        <F_FIELD> = PT_EXCEL-VALUE.
        AT END OF ROW.
          APPEND WA_UPLOAD_FILE TO GT_UPLOAD_FILE.
          CLEAR WA_UPLOAD_FILE.
        ENDAT.
      ENDLOOP.
    With Regards
    George
    Edited by: giorgos michaelaris on Mar 4, 2010 3:44 PM

  • Function module to get data from VARI table

    Hi All,
    thank you for viewing this thread. can anyone help me out in finding a function module which can get data from the VARI table?
    thank you

    Hi,
    FMs you will require are:
    RS_VARIANT_CONTENTS - Values of a variant returned in a table
    RS_VARIANT_EXISTS - Checks whether a variant exists for a report
    RS_VARIANT_TEXT - Returns short description of variant
    RS_VARIANT_VALUES_TECH_DATA - Reads variant parameters of a report
    Do search on them for complete details.
    Cheers.

  • Function Module to get Date and Time out of Timestamp

    Hi,
    Source system timestamp field CREATED_TS of Type DEC-15
    BW PSA data in format 20.140.707.105.948
    In DSO, I have created two target InfoObjects; one for Date and one for Time.
    In transformation from PSA to DSO, in field level routine, I want to split timestamp into Date and Time.
    There is a function module CACS_TIMESTAMP_GET_DATE in source system but it is not available in BW. Another function module ADDR_CONVERT_TIMESTAMP_TO_DATE which is available in BW but returns only Date. 
    Does anyone know a function module in BW which takes Timestamp (PSA data in format 20.140.707.105.948) and returns Date and Time.
    Much better would be a FM which take timestamp and also Timezone  and returns Date and Time.
    Thanks
    Ahmad

    Timestamp to date time conversion (with time zone) is built into ABAP. Why use a function module?
    Read the ABAP help on CONVERT.

  • Any Function module to get data from ESS leave form

    Hi Friends,
    I have modified std workflow ws12300111.with 2 levels.
    I want to send mail to HOD. In that mail i have to mention details like start date , end date,leave type which is entered into ESS form. I want to retrive that data.
    Is there any Fm is available? which wil give ESS data as output.
    Plz let m know.
    Regards,
    Shital

    Have you thought about creating attachments in the WF so you can read the form and get data from it.
    There's plenty of standard WF examples around of attaching objects to WF's.
    Since the ESS action will initiate the relevant workflows you should easily be able to save this data.
    BTW If your other question on this WF was answered please close that thread.
    Cheers
    Jimbo

  • Reg Function module for getting date

    Hi,
    My requirement is, If I entered some date I need to get past three months number of days.
    Eg: if I entered 26thDec,2007
    I need to get number of days form October 1st to 26th Dec.
    Regards,
    sarath.

    try this code
    REPORT ztest .
    DATA : lv_date TYPE syst-datum ,
           lv_tmp  TYPE i          .
    PARAMETERS : p_date TYPE syst-datum OBLIGATORY .
    CALL FUNCTION 'ADD_TIME_TO_DATE'
      EXPORTING
        i_idate = p_date
        i_time  = '3'
        i_iprkz = '2' "Month
      IMPORTING
        o_idate = lv_date.
    lv_tmp = lv_date - p_date .
    WRITE : 'Diff in days ' , lv_tmp .

  • Function Modules to get First day of week, month, Year

    Can anyone name the Function Modules for getting First day of week, month ,year.

    to get first day of week use this function;   WEEK_GET_FIRST_DAY
          CALL FUNCTION 'WEEK_GET_FIRST_DAY'
               EXPORTING
                    WEEK         = '201107'
               IMPORTING
                    DATE         = l_date
               EXCEPTIONS
                    WEEK_INVALID = 1
                    OTHERS       = 2.
    with DATE_COMPUTE_DAY function you can get date number in week.
    CALL FUNCTION 'DATE_COMPUTE_DAY'
           EXPORTING
                DATE = workdate
           IMPORTING
                DAY  = day_of_week_num
           EXCEPTIONS
                OTHERS  = 8.
      CASE day_of_week_num.
        WHEN 1.
          hold_day_of_week = 'Monday'.
        WHEN 2.
          hold_day_of_week = 'Tuesday'.
        WHEN 3.
          hold_day_of_week = 'Wednesday'.
        WHEN 4.
          hold_day_of_week = 'Thursday'.
        WHEN 5.
          hold_day_of_week = 'Friday'.
        WHEN 6.
          hold_day_of_week = 'Saturday'.
        WHEN 7.
          hold_day_of_week = 'Sunday'.
        WHEN OTHERS.
          hold_day_of_week = 'invalid'.
      ENDCASE.

Maybe you are looking for

  • Taking more time for retreving data from nested table

    Hi we have two databases db1 and db2,in database db2 we have number of nested tables were there. Now the problem is we had link between two databases,whenever u firing the any query in db1 internally it's going to acces nested tables in db2. For fech

  • Different Date Formats in the same "From"

    Hello We used different date formats depending on the users language. In a report this is simple to implement ... read the date field twice (in different formats dd/mm/yyyy and mm/dd/yyyy) and display only one based on the language. I want to be able

  • Actionlistener in swing won't let me play with my variables!

    I am sort of new to java, having done some scripting before, but not much programming experiance. OOP was, until I learned java, something I didn't use that much. All this static and public stuff was hard at first, but I finally think I understand it

  • N8 using bookmarks on shortcuts widget

    HI, you can on the homescreen use the widget to put 4 links too applications or bookmarks or folders.  Now i encountered the problem that i wanted to put in 4 bookmarks on in that widget. But the problem is it shows exactly the same icon for every bo

  • Getting error while trying to generate SNP PPM

    Hi Experts, I am getting error, while trying to generate SNP PPM fron PP/DS PPM. It says Set up matrix for resource in planning version is not define. But I checked that i havea set up matrix as well as setup group. Any help will be appreciated. Than