cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI returning null values in output structure

Former Member
0 Kudos

Hi Gurus,

I am facing a big show stopper issue from the BAPI (Customized) side in my development. I am passing all the parameters required to execute BAPI from front end but unable to get values in output structure.

I kept debugger for that particular BAPI and when I executed the particular action from front end and debugged the whole ABAP code I came to know that in output structure values are coming (In debug screen). But as soon as I pressed F8 and came back to my front end screen I got no values in output structure. I tried printing size of the model output node and it got size = 0 .

Just to brief the history of the BAPI: Its a BAPI to get duplicate records of customer and vendor address. One year back same BAPI was used in a different application and still working fine and returning all expected results.

I have a question here - Is it possible that this problem is getting caused as in past one year this code got changed so many times?

Or is there some configuration level issue?

Please help me in this as I am in phase of completing my development but got stuck coz of this issue.

Regards

Akanksha

Accepted Solutions (1)

Accepted Solutions (1)

former_member182534
Active Participant
0 Kudos

Hi Akanksha,

The solution is simple. I believe you have forgot to do the binding operation.

Just look if there is any code written something like this.

wdContext.node<Model Request Node Name>().bind(<Model execution Object Name>);

This particular statement binds the node to the response which is coming back.

The above code should be before the following code.

<Model execution Object Name>.execute();

Regards

Piyas

Former Member
0 Kudos

Hi Priyas,

Thanks for the quick reply.

I already written the code you have mentioned above.

Checked all mappings and bindings. All sounds good.

Really unable to find out the cause. Please suggest me further checks.

Regards

Akanksha

JonathanM
Contributor
0 Kudos

Hi,

Did you do a start/stop of the server?

The structure of your BAPI is stored in the server's cache.

Otherwise, check all binding and mapping. Even delete/remove it to force the rebuild.

I have a lot of issues with that...

Best regards,

Jonathan

Former Member
0 Kudos

Hi Jonathan,

Unfortunately I  took restart of server 3 times since I am facing this issue. Deleted mappings and bindings, Deleted model and created it again. Even I created model and did import of RFC in a brand new test DC. But I am facing the same issue.

Can you help me suggesting anything else what I can try from my end or you ever tried for this kind off issue.

Regards

Akanksha

JonathanM
Contributor
0 Kudos

The only thing to do in that case, is to copy your BAPI to another name like BAPI2 and redo the same.

This was the only solution we have found. As this is like new model, everything is really regenerated...

Best regards,

Jonathan

former_member182534
Active Participant
0 Kudos

Hi Akanksha,

Have you tested the RFC from SAP Log on if it is returning the response you are expecting.

Have you done zero padding when you are calling it from WebDynpro screen.

Check if the RFC destination has been created or working.

Regards

Piyas

Former Member
0 Kudos

Hi Jonathan,

I tried the trick you asked to perform. But still I am unable to get the results in output structure of BAPI.
Is there anything else I can try apart from this ?? Please suggest.

Regards

Akanksha

Former Member
0 Kudos

Hi Piyas,

I did debugging of BAPI from SAP Logon and the expected result is coming in the output structure of BAPI in ECC Logon. I can see BAPI returning result in ECC but once I am returning to my Dynpro screen I am not getting anything in the output structure of BAPI.

Regards

Akanksha

former_member182534
Active Participant
0 Kudos

Hi Akanksha,

After the <Model execution Object Name>.execute(); have you invalidated the request node as shown bellow :

wdContext.node<Operation Node Name>().invalidate();

It should be invalidating the Output Node before executing ie. <Model execution Object Name>.execute(); as shown bellow :

wdContext.node<Output Node Name>().invalidate();

<Model execution Object Name>.execute();

Regards

Piyas

junwu
Active Contributor
0 Kudos

did it work before?

show me your java code

Former Member
0 Kudos

Hi Johnathan,

As my last try I did import of BAPI once and and did all bindings and mappings. cleared metadata cache from server and surprisingly it started working.

Thanks !!!!

Akanksha

amolgupta
Active Contributor
0 Kudos

Hi Akanksha,

This happened because the BAPI must have been changed after you imported the BAPI in your NWDS. A cache is maintained in the SAP Java Stack server which is not updated when changes are made in the BAPI in ABAP stack or even if BAPI is reimported in the NWDS.

The way out as you rightly figured out is by invalidating the metadata cache after which a new cache is formed or by restarting the SAP server which would implicitly invalidate the metadata cache.

If you are working in an environment where BAPI developments are going in parallel with WDJ development, sometimes even invalidating the metadata cache does not help. In such cases, a server restart only works.

Regards,

-Amol Gupta

Answers (2)

Answers (2)

amolgupta
Active Contributor
0 Kudos

Hi Akanksha,

If it is working on the ECC, and not working in your WebDynpro Java Application, the cause must be a coding problem. Study the code thoroughly and you should be able to overcome it.

- Check your code thouroughly

- Check context mappings

- Check context binding with UI elements

- Restart NWDS

- Restart Server

Regards,

-Amol

nikhil_bose
Active Contributor
0 Kudos

I suspect the 'Output' node that is bounded to the view context. If you are getting values in debugging, check for the output node and binding for that.

- nikhil