3 weeks ago - last edited 3 weeks ago
Hi,
I'm trying to make a sample of POST data in SEGW that call a BAPI. I follow this tutorial step by step:
Step-by-step Creation of sales order using BAPI in... - SAP Community
However, when I try to POST through SAP Gateway Client, there is error 405 Method Not Allowed. I already tried some solutions including tick Creatable, Updatable in Entity Properties but the error 405 persists.
I also try to create another SEGW project that call a simple BAPI to insert data to my ZTable, but
The similar error 405 also happens
HTTP Status Code : 405
Error Text : The specified HTTP method is not allowed for the resource identified by the Data Service Request URI
T100 Error ID : /IWFND/CM_CONSUMER122
I also make other SEGW sample project to GET data from a BAPI as well, it works well and everything is okay. The problem only happens when I POST data to a BAPI create.
Is there any solution for this error? Is is related to networking setting/configuration?
remove $format=json
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@YS1990 are you sure you have tried like this?
/sap/opu/odata/sap/Z_ODTSLSORDCRT_SRV/SalesOrderSet
request body
{ "DocType" : "TA", "SalesOrg" : "8900", "DistrChan" : "10", "Division" : "11", "TextLine" : "coba text", "ItmNumber" : "000010", "ReqQty" : "15.000", "PartnRole" : "AG", "PartnNumb" : "0001000000", "Material" : "000000000030000032", "Plant" : "8921", "TargetQty" : "15.000", "CondType" : "", "CondValue" : "0.000000000" }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Junwu,
I tried to change my request body and still error (404)
with this url
/sap/opu/odata/sap/Z_ODTSLSORDCRT_SRV/SalesOrderSet?$format=json
and
Error (405) with this url
/sap/opu/odata/sap/Z_ODTSLSORDCRT_SRV/SalesOrderSet('0050000004')?$format=json
Both the request body is
{
"DocType" : "TA",
"SalesOrg" : "8900",
"DistrChan" : "10",
"Division" : "11",
"TextLine" : "coba text",
"ItmNumber" : "000010",
"ReqQty" : "15.000",
"PartnRole" : "AG",
"PartnNumb" : "0001000000",
"Material" : "000000000030000032",
"Plant" : "8921",
"TargetQty" : "15.000",
"CondType" : "",
"CondValue" : "0.000000000"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you are not following correctly.
{
"DocType" : "TA",
"SalesOrg" : "8900",
"DistrChan" : "10",
"Division" : "11",
"TextLine" : "coba text",
"ItmNumber" : "000010",
"ReqQty" : "15.000",
"PartnRole" : "AG",
"PartnNumb" : "0001000000",
"Material" : "000000000030000032",
"Plant" : "8921",
"TargetQty" : "15.000",
"CondType" : "",
"CondValue" : "0.000000000"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you want to test "create", you have to remove ("***") from the url, entityset name is enough
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
remove this part in your payload for post call
"d" : {
"__metadata" : {
"id" : "http://hostname.local:8004/sap/opu/odata/sap/Z_ODTSLSORDCRT_SRV/SalesOrderSet('50000004')",
"uri" : "http://hostname.local:8004/sap/opu/odata/sap/Z_ODTSLSORDCRT_SRV/SalesOrderSet('50000004')",
"type" : "Z_ODTSLSORDCRT_SRV.SalesOrder"
},
{
"d" : {
"__metadata" : {
"id" : "http://hostname.local:8004/sap/opu/odata/sap/Z_ODTSLSORDCRT_SRV/SalesOrderSet('50000004')",
"uri" : "http://hostname.local:8004/sap/opu/odata/sap/Z_ODTSLSORDCRT_SRV/SalesOrderSet('50000004')",
"type" : "Z_ODTSLSORDCRT_SRV.SalesOrder"
},
"DocType" : "TA",
"SalesOrg" : "8900",
"DistrChan" : "10",
"Division" : "11",
"TextLine" : "coba text",
"ItmNumber" : "000010",
"ReqQty" : "15.000",
"PartnRole" : "AG",
"PartnNumb" : "0001000000",
"Material" : "000000000030000032",
"Plant" : "8921",
"TargetQty" : "15.000",
"CondType" : "",
"CondValue" : "0.000000000"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.