cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Null Value

Former Member
0 Kudos

Hi

I have made on Bapi as webservice.. and i imported that webservice in model...

The structure of the model is like this.....

Request_Z_Bapi_Customer_GetDetail

.......|

.......|----- parameter

................|

................|-------customerNo

................|-------division

................|-------distributionchannel

................|-------saleOrg

................|-------passbuffer

.......|-------Response

................|------Result

.......................|-------peAddress

...............................|---city

...............................|---country

...............................|----name

...............................|----.....

...............................|----......

<b>I have writtin the following code in my Custom Controller</b>

Request_Z_BAPI_CUSTOMER_GETDETAIL_WS_customerGetDetail customer = new Request_Z_BAPI_CUSTOMER_GETDETAIL_WS_customerGetDetail();

customer._setUser("abap");

customer._setPassword("quinnox");

wdContext.nodeRequest_Z_Bapi_Customer_GetDetail().bind(customer);

<b>I have executed the fuction like this...............</b>

public void executeCustomerDetails( )

{

//@@begin executeCustomerDetails()

try{

wdContext.currentRequest_Z_Bapi_Customer_GetDetailElement().modelObject().execute();

wdComponentAPI.getMessageManager().reportSuccess("Check "+wdContext.currentPeAddressElement().getFirstName());

}catch(Exception e){

wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);

}

but when i am priniting the results i am getting the null values.........

ex:

wdComponentAPI.getMessageManager().reportSuccess("Check "+wdContext.currentPeAddressElement().getFirstName());

here i am trying to get the FirstName but i am getting null value.....

how to solve this problem....

please help me

Best Regards

Ravi Shankar B

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ravi,

First i would suggest you to test/execute the webservice to makesure that its working properly.

If yes, pass all the madatory fields to the webservice input parameters. In your case customerID could be a madatory parameter to get the address.

You can pass that parameter by customer.setCustomerNo().

Regards, Anilkumar

Former Member
0 Kudos

I think the BAPI is expecting some mandatory parameters to execute the webservice.

Try setting the mandatory parameters and call the execute method.

Thanks and Regards,

Amar Bhagat Challa

Former Member
0 Kudos

Hi

Can any one tell me how to map the above Context Elements.....

Please help me

Best Regards

Ravi Shankar B

Former Member
0 Kudos

Hi

try invalidating the node after execution

Regards

Ayyapparaj

Former Member
0 Kudos

Hi

I have tried that but still i am getting any thing this time

Best Regards

Ravi Shankar B

Former Member
0 Kudos

Hi

Is any one know the solution please give me a reply

Best Regards

Ravi Shankar B