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

Table dosn't load R/3 data

Hallo,

I'm evaluating WAS 6.30 Sneak Preview,and I'm asking myself why my custom project, EXACTLY modelled on the "Flights" tutorial, doesn't load data obtained from a RFC call (BAPI_SALESORDER_GETLIST).

In the "Search" view two input fields pass SALES_ORGANIZATION and CUSTOMER_NUMBER import parameters.

The "SalesorderList" table of the "Results" view, bound to the "Output" Controller Context attribute shold display some Bapiorders data, but it doesn't work! (the table columns remain blank..)

This is the code which should be manually written (according to the tutorial), I don't know if it's allright!! (something missing? wrong?):

public void wdDoInit()

{

//@@begin wdDoInit()

Bapi_Salesorder_Getlist_Input input = new Bapi_Salesorder_Getlist_Input();

wdContext.nodeBapi_Salesorder_Getlist_Input().bind(input);

input.setCustomer_Number("1172");

input.setSales_Organization("1000");

// (data obviously hidden..)

client = JCO.createClient("800", "username", "pwd", "en", "sapsrv00", "00");

model = (SalesorderGetlistModel) WDModelFactory.getModelInstance(

SalesorderGetlistModel.class, WDModelScopeType.APPLICATION_SCOPE);

model.setJcoClient(client);

}

public void getList( ) {

//@@begin getList()

// Connects to remote SAP System

client.connect();

try {

// Calls remote Function Module BAPI_SFLIGHT_GETLIST

wdContext.currentBapi_Salesorder_Getlist_InputElement().modelObject().execute();

} catch (Exception ex) {

ex.printStackTrace();

} finally {

client.disconnect();

}

// Invalidates the output context node

wdContext.nodeOutput().invalidate();

//@@end

}

Can someone tell me why it doen't load data??

Thanks in advance

Gianluca

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Dec 22, 2003 at 05:03 PM

    Hi Gianluca,

    first tip of mine is that you should change your exception handling code:

    instead of:

    try {

    // Calls remote Function Module BAPI_SFLIGHT_GETLIST

    wdContext.currentBapi_Salesorder_Getlist_InputElement().modelObject().execute();

    } catch (Exception ex) {

    ex.printStackTrace();

    } finally {

    client.disconnect();

    }

    you should change it to:

    try {

    // Calls remote Function Module BAPI_SFLIGHT_GETLIST

    wdContext.currentBapi_Salesorder_Getlist_InputElement().modelObject().execute();

    } catch (Exception ex) {

    //change

    wdThis.wdGetAPI().getComponent().getMessageManager().reportException(ex.getMessage(), true);

    ex.printStackTrace();

    } finally {

    client.disconnect();

    }

    The addional statement informs you about an exception, which might be occured. If the message, which is shown in the browser, doesn't help, you will have to look in a specific log-file. The statement "ex.printStackTrace();" logs directly in the console-log-File of your server-installation directory (\usr\sap\<your instance e.g. C11>\JC00\j2ee\cluster\server0\log\console_logs\). There you will find an output.log-File, in which the complete trace of the exception is written. Please add the trace to the next sdn-message, if it does not help you to solve the problem.

    Note: Please check for correct connection-data (system, user, password etc.) and system- and rfc-availability.

    Regards

    Joerg

    Add comment
    10|10000 characters needed characters exceeded