Creating Includes for Function Modules

Hi Experts,
Can you please let me know how to create includes for function modules.
I came across this in a standard include program, which was generated by a function library. The includes inside this program where linked to the function modules (when I double clicked on them).
Please let me know how to create it.
Thanks in advance !
Regards,
Anand Patil.

Hi,
have a look at the code for better understanding
Declaration of Workareas                                             *
  DATA: lwa_e1bp2017_gm_item_create TYPE e1bp2017_gm_item_create,
        lwa_data         TYPE edidd, " Work area for IDOC
        lwa_control      TYPE edidc. " Work Area for control rec
Read the control data information of idoc.
  loop at idoc_contrl INTO lwa_control Where mestyp = lc_mbgmcr.
Extract the data from the segments.
    LOOP AT idoc_data INTO lwa_data
    WHERE docnum = lwa_control-docnum and
          segnam = lc_item_create.
*->> Set the tabix of the internal table
      lv_index = sy-tabix.
Move the Material Document Item Segment data
      MOVE lwa_data-sdata TO lwa_e1bp2017_gm_item_create.
Modify the material document item data  internal table
      PERFORM sub_modify_idocdata changing lwa_e1bp2017_gm_item_create.
*->> set the changed values to the IDOC SDATA
      MOVE  lwa_e1bp2017_gm_item_create TO lwa_data-sdata.
*->> Modify the table
      MODIFY idoc_data FROM lwa_data index lv_index.
Clear the Work areas
      CLEAR : lwa_data,
              lwa_e1bp2017_gm_item_create.
    ENDLOOP.                                     "LOOP AT t_idoc_data
Call the BAPI function module to create the
appropriate Material Document
    CALL FUNCTION 'BAPI_IDOC_INPUT1'
      EXPORTING
        input_method          = input_method
        mass_processing       = mass_processing
      IMPORTING
        workflow_result       = workflow_result
        application_variable  = application_variable
        in_update_task        = in_update_task
        call_transaction_done = call_transaction_done
      TABLES
        idoc_contrl           = idoc_contrl
        idoc_data             = idoc_data
        idoc_status           = idoc_status
        return_variables      = return_variables
        serialization_info    = serialization_info
      EXCEPTIONS
        wrong_function_called = 1
        OTHERS                = 2.
    IF sy-subrc = 1.
      RAISE wrong_function_called.
    ENDIF.
  endloop.
ENDFUNCTION.
here when we write the statment
PERFORM sub_modify_idocdata changing lwa_e1bp2017_gm_item_create and double click on sub_modify_idocdata .
it will create a include with the name "LZDTSINT052F_GPOMS_GMF01 ".
now we can write the FORM ..END FORM In this inculde.like this.
***INCLUDE LZDTSINT052F_GPOMS_GMF01 .
*&      Form  sub_modify_idocdata
Modify the material document item data  internal table
FORM sub_modify_idocdata
CHANGING pwa_e1bp2017_gm_item_create TYPE e1bp2017_gm_item_create.
contant declaration
  CONSTANTS: lc_261(3) TYPE c VALUE '261'.
  DATA : lv_aplzl LIKE resb-aplzl,
         lv_aufpl LIKE resb-aufpl,
         lv_subrc LIKE sy-subrc,
         lv_charg LIKE resb-charg,
         lv_uom LIKE pwa_e1bp2017_gm_item_create-entry_uom.
  CLEAR: pwa_e1bp2017_gm_item_create-reserv_no,
         pwa_e1bp2017_gm_item_create-res_item.
*->> Get SAP storage bin & Storage type from the Z table
  SELECT lgtyp lgpla
    INTO (pwa_e1bp2017_gm_item_create-stge_type,
          pwa_e1bp2017_gm_item_create-stge_bin)
     UP TO 1 ROWS
    FROM zdtsint050_sttyp
     WHERE zstorage_typ = pwa_e1bp2017_gm_item_create-stge_type
      AND  zstorage_bin = pwa_e1bp2017_gm_item_create-stge_bin.
  ENDSELECT.
  IF sy-subrc NE 0.
    CLEAR: pwa_e1bp2017_gm_item_create-stge_type,
           pwa_e1bp2017_gm_item_create-stge_bin.
  ENDIF.
  PERFORM get_oper CHANGING pwa_e1bp2017_gm_item_create.
