cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Standard API ODATA v2 Class Data for Classification

jmhvieira
Explorer
0 Likes
1,965

Hello experts,

has anyone in this community ever implemented this API?  I kindly ask for your assistance. I'm facing an error when posting a request to create a class header, however I'm able to perform a get entity set to read the existing class headers.

APIhttps://api.sap.com/api/OP_API_CLFN_CLASS_SRV/overview

I'm currently using a S4HANA on premise 2022 FPS01. I already tried the same API in a more recent system but unfortunately, I got the same error message.

 

URL Request:

(...)sap/opu/odata/SAP/API_CLFN_CLASS_SRV/A_ClfnClassForKeyDate   

 

HTTP Method:

Post

 

JSON:

{
   "ClassType": "300",
   "Class": "API_test1",
   "ClassStatus": "1",
   "ClassGroup": "",
   "ClassSearchAuthGrp": "",
   "ClassClassfctnAuthGrp": "",
   "ClassMaintAuthGrp": "",
   "DocNumber": "",
   "DocumentType": "",
   "DocumentPart": "",
   "DocumentVersion": "",
   "SameClassfctnReaction": "X",
   "ClassStandardOrgName": "",
   "ClassStandardNumber": "",
   "ClassStandardStartDate": null,
   "ClassStandardVersionStartDate": null,
   "ClassStandardVersion": "0",
   "ClassStandardCharcTable": "",
   "ClassIsLocal": true,
   "to_ClassCharacteristic": [
       {}
   ],
   "to_ClassDescription": [
       {
            "Language": "EN",
           "ClassDescription": "API_test1",
           "to_Class": {}          
       }
   ],
   "to_ClassKeyword": [
       {}
   ],
   "to_ClassText": [
       {}
   ]
}

 

Status:

405 Method Not Allowed

 

Error details:

"errordetails": [
               {
                "ContentID": "",
                 "code": "CX_SADL_ENTITY_CUD_DISABLED",
                 "message": "Creating operations are disabled for association '_CLASS', source entity 'API_CLFN_CLASS~A_CLFNCLASSDESCFORKEYDATE'",
                "propertyref": "",
                "severity": "error",
                "transition": false,
                "target": ""
               },
               {
                 "ContentID": "",                                           "code": "/IWBEP/CX_MGW_BUSI_EXCEPTION",                                                    "message": "An exception  was raised",
                "propertyref": "",
                "severity": "error",
                "transition": false,
                "target": ""
               }
           ]

Thank you,
Best Regards

 

Accepted Solutions (1)

Accepted Solutions (1)

Ryan-Crosby
Active Contributor

Try removing the "to_class": {} association that it is complaining about in, and probably best to remove the other associations with no data.

   "to_ClassDescription": [
       {
            "Language": "EN",
           "ClassDescription": "API_test1",
           "to_Class": {}          
       }
   ],

 

Regards,

Ryan Crosby

jmhvieira
Explorer
0 Likes
Thank you very much for your help Ryan, your suggestion worked perfectly.

Answers (0)