Function module - basic questions

Hi Experts ,
I wanted to know some basic concepts of the function module :
My question is :
1) What is the "Type ref " in a function module import or export ?
2) An example of a standard function module where type ref is used.
3) What is the use of changing tab ? what do we use this tab for ?
4) An example of a standard function module where a parameter is declared in Changing tab.
5) what is the use of a Exception tab ? is it any thing similar to exceptions in java ?? can you throw the excetion and write a common code in a catch to handle the exception ?
Can anyone help me ?
Regards,
Ashish Shah

Hi
Hi,
Function Modules;
Check this matter.
Function Modules are Glopbal 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|EXCEPTIONS} exc1 exc2 ...]
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.
RFC is a technology which is used to access a functions (Modules) from
the remote systems.
If a function module is set as remote enabled which can be access from
the remote system via RFC.Eg: U can access the Remote enabled function modules in ur VB,Webdynpro,Java,Visual composer program.
A function module can be set as remote enabled by SE37->Go to ur FM->click the option Button "remote enabled".
But Normal function modules can not accessd from the remote system.
Good Example for RFC enabled function module is : BAPI(Business Application Programming Interface)
Note: All BAPIs are Remote enabled but not all remote enabled function modules are BAPI.
CALLING A FUNCTION MODULE:
1)In U ABAP Editor --> Click "Patter" ---> Selection Option Button "Call Function"
--> Write the Corresponding FM name --> Hit Enter
2)The appropriate import ,export Parameters will be displayed in ur editor
3)Pass the Values Here.
Also check these links.
Check this link:
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
Check this link:
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
See the following links:
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
Regards,
Sree

