Need Help in Replacement of Function Modules

Hello all,
I am working on Upgrade project from ECC 5.0 to ECC 6.0. I am facing problems for Replacement of two Obsolete Function Modules. Please give me a solution. FM's  are as follows.
1) SET_AUTHORITY : This FM is obsolete in ECC 6.0 and there is not alternative FM present in help.sap.com or any other web portal.
2) WS_QUERY : Here as per my knowledge we use class CL_GUI_FRONTEND_SERVICES and methods FILE_EXIST or DIRECTORY_EXIST as per the parameters in old FM. For parameter 'FS' we use 'FILE_EXIST' and 'DS' we use 'DIRECTORY EXIST'.
But in our program prev. FM has parameter 'OS' i.e. Operating System.
But there is not method called 'OS EXIST' or similar. Please suggest suitable method.
Thanking you all in anticipation.
Best Regards,
Harish

Hi Harish,
                   I too could not find any replacement for SET_AUTHORITY
Obsolete Modules can be used in newer versions, but it is not supported by SAP in case of any technical issues.If you still need a replacement, you can replace it by the source code in the FM SET_AUTHORITY itself and modify according to your needs.
Below is the source code of FM SET_AUTHORITY, so you can modify it according to your requirement.
  DATA: l_actvt  TYPE tact-actvt,
        l_hier   TYPE STANDARD TABLE OF sethier WITH HEADER LINE.
  CASE action.
    WHEN 'A    '.
      l_actvt = activity-add.
    WHEN 'C    '.
      l_actvt = activity-modify.
    WHEN 'D    '.
      l_actvt = activity-display.
    WHEN 'E    '.
      l_actvt = activity-delete.
    WHEN 'UD   '.
      l_actvt = activity-display.
  ENDCASE.
  CALL FUNCTION 'G_SET_TREE_IMPORT'
       EXPORTING
            no_descriptions  = 'X'
            no_rw_info       = 'X'
            setid            = set
            tabname          = table
            root_header_only = 'X'
       TABLES
            set_hierarchy    = l_hier
       EXCEPTIONS
            OTHERS           = 0.
  READ TABLE l_hier INDEX 1.
  IF sy-subrc <> 0.
    CLEAR l_hier.
    l_hier-shortname = set.
  ENDIF.
  CALL FUNCTION 'G_SET_AUTHORITY_CHECK'
       EXPORTING
            actvt  = l_actvt
            authgr = l_hier-authgr
       EXCEPTIONS
            OTHERS = 1.
  IF sy-subrc <> 0.
    CASE action.
      WHEN 'A    '.
        MESSAGE e827 WITH l_hier-shortname RAISING no_authority.
      WHEN 'C    '.
        MESSAGE e828 WITH l_hier-shortname RAISING no_authority.
      WHEN 'D    '.
        MESSAGE e829 WITH l_hier-shortname RAISING no_authority.
      WHEN 'E    '.
        MESSAGE e830 WITH l_hier-shortname RAISING no_authority.
      WHEN 'UD   '.
        MESSAGE e831 WITH l_hier-shortname RAISING no_authority.
    ENDCASE.
  ENDIF.
If you need help in replacing in the above source code, please post your code here so that I can help you in modifying accordingly.
Regards,
Vasuki

