SAP-samples / s4hana-ext-order-app

SAP S/4HANA Cloud Product Web Ordering and Reporting extension sample showcases how to consume services from SAP S/4HANA Cloud. Both read and write data from/to SAP S/4HANA Cloud are used in this sample. This repository holds only the 'Web Ordering' app.
http://tiny.cc/s4-ext-order-app
Apache License 2.0
0 stars 5 forks source link

!! Internal Server Error !! #1

Closed manjunathgudisi closed 4 years ago

manjunathgudisi commented 5 years ago
Screen Shot 2019-09-21 at 8 43 18 PM

Hello

Im getting internal server error as shown in the attached screenshot. I have done all the necessary steps (like communication arrangements for Products, Sale Orders, and custom business object in S/4HANA cloud system).

Not sure where is the problem? Do we have any troubleshooting guide?

I can think of only one thing: nowhere I have mentioned S/4HANA API (https://myXXXXXX-api.s4hana.ondemand.com) in the Java source code apart from Destinations in SAP CP.

Screen Shot 2019-09-21 at 8 54 26 PM

Thanks, Manju

manjunathgudisi commented 5 years ago

When I look at the log, it says like this:

2019 09 21 15:29:31#+00#ERROR#com.sap.cloud.extensibility.servlets.OrderServlet##anonymous#https-jsse-nio-8041-exec-6#na#hgd5bn05dd#extorderapp#web#hgd5bn05dd#na#na#na#na#Exception occured while fetching the products and the exception is :java.lang.NullPointerException: while trying to invoke the method com.sap.cloud.extensibility.services.ProductService.findCustomerProductsByProductGroup(java.lang.String) of a null object loaded from field com.sap.cloud.extensibility.servlets.ProductServlet.productService of an object loaded from local variable 'this'

manjunathgudisi commented 5 years ago

I could understand from the above log that, there is some issue with product group. In Application properties file, the

s4cld.productgroup=L001

I looked at my S/4HANA cloud system and understand that I don't have a product group of L001. I have product groups of A001, A002..etc.

So, I have changed the product group in the Application properties file and redeployed the Java app. However, it is still giving the same error log. Any help would be appreciated.

Thanks, Manju

manjunathgudisi commented 5 years ago

I have fixed the problem by doing:

  1. Assigning BR_INTERNAL_SALES_REP role to myself
  2. Creating and Adding 'Saleable Product'

Those above 2 things have not done in S/4HANA system earlier. After I did set those and run the Java app on SAP CP. Its not rendering the UI with products.

However, when I try to order, and then fill out the form, and then click on Order button, giving error page.

Screen Shot 2019-09-22 at 3 53 14 PM

error message: No customer master record exists for sold-to party P1010E2E10

This is the FULL error message:

2019 09 22 10:09:24#+00#ERROR#com.sap.cloud.extensibility.services.SalesOrderService##I302342#http-bio-8041-exec-2#na#hgd5bn05dd#extorderapp#web#hgd5bn05dd#na#na#na#na#Exception occured while creating a sales Order and the exception is :: com.sap.cloud.sdk.s4hana.datamodel.odata.helper.ODataVdmErrorResultHandler$ErpODataException: The endpoint responded with HTTP error code 400. No customer master record exists for sold-to party P1010E2E10 Full error message: { "error": { "code": "VP/199", "message": { "lang": "en", "value": "No customer master record exists for sold-to party P1010E2E10" }, "innererror": { "application": { "component_id": "SD-SLS-SO", "service_namespace": "/SAP/", "service_id": "API_SALES_ORDER_SRV", "service_version": "0001" }, "transactionid": "E008DAE1CB5901F0E005D21734AA0BF4", "timestamp": "", "Error_Resolution": { "SAP_Transaction": "", "SAP_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)" }, "errordetails": [ { "code": "/IWBEP/CX_MGW_BUSI_EXCEPTION", "message": "No customer master record exists for sold-to party P1010E2E10", "propertyref": "", "severity": "error", "transition": false, "target": "" } ] } } }

What should I do in the application properties file for the filed s4cld.onetimebusinesspartner. How do I know the value of this field?

Thanks, Manju

amritanshukr commented 4 years ago

Hi manjunathgudisi,

This looks like data issue. I would advise to check :: Best practice Explorer test document for appropriate data values with release version. Your master record should exist for sold-to party "P1010E2E10" for sales order to proceed.

regards, amritanshu

grenik commented 4 years ago

Closing the issue due to the author's inactivity. Please feel free to reopen it.

Kosmo112358 commented 3 years ago

Hi, I'm having the same error message when trying to create a customer record from the app. I'm using a partner demo system and would expect that the appropriate data has been maintained. Has anyone else had this issue and resolved it?

Thanks, Mark

------Error message below-----

2021 01 13 19:01:07#+00#ERROR#com.sap.cloud.extensibility.services.SalesOrderService##S0017476859#https-jsse-nio-8041-exec-5#na#gp30lvcw0u#extorderappapplication#web#gp30lvcw0u#na#na#na#na#Exception occured while creating a sales Order and the exception is :: com.sap.cloud.sdk.s4hana.datamodel.odata.helper.ODataVdmErrorResultHandler$ErpODataException: The endpoint responded with HTTP error code 400. No customer master record exists for sold-to party XXXXXXXX Full error message: { "error": { "code": "VP/199", "message": { "lang": "en", "value": "No customer master record exists for sold-to party XXXXXXXX" }, "innererror": { "application": { "component_id": "SD-SLS-SO", "service_namespace": "/SAP/", "service_id": "API_SALES_ORDER_SRV", "service_version": "0001" }, "transactionid": "A6D2614279520210E005FFF430C8AFAB", "timestamp": "20210113190107.8554210", "Error_Resolution": { "SAP_Transaction": "For backend administrators: use ADT feed reader \"SAP Gateway Error Log\" or run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details", "SAP_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)" }, "errordetails": [ { "code": "/IWBEP/CX_MGW_BUSI_EXCEPTION", "message": "No customer master record exists for sold-to party XXXXXXXX", "propertyref": "", "severity": "error", "transition": false, "target": "" } ] } } }