Skip to Content
author's profile photo Former Member
Former Member

How to import Table from Webdynpro to RFC?

In my application there is one RFC that has one import parameter String and a Table for import/export data from webdynpro.

The context of model node and attributes is as follows

A (Root Model Node for RFC)

|....B (Model Sub Node for Output)

|....C (Model Sub Node for Table)

|....x (Model attribute)

|....y (Model attribute)

Table structure in RFC is same as Model node C.

Before Executing RFC using

wdContext.currentAElement().modelObject().execute();

In Java end how to set or add data to x,y attribute so that RFC can get those values from table and insert into the ABAP table.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 05:39 AM

    Hi SBS,

    Try this code.

    IWDMessageManager msg = wdComponentAPI.getMessageManager();

    try {

    String empid = 10020;

    //or you can take empid from UI field also

    // String empid = wdContext.currentValueNodeElement().getEmployeeID();

    Bapi_Employee_Getdata_Input input = new Bapi_Employee_Getdata_Input();

    input.setEmployee_Id(empid);

    wdContext.nodeBapi_Employee_Getdata_Input().bind(input);

    // Calls remote function module BAPI_EMPLOYEE_GETDATA

    wdContext.currentBapi_Employee_Getdata_InputElement().modelObject().execute();

    // Synchronise the data in the context with the data in the model

    wdContext.nodePersonal_Data().invalidate();

    } catch (Exception e) {

    // TODO Auto-generated catch block

    msg.reportSuccess(“Message : “+e.getMessage());

    }

    rfc-issue---cardinality-and-selection-problem

    Regards,

    Mithu

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi SBS,

      Check the code.

      try

      {

      A aInputModel = new A();

      for(int i=0;i<2;i++)

      {

      ZCstruc cDetails = new ZCstruc();

      cDetails.setX(wdContext.nodeTest().getTestElementAt(i).getXVal());

      cDetails.setY(wdContext.nodeTest().getTestElementAt(i).getYVal());

      aInputModel.addC(cDetails);

      }

      wdContext.nodeA().bind(aInputModel);

      wdContext.currentAElement().modelObject().execute();

      wdContext.nodeB().invalidate();

      }

      } catch (WDDynamicRFCExecuteException e) {

      msg.reportException("Error in Creation. Please try Again... "+e.getMessage(),true);

      }

      finally

      {

      TestModel testModel = (TestModel)WDModelFactory.getModelInstance(TestModel.class);

      testModel.disconnectIfAlive();

      }

      Regards,

      Mithu

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 05:53 AM

    Hi,

    use the setter for the attribute

    Ex: wdContext.currentCElemement.setx(<Yourvalue>;

    Regards

    Ayyapparaj

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.