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

Similar Messages

  • Help code for function module

    Hi Gurus,
    I have to connect two table through function module in ECC side.
    Both table contains some field.
    I am not much familiar with ABAP.
    So PLease  give some demo coding for this.
    Coding  to connect two tables by function module.
    Thanks.
    Saurabh Jain

    Hi,
    Please find the sample code.Here I am extracting data from three tables.
    SELECT         
                   a~vbeln
                 a~MATNR
                 a~CHARG                 
                 a~POSNR              
                 a~SPART                
                 a~ERDAT              
                 a~AEDAT              
                 a~KWMENG
                 a~PSTYV
                 c~KUNNR
                 c~VKGRP
                 c~VKBUR
                 c~VTWEG
                 c~VKORG
                 c~BUKRS
                 c~VKGRP  
                 FROM((VBAP AS a INNER JOIN VBPA AS b
                            ON avbeln  = bvbeln
                           AND aposnr  = bposnr)INNER JOIN VBAK AS c ON cvbeln = bvbeln
                                                                       AND cposnr = bposnr).
    Modify in the way you want and Just include these codes into the Funtion module you create.
    I Hope it my help you.
    Regards,
    Prem

  • Function Module - Generic Extraction : Not able to solve

    Hi Guys,
           I have created a function module. The function module is working well. But when i start the extraction. It does not stops. It starts loading same data package again and again. It is becoming an endless loop. I have ot ask basis person to kill that job. He inturn has to restart SAP r/3 server. This has become a big issue. Guys please help I am attaching the code for your reference
    Example: DataSource for table SFLIGHT
    TABLES: YSALES,
           MBEW.
      DATA: BEGIN OF I_YSALES OCCURS 0.
              INCLUDE STRUCTURE YSALES.
      DATA: END  OF I_YSALES.
      DATA: BEGIN OF I_MBEW OCCURS 0.
              INCLUDE STRUCTURE MBEW.
      DATA: END OF I_MBEW.
    Auxiliary Selection criteria structure
      DATA: L_S_SELECT TYPE SRSC_S_SELECT.
    Maximum number of lines for DB table
      STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
    counter
              S_COUNTER_DATAPAKID LIKE SY-TABIX,
    cursor
              S_CURSOR TYPE CURSOR,
              S_CURSOR1 TYPE CURSOR.
    Select ranges
      RANGES: L_R_ZYEAR  FOR YSALES-ZYEAR,
              L_R_ZMONTH  FOR YSALES-ZMONTH.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
      IF I_INITFLAG = SBIWA_C_FLAG_ON.
    Initialization: check input parameters
                    buffer input parameters
                    prepare data selection
    Check DataSource validity
       CASE I_DSOURCE.
         WHEN '0SAPI_ysales_SIMPLE'.
         WHEN OTHERS.
           IF 1 = 2. MESSAGE E009(R3). ENDIF.
    this is a typical log call. Please write every error message like
    *this
           LOG_WRITE 'E'                  "message type
                     'R3'                 "message class
                     '009'                "message number
                     I_DSOURCE   "message variable 1
                     ' '.                 "message variable 2
           RAISE ERROR_PASSED_TO_MESS_HANDLER.
       ENDCASE.
       APPEND LINES OF I_T_SELECT TO S_S_IF-T_SELECT.
    Fill parameter buffer for data extraction calls
        S_S_IF-REQUNR    = I_REQUNR.
        S_S_IF-DSOURCE   = I_DSOURCE.
        S_S_IF-MAXSIZE   = I_MAXSIZE.
    Fill field list table for an optimized select statement
    (in case that there is no 1:1 relation between InfoSource fields
    and database table fields this may be far from beeing trivial)
        APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.
      ELSE.                 "Initialization mode or data extraction ?
    Data transfer: First Call      OPEN CURSOR + FETCH
                   Following Calls FETCH only
    First data package -> OPEN CURSOR
       IF S_COUNTER_DATAPAKID = 0.
    Fill range tables BW will only pass down simple selection criteria
    of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
        LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZYEAR'.
          MOVE-CORRESPONDING L_S_SELECT TO L_R_ZYEAR.
          APPEND L_R_ZYEAR.
        ENDLOOP.
        LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZMONTH'.
          MOVE-CORRESPONDING L_S_SELECT TO L_R_ZMONTH.
          APPEND L_R_ZMONTH.
        ENDLOOP.
    Determine number of database records to be read per FETCH statement
    from input parameter I_MAXSIZE. If there is a one to one relation
    between DataSource table lines and database entries, this is trivial.
    In other cases, it may be impossible and some estimated value has to
    be determined.
         OPEN CURSOR WITH HOLD S_CURSOR FOR
         SELECT (S_S_IF-T_FIELDS)
            FROM YSALES .
         OPEN CURSOR WITH HOLD S_CURSOR1 FOR
          SELECT (S_S_IF-T_FIELDS)
          FROM MBEW WHERE YSALES~MATNR
              AND BWKEY = YSALES~WERKS.
        select  BUKRS
                ZYEAR
                ZMONTH
                WERKS
                MATNR
                SLSCAT
                KNDNR
                SPART
                MATKL
                MENGE
                DMBTR
                VV702
                VV703
                VVADS
                VV704
                VV731
                INTO
                CORRESPONDING FIELDS OF table I_YSALES
                PACKAGE SIZE S_S_IF-MAXSIZE
                FROM YSALES
                WHERE ZYEAR IN L_R_ZYEAR
                AND   ZMONTH IN L_R_ZMONTH.
       ENDSELECT.
            WHERE MATNR IN L_R_MATNR.
            WHERE WERKS = WERKS
            AND   MATNR = MATNR
            AND   KNDNR = KNDNR
            AND   SPART = SPART.
        IF SY-SUBRC = 0.
          SORT I_YSALES BY WERKS MATNR .
        ENDIF.
        IF NOT I_YSALES[] IS INITIAL.
          SELECT MATNR
                 BWKEY
                 BWTAR
                 LBKUM
                 SALK3
                 BKLAS
                 INTO CORRESPONDING FIELDS OF TABLE I_MBEW
                 PACKAGE SIZE S_S_IF-MAXSIZE
                 FROM MBEW
                 FOR ALL ENTRIES IN I_YSALES
                 WHERE MATNR = I_YSALES-MATNR
                 AND   BWKEY = I_YSALES-WERKS.
          ENDSELECT.
        ENDIF.
        LOOP AT I_YSALES .
          MOVE-CORRESPONDING I_YSALES TO E_T_DATA.
          READ TABLE I_MBEW WITH KEY MATNR = I_YSALES-MATNR
                                     BWKEY = I_YSALES-WERKS.
          IF SY-SUBRC = 0.
            MOVE-CORRESPONDING I_MBEW TO E_T_DATA.
          ENDIF.
          APPEND E_T_DATA.
        ENDLOOP.
       IF SY-SUBRC <> 0.
         CLOSE CURSOR S_CURSOR.
          RAISE NO_MORE_DATA.
        ENDIF.
       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 E_T_DATA
                  PACKAGE SIZE S_S_IF-MAXSIZE.
        S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
      ENDIF.              "Initialization mode or data extraction ?
    ENDFUNCTION.

    Hi Baljit,
    This is a dangerous way of extracting your data.
    I am not surprised that it has become an endless loop.
    You have to use the cursor and the fetch statement and after the fetch statement you have to use a subreturncode
    to wonder if the fetch statement did get any data.
    if not use the folowing statements.
    close cursor s_cursor.
    raise no_more_data.
    In your situation the select statement will start every time from the first record in the table ysales because you don't use the cursor. By using the cursor and the fetch statement, the fetch statement will start from the cursor everytime it calls the function module.
    I guess this function module is part of an endless loop and will be exited at the moment that the function module returns with raise no_more_data. (in other words, the cursor is at the last record of the table ysales, so no more records will be found)
    Hope this will help
    Maarten

  • Process code for Function Module IDOC_INPUT_MBGMCR

    hello!!
    here i m tryin to create n inbound idoc
    idoc type - MBGMCR02
    Function Module - IDOC_INPUT_MBGMCR
    but i dont knw the process code for dat can ny 1 help me to find it?
    1st of all how to find da process code if u hav the FM ?
    it wld b more helpful if ny1 cld give me the process code
    thank u
    ashwinee

    hai
    if u dont have process code r cant able to find process code,
    u create process code its very easy. 
      for inbound, go to
       TX-WE42.
      click create give ur process code and give that function module.
      in processing type,
               u check the radiobutton as processing by function module and save it.
    then, u can use this process code in our partner profile .
    any doubt regarding this u can ask me.
    Message was edited by:
            tamilarasan kandasamy

  • 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

  • Help needed - ABAP for  function modules and routines.

    Dear BW gurus,
    Hope everyone is doing great.
    I gotta project recently and we are going live in 3 weeks.My BWLead is getting rolled out in a week and he has to make the knowledge transfer to me ASAP.The bottle-necking thing is I need to have a good idea about the function modules and routines.So I request our SND community to help me out with good ABAP documents for function modules,routines and query.
    my mail id is [email protected]
    Thanks in advance
    Have a nice day
    Regards
    sathiya

    Hello Sam,
    You can create function module in ABAP using tcode SE37.
    For more informations on ABAP:
    http://help.sap.com/saphelp_47x200/helpdata/en/c9/5472f6787f11d194c90000e8353423/frameset.htm
    Use http://help.sap.com
    and also use <b>ABAPDOCU</b> transaction.
    Check these links also...
    <b>Online PDFs:</b>
    http://easymarketplace.de/online-pdfs.php
    <b>ABAP HELP</b>
    If you check these links, you can find many example programs.
    http://www.sap-img.com/abap.htm
    http://www.sapdevelopment.co.uk/tips/tipshome.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://sap.ittoolbox.com/nav/t.asp?t=322&p=322&h1=322
    http://sappoint.com/abap/
    FAQs in ABAP
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    Smart forms
    http://www.sap-basis-abap.com/sapsf001.htm
    Workflow
    <http://www.sap-img.com/workflow/sap-workflow.htm>
    ALV
    http://www.geocities.com/mpioud/Abap_programs.html
    Mail
    http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
    http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp
    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    SAP Scripts:
    http://sappoint.com/abap/
    http://www.henrikfrank.dk/abapuk.html
    Some useful ABAP Links for learning:
    http://cma.zdnet.com/book/abap/index.htm
    http://www.sapdevelopment.co.uk/
    http://www.sap-img.com/
    http://juliet.stfx.ca/people/fac/infosys/abap.htm
    http://help.sap.com/saphelp_46c/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_46c/helpdata/en/d6/0db357494511d182b70000e829fbfe/frameset.htm
    http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm
    http://www.sapgenie.com/abap/example_code.htm
    http://www.geocities.com/SiliconValley/Campus/6345/abapindx.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm
    http://www.sap-img.com/abap-function.htm
    http://www.sapgenie.com/abap/code/abap19.htm
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.planetsap.com/Tips_and_Tricks.htm
    http://help.sap.com/saphelp_40b/helpdata/ru/d6/0dc169494511d182b70000e829fbfe/applet.htm
    http://www.henrikfrank.dk/abapexamples/SapScript/symbols.htm
    http://www.henrikfrank.dk/abapexamples/index.html
    http://sap.ittoolbox.com/documents/document.asp?i=752
    http://members.aol.com/_ht_a/skarkada/sap/
    http://sappoint.com/abap/
    http://members.tripod.com/abap4/SAP_Functions.html
    http://members.ozemail.com.au/~anmari/sap/index.html
    http://www.planetsap.com/Userexit_List.htm
    http://www.planetsap.com/Tips_and_Tricks.htm
    http://www.kabai.com/abaps/q.htm
    http://www.planetsap.com/Userexit_List.htm
    http://help.sap.com/saphelp_bw21c/helpdata/en/c4/3a8090505211d189550000e829fbbd/frameset.htm
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/saphelp_45b/helpdata/en/65/897415dc4ad111950d0060b03c6b76/content.htm
    http://www.sap-basis-abap.com/index.htm
    http://help.sap.com/saphelp_40b/helpdata/en/fc/eb2c46358411d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_46c/helpdata/en/aa/aeb23789e95378e10000009b38f8cf/frameset.htm
    http://www.geocities.com/ResearchTriangle/1635/system.html
    http://www.sapdesignguild.org/resources/MiniSG/3_Managing/3_Functions_Table_Control.htm
    http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm
    http://www.sapfans.com/sapfans/repos/saprep.htm
    http://www.planetsap.com/howdo_a.htm
    http://help.sap.com/saphelp_util464/helpdata/en/69/c2516e4ba111d189750000e8322d00/content.htm
    http://www.sapgenie.com/abap/smartforms_detail.htm
    http://www.sap-img.com/abap.htm
    http://help.sap.com/saphelp_46c/helpdata/en/fc/eb2d67358411d1829f0000e829fbfe/content.htm
    http://www.geocities.com/victorav15/sapr3/abap.html
    http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm
    http://abap4.tripod.com/Other_Useful_Tips.html
    http://help.sap.com/saphelp_45b/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm
    http://www.sap-basis-abap.com/sapmm.htm
    http://sap.ittoolbox.com/nav/t.asp?t=303&p=448&h1=303&h2=322&h3=448
    http://sapfans.com/
    http://cma.zdnet.com/book/abap/ch03/ch03.htm
    http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm
    http://sappoint.com/abap/
    http://www.henrikfrank.dk/abapuk.html
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://www.sapgenie.com/abap/index.htm
    http://www.sap-img.com/abap.htm
    http://www.sapdevelopment.co.uk/tips/tipshome.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://sap.ittoolbox.com/nav/t.asp?t=322&p=322&h1=322
    http://sap.ittoolbox.com/nav/t.asp?t=448&p=448&h1=448
    http://www.thespot4sap.com/
    http://www.kabai.com/abaps/q.htm
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.sapgenie.com/abap/tips_and_tricks.htm
    http://www.sapassist.com/code/d.asp?whichpage=1&pagesize=10&i=10&a=c&o=&t=&q=&qt=
    For FAQ
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.sapgenie.com/faq/abap.htm
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    http://www.sapgenie.com/abap/bapi/example.htm
    Web log for receive email and processing it through ABAP
    /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher
    For Logical database
    http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Useful link to websites
    http://www.hernangn.com.ar/sap.htm
    Useful for background
    http://www.sappoint.com/basis/bckprsng.pdf
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/08703713bf277ee10000009b38f8cf/frameset.htm
    http://publib.boulder.ibm.com/infocenter/wbihelp/index.jsp?topic=/com.ibm.wbix_adapters.doc/doc/mysap4/sap4x41.htm
    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    For posting web log,
    /people/sap.user72/blog/2005/06/28/sdn-weblogs-making-it-easier
    Dynamic Internal table -web log in sdn
    /people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table
    ALV
    http://www.geocities.com/mpioud/Abap_programs.html
    Mail
    http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
    http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    BOM Explosion
    /people/prakash.singh4/blog/2005/05/15/explode-boms-in-enterprise-portal-using-htmlb-tree--part-1-abap
    BOM
    http://help.sap.com/saphelp_erp2005/helpdata/en/ea/e9b7234c7211d189520000e829fbbd/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/d1/2e4114a61711d2b423006094b9d648/frameset.htm
    http://www.sap-img.com/sap-sd/sales-bom-implementation.htm
    http://www.sap-basis-abap.com/sappp007.htm
    OLE
    http://www.sapgenie.com/abap/ole.htm
    http://help.sap.com/saphelp_46c/helpdata/en/59/ae3f2e488f11d189490000e829fbbd/frameset.htm
    ALVGRID with refresh
    http://www.geocities.com/mpioud/Z_DEMO_ALV_REFRESH_BUTTON.html
    For language setting and decimal separator
    /people/horst.keller/blog/2004/11/16/abap-geek-7-150-babylonian-confusion
    Oracle queries
    http://sqlzoo.net/
    To format SQL
    http://www.sqlinform.com/
    SCOT settings
    http://www.sap-img.com/basis/basis-faq.htm
    Status Icon [ALV,Table Control,Tab Strip]
    http://www.sapdesignguild.org/resources/MiniSG-old/from_develop/norm_status_icons.htm#positioning_4
    ALV Group Heading
    http://www.sap-img.com/fu037.htm
    For multiMedia
    /people/thomas.jung3/blog/2005/05/11/using-classic-activex-controls-in-the-abap-control-framework
    Uploading LOGO in SAP
    http://www.sap-img.com/ts001.htm
    LSMW
    http://www.sap-img.com/sap-data-migration.htm
    http://www.sapgenie.com/saptech/lsmw.htm
    http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf
    http://www.sap.info/public/INT/int/glossary/int/glossaryletter/Word-17643ed1d6d658821_glossary/L#Word-17643ed1d6d658821_glossary
    http://www.consolut.de/saphelp/sap_online_help.html
    http://www.sap-img.com/
    http://www.sappoint.com/
    http://www.sapdevelopment.co.uk/
    http://www.allsaplinks.com/idoc_search.html
    Best Regards,
    Thangesh

  • Will Infoset Query work for Function Module

    HI Can someone let me know will a Infoset wuery works for Function module or not. I have 3 tables which i need to extract on, i am building a Infoset Query on 2 tables and using this in my Function Module to join on 3rd table. I have some conditions on 3rd tbale which i need to pull only those records.
    When ever i check the syntax it always gives me a message
    The type "ZUSERLOGINQRY" is unknown. ( This is my Infoset query name).
    Can any one help me on this.
    Thanks,
    Kris.

    HI Pat thanks for responding i havent done this earlier so i am not sure how to declare une code under Infoset Query ---> Extras. I am getting some duplicates in Infoset Query, can you let me know how to clear all those duplicates...
    Appreciate you help.
    Kris.

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

  • What are  the input parameters for Function Module

    Dear Experts,
    I want to generate a Sales Tax returns report,those fields are not available in my existing Datasources.
    For that i want to write a Generic Datasource with Function Module.
    audat
    bukrs
    vkorg
    vtweg
    spart
    aurat
    auart
    netwr
    mwsbp
    kschl zedp(consition type)
    kschl zvat(condition type)
    ksch   zcst(condition type)
    matkl     material group
    Here what are the Input parameters for Function Module.
    Thanks in Advance.
    Srinivasan.

    Srinivasan-
    For creating a Generic extractor based on a FM, you first of all need to know what is going to be your structure.. i.e. what all fields you need to pull from what all tables. A functional consultant may help you identify the exact DB tables.
    Once you know them, hand over the requirement and the pdf mentioned by Krishna to the ABAP guy, he would be able to take this up further.
    Also decide 1st whether you would be using a full load or delta. There is a slight difference in the way they are built.
    Let me know how it goes.
    -Bhushan.

  • 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

  • Best practice for function module development

    When designing a function module, what is the best practice. Should we develop it so that most of the extraction is done within the function module, or should we develop it such that prior to calling the function module the extraction should be done in the main calling program and the function module would have a huge interface of many importing parameters?
    For e.g. lets say for some business logic I need MATNR MTART MEINS BSTME and so on. Now by knowing the matnr I can get all the other fields. Should I create a function module with just matnr as importing parameter and do the Select on MARA in the FM or should I create the function module with all the fields as required importing parameters. What would be a best practise in such a scenario.
    Thank you.

    Now we are getting into the ecapsulation part of function groups.  Did you know that when you run your program, and it executes a FM, that ALL function modules in the function group are loaded into memory?  And that global data inside the function group can be shared across functino module calls?  This is how you would relieve your concern.  Lets say that all of your function modules belong to the same group,  And all of them need to use a record from MARA, and you don't want to do a SELECT in all of these functions.  Basically, you just create a global structure variable in the TOP include of the function group.  In the first FM, you simply do the select and put that data into the global variable, then during the next FM call(the FM must be in the same group) you can get the data from the global variable directly without having to go to the database.
    Regards,
    Rich Heilman

  • Alternative for  Function module 'F4_CHOOSE_MCID' in ECC 5.0?

    Hi,
    Can any one tell me the Alternative for  Function module <b>'F4_CHOOSE_MCID'</b> in ECC 5.0?
    Helpful answers will be rewarded.
    Thanks
    Kiran

    Hi,
    Please use this FM UMC_NOTIF_SEND_EMAIL to send an email in ECC 5.0.
    Regards,
    Ferry Lianto

  • Looking for function module to update User data

    Hi All,
    I'm looking for function module/base table to update data into User (User-Specific Data) data. You can notice it under PRTE t.code. Thank you.
    Regards
    Kishore

    To Read: HRTRV_IF_GET_TRIP
    To Modify: HRTRV_IF_MODIFY_TRIP
    Please be aware that these FMs are not released for customers, i.e. you won't get any support for them.
    EDIT: Since you are dealing with Structure USER/PTK99, maybe the document I created is of interest to you: Adding fields in Travel WDA Applications
    Cheers, Lukas
    Message was edited by: Lukas Weigelt

  • 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

  • Creating BW Function module to extract R3 Function module data.

    Could you tell me how to create a BW Function Module to Extract data from  R/3 Function module?.
    Also, the BW function module needs to pass a date/time filter to R/3 function module basis which the R/3 function module passes the date/time restricted data to BW function module.
    Thanks,
    Gautam

    You will have to create a function module in R/3 and then call the same in BW using the RFC call function option.
    Please do not raise separate threads for each question - you have asked the same question in another post of yours..
    bw extraction using function module
    http://tinyurl.com/lwhtk8
    this will give you an idea on how you can achieve this.

