cancel
Showing results for 
Search instead for 
Did you mean: 

API call from Build Process

MartyMcCormick
Product and Topic Expert
Product and Topic Expert

Hello

I've created a new API action for creating a customer project in S/4HANA Cloud. I can successfully test the API via the web test tool just fine.

I then created a new process and added the data type for a new project (it has a child element for work package structure). I then integrate the action and map the fields, but when I call the Build Process API from Postman and approve the workflow, the process fails with the following error:

TypeError: Cannot read property "map" from undefined in <eval> at line number 157

I suspect it has something to do with the way I have set up my data type, but the JSON that is in the context when it fails matches exactly the JSON that is in the "successful" API test.

Successful call in API

Datatype:

JSON

{ "definitionId": "eu10.na-sa-sandbox-pf0pujwe.newcustomerprojectapprovaldemo.newProjectApproval", "context": { "customerProject": { "OrgID": "1710", "EndDate": "2024-03-25T00:00:00", "Currency": "USD", "Customer": "1000185", "ProjectID": "PROCAUTOAPI10", "StartDate": "2023-03-25T00:00:00", "CostCenter": "0017101902", "ProjectDesc": "PROCAUTOAPI10 Desc", "ProjectName": "PROCAUTOAPI10", "ProfitCenter": "YB101", "ProjectStage": "P001", "WorkPackageSet": { "results": [ { "ProjectID": "PROCAUTOAPI10", "WPEndDate": "2024-03-25T00:00:00", "Description": "Execution WP Desc", "WPStartDate": "2023-03-25T00:00:00", "WorkPackageID": "PROCAUTOAPI10.1", "WorkPackageName": "Execution" } ] }, "ProjectCategory": "C", "ProjManagerExtId": "I805828" } }}

Mapping

Error on API call via action

Any idea what I'm doing wrong?

Thanks,
Marty

Accepted Solutions (1)

Accepted Solutions (1)

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Marty,

We currently do not support complex nested structure in process automation. The structure is supported only till one level but in your case "result" inside "WorkPackageSet" is under 2-level nesting. Here is the documented restrictions. This however will be removed in the future when we support complex nested structure.

Answers (0)