Calling RFC from view/component controller

I've got a model node in the component controller's context which is mapped to a node in a view controller. Now, when binding the model's input node with an array and executing the RFC from within an event handler in the view controller, everything goes just fine.
Now, I want to put this functionality in the component controller, so I created a method there, copied the code and call it from the view controller's event handler. When the RFC is called, the input table always contains just 1 element, of which the fields are all initial.
Any thoughts on what might be going on here?

Hi friend,
I too faced the problem what you faced.
Near to it.
Ill explain you .
YOu have your model node.
1st you will map that to component controller And from there to view controller.
After that you will bind the elements in this node to some elements in your view after that .
For example
Model class name:-Lok_model.
In the DOINIT method:-
write this code.
     Lok_model k = new Lok_model();          wdContext.nodeLok_model().bind(k);
Suppose you have a button in the onaction you write this code.
wdContext.nodeLok_model().currentLok_modelElement().modelObject().get_details();
Ill expalin you about this statement Lok_model() is the node in my view which is mapped from the model and by using that i am calling the method get_details() which is in my model class Lok_model.By this data will be automatically populated into the view elements which are being binded to the model attributes.
Hope this helps you,
Lokesh

Similar Messages

  • Calling a method in the view controller from the component controller

    Hi
    Is there anyway to call a method in the view implementation from the component controller??
    Thanks
    jack

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • Call methods from view controller to another (enhanced) view controller!

    Dear All,
    Is it possible to use/call methods from view controller to another (enhanced) view controller? Iu2019ve created a view using enhancement in standard WD component. I would like to call one method from standard view controller in the enhanced view controller.
    Is it possible to include text symbols as enhancement in standard class?
    u2026Naddy

    Hi,
    If you have just enhanced an existing view then you can call the standard methods in one of the new methods which you will create as part of enhancement.
    If you have created a totally new view using enhancement framework option ( Create as Enhancement ) then in this new view you won't be able to use existing methods in other view as a view controller is private in nature. So all the view attributes, context nodes and methods are Private to that view only.
    Regarding text elements, I guess adding a new text element is just a table entry in text table and is therefore not recorded as enhancement.( Not very sure about this, need to double check )
    Regards
    Manas Dua

  • Calling RFC from JSP : development component

    Hi everyone,
    I created JSP that call RFC from SAP/R3.
    I have problem with the DestinationService.
    Without DCs, it worked very good.
    But since I created a DC for my JSP project, I have exception at run time regarding
    the java.lang.NoClassDefFoundError: com/sap/security/core/server/destinations/api/DestinationService.
    Eventhough I add the specific jar, I get an excpetion.
    Thanks for the help.
    David

    Go to the application-j2ee-engine.xml file and add following reference:
         <reference
              reference-type="weak">
              <reference-target
                   provider-name="sap.com"
                   target-type="interface">tcsecdestinations~interface</reference-target>
         </reference>

  • Call RFC from DELPHI Windows Services Program

    Hi all,
    Are there any way to call RFC from DELPHI Windows Services Program?
    Best regards.
    Munur EBCIOGLU

    Hi again Bhagat,
    1. Yes, it's included on 7.4 ABAP Stack (SAP NetWeaver 7.4 SP8 - Optimized for SAP HANA, Cloud and Mobile - Service Release 2 available now!). In a recent customer, SAP licences GW by user but there are other license model like session licensing: https://store.sap.com/sap/cp/ui/resources/store/html/SolutionDetails.html?pid=0000009470&catID=&pcntry=US&sap-language=EN&_cp_id=id-1385059687642-0
    2. You could install as an AddOn on your 7.3 system, there are many options depending on your desired infrastructure: SAP Gateway deployment options in a nutshell For example our customer have deployed Central Hub Gateway in a standalone stack ABAP to act as an standalone oData bridge between ABAP/nonAbap systems.
    3. You could deploy SAPUI5 apps in 7.x, Java Web Servers or HTTP Web Servers. You must consider your SSO scenario:
    - SSO Logon Tickets. You will need to configurate SSO Logon Tickets between SAP NW Portal & SAP NW Gateway & your backend (ECC, etc). In order to pass SAP session cookie you will need setup SAP Web Dispacther and access portal & gateway throught SAP WD with the same domain.
    - SAML2 Tickets. This scenario lets you provide portal & gateway on different domains enabling SSO. You could configure SAP NW Portal as an Identity Provider and other systems must trust SAP Portal as IdP.
    Cheers

  • How to call RFC from Power Builder

    Hi,
    I am using Power Builder Tools and I want to know how can i call RFC from Power Builder
    Thanks for ur reply

    Hi,
    Although I have not worked with Powerbuilder, I am sure if you have a certain level of proficiency with it, you will be able to code your logic that will call your wrappers written in VB/C/.NET etc. Check out the wonderful weblog by Thomas Jung on integrating ActiveX controls with ABAP Control Framework at https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/995. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Do get back if you have further queries.
    Regards
    Message was edited by: Shehryar Khan

  • Example-- Call RFC from external Java Application

    Update: I need code example to call RFC from External Java application. Can onybody help me?                                                      
    RGDS
    RP
    hi all.
    i want to create my own log for each interface.
    i saw this blog:
    /people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
    my doubt is how to catch the error that i see in SXI_MONITOR y put it in a Sub-Objetc.
    For example: in sxi_monitor i get the error for my interface NMUCustomer: "No receiver could not be found" or "Error Mapping Traformation".
    I created an Object called ZNMUCUSTOMER and a Sub-Objetc called ZERROR.
    what i must do to get the error I see in monitor and assign it to Sub-Object??
    Rgds.
    Message was edited by:
            Rodrigo Pertierra
    Message was edited by:
            Rodrigo Pertierra
    Message was edited by:
            Rodrigo Pertierra

    Hi,
    Oh, you are using ABAP mapping ......
    then use the following in ABAP mapping ..
    TRACE1,TRACE2,TRACE3.... for trace level 1,2,3......
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/866ce290-0201-0010-338f-b8c3553aaa0f
    Regards
    Chilla

  • Calling RFC from custom connector

    Hi,
    I am developing a custom connector for UWL to get tasks from 3rd party system.
    I need to call a RFC from backend SAP system to complete Input data for this 3rd party provider.
    I assume that I have to make an RFC call from getItems() method of connector.
    Any idea how to call a RFC from UWL custom connector code?
    Please help.
    Thanks & Regards,
    Amey

    Hello Karri,
    Yes, I am aware of two ways of calling RFCs from Java code.
    Normally, I use following approach to call RFCs from my other Portal Components (JSPDynpages): -
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentContext myContext = request.getComponentContext();
    IPortalComponentProfile myProfile = myContext.getProfile();
    String sapSystem = myProfile.getProperty("SystemIdentifier");
    ISystemLandscapeWrapper landscapeWrapper = (ISystemLandscapeWrapper) UMFactory.getSystemLandscapeWrappers().get(0);
    ISystemLandscapeObject systemLandscapeObject = landscapeWrapper.getSystemByAlias(sapSystem);
    IJCOClientService clientService = (IJCOClientService) PortalRuntime.
    getRuntimeResources().getService(JCO_CLIENT);
    request.getNode().putValue(LOCALE_NODE_KEY,     Locale.ENGLISH);
    IJCOClientPoolEntry poolEntry = clientService.getJCOClientPoolEntry(sapSystem,request);
    JCO.Client client = poolEntry.getJCOClient();
    client.connect();
    IRepository repository = JCO.createRepository("repository", client);
    IFunctionTemplate functionTemplate = repository.getFunctionTemplate(Z_BAPI_EMP_GBU_GET);
    JCO.Function function = new JCO.Function(functionTemplate);
    JCO.ParameterList importList = function.getImportParameterList();
    importList.setValue("US", "OBJTYP");
    importList.setValue(request.getUser().getUniqueName(), "USRID");
    client.execute(function);
    JCO.ParameterList outputList = function.getExportParameterList();
    gbuCountryBean.setGbu(outputList.getString("GBU"));
    gbuCountryBean.setCountry(outputList.getString("COUNTRYCODE"));
    gbuCountryBean.setPersArea(outputList.getString("PERS_AREA"));
    gbuCountryBean.setCompanyCode(outputList.getString("COMPANYCODE"));
    When I tried implementing same in UWL custom connector, I am not able to get instance of 'request' object.
    Any hints/ideas on this?
    Hence as an temporary alternative, I wrote following to successfully execute RFC.
    mConnection = JCO.createClient(sapclient,  sapuser,
    sappassword,  "EN", saphost, sapsysnumber);
    mConnection.connect();
    mRepository = new JCO.Repository("GetLeaveRequestFlag", mConnection );
    IFunctionTemplate ftemplate = mRepository.getFunctionTemplate(Z_BAPI_CHECK_LR_TO_APPROVE);
    myFunction = new JCO.Function(ftemplate);
    JCO.Field OBJECT_TYPE = myFunction.getImportParameterList().getField("OBJECT_TYPE");
    OBJECT_TYPE.setValue("US");
    JCO.Field USERID = myFunction.getImportParameterList().getField("USERID");
    OBJECT_TYPE.setValue(p_userID);
    mConnection.execute(myFunction);
    JCO.Field leaveRequestFlag = myFunction.getExportParameterList().getField("FLAG_LEAVE_REQUEST_RECORD");
    mConnection.disconnect();
    But only catch here is that I need to create & maintain SAP logon credentials for a particular user manually.
    It is not possible to single sign on connector user into SAP system (like its done above).
    Any thoughts on this?
    Thanks & Regards,
    Amey

  • Calling RFCs from Webdypro application!!!!

    Can anybody show me a suitable example for calling rfc from webdynpro application.

    Hi steve,
    Look at this tutorial..
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial on accessing abap functions in web dynpro - 4.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial on handling transactions with bapis in web dynpro - 5.htm
    Follow the steps provided in those documents.
    You can easily understand how to access ABAP functions from WebDynpro.
    Let me know if you need more help on this.
    Regards,
    Karthick

  • Calling  RFCs from Web through XI

    We have used SAP.NET connector in the past to call RFCs from ASP.NET pages from our public website. We have now decided to use XI as the enterprise integration engine going forward.I am interested to know whether anybody has used XI to call RFCs from ASP.NET webpages. I do know that the XI to SAP calls would be made through RFC adapter.Will the communication from ASP.NET page to XI  be thourgh the HTTP adapter ? or is there any other smarter way. Can somebody point me to sample code for the calls through http adapter or  a how to guide?
    cheers
    Ramesh

    Hi
    U have scenario like this ASP.NET->XI->RFC, that means u will send a value from the ASP.NET page to RFC thru XI and then this RFC will give result which will come to ASP.NET frontend.
    For this go thru this blog it will help u to understand how to communicate from ASP.NET to XI
    <b>https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1442</b [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]> [original link is broken]
    Code Sample is provided in the blog.
    Hope it helps.
    Regards
    Arpit Seth

  • Sample Java code and detail to call RFC from Java clas developed in Eclipse

    Hi All,
    I am new to Java. I have downloaded Eclipse IDE  and planning to use for developing Java application to send data to SAP by calling RFC JCO Interface.
    I need a sample java code/tutorial step by step to create Java class for simple example to call RFC from Java.
    I have downloaded SAPJCO3 from service market place.
    Kindly help me to send steps involved to configure for JCO  with my Eclipse with JCO.
    Thanks in advance.
    Sharma

    Hi Sharma,
    Please have a look at [Example: Using Generated Proxies to Call Function Modules |http://help.sap.com/saphelp_nw04/helpdata/en/b6/55e3952a902447847066a0df27b0d6/content.htm]
    JCo Exceptions : http://help.sap.com/saphelp_nw70ehp1/helpdata/en/f6/daea401675752ae10000000a155106/content.htm
    Hope it will helps
    Regards
    Arun

  • How to call a local variable from another component controller

    Dear Experts,
           I have created 1 component controller(Controller Name as B)and methods.In that methods I Have declared Local variable(For ex data: Lv_flag). I have Created 1 more component and name as A. I used Component B in Component A(Using component usage). In A component controller I have created methods.Now I want to call a local variable Lv-flag in this method from B controller Method. Please reply your valuable answer.

    Karthikeyan,
    Please make sure that flag attribute is under some node, say NODEA. NOW please select the interface node property and input element  of NODEA.
    now NODEA will be available in interface controller. Interface controller acts like a global  controller between two different components.
    So from interface controller you can take that flag value.
    pls reply back if you have any confusion.
    Regards
    Srinivas

  • Wda: call method from a component interface definition (cid)

    hello,
    I created the following scenario:
    - I have a Main-component "m"
    - "L" is a component interface definition (cid) which force both cid-L-implementating components  "L1" and "L2" to extend and fill the method "set_COMP_USAGES()".
    - I have other cid´s (A-C) too
    - at runtime only one of the components "L1" or "L2" is created and the mother-component M holds component-usages (ref to) of the chosen variants of A-C and L as an attribute in the component-controller of m.
    now my problem: my aim is to call a method in m at runtime which is defined at designtime in my cid L (set_COMP_USAGES() )and decided at runtime which variant of this method is chosen (the one from L1 or L2). in this method the references of comp_usages other cid´s should be passed to L1 or L2.
    or short: how can I call a method from a cid-implementating component at runtime via a IF_WD_COMPONENT_USAGE reference (ref to) to this component?

    I got the solution:
    data: L_INTF_CONTROLLER         type ref to ZIWCI_Z_ITF_CID_L.
      L_INTF_CONTROLLER ?= wd_this->COMPONENT_USAGE_L->GET_INTERFACE_CONTROLLER( ).
      CALL METHOD l_intf_controller->set_comp_usages
        EXPORTING
          comp_usage_a = wd_this->COMPONENT_USAGE_a
          comp_usage_b = wd_this->COMPONENT_USAGE_b
          comp_usage_c = wd_this->COMPONENT_USAGE_c.

  • How to pass Model from view to controller in MVC

    Hi All
    The code is written in MVC architecure.
    I am using this script
    <script type="text/javascript">
    $(document).ready(function () {
    $("#btnSubmit").click(function (e) {
    e.preventDefault();
    // var val = Json.Encode(Model);
    $.ajax({
    type: 'POST',
    url: '../Apteka/UpdateParial',
    data: JSON.stringify(@Html.Raw(Json.Encode(Model))),
    contentType: 'application/json; charset=utf-8',
    dataType: "json",
    success: function (data) {
    alert('Success');
    </script>
    My controller is 
    public ActionResult UpdateParial(AptekaReportModel aptekaReportModel)
    aptekaReportModel.YearList = CommonFunctions.GetYear();
    aptekaReportModel.MonthList = CommonFunctions.GetMonth();
    // aptekaReportModel.RepresentativeTypeList = CommonFunctions.GetRepresentativeTypeList();
    aptekaReportModel.IsSearch = true;
    It is passing all everything except selected value in dropdown.
    How to send the selected value of dropdown to controller from view using ajax call
    Prashant Arora

    Hello,
    Since this is an ASP.NET MVC question, I would recommend you to re-post this question to the ASP.NET forum here:
    http://forums.asp.net/1146.aspx/1?MVC.
    Thanks,
    Prashant
    Windows Store Developer Solutions, follow us on Twitter:
    @WSDevSol|| Want more solutions? See our blog

  • Calling RFC from Adobe Interactive Form

    Hello,
       After creating and calling Adobe Interactive form from ABAP web dynpro, within the form designer is it possible to call RFC or Business Object method from the form script to get the data back from SAP for specific Click events?

    Yes,
    this is possible, but not through pure RFC, but using webservices and webservice enabled function modules within SAP.
    Technically it is quite simple. Create a functionmodule, and create a webserve from that (all SE37 or SE80 but from WAS 6.40). Generate a WSDL (with the Java tool) and import that into the form that you are designing. From there you can bind the data from the dataset (as defined in the WSDL) to screenfields or treat the data any other way Javascript can.
    BTW. I only managed this so far by using anonymous logins, so with a password and username bound to the webservice (in SICF).
    Hope this helps, regards, Hans Gmelig Meyling

Maybe you are looking for

  • System Image Utility Incredibly Slow!

    Creating any kind of image using system image utility takes ridiculous amounts of time. I started an image of a ~30GB targeted disk at 9 this morning and now at 12:48 it's less than a quarter done (if I am to believe the progress bar). This is the sa

  • What's wrong with my phone? It keeps on restarting

    Whats wrong with phone? I actually accidentally dropped it and after that it started to restart and restart again. Plus the censor is not working too. The censor only works when I'm on my bbm and it won't work when It's at home screen. Besides, whene

  • Beginner ABAPer asking Doubts in BDC

    Hi Guyz, I am a beginner in ABAP. Here i am sending some doubts on BDC . Any Kind of help will be highly Appreciated. Thanks, SAM 1>How do we handle all the scrolling funcions(page ups, page downs atc), and values entered into table controls in BDC ?

  • Slow Query on Virtual Tables

    Hello! I am using a proprietary IDE environment to compile some applications. I cannot change the following SQL query it performs. During "Compile", the IDE is checking the DB Function calls in the app by executing the following SQL Statement: select

  • Encoded "From" header issue

    Hi, I would like to know if there is any method in the JavaMail API to retrieve the only email address from an encoded "From" header without using, splits, regexs, etc. Example: Using aMimeMessage.getFrom()[0].toString() the output is +=?iso-8859-1?Q