cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Getting Data From Backend

Former Member
0 Kudos

hi All

I have problem with getting data from Backend. I am sending data to backend. & able to retrieve data in backend. but some reason i am not seeing data in frontend. Model and JCO and Context are fine. Then Where is the Problem?. I do understand.

This is my code: my backend:

SELECT SINGLE usercat INTO ex_user_cat FROM /arch/arm_user WHERE

username = im_user.

ENDFUNCTION

Controller Component:

public void wdDoInit()

{

//@@begin wdDoInit()

__Arch__Arm_Get_User_Cat_Input input = new __Arch__Arm_Get_User_Cat_Input();

wdContext.node__Arch__Arm_Get_User_Cat_Input().bind(input);

//@@end

}

public void Example_GetData( )

{

//@@begin Example_GetData()

try

{

wdContext.current__Arch__Arm_Get_User_Cat_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

}

catch(Exception ex)

{

ex.printStackTrace();

}

//@@end

}

View Controller:

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

{

//@@begin onActionToGetData(ServerEvent)

wdThis.wdGetExampleCompController().Example_GetData();

//@@end

}

Please can anu one help me in this

Thank u

Regards

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

1) Through external debugging check out if proper values are being sent to backend or not(for external debugging goto transaction code se37, open your bapi->goto Utilities->Setting->Debugging->Here check if "Act" check box is activated or not), then put a break point in code and run application from WD.

2) If proper values are sent to backend then check in WD if output node is recieving values as output or not, using

wdContext.node<output node containing values>.size()

3) If proper values are coming in output node ie if it is showing size non zero for valid parameter in import then check if the node is properly bind to UI element .

If you are using table control then best way is use Apply template method in the context menu of RootUIElement of view.

4) or finaly check if any exception is thrown while executing model object.

hope it helps

regards.

Answers (3)

Answers (3)

Former Member
0 Kudos

as per the details mention you are able to retrieve data. Have you printed the output node size? if its greater than 0 then there is a problem in binding the data with UI.Bind the data with UI element once again or simply print the output through component API.

former_member189631
Active Contributor
0 Kudos

Ravi,

Check your BAPI in the backend also.

The tcode is se37-->give ur bapi name -->execute

Regards,

Ramganesan K.

Former Member
0 Kudos

Hi Ramganesan,

BAPI is fine and working. I am getting data from Web DynPro. And rettriving value in BAPI. And not able to see data in Front end. there is no errors in my application. Can you help me in this aspect!.

thank you for your time

Regards

Ravi

Former Member
0 Kudos

Hi,

Try to print your Input params by using the WdcomponentAPI.getMessageManager().reportSuccess();statements and compare to back end system and after the execution of the execute method find the outputnode size and print it .

These are all the reasons and

One more thing is u need to get autorization the function module from R/3 system

That is also need to check.

Thanks,

Lohi.

former_member189631
Active Contributor
0 Kudos

Ravi,

Only you are handling the exception.

Please use the message manager code inside the catch block then only

you will be know that error message incase of exception.

Put this code into Yourcatch block,

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(ex.toString());

Regards,

Ramganesan K.