Similar Messages

  • Formula Functions - A basic question

    Hi,
    This must be very basic. Please bare with me.
    What is the difference in defining a formula function as 'External' and 'User Defined Function' and 'Formula' class?
    I read some where that you can use contexts in class 'External' and cannot in user defined. But when I see the seeded formula functions both the types have contexts. Is this classification insignificant? Can somebody clarify this.
    Thanks in advance.

    http://www.google.com.au/url?sa=t&rct=j&q=oracle%20cost%20group&source=web&cd=1&sqi=2&ved=0CGAQFjAA&url=http%3A%2F%2Fdocs.oracle.com%2Fcd%2FE18727_01%2Fdoc.121%2Fe13434%2FT210618T210754.htm&ei=tR4yUPzyFMmwiQe59YHoDw&usg=AFQjCNFzy3rZkjxtgiMF3FsZXKlUxVIUGw&sig2=RKE5PF-wrc_5q_Jeo2tOFg

  • Function module works correctly in debugger, but hangs otherwise.

    I am having an issue with a standard function module that 'hangs' when ran.  If i look in sm37, the calling job will just continuously run.  If i look in SM50, there aren't any sql statements which are bringing back large results, it seems to be running a large number of sequential reads against a certain table.  The odd thing is, if i break in this function module, then press F8 to continue, the function module successfully executes and the job finishes. 
    The function module in question is ISU_DUNNING_DEACT_INSTPL_0350, which i have attached to a dunning activity.  This function module SHOULD deactivate any active installment plans for the dunned account.  The FM is odd, as it calls another FM and does a hard EXIT, even though there is code below this line that it can never access. 
    If I set a breakpoint in the function module, and run FPVB (dunning transaction), it will break into the function module.  I can then press F8, the FM completes successfully, then the job completes.  If i do NOT break it (just run in background as normal), the job just continuously runs.  SM50 reveals reads to the BUT000 table (even though i cannot find any calls to this table in the fm).
    Any ideas?

    Nishikant,
    Thanks very much for the help. 
    I did this, and I can see where its getting stuck.  The following entries are repeated indefinitely (until i stop it )
          374 BUT000     FETCH       1      0
            3 BUT000     REOPEN             0 SELECT WHERE "CLIENT" = '120' AND "PARTNER" = '0007024125'
          420 BUT000     FETCH       1      0
            3 BUT000     REOPEN             0 SELECT WHERE "CLIENT" = '120' AND "PARTNER" = '0007024125'
          365 BUT000     FETCH       1      0
            3 BUT000     REOPEN             0 SELECT WHERE "CLIENT" = '120' AND "PARTNER" = '0007024125'
    If i double click the SQL statement, i see these details
    SQL Statement
      SELECT
        "CLIENT"
      FROM
        "BUT000"
      WHERE
    "CLIENT" = :A0 AND "PARTNER" = :A1
    Variable
    A0(CH,3)  = 120
    A1(CH,10) = 0007024125
    I caught it in SM50 where the read was, and it says the select exists in Function Pool SAPLBPT1.  I have done a search in this for anything containing BUT000, but have found nothing.  Any suggestions on how to find where this is occurring, or what might be going on?

  • Urgent: Problems in Generic Deltas by Function Module

    Hi BW Experts,
    My requirement is to extract text from CRM to BW using Zfunction module, copy of RSAX_BIW_GET_SIMPLE_DATA
    which works fine for full loads but the problem arises only when i go for generic deltas. My code in FM for Deltas is:
    LOOP AT s_s_if-t_select INTO l_s_select.
    CASE l_s_select-fieldnm.
    WHEN 'ZDATE'.
    s_date_from = l_s_select-low.
    s_date_to = l_s_select-high.
    WHEN OTHERS.
    ENDCASE.
    ENDLOOP.
    IF s_date_from IS INITIAL.
    s_date_from = '20060401'.
    ENDIF.
    IF s_date_to IS INITIAL.
    s_date_to = '99991231'.
    ENDIF.
    OPEN CURSOR WITH HOLD S_CURSOR FOR
    SELECT * FROM STXH
    WHERE TDOBJECT = 'CRM_ORDERH'
    AND TDID = 'A002'
    AND TDSPRAS = sy-langu
    and TDLDATE between s_date_from and s_date_to
    or tdfdate between s_date_from and s_date_to.
    ENDIF.
    FETCH NEXT CURSOR S_CURSOR
    APPENDING CORRESPONDING FIELDS
    OF TABLE wa_stxh
    PACKAGE SIZE S_S_IF-MAXSIZE.
    TDFDATE is creation date and TDLDATE is changed on
    My extract structure contains Zdate(TDLDATE), Ztext1,2,3, Key field and langu in RSO2 I have selected calday in generic delta and Zdate as field Nm and upper limit as 1 and lower limit as space in settings and new status for changed records button.
    Did I missed something because when i check in RSA7 i didnot see any changed records under totals column and i tried to load without it into BW than i didnot received single record evenafter changes.Would anyone suggest me the good solution for it I appreciate it in advance. I have seen lot of posts in SDN but I didnot find this type of secenario anywhere.
    Thanks in advance
    Regards
    Kishore

    Kishore,
    go through the thread... which i provided for Generic DS using function for CRM Texts.
    Re: Urgent: Extraction through function module
    Any questions please let me know. If you have any questions update the thread with your mail id.
    Replace the code with ...
    LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZDATE'.
    MOVE-CORRESPONDING L_S_SELECT TO L_R_TDLDATE.
    APPEND L_R_TDLDATE.
    ENDLOOP.
    OPEN CURSOR WITH HOLD S_CURSOR FOR
    SELECT * FROM STXH
    WHERE TDOBJECT = <Text Object>
    AND TDID = <Text ID >
    AND TDSPRAS = sy-langu
    AND (TDLDATE IN L_R_TDLDATE
    or TDFDATE IN L_R_TDLDATE).
    ENDIF. "First data package ?
    Fetch records into interface table.
    named E_T_'Name of extract structure'.
    FETCH NEXT CURSOR S_CURSOR
    APPENDING CORRESPONDING FIELDS
    OF TABLE wa_stxh
    PACKAGE SIZE S_S_IF-MAXSIZE.
    L_R_TDLDATE will be calculted by the system. Internally, system will save the Last Delta date(you need to enable this field for Generic delta).
    all the best.
    Regards,
    Nagesh Ganisetti.

  • BSP call Function Module

    Dear All,
    in BSP, I want to call a Function Module.
    the question is, how to display the result of Function Module into page layout, if I called a function module in/from Event Handler (onInitialization)
    thanks

    moving on from what Brian said - check the doco,
    but in a nutshell, your function module will have probably export parameters or some results, you need to create some attributes in your BSP and then assign the values of the results from the function module to these attributes and then in the layout of the bsp you can use the <%= Attribute_Name %> syntax to display the value of your attributes whether in a textView or dropdownListBox etc.
    Here's an example:
    assuming your function module has en export parameter UName then you need to create an Attribute in the Attributes section of the BSP which you will assign the value of this export parameter UName to eg,
    fm_UName TYPE STRING parameter to assign FM UName to
    then in the event handler, after you have executed the Function Module assign the export parameter UName value to your local attribute with,
    fm_UName = UName.
    then in your layout, in the right place display the value of your parameter with the syntax,
    <%= fm_UName %>
    That's it.
    Milan.

  • Types in function modules

    hi   i want to know how many types of function modules are there please help in this .
    thankyou
    pavan

    Hi,
    You have so much information regarding this in sdn.
    But function modules basically classified into
    1)Normal Function Module
    2)Remote-Enabled Module
    For more information check this link.
    http://www.allinterview.com/showanswers/62377.html
    Regards and Best wishes.

  • Basic function module in order to update table

    Hi,
    I have a very basic question. I need to make a fuction module that when accessed will update a z* table with a few inputs parameters..
    Can someone give me some sample code and a few explanations about this?
                     Best Regards
                           João Fernandes

    You can also try this.
    first you collect all records that has to be updated in an internal table,then create a function module in se37 and pass this internal table to that FM as table parameter.
    For function module write following statment.
    modify <Standard TABLE_NAME> from table ITAB.
    check if it help u.

  • Function Modules Used in BW?  (Two Questions)

    I have two function Modules that were used in SAP R3:
    G_SET_GET_ID_FROM_NAME
    G_SET_GET_ALL_VALUES
    G_SET_TREE_IMPORT
    Question 1) Are there cross referenced FMs in BW that we can use in place of these?
    Question 2) Is here a XREF lift of Cross-Functional Function Modules that can be used - or similar- in BW that were used in SAP/R3?
                   Thank-You.

    hi aravind,
    the main Function modules used in smart forms are
    1. SSF_FUNCTION_MODULE_NAME.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'Z_FL004_BANK_DRAFT'
    IMPORTING
    fm_name = fm_name.
    CALL FUNCTION fm_name
    EXPORTING
    rgds
    anver.
    if helped mark points.

  • LINKING BETWEEN FUNCTION MODULE AND INTERACTIVE NO. OF BASIC LIST

    Dear Mates,
    Iam preparing Z report for BOM display of FG and SFG materials.
    Iam displaying the Basic List using the MAST table. Here i double click on the material no.
    Here iam using the function module :CS_BOM_EXPL_MAT_V2 for fetching the data from STPOX structure ,here i want to link material no. which has been from basic list and the above said function module. 
    Can anybody provide the solution for the above said linking in ALV interactive report.
    Please treat it very urgent as this report is to be presented on high priority.
    Thanks in advance
    Subbu

    Hi
    use the Function module REUSE_ALV_POPUP_TO_SELECT.
    check the below example:
    REPORT ZSR_ALV_INTERACTIVE.
    TABLES : LFA1,EKKO,EKPO.
    SELECT-OPTIONS : VENDOR FOR LFA1-LIFNR.
    DATA : BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    END OF ITAB.
    DATA : BEGIN OF JTAB OCCURS 0,
    EBELN LIKE EKKO-EBELN,
    AEDAT LIKE EKKO-AEDAT,
    END OF JTAB.
    DATA : BEGIN OF KTAB OCCURS 0,
    EBELP LIKE EKPO-EBELP,
    MATNR LIKE EKPO-MATNR,
    END OF KTAB.
    TYPE-POOLS : SLIS.
    DATA : REPID LIKE SY-REPID.
    DATA :LFA1_B TYPE SLIS_T_FIELDCAT_ALV,
    LFA1_W TYPE SLIS_FIELDCAT_ALV,
    EKKO_B TYPE SLIS_T_FIELDCAT_ALV,
    EKKO_W TYPE SLIS_FIELDCAT_ALV,
    EKPO_B TYPE SLIS_T_FIELDCAT_ALV,
    EKPO_W TYPE SLIS_FIELDCAT_ALV,
    EVENTS_B TYPE SLIS_T_EVENT,
    EVENTS_W TYPE SLIS_ALV_EVENT.
    PERFORM GET_VAL.
    REPID = SY-REPID.
    SELECT LIFNR NAME1 FROM LFA1 INTO TABLE ITAB WHERE LIFNR IN VENDOR.
    *perform val USING USER_COMMAND sel.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = REPID
    IT_FIELDCAT = LFA1_B
    IT_EVENTS = EVENTS_B
    TABLES
    T_OUTTAB = ITAB.
    *& Form GET_VAL
    text this is to put column headings
    FORM GET_VAL.
    LFA1_W-FIELDNAME = 'LIFNR'.
    LFA1_W-REF_TABNAME = 'LFA1'.
    LFA1_W-REF_FIELDNAME = 'LIFNR'.
    APPEND LFA1_W TO LFA1_B.
    LFA1_W-FIELDNAME = 'NAME1'.
    LFA1_W-REF_TABNAME = 'LFA1'.
    LFA1_W-REF_FIELDNAME = 'NAME1'.
    APPEND LFA1_W TO LFA1_B.
    EKKO_W-FIELDNAME = 'EBELN'.
    EKKO_W-REF_TABNAME = 'EKKO'.
    EKKO_W-REF_FIELDNAME = 'EBELN'.
    APPEND EKKO_W TO EKKO_B.
    EKKO_W-FIELDNAME = 'AEDAT'.
    EKKO_W-REF_TABNAME = 'EKKO'.
    EKKO_W-REF_FIELDNAME = 'AEDAT'.
    APPEND EKKO_W TO EKKO_B.
    EKPO_W-FIELDNAME = 'EBELP'.
    EKPO_W-REF_TABNAME = 'EKPO'.
    EKPO_W-REF_FIELDNAME = 'EBELP'.
    APPEND EKPO_W TO EKPO_B.
    EKPO_W-FIELDNAME = 'MATNR'.
    EKPO_W-REF_TABNAME = 'EKPO'.
    EKPO_W-REF_FIELDNAME = 'MATNR'.
    APPEND EKPO_W TO EKPO_B.
    EVENTS_W-NAME = 'USER_COMMAND'.
    EVENTS_W-FORM = 'VAL'.
    APPEND EVENTS_W TO EVENTS_B.
    ENDFORM. "GET_VAL
    *& Form VAL
    text
    -->USER_COMMANtext
    -->SEL text for retrieving data
    FORM VAL USING USER_COMMAND LIKE SY-UCOMM SEL TYPE SLIS_SELFIELD.
    DATA : VEN(10) TYPE N,
    PO(10) TYPE N.
    DATA : MAT(10) TYPE C.
    IF SEL-FIELDNAME = 'LIFNR'.
    VEN = SEL-VALUE.
    SELECT EBELN AEDAT FROM EKKO INTO TABLE JTAB WHERE LIFNR = VEN.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = REPID
    I_STRUCTURE_NAME = EKKO_B
    IT_FIELDCAT = EKKO_B
    IT_EVENTS = EVENTS_B
    TABLES
    T_OUTTAB = JTAB.
    ENDIF.
    IF SEL-FIELDNAME = 'EBELN'.
    PO = SEL-VALUE.
    SELECT EBELP MATNR FROM EKPO INTO TABLE KTAB WHERE EBELN = PO.
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
    EXPORTING
    I_TITLE = 'ITEM DETAILS'
    I_TABNAME = 'EKPO'
    IT_FIELDCAT = EKPO_B
    I_CALLBACK_PROGRAM = REPID
    IMPORTING
    ES_SELFIELD = SEL
    TABLES
    T_OUTTAB = KTAB.
    ENDIF.
    logic to select a record
    IF SEL-FIELDNAME = 'MATNR'.
    MAT = SEL-VALUE.
    SET PARAMETER ID 'MAT' FIELD MAT.
    CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDFORM. "VAL
    check my example:
    REPORT ZSR_ALV_INTERACTIVE.
    TABLES : LFA1,EKKO,EKPO.
    SELECT-OPTIONS : VENDOR FOR LFA1-LIFNR.
    DATA : BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    END OF ITAB.
    DATA : BEGIN OF JTAB OCCURS 0,
    EBELN LIKE EKKO-EBELN,
    AEDAT LIKE EKKO-AEDAT,
    END OF JTAB.
    DATA : BEGIN OF KTAB OCCURS 0,
    EBELP LIKE EKPO-EBELP,
    MATNR LIKE EKPO-MATNR,
    END OF KTAB.
    TYPE-POOLS : SLIS.
    DATA : REPID LIKE SY-REPID.
    DATA :LFA1_B TYPE SLIS_T_FIELDCAT_ALV,
    LFA1_W TYPE SLIS_FIELDCAT_ALV,
    EKKO_B TYPE SLIS_T_FIELDCAT_ALV,
    EKKO_W TYPE SLIS_FIELDCAT_ALV,
    EKPO_B TYPE SLIS_T_FIELDCAT_ALV,
    EKPO_W TYPE SLIS_FIELDCAT_ALV,
    EVENTS_B TYPE SLIS_T_EVENT,
    EVENTS_W TYPE SLIS_ALV_EVENT.
    PERFORM GET_VAL.
    REPID = SY-REPID.
    SELECT LIFNR NAME1 FROM LFA1 INTO TABLE ITAB WHERE LIFNR IN VENDOR.
    *perform val USING USER_COMMAND sel.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = REPID
    IT_FIELDCAT = LFA1_B
    IT_EVENTS = EVENTS_B
    TABLES
    T_OUTTAB = ITAB.
    *& Form GET_VAL
    text this is to put column headings
    FORM GET_VAL.
    LFA1_W-FIELDNAME = 'LIFNR'.
    LFA1_W-REF_TABNAME = 'LFA1'.
    LFA1_W-REF_FIELDNAME = 'LIFNR'.
    APPEND LFA1_W TO LFA1_B.
    LFA1_W-FIELDNAME = 'NAME1'.
    LFA1_W-REF_TABNAME = 'LFA1'.
    LFA1_W-REF_FIELDNAME = 'NAME1'.
    APPEND LFA1_W TO LFA1_B.
    EKKO_W-FIELDNAME = 'EBELN'.
    EKKO_W-REF_TABNAME = 'EKKO'.
    EKKO_W-REF_FIELDNAME = 'EBELN'.
    APPEND EKKO_W TO EKKO_B.
    EKKO_W-FIELDNAME = 'AEDAT'.
    EKKO_W-REF_TABNAME = 'EKKO'.
    EKKO_W-REF_FIELDNAME = 'AEDAT'.
    APPEND EKKO_W TO EKKO_B.
    EKPO_W-FIELDNAME = 'EBELP'.
    EKPO_W-REF_TABNAME = 'EKPO'.
    EKPO_W-REF_FIELDNAME = 'EBELP'.
    APPEND EKPO_W TO EKPO_B.
    EKPO_W-FIELDNAME = 'MATNR'.
    EKPO_W-REF_TABNAME = 'EKPO'.
    EKPO_W-REF_FIELDNAME = 'MATNR'.
    APPEND EKPO_W TO EKPO_B.
    EVENTS_W-NAME = 'USER_COMMAND'.
    EVENTS_W-FORM = 'VAL'.
    APPEND EVENTS_W TO EVENTS_B.
    ENDFORM. "GET_VAL
    *& Form VAL
    text
    -->USER_COMMANtext
    -->SEL text for retrieving data
    FORM VAL USING USER_COMMAND LIKE SY-UCOMM SEL TYPE SLIS_SELFIELD.
    DATA : VEN(10) TYPE N,
    PO(10) TYPE N.
    DATA : MAT(10) TYPE C.
    IF SEL-FIELDNAME = 'LIFNR'.
    VEN = SEL-VALUE.
    SELECT EBELN AEDAT FROM EKKO INTO TABLE JTAB WHERE LIFNR = VEN.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = REPID
    I_STRUCTURE_NAME = EKKO_B
    IT_FIELDCAT = EKKO_B
    IT_EVENTS = EVENTS_B
    TABLES
    T_OUTTAB = JTAB.
    ENDIF.
    IF SEL-FIELDNAME = 'EBELN'.
    PO = SEL-VALUE.
    SELECT EBELP MATNR FROM EKPO INTO TABLE KTAB WHERE EBELN = PO.
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
    EXPORTING
    I_TITLE = 'ITEM DETAILS'
    I_TABNAME = 'EKPO'
    IT_FIELDCAT = EKPO_B
    I_CALLBACK_PROGRAM = REPID
    IMPORTING
    ES_SELFIELD = SEL
    TABLES
    T_OUTTAB = KTAB.
    ENDIF.
    logic to select a record
    IF SEL-FIELDNAME = 'MATNR'.
    MAT = SEL-VALUE.
    SET PARAMETER ID 'MAT' FIELD MAT.
    CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDFORM. "VAL

  • Question about destination parameter in RFC function module

    Greetings,
    For execution of RFC function module such as MD_STOCK_REQUIREMENTS_LIST_API  on local server, the destination parameter is not required or it can be DESTINATION 'NONE'. I observe that the second option is much slower than the first option. My question is why the second is much slower.
    Thanks,
    Hung

    I've tested it with se37 by leaving RFC target system blank or filling it with 'NONE' , I saw 53000 microseconds versus 45000 microseconds.
    Hung

  • Function module for conversion in basic unit of measure....

    Hi,
    Can someone give me a function module, which will convert the Unit of measure into basic unit of measure
    Say a a material has 3 CA (Cases) in a PO and the conversion factor(UMREZ in table MARAM) for CA for that material is 4 and converison for MP (Master pack) is 12,then
    3CA =  9 PC = (9/12) MP
    But I want a function module which will do this conversions ?

    Hi,
      Use MD_CONVERT_MATERIAL_UNIT
    Thanks,
    Naren

  • Question about the function module (RFC_READ_TABLE)

    Dear everyone
    Could I ask you a question about the function module (RFC_READ_TABLE)?
    I was asked if it's possible to create a report which compares the data between different SAP systems (both production systems).
    Now, the easiest way would be to use the function module (RFC_READ_TABLE) within a SAP infoset query (SQ01 type query).
    But I heard the rumor that using the function module (RFC_READ_TABLE) is not advisable due to the security reason.
    However, I am not exactly sure what sort of security problems this function module can possibly have...
    Would you help me on this?
    I also would like to know if using "remote enabled module" type function module can always overcome this possible security issue.
    Or, are there any points that I need to be careful about even when I use "remote enabled module" function module?
    Thank you very much in advance.
    Takashi

    Dear Fred-san
    Thank you very much for your support on this.
    But, may I double check about what you mentioned above?
    So, what you were mentioning was that if some user executes the query with
    the function module (RFC_READ_TABLE), under the following conditions, he can access to
    the HR data even when he does not have the authorizations for HR transactions?
    <Conditions>
    1. the user has the authorization for HR database tables themselves
    2. RFC_READ_TABLE is called to retrieve the data from HR database
    <example>
    Data: LF_HR_TABLE like  DD02L-TABNAME value 'PA0000'.
    CALL FUNCTION 'RFC_READ_TABLE'
       EXPORTING
        query_table                = LF_HR_TABLE
      TABLES
       OPTIONS                    =
       fields                     =
       data                       =    .
    But then, as long as we call this function module for a non-critical tables such as
    VBAP (sales order) or EKKO (purchase order) within our query, it wouldn't seem to be
    so security risk to use RFC_READ_TABLE...
    Besides, each query (infoset query) has got the concept of user groups, which limits
    the access to the queries within the user group.
    ※If someone does not belong to the user group, he cannot execute the queries within that
       user group, etc
    So, my feeling is that even infoset queries does have authorization concept...
    Would you give me your thought on this?
    I also thank you for your information for SCU0.
    That is an interesting transaction
    Kind regards,
    Takashi

  • Function Module Error In Uploading Data for Basic Pay Infotype

    Hi All,
    I'm trying to upload data into Basic Pay Infotype 0008 Using LSMW Subtype 0(Basic Contract). While we are trying to input values into ANSAL(Annual Salary) field directly using default wage type as 1000.
    We are gettting a error in function module RP_ANSAL_FROM_WAGETYPES.
    and eventhough we are inputting values into ANSAL field it is taking it as 0.00 by default .
    Kidly suggest me solution.
    Thanks,
    Vasanth

    Hi ..
    check this
    765785
    673372
    730976
    note 1032950
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8d/3e4ec2462a11d189000000e8323d3a/content.htm
    Message was edited by:
            hari kv

  • Question with function module / Bapi

    I am trying to test function module/ Bapi:
    BAPI_BILLINGDOC_CREATEMULTIPLE in se37. I gave all the basic parameers required.
    BILLING_DATA_IN-SALESORG
       BILLING_DATA_IN-DISTR_CHAN
       BILLING_DATA_IN-DIVISION
       BILLING_DATA_IN-DOC_TYPE
       BILLING_DATA_IN-ORDBILLTYP
       BILLING_DATA_IN-SOLD_TO
       BILLING_DATA_IN-ITEM_CATEG
       BILLING_DATA_IN-REQ_QTY
      BILLING_DATA_IN-SALES_UNIT
      BILLING_DATA_IN-CURRENCY
    But when I execute, it says 'Company code not defined' in the error messages. I don't see any company code field in the above structure. What am I doing wrong?
    Please give your input.
    Thanks,
    Krishen

    Might be the company code is not defined for the sales organization..
    Thanks,
    Naren

  • How to find IDOC Function Module for Basic Type:ORDERS05

    Hi,
    What is the Transaction Code to locate the Function Module linked to the IDOC Basic Type & IDOC Message Type?
    Appreciate Your Help.
    Thanks,
    Kannan.

    Hi Seshu,
    Thanks for your reply. While creating a Custom IDOC, How do I link the IDOC Function Module and Basic Type. Appreciate Your Help.
    Thanks,
    Kannan.