Get the Reservation number and Reservation item number
basing on the idoc data.
  SELECT rspos werks lgort
         INTO (pwa_e1bp2017_gm_item_create-res_item,
              pwa_e1bp2017_gm_item_create-plant,
                 pwa_e1bp2017_gm_item_create-stge_loc)
         FROM resb
         UP TO 1 ROWS
         WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no
         AND   matnr = pwa_e1bp2017_gm_item_create-material
         AND   charg = pwa_e1bp2017_gm_item_create-batch
         AND   aufnr = pwa_e1bp2017_gm_item_create-orderid
         AND   vornr = pwa_e1bp2017_gm_item_create-activity
         AND   bwart = lc_261.
  ENDSELECT.
  IF sy-subrc <> 0.
Start of insertion for R31K993797
    CLEAR lv_charg.
    SELECT rspos werks lgort
         INTO (pwa_e1bp2017_gm_item_create-res_item,
              pwa_e1bp2017_gm_item_create-plant,
                 pwa_e1bp2017_gm_item_create-stge_loc)
         FROM resb
         UP TO 1 ROWS
         WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no
         AND   matnr = pwa_e1bp2017_gm_item_create-material
         AND   charg = lv_charg
         AND   aufnr = pwa_e1bp2017_gm_item_create-orderid
         AND   vornr = pwa_e1bp2017_gm_item_create-activity
         AND   ( splkz = 'X' or
                 splkz = space )
         AND   bwart = lc_261.
    ENDSELECT.
    IF sy-subrc <> 0.
End of insertion for R31K993797
      SELECT SINGLE werks lgort
            INTO (pwa_e1bp2017_gm_item_create-plant,
                   pwa_e1bp2017_gm_item_create-stge_loc)
            FROM resb
            WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no.
      CLEAR : pwa_e1bp2017_gm_item_create-reserv_no,
              pwa_e1bp2017_gm_item_create-res_item.
    ENDIF.
  ENDIF.
get SAP UOM
  SELECT SINGLE zsap_uom
                INTO lv_uom
                FROM zca_uom_conv
                WHERE zext_uom = pwa_e1bp2017_gm_item_create-entry_uom.
  IF sy-subrc = 0.
    pwa_e1bp2017_gm_item_create-entry_uom = lv_uom.
  ENDIF.
ENDFORM.                    " sub_modify_idocdata
*&      Form  get_oper
     Get the operation
     <--P_PWA_E1BP2017_GM_ITEM_CREATE_RE  Segment
FORM get_oper  CHANGING p_pwa_e1bp2017_gm_item_create TYPE
               e1bp2017_gm_item_create.
  DATA : l_aufpl LIKE afko-aufpl,
         l_aplzl LIKE afvc-aplzl.
  REFRESH : i_op.
  UNPACK p_pwa_e1bp2017_gm_item_create-orderid TO
         p_pwa_e1bp2017_gm_item_create-orderid.
Get the reservation and routing number for the order
  SELECT SINGLE
         rsnum
         aufpl
         FROM afko
         INTO (p_pwa_e1bp2017_gm_item_create-reserv_no,
               l_aufpl)
         WHERE aufnr = p_pwa_e1bp2017_gm_item_create-orderid.
  IF sy-subrc = 0.
    CALL FUNCTION 'CONVERSION_EXIT_NUMCV_INPUT'
      EXPORTING
        input  = p_pwa_e1bp2017_gm_item_create-activity
      IMPORTING
        output = p_pwa_e1bp2017_gm_item_create-activity.
  ENDIF.
ENDFORM.                    " get_oper
Regards,
nagaraj

