Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_SALESORDER_CREATEFROMDAT2 - quanity =0 when consumed& exposed as WSDL

Former Member
0 Kudos

Dear all,

Any help on this is greatly appreciated. We have developed a .NET application that will consumed the create order bapi web services that's being generated from WAS 6.20. ICM is set up and working properly. However, when we executed the .NET application, quantity related fields in all both structures (ORDER_ITEMS_IN and ORDER_SCHEDULES_IN) does not get posted correctly in the sales order as we have a zero value in those fields. And I did pass an "X" into the other 2 structures (ORDER_SCHEDULES_INX and ORDER_ITEMS_INX). I tested the same dataset in both SAP (se37) and a direct bapi call (with a Z RFC with BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_TRANSACTION_COMMIT) in another .NET application, and they had been executed successfully. Everything was posted correctly in SAP.

So I activated the debugger in txn. SICF for SOAP RFC (/sap/bc/soap/rfc), and noticed the quantity value did not even get passed into the structures (ORDER_ITEMS_IN and ORDER_SCHEDULES_IN) when I am inside of the Z RFC. I tried to narrow down to the mapping of the body of the WSDL file within the SOAP SAP program, but it has been unsuccessful as I am not familiar with construct of the SOAP program. Any idea on what the SAP technical processing differences are between a web service call and a direct bapi call?

Any insights on this will be greatly appreciated!!!

Thanks much and best regards,

Cyanna

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Cyanna,

Your problem most likely is caused by the fact, that any parameter for an RFC enabled function module (your Z RFC) must be transferred by VALUE and not by REFERENCE.

So you MUST check the 'Pass Value' checkbox on each IMPORT and EXPORT parameter.

CHANGING parameters are not allowed with RFC modules.

If this does not help your problem, it is most likely, that your external program cannot handle the exact TYPE of the parameter.

Consider in this case to change the type and to convert it within your Z RFC module.

Regards,

Rob.

2 REPLIES 2

Former Member
0 Kudos

Hi Cyanna,

Your problem most likely is caused by the fact, that any parameter for an RFC enabled function module (your Z RFC) must be transferred by VALUE and not by REFERENCE.

So you MUST check the 'Pass Value' checkbox on each IMPORT and EXPORT parameter.

CHANGING parameters are not allowed with RFC modules.

If this does not help your problem, it is most likely, that your external program cannot handle the exact TYPE of the parameter.

Consider in this case to change the type and to convert it within your Z RFC module.

Regards,

Rob.

0 Kudos

Hi Rob,

Thanks for your response . I was thinking the same thought about the data type of quantity, but was refusing to change anything as I would think it should work the same way using web services. I gave in.... I modified my Z RFC in SAP to read the quantity as char and then convert it back to QUAN. And now the quanity is being pass into SAP successfully.

I think it's still very inconvenient to have to modify the standard BAPI in order to make the web service work.

Thanks for your help, Rob!

Cheers,

Cyanna