Maybe you are looking for

  • How do I sync my ipod touch with itunes 10.7 under windows 8?

    It is already three weeks since I installed Windoes 8 on my computer, till now I haven't got any help from apple concerning the syncing problems of my Ipod touch. This is not very impressive. do I have to change my MP3 player and forget about Ipod?

  • Why is the small text blurry on photoshop?

    why is the small text blurry on photoshop? i am **** a very small advert for a newspaper! and the text is printing blurry and when zoomed in is appearing all blurry? how do i stop this i only have photoshop and indesign

  • Resizing columns in a JTable

    How can I know when a JComponent is valid? i.e. I need to execute some code after a table has resized its columns, but I can't use the method SwingUtilities.invokeLater. Is there any method that informs when the component has finished painting? Thank

  • IPhoto placed 7000 pictures into one event

    After recently upgrading to Mavericks and the iphoto upgrade... iphoto merged about 7000 of my 12000 pictures into one event unders the Library/Photos... It's only those 7000 that have been merged and the rest are still as I had put them... Any help

  • 7920 associates to root bridge but not to non-root bridge

    I have 7920s using open authentication with WEP128 cipher. I have two 1300 root AP's (with client support) and three non-root AP's (also client support) in the same lab area. The root AP's and non-Root AP's associate and link to each other no problem