Similar Messages

  • Creating tcode for function module

    Hi all
               I have created a screen in the funcion group.Now my problem is I have a requirement that I have to keep this screen inside a function group and I also must create a transaction code for this screen so that the user can see only that screen using this tcode whenever he want.Will you please help me to solve this problem.
    Thanks in advance.
    Regards
    Giri.

    Hi Giri,
              U can create Tcode for Program only i.e for report or module pool program.
    So keep ur Function inside ur program and create Tcode for that
    se93>tcode name> create
    reward if it useful....

  • Include for function module

    Dear Gurus,
    Could you explain me why is an include generated for a function module?
    After I write a function module, to use this function module, how should I use the generated include?
    Regards
    Suzie

    Hi,
    The FM code is stored in the INCLUDES.
    go to SE37-  give the FM
    u can c the code of the FM.
    There u will get the import and export parameters.
    if you know the import paramaters u can run the program there itself and test the ouput.
    hope u got an idea
    Rgds
    Anver

  • Tranceport request for function module

    Hi,
    first i have created function group and function module under local class, now i created request for function group, but how to create request for function module, i have to trancport my functionmodule. please do the need full help.
    thanks in advance.
    Radhakrishna

    go to se37
    1.give desired function module
    2.select change or display option
    3. Click -GOTO optin on menu bar and select 'Object Directory entry '
    4.click on object directory entry  and press f6
    5.change package and reponsible person and save it will ask you request finaly you can relese.

  • How to create the INBOUND Function Module for INBOUND IDOCs

    Hi Friends,
    Can any Suggest me How to proceed to Create an INBOUND Function Module for Processing the INBOUND IDOCS
    which are recieved from XI Server ?
    I am working in SAP-ISU
    Here i will recieve the INBOUND IDOCs for the Meter Reading Orders.
    We have a Standard INBOUND FUNCTION MODULE
    IDOC_INPUT_ISU_MR_UPLOAD
    which Uploads the Meter Reading Results.
    I copied the Same function Module into ZIDOC_INPUT_
    and working on it.
    Can any one suggest me, whether i am going in correct way or not.
    In IDOC_INPUT_ISU_MR_UPLOAD Inbound fun module,
    BAPI_MTRREADDOC_UPLOAD is used to Update or Insert the Meter Reading Results,
    My requirment is to Insert and Update the Meter Reading Orders which are Inbounded from XI.
    Can I Use the Same BAPI
    BAPI_MTRREADDOC_UPLOAD
    to Update the below fields,
    EABL-SERNR
    EABL-ZWNUMMER
    EABLG-ABLESGR
    EABL-V_ZWSTAND
    EABL-N_ZWSTAND
    EABL-ABLHINW
    EABL-ZSKIPC
    EABL-ADAT
    EABL-ATIMTATS
    EABL-ADATTATS
    EABL-ATIM
    EABL-ZMESSAGE
    EABL-ABLESER(Meter reader number)
    Kindly Suggest me,
    Thanks in Advance,
    Ganesh

    Hello Ganesh
    I think you are going completely astray with you z-function module for IDoc processing.
    If you look at TABLES parameter METERREADINGRESULTS (type BAPIEABLU ) of BAPI_MTRREADDOC_UPLOAD you will find many of the requested fields already:
    EABL-SERNR => BAPIEABLU-SERIALNO
    EABL-ZWNUMMER =>REGISTER
    EABLG-ABLESGR
    EABL-V_ZWSTAND
    EABL-N_ZWSTAND
    EABL-ABLHINW
    EABL-ZSKIPC
    EABL-ADAT
    EABL-ATIMTATS => ACTUALMRTIME
    EABL-ADATTATS => ACTUALMRDATE
    EABL-ATIM
    EABL-ZMESSAGE
    EABL-ABLESER(Meter reader number)
    Field EABL-ZMESSAGE appears to be custom field (at least I cannot find it on ECC 6.0). If this field was added using include CI_EABL then you probably can get these values into the BAPI using the EXTENSIONIN parameter.
    Check routine CHECK_UPLOADRECORDS in the BAPI which allows two extension structures:
    - BAPI_TE_EABL
    - BAPI_TE_EOSB
    Not surprisingly BAPI_TE_EABL contains the include CI_EABL.
    Regards
      Uwe

  • Transport of ALE Interfaces for Function Module

    hi,
    i have a Z function module, Z business object type and z message type identifying ALE interface.
    i need to move all the objects from Dev R3 to QA R3. What are the steps involved?
    Thanks,
    Tirumal

    Hi
    While creating a Z function module it will ask you for a change request number. attach it to change request and migrate it to Production.
    In case your function group to which you assigned this function module is open then the CTS number will by default come in CTS number field if any exists for the function group. You can now migrate your CTS to production.
    Now after assinging function module to a CTS you can be sure that your program for function module and FM both will be migrated. For confirmation you can now check attribuutes section in your function module. it will list the SAP program associated with Func mod , function group to which function module is assigned , package and include programs which needs to be migrated. So you only need to attach a CTS and migrate your CTS.
    You can create a Change erquest (CTS) in SE01 or SE10 transactions.
    Regards,
    Amit.
    Please reward any help
    Message was edited by: amit bhadauria
    Message was edited by: amit bhadauria

  • 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

  • Search help(f4)  for function module input

    can we create a serch help for  function module input giving process

    Hello basichodary,
    You can encapsulate the function module within a program.  Include the search help in a parameter statement in the calling program and pass the parameter to the function module.  For example, suppose you want to have field i_carrid to have a search help.  Use the following code. 
    report  call_function_module.
    parameters p_carrid type s_carr_id matchcode object demo_f4_de.
    call function 'FUNCTION_MODULE'
       exporting
          i_carrid    = p_carrid
    Kind Regards,
    Rae Ellen Woytowiez

  • Example needed for function module

    kindly provide me an example for function module & let me how to use this function in a report program..Thnaks in advance..

    Hi,
    GO to Tcode SE80.Create fucntion group.Name should start with z or y.
    GO to Tcode SE37.Create function module.Assign it to function group created above.Name should start with z or y.
    In change mode,you can top include.This is the place you should put the declarations.
    In F01,you need to write the form and U01 you should write the main program.Best way is to take any function module(z*) and follow it.
    There are 3 types of fm.
    1.Normal fm
    2.RFC enabled
    3.Update task.
    Check this link for RFC.
    http://help.sap.com/saphelp_47x200/helpdata/en/22/0425f2488911d189490000e829fbbd/frameset.htm

  • User exit for Function Module

    Hi,
    I have a Exit function module  EXIT_SAPLCVV1_003. i wrote my code in the include and i dont know how to activate it in CMOD. i dont have the user exit name. can anyone tell me how to find user exit for function module.
    Regards

    hi
    you should find the enhancement name for your function module exit.
    go to CMOD Utilities->SAP Enhancement->extended selection->
    give the program name(SAPLCVV1) in Component name field and execute.
    it will display the enhancement name.Afterwards u should create the enhancement project.
    Steps to create enhancement Project:
    1.Goto CMOD.
    2.Give project name.->Create
    3.Assign the enhancement using the option.
    4.select Components and choose change.go to ur code and activate.
    5.activate the exit
    6.activate the enhancement.
    Cheers,
    Abdul Hakim
    mark all useful answers..

  • How to log input parameters for Function Modules?

    Hi,
    I need to create a Logging system to trace input parameters for function modules.
    The log functionality could be done by developing a class method or a function module (For example 'write_log'), and calling it within each function module that I want to log. The 'write_log' code should be independent from the interface of the Function Module that I want to log.
    For example, I'd like to write a function/class method that can log both these functions modules:
    Function DummyA
       Input parameters: A1 type char10, A2 type char10.
    Function DummyB
       Input parameters: B1 type char20, B2 type char20, B3 type char20, B4 type Z_MYSTRUCTURE
    Now the questions...
    - Is there a "standard SAP" function that provide this functionality?
    - If not, is there a system variable in which I can access runtime all parameters name, type and value for a particular function module?
    - If not, how can I loop at Input parameters in a way that is independent from the function module interface?
    Thank you in advance for helping!

    check this sample code. here i am capturing only parameters (import) values. you can extend this to capture tables, changin, etc.
    FUNCTION y_test_fm.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(PARAM1) TYPE  CHAR10
    *"     REFERENCE(PARAM2) TYPE  CHAR10
    *"     REFERENCE(PARAM3) TYPE  CHAR10
      DATA: ep TYPE STANDARD TABLE OF rsexp ,
            ip TYPE STANDARD TABLE OF rsimp ,
            tp TYPE STANDARD TABLE OF rstbl ,
            el TYPE STANDARD TABLE OF rsexc ,
            vals TYPE tihttpnvp ,
            wa_vals TYPE ihttpnvp ,
            wa_ip TYPE rsimp .
      FIELD-SYMBOLS: <temp> TYPE ANY .
      CALL FUNCTION 'FUNCTION_IMPORT_INTERFACE'
        EXPORTING
          funcname                 = 'Y_TEST_FM'
    *   INACTIVE_VERSION         = ' '
    *   WITH_ENHANCEMENTS        = 'X'
    *   IGNORE_SWITCHES          = ' '
    * IMPORTING
    *   GLOBAL_FLAG              =
    *   REMOTE_CALL              =
    *   UPDATE_TASK              =
    *   EXCEPTION_CLASSES        =
        TABLES
          exception_list           = el
          export_parameter         = ep
          import_parameter         = ip
    *   CHANGING_PARAMETER       =
          tables_parameter         = tp
    *   P_DOCU                   =
    *   ENHA_EXP_PARAMETER       =
    *   ENHA_IMP_PARAMETER       =
    *   ENHA_CHA_PARAMETER       =
    *   ENHA_TBL_PARAMETER       =
    *   ENHA_DOCU                =
       EXCEPTIONS
         error_message            = 1
         function_not_found       = 2
         invalid_name             = 3
         OTHERS                   = 4
      IF sy-subrc = 0.
        LOOP AT ip INTO wa_ip .
          MOVE: wa_ip-parameter TO wa_vals-name .
          ASSIGN (wa_vals-name) TO <temp> .
          IF <temp> IS ASSIGNED .
            wa_vals-value = <temp> .
          ENDIF .
          APPEND wa_vals TO vals .
        ENDLOOP .
      ENDIF.
    ENDFUNCTION.

  • How to create webservice from function module

    Hello,
    I'm trying to create webservice from function module from. I choose Utilities/More Utilities/Create Webservice/..From function Module. What data should I enter in section "Enter Package/Request" ?
    When I check "Local object" checkbox I get a message "Test objects cannot be created in foreign namespaces"
    Is there any doc about this procedure (web service creation) with description of all sections ?
    thanks for any reply,
    Lukasz Ferenc

    Hi,
    Which SAP product of wich release of which SP are you using ?
    The procedure is documented in help.sap.com and in blogs and SDN forum messages.
    It means that the use of the SEARCH button should give plenty of answers...
    >When I check "Local object" checkbox I get a message "Test objects cannot be created in foreign >namespaces"
    As usual, begin your choosen name with an "Z".
    Regards,
    Olivier

  • How to create a new function module?

    I was doing the tutorial to create a SAP data widget and the tutorial was using BAPI_FLIGHT_GETLIST to display the data. However, in my system, theres no data in the table SFLIGHT2 and i couldnt populate any data in it.
    So i am trying to create my own function module. Can anyone tell me how should i go about doing it?

    Hi Low Soon ,
    please check the below links for creating a new function module.
    SAP Help :
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/frameset.htm
    Step by Sterp approach to create a Functional Module:
    http://www.****************/Tutorials/ABAP/FunctionModule/page1.htm
    Thanks
    Jaideep Srinivasan

  • How to create a callback function module

    Hi all,
    I am working in a requirement where we need to call a function module at a 'after change' event. So how to create a callback function module and register it with the crmvevent ?_
    I created a sample function module and try to create entries in table crmv_event_cust, but i got an error message saying that the function module name I provided is not in table CRMC_FUNC_ASSIGN. When I try to create entry there, I got a message that function module is not in CRMC_OBJ_FUNC and that table is a standard table with no maintanance options !!
    looks like i am going in wrong way ... can any one please help ??

    Looking at my system all you need to do is create the entry for the callback function in maint view: CRMV_FUNC_ASSIGN.
    Your entry should be as simple as Z-function name Object Function - <same as others in the segment you are assigning>
    IE for the partner it would be CRM_PARTNER as object function, for general order processing CRM_ORDER
    Take care,
    Stephen

  • How to create a Z Function Module

    Hi,
      I am trying to create a Z function module in BI 7.0 that i can use in Transformations.
    SE37> Name of FM.Create..>
    It is prompting me to enter Function Group.
    What is Function Group and How can i create a new function group (Detail Steps please)
    and steps involved in creating a Function Module in BI 7.0
    Thanks in Advance

    Hi,
    Function Group is just like a folder under which we can store n no. of function modules for organizational purpose. If u want any global declarations we will declare at function Group Level.
    It is mandatory to save a function module under one function group. Select Goto menu item, select Function Group, then select, create function group in SE37. Just give the technical name and description and save.
    Hope this helps u..
    Regards
    Ramakrishna Kamurthy