Maybe you are looking for

  • Jumping gun? Netgear N300 Wireless ADSL2+ modem/rout​er

    Hi, I'm probably jumping the gun here but I've got a Verizon Actiontec GT704WG modem/router and have been disapointed in the last few months by spotty wireless and internet connectivity when nothing else in my house has changed.  In addition, I need

  • How to make VIs as "Fp Read (Float Array -IO)" available to take a measurement?

    I can't succeed in launching a fieldpoint VI cause I don't find the VI FP Read (Float Array -IO).vi. If I have well understood these VIs (like FP Open and other) are made available when installing the Field Point Server. In my case nothing occurs. Wh

  • ICloud display name

    I have just set up a new log in account on the mac for my daughter with her iCloud account. When logging into her iCloud it is displaying my name and not hers for some reason.  Is there a way of changing the display name it is the one in the top righ

  • Firefox beta on my tab does not have the options button, how do I delete unwanted password

    I have a Samsung tab 7 2 I have loaded firefox beta. but am unable to remove an unwanted password that keeps coming up when signing in to my emails.

  • Messages keeps crashing.

    Hello, My friend and I both have iPhone 4S. We have noticed a few times that the Messages app keeps crashing. For example, last night, we tried to exchange photos using the shortcut in Messages. The phone returned itself to the Home Screen but the me