Question about function Module

Hi Expert,
         First tell me What is function Module & its working?
And second is how to call dynamically function module?
Moderator message : Search for available information, read forum rules before posting.  Thread locked.
Edited by: Vinod Kumar on Nov 9, 2011 4:57 PM

This is what happens inside the FM using I_ROLL_BACK:
To understand what a rollback statement does, have a look at this:
https://help.sap.com/abapdocu_70/en/ABAPROLLBACK.htm

Similar Messages

  • Question about Function Module ME_PO_PRICE_SIMULATION

    Hi experts,
    I am trying to solve an issue concerning the importing parameter I_ROLL_BACK of the function module ME_PO_PRICE_SIMULATION.
    Inside the coding of the user-exit ZXM06U44 (executed after saving a purchase order) there is a call to the function module ME_PO_PRICE_SIMULATION with this importing parameter set to true. In that case, purchase order is not created. Otherwise if I modify this value into false the order is created appropriately.
    Could someone more functional explain me what is the meaning of this parameter. I try to read the documentation but is in German, so I don't understand anything.
    Lots of thanks,
    Javier

    This is what happens inside the FM using I_ROLL_BACK:
    To understand what a rollback statement does, have a look at this:
    https://help.sap.com/abapdocu_70/en/ABAPROLLBACK.htm

  • A question about function module

    hi everyone,
    if i want to know the meaning of a function module and how it work,
    for example,function'HRHAP_DOCUMENT_GET_DETAIL'
    i must use it,but i don't know its meaning,
    what should i do ?
    thanks

    but,in program,import and export are reverse.
    for example:
    CALL FUNCTION 'HRHAP_DOCUMENT_GET_DETAIL'
        EXPORTING
          plan_version                  = plan_version
          s_appraisal_id                = ls_appraisal_id
        IMPORTING
        S_DOC_PROCESSING              =
        S_HEADER_TEXTS                =
        T_HEADER_APPRAISER            =
          t_header_appraisee            = lt_header_appraisee
        T_HEADER_PART_APPRAISER       =
        T_HEADER_OTHERS               =
        S_HEADER_STATUS               =
          s_header_dates                = ls_header_dates
        T_HEADER_ADD_DATA             =
        S_HEADER_DISPLAY              =
        T_BUTTONS                     =
          t_body_columns                = lt_body_columns
          t_body_elements               = lt_body_elements
        T_BODY_ELEMENT_BUTTONS        =
        T_BODY_ELEMENT_DESCR          =
          t_body_cells                  = lt_body_cells
        T_BODY_CELL_VAL_VALUES        =
        T_BODY_CELL_VAL_RANGES        =
        T_BODY_CELL_VAL_C_LIKE        =
        T_BODY_CELL_VAL_DESCR         =
          t_body_cell_notes             = lt_body_cell_notes
          s_return                      = s_return
      CHANGING
        MODE                          =
    why?

  • Question about function with in parameters

    Hello,
    I have a question about functions with in-parameters. In the HR schema, I need to get the minimum salary of the job_id that is mentioned as an in-parameter.
    this is what I am thinking but I dont know if it's correct or not or what should I do next!
    create or replace function get_minimum_salary (i_job_id in varchar2)
    return number
    as
    begin
    SELECT min_salary INTO min_sal
    FROM jobs
    where job_id = get_minimum_salary(xy);
    RETURN i_job_id;
    end get_minimum_salary;
    thanks in advance
    EDIT
    Thanks for your help all.
    Is it possible to add that if the i_job_id which is the in type parameter does not have a minimum salary then use the following function to register an error:
    create or replace procedure insert_error (i_error_code in number,
                                                      i_error_message in varchar2)
    as
    begin
    insert into error_table (error_user, error_date, error_code, error_message)
    values (user,sysdate,i_error_code,i_error_message);
    end insert_error;
    This function is basically to say that an error has occured and to register that error, at the same time I need to print out the error using the dbms_out.put_line.
    Any ideas of how to do that?
    Thanks again
    Edited by: Latvian83 on Jun 1, 2011 5:14 AM

    HI
    I have made little bit changes in ur code. try this
    create or replace function get_minimum_salary (i_job_id in varchar2)
    return number
    as
    v_Min_sal jobs.salary%type=0;---- Variable declaration
    begin
    SELECT min_salary INTO v_ min_sal
    FROM jobs
    where job_id = i_job_id;
    RETURN v_Min_sal;
    end get_minimum_salary;
    Regards
    Srikkanth.M

  • Important conceptual question about Application Module, Maximum Pool Size

    Hello everyone,
    We have a critical question about the Application Module default settings (taking the DB connections from a DataSource)
    I know that on the Web it is generally suggested that each request must end with either a commit or rollback when executing PL/SQL blocks "directly" on the DB without the framework BC/ViewObject/Entity service intervention.
    Now, for some reasons, we started to develop our applications with thinking that each Web Session would reference exactly one DB session (opened by any instance taken from the AM pool) for the whole duration of the session, so that the changes made by each Web session to its DB session would never interfere with the changes made by "other" Web Sessions to "other" DB sessions .
    In other words, because of that convincement we often implemented sort of "transactions" that open and close (with either commit or rollback) each DB session not in/after a single HTTP request, but during many HTTP Requests.
    As a concrete example think of this scenario:
    1. the user presses the "Insert" button. An HTTP request is fired. The action listener is executed and ends up with inserting rows in a table via a PL SQL block (not via the ViewObjects API).
    2. no commit or rollback after the above PL/SQL block is done yet.
    3. finally the user presses a "Commit" or "Rollback" button, firing the call to the appropriate AM methos.
    Those three requests consist of what I called "transaction".
    From the documentation it's clear that there is no guarantee that the couple AM istance + DB session is the same during all the requests.
    This means that, during step 2, it's possible that another user might reference the same "pending" AM/DbSession for his needs and "steal" somehow the work done via PL/SQL after step 1. (This happens because sessions taken by the pool are always rolled back by default.)
    Now my question is:
    Suppose we set the "Maximum Pool Size" parameter to very a great number (always inferior to the maximum number of concurrent users):
    Is there any guarantee that all the requests will be isolated in that case?
    I hope the problem is clear.
    Let me know if you want more details.

    Thanks for the answers.
    If I am right, from all your answers about resource avaiability, this means that even supposing the framework is able to always give us the same AM instance back from the AM pool (by following the session-affinity criterias), there is, however, no "connection affinity" with the connections from the DataSource. This means that the "same AM instance" might take the "a new DB connection", if necessary, from the connection pool of the DataSource. If that happens, that could give us the same problems as taking "a new AM instance" (that is, not following session-affinity) from the beginning, since each time an a new connection is taken (either via a new AM instance or via the same AM instance plus a new DB connection), the corresponding DB session is rolle back by default, clearing all the pending transactions we might have performed before with direct PL/SQL calls bypassing the AM services during the life cycle of our application, so that the new HTTP request will have a clean DB session to start to work with.

  • About Function module 'PRICING'

    Hi experts,
    Now My requirement is get all contract condition data. If I don't want to create a new contract to get these condition data, I can use Function module 'PRICING' to get all condition data. But the question is the parameter COMM_ITEM_I is a structure, it only can store a record(single material). If the contract has many item, eg Service + Goods............ How to process this scenario? If you have experience in this, please give me any idea. Thanks in advance!
    function pricing.
    ""Globale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(CALCULATION_TYPE) LIKE  KOMV-KSTEU DEFAULT 'A'
    *"     VALUE(COMM_HEAD_I) LIKE  KOMK STRUCTURE  KOMK
    *"     VALUE(COMM_ITEM_I) LIKE  KOMP STRUCTURE  KOMP
    *"     VALUE(PRELIMINARY) TYPE  C DEFAULT ' '
    *"     VALUE(NO_CALCULATION) TYPE  C DEFAULT ' '
    *"  EXPORTING
    *"     VALUE(COMM_HEAD_E) LIKE  KOMK STRUCTURE  KOMK
    *"     VALUE(COMM_ITEM_E) LIKE  KOMP STRUCTURE  KOMP
    *"  TABLES
    *"      TKOMV STRUCTURE  KOMV
    *"      SVBAP STRUCTURE  VBAPU OPTIONAL
    *"  CHANGING
    *"     VALUE(REBATE_DETERMINED) TYPE  C DEFAULT ' '

    Hi,
    I guess contracts will be found in EKKO, not in VBAK. Correct me if I am wrong.
    If I am correct, you can use the BAPI "BAPI_PO_GETDETAIL1". POCONDHEADER and POCOND inporting tables will retrieve pricing information.
    Regards,
    Ganga

  • About function module in alv

    hai all
    iwant to know about few function modules in alv
    1) reuse_alv_default_varients_get.
    2)reuse alv_varients_f4
    what is the use of these function modules
    how to use these function modules, what r the structures used to use these function module. where to pass this in
    in list and grid display function modules.
    plz help me.
    thanks & regards
    sindu

    HI,
    check this.
    REPORT Z_TEST_alv_variant .
    TYPE-POOLS : SLIS.
    PARAMETERS: ONE RADIOBUTTON GROUP G1 DEFAULT 'X',
                TWO RADIOBUTTON GROUP G1.
    DATA: BEGIN OF I_TAB OCCURS 0,
    FIELD1 TYPE I,
    FIELD2 TYPE I,
    END OF I_TAB.
    DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: L_VARIANT TYPE DISVARIANT,
          LX_VARIANT LIKE DISVARIANT,
          L_SAVE TYPE C,
          L_EXIT(1) TYPE C.
    SELECTION-SCREEN BEGIN OF BLOCK 0 WITH FRAME TITLE TEXT-VAR.
    PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT.
    SELECTION-SCREEN END OF BLOCK 0.
    INITIALIZATION.
      L_SAVE = 'A'.
      PERFORM VARIANT_INIT.
    Get default variant
      LX_VARIANT = L_VARIANT.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          I_SAVE     = L_SAVE
        CHANGING
          CS_VARIANT = LX_VARIANT
        EXCEPTIONS
          NOT_FOUND  = 2.
      IF SY-SUBRC = 0.
        P_VARI = LX_VARIANT-VARIANT.
      ENDIF.
    Process on value request
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
      PERFORM F4_FOR_VARIANT.
      I_TAB-FIELD1 = 19.
      I_TAB-FIELD2 = 20.
      APPEND I_TAB.
      I_TAB-FIELD1 = 19.
      I_TAB-FIELD2 = 20.
      APPEND I_TAB.
      I_TAB-FIELD1 = 19.
      I_TAB-FIELD2 = 20.
      APPEND I_TAB.
      I_TAB-FIELD1 = 19.
      I_TAB-FIELD2 = 20.
      APPEND I_TAB.
      I_TAB-FIELD1 = 19.
      I_TAB-FIELD2 = 20.
      APPEND I_TAB.
      PERFORM INITIALIZE_FIELDCAT USING GT_FIELDCAT[].
      PERFORM CALL_ALV  TABLES I_TAB[]
                       USING GT_FIELDCAT.
    *& Form initialize_fieldcat
    text
    -->P_GT_FIELDCAT[] text
    FORM INITIALIZE_FIELDCAT USING L_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
      LS_FIELDCAT-FIELDNAME = 'FIELD1'.
      LS_FIELDCAT-KEY = 'X'.
      LS_FIELDCAT-COL_POS = 1.
      LS_FIELDCAT-SELTEXT_S = 'Work center'.
      LS_FIELDCAT-SELTEXT_L = 'Work center'.
      APPEND LS_FIELDCAT TO L_FIELDCAT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME = 'FIELD2'.
      LS_FIELDCAT-KEY = ' '.
      LS_FIELDCAT-COL_POS = 2.
      LS_FIELDCAT-SELTEXT_S = 'Work center2'.
      LS_FIELDCAT-SELTEXT_L = 'Work center2'.
      APPEND LS_FIELDCAT TO L_FIELDCAT.
      CLEAR LS_FIELDCAT.
    ENDFORM. " initialize_fieldcat
    *&      Form  call_alv
          text
         -->P_GT_FIELDCAT  text
         -->P_I_TAB  text
    FORM CALL_ALV  TABLES   P_TAB
                    USING    P_GT_FIELDCAT .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = SY-REPID
          IT_FIELDCAT        = P_GT_FIELDCAT
          I_DEFAULT          = 'X'
          IS_VARIANT         = L_VARIANT
          I_SAVE             = L_SAVE
        TABLES
          T_OUTTAB           = P_TAB[]
        EXCEPTIONS
          PROGRAM_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.
    ENDFORM.                    " call_alv
    *&      Form  VARIANT_INIT
          text
    FORM VARIANT_INIT.
      CLEAR L_VARIANT.
      L_VARIANT-REPORT = SY-REPID.
    ENDFORM.                               " VARIANT_INIT
    *&      Form  variant_SELECTION_SCREEN
          text
    FORM VARIANT_SELECTION_SCREEN .
      IF NOT P_VARI IS INITIAL.
        MOVE L_VARIANT TO LX_VARIANT.
        MOVE P_VARI TO LX_VARIANT-VARIANT.
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
          EXPORTING
            I_SAVE     = L_SAVE
          CHANGING
            CS_VARIANT = LX_VARIANT.
        L_VARIANT = LX_VARIANT.
      ELSE.
        PERFORM VARIANT_INIT.
      ENDIF.
    ENDFORM.                    " variant_SELECTION_SCREEN
    *&      Form  F4_FOR_VARIANT
          text
    FORM F4_FOR_VARIANT.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          IS_VARIANT = L_VARIANT
          I_SAVE     = L_SAVE
        IMPORTING
          E_EXIT     = L_EXIT
          ES_VARIANT = LX_VARIANT
        EXCEPTIONS
          NOT_FOUND  = 2.
      IF SY-SUBRC = 2.
        MESSAGE ID SY-MSGID TYPE 'S'      NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        IF L_EXIT = SPACE.
          P_VARI = LX_VARIANT-VARIANT.
        ENDIF.
      ENDIF.
    ENDFORM.                    "F4_FOR_VARIANT
    Regards,
    Laxmi.

  • About Function module reltate to Enhancement

    Hi All,
    i need to know about the Usage and purpose of the function module FKK_BP_BADI_UPDATE.
    Kindly help me to know about this function module

    Hi Venkat,
    The function module BAPI_CUBE_GETDETAIL provides you the detials of infocube (including dimension, characteristics, keyfigures etc).
    Moreoverthis FM is RFC enabled; so you can call this FM from DEV and pass RFC connection of PROD to get detials of the cube in prod. This compare the structures between DEV and PROD.
    Similarly you can use BAPI_ODSO_GETDETAIL from DSO structure comparision across the system landscape.
    Thanks
    Vasu

  • Table that stores information about function module

    Hi All,
    I know that table TFDIR stores primary information about any function module.
    Could anyone tell me where the code of that function module gets stored in?
    Also.. If I want to write an ABAP code to read the function module code then what is the best possible solution?
    Thanks in advace and any answer will be appreciated.
    Regards
    Jignesh

    Hi All,
    Apologies for the same!
    The codes are not stored in any table, they are stored as cluster.
    To read the code, you can use READ REPORT.
    But there you must provide the Include Name For Example , If you want to read the code of READ_TEXT,
    READ REPORT 'LSTXDU01'.
    You can get this include name inside include LSTXDUXX
    Table TFDIR also stores the program name and include number.
    You need to truncate first 3 char 'SAP' and append UXX at the end and that will be your program name.
    Then we can use READ REPORT!!!
    Regards
    Jignesh

  • ABOUT FUNCTION MODULE  (urgent)

    hi ,
    is any one know about below function module.
    CUST_ACCT_STMT_REQUEST_LITE
    we schedule customer account statement in th background.
    we want to add some functionality.
    if any one know anything then it will be appreciated.
    thans,
    jack

    Hi,
    I am giving the Function Modules list link, from there you can findout which is suitable for your application:
    http://sap-img.com/abap/function-list.htm
    Regards,
    Bhaskar

  • Query about  Function Module  'RSPO_RETURN_SPOOLJOB'

    Hi all,
         I am currently working on a report that takes the SPOOL NO. for the back ground runned job and passes to the Function module 'RSPO_RETURN_SPOOLJOB' that gives the data in BUFFER after reading this data I am converting it to the excel format and sending it as an attached mail to the specified recepient.
         But the FM mentioned is getting data in weird manner. I am converting it to excel format as we do for the normal internal table data being converted to excel format. But the problem is ragarding the data...
         Is there a way to covert this data into excel format? Or is there any other function Module that converts the data into excel format for the job. If it is there then let me know...
    regards,
    Brijesh Patel

    I have not used this myself, but check if this works for you.
    RSPO_DOWNLOAD_SPOOLJOB
    Regards,
    Ravi
    Note : Please mark the helpful answers

  • QUESTION REGARDING FUNCTION MODULE

    what is the use  ' IT_EVENTS' in the function module 'REUSE_ALV_GRID_DISPLAY'

    Hi,
    Go to SE37 and Give your Fm Name -> Display.
    Go to Function Module Documentation.
    It will help you.
    Thanks.

  • Doubt About Function Module

    Hi Experts,
    I want one function module which wil allows us to attach a attachment to the material in the SAP PLM System.
    Please clear my doubt . Why Because i got strucked here in this issue of selecting a right Function Module.
    Please clear my doubt. Helpful ANswers wil be Reward.
    Regards
    Khanna

    Hi khanna,
    try this MATERIAL_MAINT_DIAL_GET_DOC Functional Module for attachment in Material Master,
    In DIR try this CV110_DOC_ASSIGN_FILE,
    Regards
    Rehman

  • About function module"IDOC_XML_TRANSFORM"?

    Hi Gurus:
         When i do the "IDOC_XML_TRANSFORM",where can i find the exporting file which is in  XML format?
         Thanks for advanced!
    alex zhang

    Check with below link :
    Re: IDOCS_OUTPUT_IN_XML_FORMAT -- IDOCS_OUTPUT_TO_FILE
    Re: any function module to write-xml schema of a idoctype to an internal table
    /people/michal.krawczyk2/blog/2005/11/13/xi-how-to-check-your-idocs-on-a-web-page-from-sapgui -> this will help you
    Thanks
    Seshu

  • About function module

    "FM_SELECTION_CRITERIA_PRINT"
    What is its use ? There is documentation available in english.

    hi,
    for documentation to the function module "FM_SELECTION_CRITERIA_PRINT"
    procedure to getting the Document.
    se37-->provide function module name-->select the option Document , then u will get the documentation provided by SAP.
    <u>for knowing the Use of FM    <b>FM_SELECTION_CRITERIA_PRINT</b></u>
    REPORT ZVVRLPOP.
    TABLES USR01.
    SELECT-OPTIONS: S_USER  FOR USR01-BNAME,
                    S_LANGU FOR USR01-LANGU.
    PARAMETER:      P_NAME(12) DEFAULT 'Victor',
                    P_CITY(12) DEFAULT 'Minsk'.
    DATA: BEGIN OF INFOTAB OCCURS 0,
            FLAG,
            OLENGTH TYPE X,
            LINE LIKE RSVAR-INFOLINE,
          END OF INFOTAB.
    *---- 1st -
    write / '1st: PRINT_SELECTIONS' color col_key.
    CALL FUNCTION 'PRINT_SELECTIONS'
         EXPORTING
              MODE      = 1
              RNAME     = SY-CPROG
              RVARIANTE = SY-SLSET
         TABLES
              INFOTAB   = INFOTAB
         EXCEPTIONS
              OTHERS    = 1.
    LOOP AT INFOTAB.
      WRITE: / '=>', INFOTAB-LINE.
    ENDLOOP.
    *---- 2nd -
    write / '2nd: FM_SELECTION_CRITERIA_PRINT' color col_key.
    CALL FUNCTION 'FM_SELECTION_CRITERIA_PRINT'
         EXPORTING
              I_REPORT_NAME = SY-CPROG
         EXCEPTIONS
              OTHERS        = 1.
    write / 'End of data.' color col_key.
    regards,
    sudheer.