Maybe you are looking for

  • Disabling Smart Quotes in FrameMaker 7.2

    Hi, My team uses FrameMaker 7.2 to create and edit DITA XML files. We recently noticed that the smart quote feature inserts non-printable characters in our XML content files. Our help system cannot display the characters properly, and so we've starte

  • Can't open files in Doc Library with IE

    hello all: I have a document library which has recently shown an issue.  There are many users that access this library with no problem.  Recently, a few users (3-4) have complained that they are no longer able to view files.  They are definitely able

  • Installing update Flash Player on Windows 8.1

    Dell Inspiron 660, Windows 8.1, Flash player pre-installed as noted in control panel at 14.0.0.145.  I would like to update to Flash player 14.0.0.176.  Is that possible and how would I do that?  The note that comes up at Adobe's website is that the

  • AS 10g (9.0.4)

    Hi everybody I have install Reports server and form server 10 g (9.0.4) for linux in a Red Hat 4 I can run reports and form but from de OEM - Application Control when i click in the rep_apserver LINK i get the following message java.lang.NumberFormat

  • AFP logon window takes 60 - 90 seconds for remote users

    We have a 10.4.11 server running AFP and multiple other services. About 25 users connect to the AFP sharepoints via the internal network and the login window appears immediately. Another 25 users connect through a hardware VPN from another office and