Similar Messages

  • Need help for IDOC inbound function module !

    Hi guys please help me to create a IDOC inbound function module.
    What are the parameters and tables.
    How to write the code.
    What it does.
    Please send me one inbound func module code if possuble
                                                                                  Thanks

    Hi,
    You need to create an inbound function module. Then define the process code in transaction we42 and attach the function module to this process code.
    In the function module you create you need to define tables of types EDIDC (Control record (IDoc)), EDIDD (Data record (IDoc)) and BDIDOCSTAT (ALE IDoc status (subset of all IDoc status fields)).
    Regards,
    Soumya.

  • Need help in OM.. function module

    Dear All,
    Do we have any standard function module which will give the list of persons who are all belong to the org unit...
    The input for the function module is the Org unit and the output for the function module should be the list of person belong to the org unit.
    Please help me to solve this issue...
    Thanks
    Ram

    Hi,
      Refer the theard
    https://forums.sdn.sap.com/click.jspa?searchID=13348704&messageID=3510249
    Regards
    Kiran Sure

  • Replacement for Function Module 'SEND_TABLE_TO_EXCEL' in ECC 6.0

    Hi Friends,
    Can anybody help me to find the replacement of Function Module <b>'SEND_TABLE_TO_EXCEL'</b> in ECC 6.0.
    The Function Module exists in 4.6b. But it is no longer available in ECC 6.0.
    Regards,
    Vaitheeswaran.

    If you want to download an internal table to excel format you can use the <b>"GUI_DOWNLOAD"</b> function.Some sample code is as below.
    types: begin of gs_xcel,
            vkorg      type vbak-vkorg,
            del1(1)    type c,
            vtweg      type vbak-vtweg,
            del2(1)    type c,
            zzposmgr   type zzsdacspo-zzposmgr,
            del3(1)    type c,
            zz_region  type zzsdaregn-zz_region,
            del4(1)    type c,
            ename2     type pa0001-ename,
            del5(1)    type c,
            zzcsospos  type vbak-zzcsospos,
            del6(1)    type c,
            ename      type pa0001-ename,
            del7(1)    type c,
            vbeln      type vbfs-vbeln,
            del8(1)    type c,
            text       type t100-text,
            del9(1)    type c,
            msgv1      type vbfs-msgv1,
            del10(1)   type c,
            auart      type vbak-auart,
            del11(1)   type c,
            erdat      type vbsk-erdat,
            del12(1)   type c,
            wadat_ist  type likp-wadat_ist,
           end of gs_xcel.
    data: gt_xcel type table of gs_xcel,
          gws_xcel type gs_xcel.
    data: v_tmp_name type string,
    v_tmp_name = 'c:\sdrinver.xls'.
        call function 'GUI_DOWNLOAD'
         exporting
         BIN_FILESIZE                    =
           filename                        = v_tmp_name
          FILETYPE                        = 'ASC'
         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                        = gt_xcel
         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

  • Need to know the standard function module/program in E recruitment

    Hi All,
    I need to know the standard function module/programm that defaults the 'Functional area' field in the posting page from the requisition page.
    Early responce is greatly appreciated.
    Thanks and best regards
    Rajeev

    Hi Masa,
    Thanks for your reply.
    We are using Assets with the integration of Project systems. We are now in 4.6C R/3 & SRM 5.0 system. And now R/3 upgrade and SRM upgrade going on smultaniously to ECC6.0 and SRM 7.0 respectively.
    I would like to know any new functionality available in the latest upgrades and we have done lot of customization for Asset Procurement. And would like to go with Vanilla.
    Can you please provide me some inputs about the Project (WBS element ) based Asset Procurement in SRM as standard.
    Thanks and Regards,
    Ramesh

  • Need to create a validation Function Module

    Hi,
    I need to create a Validation Function Module.
    I have a ITAB into which data comes.
    FIELD-SYMBOLS : <ITAB> TYPE ANY ,
                                  key      TYPE ANY,
                                  char  TYPE ANY.
    <ITAB> = local_file.
    there is a field KEY whose sum when becomes equal to 10.000 for every CHAR,system should show a popup in the below FM
    CALL FUNCTION 'POPUP_WITH_WARNING_ALV'
      EXPORTING
        TEXTLINE1       = LT_POPUPTEXT
      TEXTLINE2       = ' '
      TITEL           = 'Warnung'
    Please let me know if the requirement is not clear.
    Thank U very Much.

    Hi annapurna ,
    In your case even the KEY value is the most useful one right,
    If so go about this way,
    have another field flag set it when the sum of the KEY values exceeds 10.
    Loop in an internla table.
    Now the internal table will have all the data including the flag and now based on the flag (whether set or not) call the function module popup which should retrieve those matnr field where flag is set.
    Display the error message saying that the KEY value fr this matnr exceeds 10.
    Revert for further clarification.
    Thanks and Regards
    Srikanth.P

  • Need to know the standard function module in E-Recruitment

    Hi All,
    I need to know the standard function module that defaults the value of 'Functional area' in 'Posting' from 'Requisition'.
    Early response is greatly appreciated.
    Thanks an best regards
    Rajeev

    Hi Masa,
    Thanks for your reply.
    We are using Assets with the integration of Project systems. We are now in 4.6C R/3 & SRM 5.0 system. And now R/3 upgrade and SRM upgrade going on smultaniously to ECC6.0 and SRM 7.0 respectively.
    I would like to know any new functionality available in the latest upgrades and we have done lot of customization for Asset Procurement. And would like to go with Vanilla.
    Can you please provide me some inputs about the Project (WBS element ) based Asset Procurement in SRM as standard.
    Thanks and Regards,
    Ramesh

  • How to replace ws_filename_get function module to file_open_dialog

    how to replace ws_filename_get function module to file_open_dialog

    Here it is,
    DATA: i_file_name TYPE FILETABLE,
          w_file_name TYPE FILE_TABLE,
          v_rc TYPE i.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      EXPORTING
        INITIAL_DIRECTORY       = 'C:\'
      CHANGING
        file_table              = i_file_name
        rc                      = v_rc
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_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.
    READ TABLE i_file_name INTO w_file_name INDEX 1.
    No wthe w_file_name will contain the file name.
    Regards
    Kathirvel

  • Help on Code for functional module generic extraction - needed.

    Hi Experts,
    Can you pleaese help  me on : how to pass data to the structure created.
      How to fill the structure in functional module  extraction (structure) from i_t_final to e_t_data.
    we are using include programe in the extraction.
    help appreciated.
    Thanks Much
    kannan

    Hi Shreem,
    Check if the following SDN Article link is helpful.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c062a3a8-f44c-2c10-ccb8-9b88fbdcb008?QuickLink=index&overridelayout=true
    http://www.erphowtos.com/guides-a-tutorials/doc_view/534-generic-extraction-using-function-module-fm.html
    Best Regards,
    Kush Kashyap

  • Replacement of Function module in ECC 6.0

    Hello All,
    The Function module 'NAMETAB_GET' is shown to be obsolete in ECC 6.0 .
    Please suggest which of the function modules among 'DDIF_FIELDINFO_GET'  and 'DDIF_NAMETAB_GET' can be used as a replacement for the same.
    Also ,it would be helpful if the use of these function modules is mentioned.
    Best Regards,
    Lavanya.

    use          'DDIF_NAMETAB_GET'
    Functionality
    This function module reads the runtime information (nametab) of a table or in general of any type of the ABAP Dictionary. However, the runtime information does not contain any text. You should use the function module DDIF_FIELDINFO_GET to read the runtime information including text (or to determine the domain for table fields).
    The types of the ABAP Dictionary are divided into data elements, structured types and table types.
    A structured type consists of a sequence of components that are each identified by a unique name. A type is defined for each of these components. In addition to the types of the ABAP Dictionary, you can also use the built-in types of the R/3 System (CHAR, NUMC,...) to define the types of the components.
    All its components as well as the fields of its structured components are called the fields of a structured type. The name of a field no longer uniquely identifies it within a structured type. For example, a structured type S could have a structured component F, which itself has a component called F. In this case S would have two fields with the name F. For this reason, its long field name is used to identify a field within a structured type. The long field name is the same as the name of the components for the components of the structured type itself. For the fields of a structured component, the long field name is a concatenation of the name of this structured component, the separator '-' and the long field name of the field in the structured component.
    A field whose type is defined by a data element or a built-in type is also called an elementary type. A structured type whose components are all defined as elementary types is called flat. All other structured types are called deep.
    This module gets the runtime information for the type whose name is defined in the IMPORT parameter TABNAME. If there is no such type, the exception NOT_FOUND is triggered.
    Caution: If the IMPORT parameter ALL_TYPES is not set, only flat structured types are taken into consideration. In this case the exception is also triggered if the specified type is a data element, deep structure or a table type.
    If the IMPORT parameter LFIELDNAME is not initial, only structured types having a field with the long name defined by LFIELDNAME are taken into consideration. The exception NOT_FOUND is triggered for all other types.
    The internal representation of the runtime object is returned in parameters X030L_WA and X031L_TAB. Depending on the type category, this information is then edited in the corresponding parameters (see documentation about the parameters).
    Notes
    1. If parameter LFIELDNAME is not initial, X031L_TAB nevertheless contains the description of all fields of the structured type. The decoded form is only determined for the specified field, and the result is copied to DFIES_WA instead of DFIES_TAB. Since decoding for all the fields often takes up most of the runtime for this module, you should set parameter LFIELDNAME if you only need information about one field of the structured type.
    This module gets the runtime information about a type. This means that only the currently active version of the type is taken into consideration. If none exists, the exception NOT_FOUND is triggered.
    The corresponding function module DDIF_<object type>_GET is used to read the actual definition of a type of the ABAP Dictionary.
    Caution: These read modules are much less efficient than the modules for defining the runtime information. You should therefore only use them if the runtime information is not sufficient.
    2. The documentation for IMPORT parameter GROUP_NAMES describes how to handle named includes.

  • Replacement of Function Module 'www_get_mime_object' in ECC 6.0

    HI,
    I need an exact replacement for the Function Module 'www_get_mime_object' in ECC 6.0.
    Please help it out.
    Regards,
    Ashok.

    hey

  • Help me in Creating Function Module

    Hi All,
    I am new to SAP, please help me doing the following task given to me.
    Given EE group and EE subgroup, how to write a custom function module that displays all the employees in it?
    The output should be displayed in 2 tables where first table has the infotypes 0001 and 0002 and second table has infotype 0006.
    Thank you

    HI.
    Function Modules;
    Check this matter.
    Function Modules are Global ABAP programs created by SAP for reusable purpose.they have IMPORT,EXPORT and TABLE parameters, and EXCEPTIONS to through when error occurs.
    You can create them from TCode SE37.
    Go through the following doc:
    Function modules are cross-program, reusable procedures that are organized into function groups, and whose functions are implemented between the statements FUNCTION and ENDFUNCTION. Function modules and their interfaces are created in the Function Builder.
    Function Module Interfaces
    The parameter interface of a function module is defined in the Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be triggered by a function module. The Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module, which represent the interface of the function module with the following syntax:
    Syntax
    ... IMPORTING parameters
    EXPORTING parameters
    CHANGING parameters
    TABLES table_parameters
    {RAISING
    The syntax and semantics of IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS mainly correspond to the definition of method interfaces with CLASS-METHODS. The additional option of defining table parameters using TABLES is obsolete.
    Interface parameters
    The interface parameters are defined on the relevant tab pages in the Function Builder.
    IMPORTING parameters are input parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input parameter. The content of the actual parameter is passed to the input parameter when the call is made. The content of an input parameter for which 'pass by reference' is defined cannot be changed in the function module.
    EXPORTING parameters are output parameters. When the function module is called, a suitable actual parameter can be specified for every output parameter. The content of an output parameter that is defined for 'pass by value' is transferred to the actual parameter if the function module is completed without errors. An output parameter that is defined for pass by reference is not initialized when the function module is called.
    CHANGING parameters are input and output parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input or output parameter. When the function module is called, the content of the actual parameter is passed to the input/output parameter, and when the function module is completed, the content of the input/output parameter is passed to the actual parameter.
    TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as standard tables with a header line. If an internal table without a header line or a table body is passed as an actual parameter to a formal parameter of this type, an empty local header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. Pass by value is not possible in formal parameters defined using TABLES. Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created for the internal table in the function module by using the addition LIKE LINE OF itab of the DATA statement.
    Exceptions
    The exception of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
    The addition RAISING is used to declare class-based exceptions that can be propagated from the function module to the caller. Exceptions in the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK must be explicitly declared, otherwise a propagation can lead to an interface violation. A violation of the interface leads to the treatable exception CX_SY_NO_HANDLER. Exceptions of the category CX_NO_CHECK are implicitly always declared. The declaration of exceptions of the category CX_STATIC_CHECK is statically checked in the syntax check. For exceptions of the category CX_DYNAMIC_CHECK, the check is not performed until runtime. In a function module in which class-based exceptions are declared with the RAISING addition, the statement CATCH SYSTEM-EXCEPTIONS cannot be used. Instead, the relevant treatable exceptions should be handled in a TRY control structure.
    The addition EXCEPTIONS is used to define a list of non-class-based exceptions that can be triggered in the function module using the statements RAISE or MESSAGE RAISING. Exceptions defined in this way - as with formal parameters - are bound to the function module and cannot be propagated. If an exception of this type is triggered in a function module, and no return value has been assigned to it with the homonymous addition EXCEPTIONS of the CALL FUNCTION statement when the call was made, this leads to a runtime error.
    Note
    For new developments after release 6.10, SAP recommends that you work with class-based exceptions that are independent of the function module.
    Plz follow these steps:::
    for creating the function modile initiallly we need to create the function group in se37 tcode.
    1.later create the function module:
    2. let us take some example
    in import -
    > im_kunnr type kunnr.
    3. export:::
    Ex_kna1 Type kna1.
    4. Source code: tab
    if not Im_kunnr is initial.
    select single * into ex_kna1
    from kna1
    where kunnr eq im_kunnr.
    5.save
    6. goto se80 and activate all the function module as a set.
    now u can use it in se38 z programs.
    hope u understood the logic to use try this..
    To be reward all helpfull naswers.
    Jay

  • Need to find BAPI or Function module to calaculate Accrued Interest

    HI All,
      CAn you please help me find BAPI or FM to calculate accrued interest with tcode FTR_EDIT for company code and transaction with cash flow details based on key date user gives. I need to takk all amounts less than key date on selection screen and get transaction details with interest rate and calculate number of days multiply it and then divide by 360 days.
    my formula is like this,
       Principal Amount * Interest rate * Number_ofdays/360.
    The logic is like this ,  Single Key Date -> Multiple Company codes -> Multiple transactions per company code ->multiple payments per transaction with credit/debit indicator.
    But when I run the report with one company code I should get multiple transactions with multiple paymetns calculated  accrued interest.
      After spending lot of time on finding function modules my Treasury functional team asked me to write manual formula to do this, but it works fine when I run for one transaction in one company code. IT's not working in all scenarios.
      I think manual calculation won't be accurate in all cases.
    As I am new to Treasury module, having difficulty to do this.
    Thanks,
    Thanvi.

    check with T-code TPM44
    zashok

  • Need of Changing Parameters in Function Module

    Hi All,
    Why we need sepearte Import and Export parameters in Function Module if the Changing Parameters
    acts as both import and export parameters.
    What is the use of using Changing Parametrs in Function Module.
    Thanks in advance.
    Sundaresan

    Hi,
    EXPORT PARAMETERS: When u r passing some value to the function, and the parameter will not be changed in the function, we use export parameter. Example: u pass parameter (a : 10) to a function, even after the function has been executed, value of a will be 10 only.
    IMPORT PARAMETER: When u require some value back from the function. u do not provide any initial value to the function. Example : u pass a parameter (b: <blank>) to the function, function returns the same import parameter as (b : 20).
    CHANGING PARAMETER: When u pass some value to the function and that function may change that value inside function, then changing parameters are used. Example: u pass parameter ( c: 30) to the function as changing parameter and function modifies this variable and return ( c: 50).
    Reward points if helpful.
    Thanks & Regards
    - Rishika Bawa

  • Replacement for function modules

    can anyone let me know the replacement for these function modules
    POPUP_TO_CONFIRM_STEP
    POPUP_TO_CONFIRM_WITH_MESSAGE

    It says the name of the replacement right there in the Attributes of the above FMs: POPUP_TO_CONFIRM.
    Hope this helps.
    Sudha

Maybe you are looking for