Maybe you are looking for

  • Problem in printing script.

    Hi all. I am modified layout  Medruck.Same is transported in production also. but when i take print in both development and production on same printer then the printout not come same. means font size changes. Can anyone tell me why this happens? I ha

  • Safari 5 won't open on Snow Leopard; cannot upgrade to Safari 6 since it requires Lion.

    I can use Firefox and Chrome with no problem but like the Apple format better.  This is the first time I have ever had issues with products that are partners with Apple.  Please someone fix it.  "Oh well" is not acceptable:-)

  • Does Firefox "freeze" tabs that are in an inactive tab group to increase performance/save memory?

    Tabs that are in a tab group but are otherwise not in focus occupy the same amount of memory as the tabs that are open. In all probability, this is inefficient. I realize Firefox handles all tabs as one process (as opposed to Chrome's single-process-

  • Vertical text in charts appears upside-down in Acrobat pdf

    When I copy a chart with vertical text from Tableau into Word and then Save as Adobe PDF, the vertical text appears upside-down. When I copy a chart with vertical text from Tableau into Word and then Save as PDF using Word's built in PDF creator, the

  • I think my digitiser is broken

    my phone today got stuck on the lock screen . it won't unlock, turn off, answer calls/texts etc. I have done a soft reset by holding down the power and home buttons but when it reboots nothing happens....help me please I'm desperate at this stage :/