Calling FM in SAP

I have a requirement wherein i need to pass a user input value to a FM created in ABAP.
Based on that i need to display the results or display a message if no results found.
Can any of the forum member supply me with the code/documentation which can help me achieve this?
I have already gone thru the basic webdnpro tutortial for calling rfc's.
Thanks in advance

Stride,
This online demo explains very clearly what you are looking for :
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b017bd92-320d-2b10-81ae-ac921eff585d
Some More:
Already SDN friends provided some information , jsut i am trying to share some info and it might be helpful.
Step1: Once you know which function module your going to use , make sure that Funcation module is working in expected way. Ex: what are the input parameters you suppose to give , is returning the expected results are not? if there is no results found in the backend table what kind of error message it should throw?
These things you can perform while logging on to the SAP Backend System and use the TCODE : SE37 , enter the FM name and display. Once you open the required function module provide the expected input parameters and Execute it.
Now we expected to see the results if the data is avaialable if not you will see the appropriate error message or some other message based on the program developed.
Step2: From the NWDS Import the model while importing the model you required to provide the appropriate backend system details to call the RFC.
Step 3: Say example , when the user selects Results button on view then it should return the results in a table. The Results Button event calls the appropriate methos from the controller.
in View controller under Results action event you call the methos from the controller as below:
public void onActionResults(com.sap.xxx.webdynpro.progmodel.api.IWDCustomEvent wdEvent){
    //@@begin onActionResults(ServerEvent)
    wdThis.wdGetCOMPNAMEController().getRsults();
    //@@end
Step 4: Now in the component controller create a method called getresults() and execute your function module as below shown:
public void getResults{
//Initializing The RFC model class
Zs_results_volume_Input input = new Zs_results_volume_Input();
//if the RFC expect any manadatory parameters you have to set them before excuting the function module, normally most of the rfc'S expect input
parameters as Userid, Role, laungauge as input parameters.
// set user id which is retrived from the portal frame work in the runtime
input.setUser(WDClientUser.getCurrentUser().getSAPUser().getUserAccounts()[0].getLogonUid().toUpperCase());
//if you want to send launguage also as a mandatory parameter you can
input.setLanguage("EN");
//after settting the values bind the input object
wdContext.nodeAllowedValues().bind(input);
//if RFC execution is done from some different method
wdThis.executeZs_Results_Volume();
//implementation of the executeZs_Results_Volume() method:
public void executeZs_Results_Volume()
    //@@begin executeZs_Results_Volume()
     try
               // Calls remote function module Zs_results_volume_Input
               wdContext.currentZs_results_Volume_InputElement().modelObject().execute();
               // Synchronise the data in the context with the data in the model
               wdContext.nodeOuput_Results_Vol().invalidate();
          catch (Exception ex)
               // If an exception is thrown, then the stack trace will be printed
               wdComponentAPI.getMessageManager().reportException("Error while executing RFC: Zs_results_volume_Input Details : " + ex.getMessage(), true);
   //@@end
For mor help:
Creating a Web Dynpro Application Accessing ABAP Functions
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/355b9c90-0201-0010-d2a8-89fece426526
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b017bd92-320d-2b10-81ae-ac921eff585d
http://help.sap.com/saphelp_nw04s/helpdata/en/15/0d4f21c17c8044af4868130e9fea07/frameset.htm
tps://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e07753b9-fa0c-2a10-64a8-c6754c45396e

Similar Messages

  • Calling a Standard SAP transaction VA03 from another web dynpro application

    Hi All,
    I have a requirement wherein I need to call the standard SAP transaction VA03 whenever a sales order is selected in some other we dynpro application so that the sales order gets displayed.
    No regarding usage of OBN for the above functionality I have certain queries:
    1. In order to call VA03 do I need to create a transactional iview for it or is there any direct method.Also how to pass this sales order number as parameter to the T.Code.
    2. Can we use standard business object BUS2032 for OBN or a new Business object is created.What exactly is the purpose of these standard business objects in portal and when should they be used.
    Thanks in advance
    Aman Gupta

    Hi Aman - Do you have a portal team in your project or you have to create the IVIEWS yourself?
    I do have a portal team and I dont know how they create the IVIEWs but for example, I will go to my portal team and I will ask them to create an IVIEW for TCODE VA03, they will created and they will tell me the input parameters they entered for the IVIEW so I can call OBN and display in webdynpro.
    SAP in SRM has webdynpro e.g. for BUS2121 and they have an IVIEW already implemented in the portal context pointing to the webdynpro of BUS2121 so we can used the IVIEW by calling OBN and passing the parameters; in my case the object_type will be 'shc' and the operation will be 'display' and the paremeters itab will be the GUID of my shopping cart, that way the OBN can understand which Shopping cart open and in which operation mode.
    I also did something like your requirement, I need it to display a specific case in Records Management but SAP has a standard IVIEW for records management 'RMREGEDIT' that didn't work for my requirement so I went to SE38 created a program that displayed the case based on GUID and I created a TCODE of my custom program. Portal team created a custom IVIEW of my custom TCODE and they told me the input parameters to call the TCODE in OBN and I pass in the itab parameter the GUID of the case using the FM that I post before.
    The action to call the OBN is in the event handler ON_CLICK of my ALV and the action is getting trigger when the user actually clicks a HYPERLINK in the ALV.
    Hope this helps you!
    Please feel free to ask me more details if you need.
    Jason PV

  • Need Information regarding Service Call creation in SAP R/3

    Hello,
      I need the Transaction code or BAPI to create a service call in sap. Please provide the database table name for the service calls.
    We want to develop  service call management in our server.So please send me the Business data model for service call management in SAP.(All related objects to the service call and their data models.)
    Regards,
    Kiran.

    Hi
    Invoice list is basically SD configuration.
    <b>Invoice List</b>
    <b>Purpose</b>
    The invoice list lets you create, at specified time intervals or on specific dates, a list of billing documents (invoices, credit and debit memos) to send to a particular payer.
    The billing documents in the invoice list can be single or collective documents (collective invoices combine items from more than one delivery).
    The standard version of the SAP R/3 System includes two types of invoice lists:
    1.for invoices and debit memos
    2.for credit memos
    If you wish, you can process invoices, debit memos, and credit memos at the same time. The system automatically creates a separate invoice list for credit memos.
    A payer may be the head office of a buying group, which pays all the invoices for goods that are shipped to individual members. The group payer takes responsibility for paying the invoice lists and then collecting payment from the individual members. In return for these services, the group payer usually earns a factoring or del credere discount.
    Depending on the tax structure of the payer's country, the payer may be liable to pay taxes on factoring discounts that he earns. In Germany, for example, factoring discounts are taxed at the standard rate of 15%. During invoice list processing, you can reimburse the payer in advance for this tax liability by creating special condition records
    Regards
    Ramakrishna

  • Is it possible to call std. SAP transaction from abap wd

    Is it possible to call std. SAP transaction from abap wd so that transaction appears and work as in gui? Without portal ofcourse.
    I know that using webgui and/or ITS it is possible so then it must be somehow possible....

    Hi,
    see Web Dynpro ABAP call transaction in the foreground and just carry out a simple search in this forum, then you'll find several threads with similar questions...
    Regards, Heidi

  • How to call a Standard SAP Program in Zprogram.

    Hi,
    how to call a SAP Standard program in SAP Program?
    Do we have to use any funtion module and pass paramters?
    I want to call a Standard SAP prg in to my prgram? can anyone explain me or give the piece of code to call standard prg.
    Thanks & Regards

    Again, ABAP related questions should be asked in the ABAP forum.
    To answer you question,  if the standard program is a report program, you can use the SUBMIT statement and pass parameters using the WITH Extention.
    Submit <report>
          with p_fld = 'X'
              and return.
    Please make sure to award points for helpful answers and mark your posts as solved when solved completely.  Thanks.
    Regards,
    RIch Heilman

  • Call  an internal SAP report

    Hello everyone, I would help you if you can :).
    I have an add-ons that adds buttons to the "Sale".
    Now I would like to add a button to create a PDF invoice.
    I  have  call  an internal SAP report , with code 'INV20001' in table [RDOC]
    Who can help me?
    Thanks to all for the info that you give me.
    PS sorry for my bad English
    Edited by: Ste Righetti on Mar 6, 2012 9:52 AM

    Hi,
    Ask our friends at the [Reports Forum|http://forums.oracle.com/forums/forum.jspa?forumID=84]
    You might want to fix your keyboard first, because too much caps, exclamation marks and question marks make the chance some expert will respond much smaller.

  • HOw can we Call Subroutine in Sap Script?

    HOw can we Call Subroutine in Sap Script?

    Hi
    *You have to call sub routine from script like this.
    /:   PERFORM DATE_FORMAT IN PROGRAM &SY-REPID&
    /:   USING &RM06P-LFDAT&
    /:   USING &PEKKO-LFDAT&
    /:   CHANGING &VALUE_OLD&
    /:   CHANGING &VALUE_NEW&
    /:   ENDPERFORM
    *In print program write code.
    FORM date_format TABLES in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
      DATA : date TYPE char10.
      DATA : date2 TYPE char10.
      DATA : l_dmbtr TYPE char10.
      READ TABLE in_tab WITH KEY 'RM06P-LFDAT'.
      IF sy-subrc = 0.
        "Your code goes here
        CLEAR l_dmbtr.
      ENDIF.
      READ TABLE in_tab WITH KEY 'PEKKO-LFDAT'.
      IF sy-subrc = 0.
        l_dmbtr = in_tab-value.
        "Your code goes here
        CLEAR l_dmbtr.
      ENDIF.
      READ TABLE out_tab WITH KEY 'VALUE_NEW'.
        IF sy-subrc EQ 0.
            out_tab-value = date2.
            MODIFY out_tab INDEX sy-tabix.
        ENDIF.
      READ TABLE out_tab WITH KEY 'VALUE_OLD'.
        IF sy-subrc = 0.
            out_tab-value = l_dmbtr.
            MODIFY out_tab INDEX sy-tabix.
        ENDIF.
    ENDFORM.            "DATE_FORMAT

  • Calling webservice in SAP XI from Servlet

    I have requirment of Calling webservice in SAP XI from Servlet.
    COuld you provide information of caling simple webservice from servlet

    Hello Venkat,
    Getting Started with Web Services
    Web Services Infrastructure
    Getting Started with Web Services [original link is broken]
    Thanks,
    Satya

  • Call widgets from SAP EP(WebDynpro)

    hi,
    Can anyone please tell me how to call widgets from SAP EP (WebDynpro).
    Eg. i have created a webdynpro project and i have a button called "SEE WEATHER FORECAST". When i click on it, i should get the widget opened.

    what does this have to do with XI?
    Regards,
    Robin

  • IS IT POSSIBLE TO CALL FUNCTION IN sap QUERY sq01

    IS IT POSSIBLE TO CALL FUNCTION IN sap QUERY sq01

    Use enhancement project SQUE0001 for background downloads of query data.  Use the 'Private File' option with the query execution.

  • Call subroutine in sap script

    how can i call subroutine in SAP Script?& where?

    hi,
    refer d links
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/calling%2ba%2bsub-routine%2bin%2bsap%2bscripts
    subroutine in script. REWARDED
    abput subroutines in scripts
    How to call a subroutine in a script ?
    How to call subroutine in a sap script

  • Can we call bapi from SAP or ABAP How? Pls Step by step

    Can we call bapi from SAP How? Pls Step by step
    thank you,
    Regards,
    Jagrut BharatKumar Shukla

    Hi,
    Do you mean you want to access BAPI in ABAP report?
    If yes, then YES we can call,
    1.Create a report -> In pattern write your BAPI name.
    2. It is like your FM , Read correspoding BAPI documentation
    3. Fill required parametes.
    4. Test run and if successful , final run it.
    And from Outside,
    You have to establish a connection and create a wrapper and access using avaialble APIs.
    Reward if useful!

  • JCo error when calling from webmethods sap adapter to SAP BAPI

    Hi,
          I am getting an error "[SAP.102.9000] JCo error: (104) RFC_ERROR_SYSTEM_FAILURE - connection closed without message (CM_NO_DATA_RECEIVED)"  when webmethods sap adapter is calling BAPI in SAP. The BAPI is working fine in SAP.
         Can anyone suggest me a possible solution.
      Thanks,
      Sarath.

    BAPI-step by step procedure
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all BAPI's
    http://www.planetsap.com/LIST_ALL_BAPIs.htm

  • Send data to ECC table through RFC Call function from SAP B1 via  b1if

    Hi,
    I have created scenario in B1if which triggers from SAP B1, now I have to send this data in to ECC table, so I have created scenario for that with inbound SAP B1, outbound void and in process RFC Call atom is there but I am not getting data in receiver and also how to write xml to send data in RFC function. Function for RFC has configured from ECC end and have access of that function.
    So please help me to send data to ECC table through RFC Call function from SAP B1 (9.0) via b1if
    Thanks

    Solved by my own.

  • How to call a standard sap transaction in workflow

    Dear All,
    I want to know how to call a standard sap transaction inside my workflow , please tell me how to get this done .
    Kind Regards,
    Anshu Kumar

    Hi,
    You can use the FM - ABAP4_CALL_TRANSACTION u2013 Initiates a transaction in a separate window
    inside the method in the BO.
    Implement that BO and the method in the Activity of the WF..!!
    Use the FM like this:-
    CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
      EXPORTING
        tcode                         = 'ZSCREEN_884' - T-Code
       SKIP_SCREEN                   = ' '
       MODE_VAL                      = 'A'
       UPDATE_VAL                    = 'A'
    EXCEPTIONS
       CALL_TRANSACTION_DENIED       = 1
       TCODE_INVALID                 = 2
       OTHERS                        = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    If you do not want to use the FM u can use this Statement:-
    call transaction 'ZSCREEN_884'. - T_CODE
    Check the following links:-
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/delegationandRedefiningmethodsofbusinessobject+BUS1001
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/workflow%252bscenario
    Let me know if you still face any issues..!!
    Regards,
    Kanika

  • Call a new SAP session within a subscreen area.

    Hi,
    I will really appreciate your help on this.
    How could I call a new SAP session (other transaction or whatever) within a sub screen area?
    Many thanks.

    Hi Lezarazo,
    http://help.sap.com/saphelp_46c/helpdata/en/73/69eba655bb11d189680000e829fbbd/content.htm
    If you need to have functionality where you can kick off a transaction in another window then do the followingu2026.
    To call the function:
    The Structure: ZSE_ITAB
    with FIELD  CHAR40 and VALUE CHAR40
    DATA: itab_fields type STANDARD TABLE OF ZSE_ITAB,
          wa_field    type ZSE_ITAB.       wa_field-field = 'BELNR'.
          wa_field-value = t_invoice.
          APPEND wa_field TO itab_fields.
          CALL FUNCTION 'Z_CALL_TRANSACTION_SESS'
            STARTING NEW TASK 'TA'
            EXPORTING
              tcode          = 'VF03'
              skip           = 'X'
            TABLES
              itab_data      = itab_fields
            EXCEPTIONS
              no_transaction = 1
              OTHERS         = 2.
    Function Module Defined: Must be a remotely enabled function module
    Its just the same procedure as of ordinary Function module, but in the Attributes Tab, under Processing Type you have to select Remote-Enabled Module instead of Normal Function Module.
    Example :
    FUNCTION z_call_transaction_sess.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(TCODE) TYPE  TCODE
    *"     VALUE(SKIP) TYPE  FLAG OPTIONAL
    *"  TABLES
    *"      ITAB_DATA STRUCTURE  ZSE_ITAB OPTIONAL
    *"  EXCEPTIONS
    *"      NO_TRANSACTION
    The additional info about calling transactions can be found in the following link
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9da935c111d1829f0000e829fbfe/content.htm
    or Lezarazo you can create your own zfunction module call that function module in your program using the CALL TRANSACTION Statement inside a Remote-Enabled Function Module and then using the STARTING NEW TASK addition while calling the Function Module.
    Hope this helps,
    Revert for further clarification.
    Thanks and Regards
    Srikanth.P

Maybe you are looking for

  • Hp officejet Pro 8100 Printer Tray

    I have an HP Officejet Pro 8100 printer. I removed the paper tray this morning to load paper and now I can't get it to slide back in all the way. It stops about 4 inches short of closing.  I feel like an idiot! How can I have problems sliding a drawe

  • OS X 10.9 reinstalling stuck at "24 minutes left"

    I was going to clean reinstall Mac OS X. I was running on Yosemite, but for some reason "Mac OS X Utilities" were on Mavericks. I didn't really pay any attention to it, I could freely download 10.10 after the installation. Anyway, after erasing my dr

  • Gallery/slideshow source needed

    i need to build a gallery/slideshow for a site and am looking for a great example code, or component as a starting place. one key feature is that the users will need to be able to logon and upload/manage their images on our server. anybody know of go

  • Upgrade from OS X 10.6.8 to Mountain Lion

    Hi, my MacBook has the following specs:  2 GHx Intel Core 2 Duo, with 2 GB 667 MHz DDR2 SDRAM, with about 200 GB of available space on my hard drive, running Snow Leopard 10.6.8.  I tried to purchase and download Mountain Lion and got a message stati

  • Is there any webcam security app?

    I would like to use this notebook for monitoring the back of my place as the neighbour is getting manic again and destroying my property and things might get worse. Anyway i have ran several apps in windows and linux but dont know anything about doin