Function Module which will take Wekk No & Return date range (from & To dat)

Hello everyone,
I need a Function Module which will take Week No as an input Parameter & return me the date range
(From date & To date of that week) .
Thanks in advance!
Cheers!
Moderator message: date calculation questions = FAQ, please search before posting.
Edited by: Thomas Zloch on Nov 2, 2010 5:25 PM

Hi,
     Please write the below logic..
data : v_date11 type sy-datum,
          monday    type sy-datum,
          sunday  type sy-datum,
          v_count1 type i .
*v_count1 = 20 * 7.            "   Say U want details for 20th week , or give a parameter for week and multiply with 7*
v_date11 = '20100101'.     "   take the starting day of the year ....
v_date11 = v_date11 + v_count1.   " add to the date
CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'   <-- call this FM
EXPORTING
   DATE          = v_date11
IMPORTING
  WEEK          = WEEK
   MONDAY        = MONDAY <-- will have the week starting day
   SUNDAY        = SUNDAY
Regards,
Srini.

Similar Messages

  • Any Function Module which will give user id or position

    Hello Friends,
       is there any standard function module which will give the attribute position id or user name if i pass the 'attribute id as CNT' with value of the CNT. i know there is a standard function module 'BBP_READ_ATTRIBUTES'. but this FM will give the value of the attribute id if i pass the user id and attribute id but i want user id or position when i pass attribute id and value.
    john.

    Hi,
    See this related thread:
    Re: Get all users given a specific product category
    You cna use the similar approach to find for the attribte cost centre.
    BR,
    Disha.

  • Function module which will capture system generated errors

    hi gurus,
      What is the name of the function module which will capture system generated errors and will populate a internal table?

    hi,
    there is a backgroung job running, if it fails i need to catch the system error because of which the job has failed
    Edited by: arunchandra c p on Aug 27, 2008 2:02 PM

  • RFC enabled function module which will be called from XI

    Hi Abappers,
    I have to send confirmation of the sales orders created by inbound Idocs ORDERS05 to XI. For this I have to use outbound Idoc ALEAUD01. But since I also need to send NETWR(from VBAK) and there is no field in this Idoc for that,
    I have to develop an RFC enabled function module for which a RFC lookup will be performed from XI. This function module has to return NETWR values for sales orders. Can anyone please tell me how to go about with this function module.
    Thanks in advance.

    Hi Priyanka,
    Add a parameter in <b>tables tab</b> of function module with reference to NETWR. It'll work.
    Regards,
    Younus
    Reward Helpful Answers!!!!

  • Want to create a function module  which will convert smartform into PDF .

    Hi All ,
    Requirement : I want to create a function module/report  which will convert smartform into PDF .
    Thanks in advance

    Hi All ,
    zsuresh_test : for converting smartform into pdf.
    when I am excuting this report(zsuresh_test) and by passing the smartform name FOPCR_STANDARD_F1
    I am getting error :
    Incorrect parameter with CALL FUNCTION
    Can you  please help me out..
    REPORT zsuresh_test.
    Variable declarations
    DATA:
    w_form_name TYPE tdsfname VALUE 'FOPCR_STANDARD_F1',
    w_fmodule TYPE rs38l_fnam,
    w_cparam TYPE ssfctrlop,
    w_outoptions TYPE ssfcompop,
    W_bin_filesize TYPE i, " Binary File Size
    w_FILE_NAME type string,
    w_File_path type string,
    w_FULL_PATH type string.
    Internal tables declaration
    Internal table to hold the OTF data
    DATA:
    t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    Internal table to hold OTF data recd from the SMARTFORM
    t_otf_from_fm TYPE ssfcrescl,
    Internal table to hold the data from the FM CONVERT_OTF
    T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    This function module call is used to retrieve the name of the Function
    module generated when the SMARTFORM is activated
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = w_form_name
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    fm_name = w_fmodule
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Calling the SMARTFORM using the function module retrieved above
    GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
    format of the output
    w_cparam-no_dialog = 'X'.
    w_cparam-preview = space. " Suppressing the dialog box
    " for print preview
    w_cparam-getotf = 'X'.
    Printer name to be used is provided in the export parameter
    OUTPUT_OPTIONS
    w_outoptions-tddest = 'LP01'.
    CALL FUNCTION w_fmodule
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    control_parameters = w_cparam
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    output_options = w_outoptions
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    job_output_info = t_otf_from_fm
    JOB_OUTPUT_OPTIONS =
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 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.
    t_otf[] = t_otf_from_fm-otfdata[].
    Function Module CONVERT_OTF is used to convert the OTF format to PDF
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    ARCHIVE_INDEX = ' '
    COPYNUMBER = 0
    ASCII_BIDI_VIS2LOG = ' '
    PDF_DELETE_OTFTAB = ' '
    IMPORTING
    BIN_FILESIZE = W_bin_filesize
    BIN_FILE =
    TABLES
    otf = T_OTF
    lines = T_pdf_tab
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    ERR_BAD_OTF = 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.
    To display File SAVE dialog window
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
    WINDOW_TITLE =
    DEFAULT_EXTENSION =
    DEFAULT_FILE_NAME =
    FILE_FILTER =
    INITIAL_DIRECTORY =
    WITH_ENCODING =
    PROMPT_ON_OVERWRITE = 'X'
    CHANGING
    filename = w_FILE_NAME
    path = w_FILE_PATH
    fullpath = w_FULL_PATH
    USER_ACTION =
    FILE_ENCODING =
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    NOT_SUPPORTED_BY_GUI = 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.
    Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
    presentation server
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = W_bin_filesize
    filename = w_FULL_PATH
    FILETYPE = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
    tables
    data_tab = T_pdf_tab
    FIELDNAMES =
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Is there any function module which will upload storage locations for a mat

    Hi gurus,
      Is there any function module or BAPI to extend the storage locations of material which is done through <b>MMSC</b> transaction. I need to write a program to upload new storage locations for some materials.Please advise.
    Thanks ,
    Sam.

    You can do this using the BAPI_MATERIAL_SAVEDATA
    Regards,
    Rich Heilman

  • Functional module which get triggered after posting of the document F-22

    Hi,
    I am posting the documents using the transaction F-22. I need to update some table after the documet will get post.
    I try to find out the BTE'S in the transaction FIBF but unable to find it out.
    Can anyone help me to find out the relvant functional module which will get triggered after the posting of the documents.
    Please help me with this.
    Thanks in advanced.
    Regards,
    Darshana

    Hi Harini,
    It is also not get triggered while i am posting the documents.
    Can you please suggest me some more functional modules.
    Thanks in advanced.
    Regards,
    Darshana

  • Is there any function module which gives open invoices &open amount?

    Hello All,
    I want to use function module which gives open invoices with open amount.
    I know 'CUSTOMER_OPEN_ITEMS'  'BAPI_AR_ACC_GETOPENITEMS' function which gives open invoices but does not give open amount.
    Can anyone help me to find such function?

    From this BAPI ,
    BAPI_AR_ACC_GETOPENITEMS, You got amount for items in lc_amount field of lineitems table parameter.
    I hope, it will helpful to you.
    by
    Prasad GVK.

  • Is there a BAPI function module which reverses the sign of an integer

    Hi Friends,
                     Could u plz tell me  a BAPI function module which can reverse the
    sign of an integer ?
    For example:       
    if i get the integer value in work area as <number> <sign> , i need to change it to <sign><number>. 
    i.e if i get the integer value in work area as    "248-" ("-" indicates minus sign) to " -248 ".
    i.e if i get the sign after the value , my requirement is to get the sign before the value.
    The actual ABAP query is:
    data: QTY_1 TYPE CHAR10,
            QTY_2  TYPE CHAR10,
            WA_DISTK_PORTLET-QUANTITY TYPE INT4.
    QTY_1 = WA_DISTK_PORTLET-QUANTITY.
                    SEARCH QTY_1 FOR '-'.
            IF SY-SUBRC = 0 AND SY-FDPOS <> 0.
              SPLIT  QTY_1 AT '-' INTO  QTY_1 QTY_2.
              CONDENSE  QTY_1.
              CONCATENATE '-'  QTY_1  INTO QTY_1.
              CONDENSE  QTY_1.
            ELSE.
              CONDENSE  QTY_1.
            ENDIF.
            CLEAR: WA_DISTK_PORTLET-QUANTITY.
         MOVE : QTY_1 TO  WA_DISTK_PORTLET-QUANTITY.
    when i move this QTY_1 to work area  quantity field The sign is coming after the numeric value.
    Note: There is no possibility to change the datatype of quantity field.
    I have tried my level best with 'CLOI_PUT_SIGN_IN_FRONT' function module.
    I will assign full points to the correct function module.

    Hi Ram,
    try this ang look into fields.
    data: fields type table of SVAL with header line.
    fields-tabname = 'MARA'. fields-fieldname = 'MATNR'. append fields.
    fields-tabname = 'BKPF'. fields-fieldname = 'BUDAT'. append fields.
    CALL FUNCTION 'POPUP_GET_VALUES'
      EXPORTING
        POPUP_TITLE           = 'Value Insert'
      TABLES
        FIELDS                = fields.
    Regards, Dieter

  • Function module which could calculate the previous month's start date.....

    hi,
    I want a function module which could calculate the previous month's start date and end date...
    Say todays date is  like 29.05.2007(start date) it should return
    01.04.2007 and 30.04.2007...
    IS there any FM for this ... or how to go about this scenario ???
    thanks in advance
    samm

    See the below Logic :
    DATA :g_date(2) TYPE n,           " Date
          g_month(2) TYPE n,          " Month
          g_year(4) TYPE n ,          " Year
          g_bill_low(10) TYPE n,       " From date
          g_bill_high(10) TYPE n,      " To date
          g_month1(2) TYPE n,         " Month
          g_year1(4) TYPE n,          " Year
          g_date1(2) TYPE n,          " Date
          g_year2(4) TYPE n,          " Year
          g_datum LIKE sy-datum.      " System date
    RANGES : r_bdate  FOR vbrk-fkdat.             " Billing date
      g_datum = p_date + 10.
      g_month = g_datum+4(2).
      g_year = g_datum+0(4).
      IF g_month = 1.
        g_year = g_year - 1.
        g_month = 12.
        g_date = 1.
      ELSE.
        g_month = g_month - 1.
        g_date = 1.
      ENDIF.
    Passing the date to billing date-low
      CONCATENATE  g_year g_month g_date  INTO g_bill_low.
      r_bdate-low = g_bill_low.
      r_bdate-sign = 'I'.
      r_bdate-option = 'BT'.
      g_month1 = g_datum+4(2).
      g_year1 = g_datum+0(4).
      IF g_month1 = 1.
        g_year1 = g_year1 - 1.
        g_month1 = 12.
      ELSE.
        g_month1 = g_month1 - 1.
      ENDIF.
      CASE g_month1.
        WHEN 1.g_date1 = '31'.
        WHEN 3.g_date1 = '31'.
        WHEN 4.g_date1 = '30'.
        WHEN 5.g_date1 =  '31'.
        WHEN 6.g_date1 = '30'.
        WHEN 7.g_date1 = '31'.
        WHEN 8.g_date1 = '31'.
        WHEN 9.g_date1 = '30'.
        WHEN 10.g_date1 = '31'.
        WHEN 11.g_date1 = '30'.
        WHEN 12.g_date1 = '31'.
      ENDCASE.
      g_year2 = g_year1.
      IF g_month1 = 2.
        g_year2 = g_year2 MOD 4 .
        IF g_year2 = 0.
          g_date1 = 29.
        ELSE.
          g_date1 = 28.
        ENDIF.
      ENDIF.
    Passing the date to billing date-high
      CONCATENATE  g_year1  g_month1  g_date1 INTO g_bill_high.
      r_bdate-high = g_bill_high.
      APPEND r_bdate.
    Reward Points if it is helpful
    Thanks
    Seshu

  • Function module which convert number to days to date

    Hi,
    Any one knows any function module which convert total number of days into date.
    thnaks,
    shilpa k

    Hi,
        FIMA_DAYS_AND_MONTHS_AND_YEARS
    FI_PSO_DAYS_MONTHS_YEARS_GET
    RSSM_CONVERT_DAYSEC2TIMESTAMP
    RSSM_CONVERT_TIMESTAMP2DAYSEC
    Function Modules related to Date and Time Calculations
    DATE_COMPUTE_DAY : Returns weekday for a date
    DATE_GET_WEEK : Returns week for a date
    DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified
    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
    Regards

  • I need to create RFC function module which creates the IDOC

    Hi-
    Any idea how to create RFC function module which creates the outbound IDOC. If you have any sample code please forward to me.
    Thanks,
    Sony

    My Problem is
    Whenever they create Invoice using T-code's like FV65(Parked Document), automatically should create IDOC's...
    I have used message type FIDCC1 but this message type is usefull only for Posting documents.
    1. Whenever they create parked document, entries will be stored in BKPF(Parked Document-Filed-BKPF-BSTAT = 'V') and Bseg....
    2. I have to read entries from those tables and should create IDOC...
    3. I checked FM's(FI_IDOC_CREATE_FIDCC1, FI_IDOC_PREPARE) but are not useful...
    4. Now I need to write one RFC function module and that FM should create the IDOC's....
    Can anyone please help me out?
    Thanks,
    Sony

  • Function module which can print from spool request ?

    Hi ,
    Is there any function module which can print from spool request ?
    Regards
    pabi

    I think NO.
    You have to take print from SP01.
    Amit.

  • Calling a remote enabled function module which does not exist in caller sys

    Hi,
    I have a a system ABC from which I am trying call a rfc enabled fm(Test) present in system XYZ.
    The fm(Test) does not exist in the system ABC so I am getting generation errors and dumps.
    Is there a way for me to call these remote enabled function modules which does not exist in the caller system without the obvious errors etc.
    Is there any special way.
    Thanks

    Hi,
    please check this sample:
    REPORT  zcallfm                                 .
    DATA: xv_return TYPE sysubrc.
    CALL FUNCTION 'DOESNOTEXIST'
    DESTINATION   'NOWHERE'
    EXPORTING     caller                = sy-sysid
    IMPORTING     return                = xv_return
    EXCEPTIONS    system_failure        = 1
                  communication_failure = 2
                  OTHERS                = 4.
    It shouldn't throw any generation errors in your system!
    Regards,
    Klaus

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

Maybe you are looking for

  • Bug report, Beta 2.12 Standard Edition

    Bug report: redundant, confusing, and apparently erroneous calls to jdoPreClear and jdoPostLoad. Note in output the null name in the third iteration. Hi, A lot of information being sent. Sorry, but I think you'll find it helpful. I expected the exact

  • Enter key not working in forms 10g

    Hi guys, Enter key to select a form is not working on my application. I have to double click the form to open it using the mouse. Then if we try to exit we have to press exit that many number of times as we have pressed enter key. So it seems to be s

  • When I send my GarageBand Song to iTunes, some effects aren't there? How can I Fix?

    I've added effects to one of the tracks, But when I play the song in iTunes, it sounds plainly acoustic, (no effects) Why is this? Please help me out! Thanks T

  • Using workflow in DMS

    Hi. I have several questions about using workflows with DMS. I want to implement an approval workflow. - Is it possible to fix the next status of the document if somebody doesn't approve the workflow? - Is it possible to manage distribution lists whe

  • How can i customize maverick dock in the bottom to be transparent and 2D

    macbookpro, late 2011 with os x mavericks: i tried to get the dock in the bottom transparent and in 2D, which in ML worked fine with the small program MIRAGE. this program does not appear to work in mavericks and can also not be updated from version