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

Problem with accessing BAPI

Hi,

If I go through the same scenario from Tutorials - connect to backend using Adaptive RFC, using BAPI_FLIGHT_GETLIST, everything works well. When I try to use different BAPI, e.g. Bapi_Material_Get_Detail, I'm not able to access the data. I don't get any error, just nothing happens when I execute Bapi.

Here are code snippets:

-


- from custom controller:

public void wdDoInit()

{

//@@begin wdDoInit()

Rfc_Customer_Get_Input input = new Rfc_Customer_Get_Input();

wdContext.nodeRfc_Customer_Get_Input().bind(input);

//@@end

}

public void executeRfc_Customer_Get_Input( )

{

//@@begin executeRfc_Customer_Get_Input()

try {

wdContext

.currentRfc_Customer_Get_InputElement()

.modelObject()

.execute();

wdContext.nodeOutput().invalidate();

} catch (Exception ex) {

ex.printStackTrace();

}

//@@end

}

- from view implementation:

public void onActionFilter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionFilter(ServerEvent)

wdThis.wdGetCustControllerController().executeRfc_Customer_Get_Input();

//@@end

}

-


One thing I couldn't do is:

input.setDestination_From(new Bapisfldst());

input.setDestination_To(new Bapisfldst());

of course, mapped to fields I'm using, because I don't get any additional model imported, like com.sap.tut.wd.flightlist.model.Bapisfldst from Flight demo app.

I know it's quite generic question, but does someone have an idea where to start looking for a problem?

BR, Ivan

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 08, 2005 at 02:23 PM

    Hi

    Did you created proper proxies for model/metadata of your model, check proper mapping from model to coustom controller and then coustom controller to View, once after deploying check Jco connction test it...,

    check your code

    I hope the corrected code should be as follows

    public void wdDoInit()

    {

    //@@begin wdDoInit()

    Bapi_Material_Get_Detail_Input input = new Bapi_Material_Get_DetailInput();

    wdContext.Bapi_Material_Get_Detail_Input().bind(input);

    //@@end

    }

    //This is the method your are calling from View

    public void executeRfc_Customer_Get_Input( )

    {

    //@@begin executeRfc_Customer_Get_Input()

    try {

    wdContext

    .Bapi_Material_Get_Detail_InputElement()

    .modelObject()

    .execute();

    wdContext.nodeOutput().invalidate();

    } catch (Exception ex) {

    ex.printStackTrace();

    }

    //@@end

    }

    - from view implementation:

    public void onActionFilter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

    {

    //@@begin onActionFilter(ServerEvent)

    wdThis.wdGetCustControllerController().executeRfc_Customer_Get_Input();

    //@@end

    }

    I Hope This code certainly works....

    RK

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Patric,

      probably there are some UI elements (e.g. input fields) bound to the attributes of the xxx_Get input node element, so there's no need to fill something here manually, at least if there are some values entered in the UI elements before executing the function call.

      Regards

      Stefan

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.