Calling a normal function module in SAP system .

Hi Experts,
    I have the requirment like --> 
I want to call a normal function module in SAP system which will perform a data look up. The module will be called by SAP-XI and the response will come to SAP-XI . That means i want to make a synchronous call to a Normal function module (not Remote module) which can perform the data look up and send me the result.
Can anyone help me in this.
Thanks

Hi Ajay,
Lookup’s in XI made simpler -
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
How to check JDBC SQL Query Syntax and verify the query results inside a
User Defined Function of the Lookup API -
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
/people/prasad.illapani/blog/2006/10/25/how-to-check-jdbc-sql-query-syntax-and-verify-the-query-results-inside-a-user-defined-function-of-the-lookup-api
Lookups - /people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
Lookups - /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
http://help.sap.com/saphelp_nw04/helpdata/en/cf/406642ea59c753e10000000a1550b0/content.htm
/people/sap.user72/blog/2005/12/06/optimizing-lookups-in-xi
Thanks,
Satya Kumar

Similar Messages

  • Transformation: Need for calling a custom function module on source system

    Hi Gurus,
    I need to use a custom FM residing on source system within the transformation to determine the type (e.g. posting type) of a document item. The logic is quite complex with many exceptions (many if statements) and 2 customizing & few transparent tables are in use as well in the FM.
    From my point of view, there are few options for achieving the outcome:
    1. Copy the FM logic 1:1 in transformation
    2. Transport the FM from ERP to BW system
    3. Source system delivers the info (e.g. with an extra field "posting_type")
    4. Access the FM directly via RFC/BAPI
    However, there are pros and cons for each of the alternatives:
    *Option 1*
    pros:
    cons: consistency problem, need for importing customizing tables & source tables, high maintenance effort
    *Option 2*
    pros: better consistency compared to Option 1
    cons: need for importing tables, administrative efforts
    *Option 3*
    pros: no logic is needed at BW side, no transformations means no impact on performance, high consistency, no administrative effort
    cons: structure in source system has to be changed, impact on historical records
    *Option 4*
    pros: best consistency (better than Option 3 as FM might change), no administrative effort
    cons: impact on performance during transformation
    Could you please verify my assumptions and give suggestions on solving the problem?
    Thanks a lot!
    Regards,
    Meng

    Hi Joon,
    According to me.
    If Historical data amount is so high, historical data is available in BW(at PSA level or acquisition layer or corporate memory layer) and headache to load history data(because of overload on ECC due to huge amount of data) from ECC then I will suggest combination of 3 and 4 steps.
    If fetching history data from ECC is not headache for you then go for step 3.
    Step 3 is most common approach in BW, which is easy for implementation and support.
    Regards,
    Ashish

  • Can i call a function module of SAP?

    Hi, i have a question... Can i call a function module of SAP... I need print a document from a device, can i call the function module of SAP in order that me it prints it?
    Thanks,

    Hi Victor,
    you can use the GenericSync Example of the MDK. This calls the Module to verify the user directly. Generic Sync is exactly for that purpose: call a BADI directly and no usage of SyncBO. Be aware, that you - out of the box- sync your app data as well at that moment, because a sync runs both - generic and smartsync. Even worse: even when you have nothing to sync in Generic Sync - so nothing to print - it will call the function module for generic sync as long as it is registered.
    Well,  anyway, this is the way to call a function module separate.
    If it works with you rparticular print module? I have no idea, but if this is a normal function module - well, it should be ok.
    Hope this helps.
    Regards,
    Oliver

  • Is it possible to call Normal function Module from WD4A , Not RFCs

    Is it possible to call Normal function Module(FM) from WebDynPro for ABAP , Not RFCs

    There is no difference, unless you are specifically calling the RFC to connect to another system. If so, then you need to add the DESTINATION keyword to the function call and specify the destination name. This name must be defined in SM59.  But, if you are not going to another system, you can call the RFC the same way you call the regular function module.
    REgards,
    Rich Heilman

  • How to develope custom function modules in SAP R/3 system to maintain c...

    How to develope custom function modules in SAP R/3 system to maintain cross
    referencing tables for sales order number.

    Hi Raja,
    Steps to crate FM..
    Follow these steps..
    Go to the T: code SE37
    First You Create Function Group
    On That u specify
    Function Group Name..............
    Short Text..............................
    save...
    Go to SE 37
    Specify the Function Module Name: Eg: Z_Bapi_Materialmaster
    Short Text.......
    Save...
    Next Go to Attributes..
    Select Radio button : Remote enabled model
    Go to Parameters..
    Click Import...
    Give Parameter Type Associate type S.t
    next Click Export...
    Give Parameter Type Associate type S.t
    Next Click Tables Button..
    Specify tables..
    Next click source code button..
    Write Source code here..
    Eg : Select statements Etc..
    Finally we should be select the Radio button Enable remorely
    https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=39728
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/bapi%2bstep%2bby%2bstep
    Hope this information is useful to you..
    Reward points if it is usefulll....
    Thanks ,
    Satya Kumar..

  • Can we call function modules in SAP query or ADHOC query

    Hi ,
    Can we call afunction moudule in sap query or ADHOC query ?If yes How
    An early responce is greatly appreciated
    Thanks and best regards
    Rajeev Chhabra

    Hello Rajeev Chhabra,
       Yes; you can call function module in SAP Query. In InfoSet definition (SQ02), you can create additional field. In this field definition, you can add code snippet where you can function module.  
    However, this is not possible in Quick Viewer (SQVI) Query.
    Thanks,
    Venu

  • Can we call function module in sap script

    hi
    can we call function module in sap script
    i want to use function module HR_TMW_GET_EMPLOYEE_NAME in sapscript
    to get Empname by using personal no
    pernr no is coming from bseg-pernr table
    so how i can use it .
    please help me
    thanks in advanced.

    hi,
    You can use like this:
    PERFORM FUNCTION_MODULE IN PROGRAM SUBROUTINE_POOL
    USING &FIELD1&
    USING &FIELD2&
    CHANGING &FIELD3&
    ENDPERFORM.
    where function_module is the func. module name defined in program SUBROUTINE_POOL , field1 n field2 are the fields to be passed, and field3 is the value which you want to display...
    You have to read field1 & field2 in the pool, process them & get the value of field to be output.
    Reward helpful answers.
    Regards,
    SIddhesh Sanghvi.

  • How to Developed user defined functions to call function modules in SAP R/3

    •     how to Develope user defined functions to call function modules in SAP R/3 system

    Hello Raja,
    Go through this V.imp Link...
    http://download.oracle.com/docs/cd/B10464_05/integrate.904/b10408/rfc.htm
    Steps to crate FM..
    Follow these steps..
    Go to the T: code SE37
    First You Create Function Group
    On That u specify
    Function Group Name..............
    Short Text..............................
    save...
    Go to SE 37
    Specify the Function Module Name: Eg: Z_Bapi_Materialmaster
    Short Text.......
    Save...
    Next Go to Attributes..
    Select Radio button : Remote enabled model
    Go to Parameters..
    Click Import...
    Give Parameter Type Associate type S.t
    next Click Export...
    Give Parameter Type Associate type S.t
    Next Click Tables Button..
    Specify tables..
    Next click source code button..
    Write Source code here..
    Eg : Select statements Etc..
    Finally we should be select the Radio button Enable remorely
    https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=39728
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/bapi%2bstep%2bby%2bstep
    Re: User Defined Functions Tutorials
    Hope this information is useful to you..
    Thanks ,
    Satya Kumar..

  • What is the difference between the normal function module and bapi function

    hi,
    what is the difference between the normal function module and bapi function module.

    Hi
    BAPI stands for Business API(Application Program Interface).
    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    Regards
    Anji

  • How to make a normal Function Module remote able function module

    Hi guys,
    i am a beginner in abap programming. I have made a programm in Se80 which shows all the nodes of the active hierarchies (5 stk.)
    in a ALV grid. Therefore i am getting the active hierarchies from table "rshiedir" and use the normal function module "RSSH_HIERARCHY_READ" to display the nodes of the hierarchie. The problem is the hierarchies do have a different techical name in the systems (development-acceptance-productive) but the descriptive nbame is the same in all systems. Because of the difference of the technical names I can use this programm in just one system. But the hierarchy content should be comparable and be displayed in all three systems. Therefore i would like to create a remoteable function module which covers the normal one. Can i do this and how can i create a remoteable function module and use it? 
    If not do you know any remotable functgion module which gives back all the nodes from an active hierarchy in table "RShiedir".
    Thanks and kind regards,
    Murat

    Hello,
    Simple, create a wrapper RFC (similar to 'RSSH_HIERARCHY_READ' ) & call the normal FM 'RSSH_HIERARCHY_READ' inside the wrapper.
    Something like this:
    FUNCTION z_rssh_hierarchy_read.
    *"*"Global Interface:
    *"  IMPORTING
    *"     VALUE(I_RSHIEDIRKEY) TYPE  RSHI_S_RSHIEDIRKEY OPTIONAL
    *"     VALUE(I_RSHIEDIRLOG) TYPE  RSHI_S_RSHIEDIRLOG OPTIONAL
    *"     VALUE(I_DATE) TYPE  RSHI_DATE DEFAULT SY-DATUM
    *"  EXPORTING
    *"     REFERENCE(E_RSHIEDIR) TYPE  RSHI_S_HIEDIR
    *"     REFERENCE(E_T_RSNODES) TYPE  RSHI_T_HIENODE
    *"     REFERENCE(E_TH_RSINTERVAL) TYPE  RSHI_TH_INTERVAL
    *"     REFERENCE(E_DUPLICATE_LEAFS) TYPE  RS_BOOL
    *"     REFERENCE(E_T_RSNODES_LNK) TYPE  RSHI_T_HIENODE
    *"  EXCEPTIONS
    *"      INVALID_HIERARCHY
    *"      NAME_ERROR
    *"      IOBJ_NOT_FOUND
    " Don't forget to add TYPE-POOLS rshi to the FuGr. TOP include
      CALL FUNCTION 'RSSH_HIERARCHY_READ'
        EXPORTING
          i_rshiedirkey     = i_rshiedirkey
          i_rshiedirlog     = i_rshiedirlog
          i_date            = i_date
        IMPORTING
          e_rshiedir        = e_rshiedir
          e_t_rsnodes       = e_t_rsnodes
          e_th_rsinterval   = e_th_rsinterval
          e_duplicate_leafs = e_duplicate_leafs
          e_t_rsnodes_lnk   = e_t_rsnodes_lnk
        EXCEPTIONS
          invalid_hierarchy = 1
          name_error        = 2
          iobj_not_found    = 3
          OTHERS            = 4.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Here Z_RSSH_HIERARCHY_READ is the wrapper RFC. Hope you get the point.
    BR,
    Suhas

  • Calling a RFC Function Module

    Hello Guys,
    I have a question regarding calling a RFC function module.
    In BW - BI 7.0 I call a RFC function module:
    (The ABAP program in BW-BI 7.0 is below)
      CALL FUNCTION ''ZTESTFUNCTIONMODULE'  " Function module in ECC
         DESTINATION 'DECCLNT110'  " ECC system
        TABLES
          it_gl_item   = it_gl
          it_errlog_gl = it_errlog_gl.
    The 'ZTESTFUNCTIONMODULE'   is RFC enabled in the ECC system.
    The purpose is we retarct the data from BW to ECC.
    When I run the function module it always asks for the user id and password.
    The SAP logon screen appears and it asks for the user id and password.
    The destination is maintained in the SM59 transaction and also the user is maintained there. I think it should login automatically into remote system and return the tables. is it correct. How to skip the logon screen.
    Do I have to pass the user id and password in the function module. I think it should take the user id from the SM59 destination. Is it correct.
    Please advise. As always thanks for your help guys.

    Hi Senthil,
    I think you answered your query in your question itself
    The user ID and password need to be maintained in RFC destination in SM59.
    Go to SM59 and then click on test connection..if it does not ask for ID and passwoed that means correct ID and password is maintained in SM59 otherwise maintain it.
    Regards,
    Atish

  • Debuggin a Call to Remote Function Module

    Hi
    I have a scenario where i have a Remote Function Module in r3 which is being called synchronously by an external java application. The FM has a lot of input and output parameters and many tables.  The output returned by the FM is not as expected.
    Can anyone tell me how debug a Remote Function Module when a call has been made from an external application.
    I am not able to get the test data sent by the external application . So when the external application gives a call to this Remote FM and if it is possibele to debug it would be great.
    regards
    Nilesh Taunk.

    Hi Nilesh,
    1) Login to SAP with the same ID with which you will calling the RFC function module from the outside system.
    2) Goto transaction - se37/se38
    3) Goto Utilities => Settings.
    4) Select the ABAP Editor Tab.
    5) Click on the Debugging tab.
    6) Tick the Actv. button and give the user name with which you will be debugging the code. In this case the logged in user id.
    7) Press Enter.
    8) Now put an external break point inside the Function Module.
    9) Load your external application (from where you want to debug the FM) once again.
    The execution will stop in the FM.
    Hope it helps..
    Lokesh
    PS: This was a simple question, but I guess the reason no one has answered your question is due to the fact that you havent rewarded points to members helping you. Also remember to close your post once it has been answered.

  • Calling an ABAP function module

    Hi friends,
    I am developing an application in EP6 SP2 using JSPDynPage from which, want to call an ABAP function module that returns table and show the values from this table in this application.
    I went thru various blogs and APIs. I am confused between SAP JCO, JCO client service and connector framework. Do u have any documentation on how to connect to R3 systems and call a function module, retrieve results etc.
    Regards,
    Nilz

    JCo is the point to start. This gives you low level access to all rfc functions. Everything else (accept BSP and Web dynpro) are just layers of encapsulation around the low level JCo function.
    The steps are always like this:
    call the sap system for rfc login
    prepare data areas and call in java
    call the rfc in the R/3 system
    handle exceptions
    logoff and free ressource
    continue with data obtained in R/3
    There is a lot of material around jco. One book that is fairly ok is :
    SAP Interface Programming
    A comprehensive reference for RFC, BAPI, and JCo programming
    J. Meiners, W. Nüßer
    SAP PRESS ISBN 1-59229-034-5
    This helps you navigate through the wealth of information also at SDN

  • Using Function Module in SAP Script

    Dear Friends,
    how can i use function modules in sap scripts?. i want to use call function SPELL_AMOUNT in sap script?
    in text element using perform statement hw can i use?
    Regarding i search related articles but, i am not getting any solution.
    Plz help Me.
    Regards,
    K.S.Kannan

    Dear Kanan,
    You can do it in two ways:
    Way1
    your Amount will be in some variable say VAR_AMT1 and want in words in field say VAR_SPELL.
    In your report program you can use the function module SPELL_AMOUNT and pass the  VAR_AMT1 to it and you will get the words in VAR_SPELL.
    So now in your sap script you can use the variable  VAR_SPELL to print the amount in words.
    we normally use this above method.
    WAY2
    You are inside Sap script and you can write the following code in the sap Script window.
    /: PERFORM AMT_TEXT IN PROGRAM ZF_REPORT USING &VAR_AMT1& CHANGING &VAR_SPELL&
    /: ENDPERFORM
    In the Tag Column when you press F4 you can see various symbols like
    /: =  ( / /= /( /: /* /E
    . Select
    In the program ZF_REPORT (any report) you should have the perform AMT_TEXT  where you should use the function module SPELL_AMOUNT to convert the amount into words.
    Hope its Clear.

  • Problem while calling an RFC Function Module in Background

    Hello,
    I have created a RFC function module for reading data from an external DB system. The FM calls an external RFC program (coded in C++ using RFC SDK), which delivers the required data. This external program is maintainged as an TCP RFC Connection in SM59.
    Further I have created a report, that calls the RFC function module to get the data from the external RFC programm.
    My problem is, when I call the report in foreground, everything works OK, the RFC connection works and data can be read from the external program.
    However, when I schedule the report to run in background as a job, the report is stating in the protocoll that there was a problem calling the defined RFC connection (although the connection is working properly at that time).
    More funny is, this particular problem with running in background occurs only in the productive system, in test and development system the report works correctly also while running as a job in background.
    Can you suggest the solution to this problem? Could it be something with authorisations or server settings?
    I will be on holiday for the next 6 weeks, so take your time to answer .
    Regards,
    Dusan.
    Edited by: Julius Bussche on Jan 22, 2009 7:19 PM
    Please read the forum rules about u r g e n t ...

    This is an external RFC server program, not a remote enabled ABAP RFC function module as the others seem to be assuming, right?
    Is it possible that your DEV and QAS systems only have one application server, but the PROD has many and dedicated one(s) for processing low priority background jobs?
    It might be that the target server of your TCP connection is not this BTC instance, and your RFC server is returning the data "locally" - so, into nirvana...
    Just guessing, but might be worth checking.
    Cheers,
    Julius

Maybe you are looking for

  • Upgraded Exchange to CU 7, now users cannot open emails in a separate window in webmail (OWA).

    Hello, Strange issue. I upgraded our Exchange 2013 to CU 7 and now users are reporting they cannot open emails in a separate window in OWA. Regardless of browser, browser version even regardless of another computer or mac. Chrome, Firefox, IE, Safari

  • Complation?

    I have just imported Frank Sinatra "The Rat Pack". Upon importation I discovered that the songs are scattered all over Itunes, based upon the singers name. For example some are in Frank Sinatra, Dean Martin and Sammy Davis. How do I get all of these

  • Sending video clips to my phone, how?

    Can anybody help me? i want to know how i can send video clips from my pc to my nokia n80 via usb cable. Nokia pc suite doesnt seem to support this and i am confused as to what to do?

  • Error must declare the scalar variable

    por que me marca ese error una consulta? DECLARE  @feci AS datetime DECLARE @fecf AS datetime SET @FECI=(SELECT DISTINCT(T0.DOCDATE) FROM ORTT T0 WHERE T0.DOCDATE='[%0]') SET @FECF=(SELECT DISTINCT(T0.DOCDATE) FROM ORTT T0 WHERE T0.DOCDATE='[%1]') EX

  • I have had an ipod stolen how do i cancel the account?

    I need to cancel the account so whoever has stolen it cant access anything- how do I do this? thanks