cancel
Showing results for 
Search instead for 
Did you mean: 

Bapi don't work

Former Member
0 Kudos

Hi everyone,

I have a problem with testing of a BAPI. I am using the Bapi Salesorder_createfromdat2 to create a sales order. Regarding the documentation of this Bapi, I have to put in the mandatory fields (examples in brackets):

ORDER_HEADER_IN :

DOC_TYPE Sales document type (ZSP1)

SALES_ORG Sales organization (S300)

DISTR_CHAN Distribution channel (S3)

DIVISION Division (S3)

ORDER_PARTNERS..:

PARTN_ROLE Partner role, SP sold-to party (AG)

PARTN_NUMB Customer number (3211)

ORDER_ITEMS_IN..:

MATERIAL Material number (SP consulting serv)

As Order_items_in and Order_partners are defined as outputs, when I drag&drop the Bapi, I used the Flip Port function, because the fields in this tables are mandatory. Now when I test the Bapi, I get always the exception "No customer master record exists for customer 3211". When I test the Bapi in the backend (IDTCLNT800) the Bapi is working fine and is creating a sales order.

What is going wrong?

Thank you in advance.

Regards,

Aylin.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Marcel,

I have checked now the BAPI with debugging in R/3. I have there the possibility to save test data, when I run the Bapi in debugging mode. I did that. When I load this test data after that again into the bapi in R/3, I saw in the table Order_Partners, that the "Partner-Type" which I gave as input in VC was transfered to English (AG (Auftraggeber) --> SP (Ship-To-Party)). This is not working in the Bapi. But I don't now how to fix this conversion.

Do you have an idea?

Regards,

Aylin.

Former Member
0 Kudos

Hi Aylin,

I'm not sure, if I understand you. Can you give me more details.

If the conversion doesn't work, you can write a function module and call the conversion and then the BAPI.

Best Regards,

Marcel

PS: If you send me more information, maybe then I can give you a better answer.

Former Member
0 Kudos

Hi Aylin,

I also do not completely understand. When and where does the conversion into a different language happen?

Please describe the path from where you write the data to where and to what place you then ask these values. I assume VC->BAPI->VC. Somewhere in between happens that.

What about the users in VC and R/3? Do they have language settings that are different?

Mario

Former Member
0 Kudos

Hi Mario,

Let me try to explain it again:

I want to call the BAPI "bapi_salesorder_createfromdat2". There are mandatory fields, which I have to fill.

ORDER_HEADER_IN :

DOC_TYPE Sales document type (ZSP1)

SALES_ORG Sales organization (S300)

DISTR_CHAN Distribution channel (S3)

DIVISION Division (S3)

ORDER_PARTNERS..:

PARTN_ROLE Partner role, SP sold-to party (AG)

PARTN_NUMB Customer number (3211)

ORDER_ITEMS_IN..:

MATERIAL Material number (SP consulting serv)

The structures Order_partners and order_items_in are for the BAPI defined as output. But I used the "Flip Port" functionality to make them to input in VC.

Then I take a form view to fill all these parameters (with data described above).

When I run the BAPI after deploying my model an putting in my parameters, I get always the exception "No customer master record exists for customer 3211". I found a Note in Service Market Place with this exception, I followed the solution, but this was not the problem. Everything seems to be OK in the backend.

After that, I tried to debug to found out, where the problem can be. During the debug, I saw, that my parameters passed correct from VC into R/3.

Then I saved the test data (input data), when I run the Bapi in debugging mode.When I load this test data again into the bapi in R/3, I saw in the table Order_Partners, that the "Partner-Type" which I gave as input in VC was transfered to English (AG (Auftraggeber) --> SP (Ship-To-Party)).

I tried the same paramaters with manual entering into the BAPI in R/3. It is working very fine, also with SP or AG. I don't know where the problem could be.

Do you have the possibility to have a look into my model? It is located in the IDES Test System VC:

<a href="http://idesportalnwdt.wdf.sap.corp:1080/VC/default.jsp">VC IDES</a>

My model is named as "Engagement Management" and is located in Public>Business Package>IBU>Professional Services>Engagement Management.

About language: I don't know, which is the default language for VC.

Regards,

Aylin.

Message was edited by:

Aylin Ufuk

Former Member
0 Kudos

Hi Aylin,

I could logon and look at the model, but I was not able to deploy. Can you try to deploy and send me the link to launch it?

Can you also try what happens if you pass SP instead of AG from the VC application as parameter for the PARTN_ROL?

Thank you

Mario

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Marcel,

I have now debugged the Bapi. My import parameters passed correct from VC into R/3. The parameters are exact those, which I put into the form view.

What else can I check?

Aylin.

Former Member
0 Kudos

Ok, if they are correct, then you must debug the BAPI until the exception "No customer master record exists for customer 3211" is raised by the BAPI. Then you can check why the exception is raised.

Best Reagards,

Marcel

Former Member
0 Kudos

Hi Marcel,

I have never debugged in VC, I don't know, how to do this. I tried to go into the SQL-Monitor, but system says, that I am not allowed to go there. The partner-number is correct, because it is working, when I start the bapi in R/3.

What do you mean with alpha conversion? What should be converted?

Thank you for your help.

Regards,

Aylin.

Former Member
0 Kudos

Hi Aylin,

you can debug your RFC/BAPI. Therefore you start the transaction SE80 or SE37 in your backend system R/3 and search for your BAPI. Then you can set an external break-point in this BAPI with CTRL + SHIFT + F9. Now deploy your VC Model and use the BAPI. Then the debugger starts, then you can control if the imort parameters passed correct from VC into R/3.

Best Regards,

Marcel

Former Member
0 Kudos

Hi Aylin,

I advise you to check if the values from VC passed correctly to the BAPI. Therefore set an external breakpoint and debug. Then check, if the value for PARTN_NUMB is correct.

Maybe you need a alpha conversion, if the BAPI doesn't convert it.

Make sure that the values passed correct to BAPI, then it must work.

Best Regards,

Marcel