Reputation: 1
We have built a number of extension apps, which run on BTP and call S/4HANA Public Cloud. Most are CAP Node.js and make use of the Cloud SDK for JavaScript. The oldest app still uses a CAP Java and we are slowly migrating the features over to Node.js (so that we might have a consistent setup).
One of the calls supported by the CAP app is to create a commercial project, using the service _CPD_SC_PROJ_ENGMT_CREATE_UPD_SRV (see https://api.sap.com/api/_CPD_SC_PROJ_ENGMT_CREATE_UPD_SRV). This works fine in production, using the CAP Java app. The project created has a number of work packages, some of which have work items underneath them. The first work package has demands underneath it. This has worked many thousands of times in production.
We have now set up the Node.js app to do the same thing. We have created a client for the service using the metadata file.
When running the app locally (hybrid, using cds bind) we can see that the project does get created, and it does have work packages, but the work items and demands are missing.
We do not get any error messages and can't see any relevant messages written to the log. We are using the latest version (3.8.1) of the SDK and have refreshed the metadata file and re-generated the client. I don't think there is an issue with the API, because when called from the Java app everything works fine.
Project created via Java app has workpackages and workitems.... ...and demands against the first work package
Project created via Node app has workpackages but no workitems.... ....and no demands
In the debugger we can see that the work items and demands are present in the project object which is passed to the execute function
{
projectId: "7001608034",
[redacted]
workPackageSet: [
{
projectId: "7001608034",
workPackageId: "7001608034.1.1",
workPackageName: "Assets",
demandSet: [
{
projectId: "7001608034",
workPackageId: "7001608034.1.1",
workPackageName: "Assets",
resType: "0ACT",
resourceId: "T020",
effort: {
s: 1,
e: 2,
c: [
100,
],
},
uom: "H",
delvryServOrg: "",
workitem: "",
},
],
workItemSet: [
{
projectId: "7001608034",
workPackageId: "7001608034.1.1",
workPackageName: "Assets",
workitem: "P002",
workitemname: "Non-circulating (P&E, Land, Leases)",
},
{
projectId: "7001608034",
workPackageId: "7001608034.1.1",
workPackageName: "Assets",
workitem: "P001",
workitemname: "Circulating (pre-appt debtors,stock,WIP)",
},
{
projectId: "7001608034",
workPackageId: "7001608034.1.1",
workPackageName: "Assets",
workitem: "P003",
workitemname: "Both circulating & non-circulating",
},
],
wpStartDate: {
_isAMomentObject: true,
_i: "2024-08-01",
_f: "YYYY-MM-DD",
_isUTC: false,
_pf: {
empty: false,
unusedTokens: [
],
unusedInput: [
],
overflow: -1,
charsLeftOver: 0,
nullInput: false,
invalidEra: null,
invalidMonth: null,
invalidFormat: false,
userInvalidated: false,
iso: true,
parsedDateParts: [
2024,
7,
1,
],
era: null,
meridiem: undefined,
rfc2822: false,
weekdayMismatch: false,
},
_locale: {
_calendar: {
sameDay: "[Today at] LT",
nextDay: "[Tomorrow at] LT",
nextWeek: "dddd [at] LT",
lastDay: "[Yesterday at] LT",
lastWeek: "[Last] dddd [at] LT",
sameElse: "L",
},
_longDateFormat: {
LTS: "h:mm:ss A",
LT: "h:mm A",
L: "MM/DD/YYYY",
LL: "MMMM D, YYYY",
LLL: "MMMM D, YYYY h:mm A",
LLLL: "dddd, MMMM D, YYYY h:mm A",
},
_invalidDate: "Invalid date",
ordinal: function (number) {
var b = number % 10,
output =
toInt((number % 100) / 10) === 1
? 'th'
: b === 1
? 'st'
: b === 2
? 'nd'
: b === 3
? 'rd'
: 'th';
return number + output;
},
_dayOfMonthOrdinalParse: {
},
_relativeTime: {
future: "in %s",
past: "%s ago",
s: "a few seconds",
ss: "%d seconds",
m: "a minute",
mm: "%d minutes",
h: "an hour",
hh: "%d hours",
d: "a day",
dd: "%d days",
w: "a week",
ww: "%d weeks",
M: "a month",
MM: "%d months",
y: "a year",
yy: "%d years",
},
_months: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
_monthsShort: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
_week: {
dow: 0,
doy: 6,
},
_weekdays: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
_weekdaysMin: [
"Su",
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa",
],
_weekdaysShort: [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
],
_meridiemParse: {
},
_eras: [
{
since: "0001-01-01",
until: Infinity,
offset: 1,
name: "Anno Domini",
narrow: "AD",
abbr: "AD",
},
{
since: "0000-12-31",
until: -Infinity,
offset: 1,
name: "Before Christ",
narrow: "BC",
abbr: "BC",
},
],
_abbr: "en",
_config: {
calendar: {
sameDay: "[Today at] LT",
nextDay: "[Tomorrow at] LT",
nextWeek: "dddd [at] LT",
lastDay: "[Yesterday at] LT",
lastWeek: "[Last] dddd [at] LT",
sameElse: "L",
},
longDateFormat: {
LTS: "h:mm:ss A",
LT: "h:mm A",
L: "MM/DD/YYYY",
LL: "MMMM D, YYYY",
LLL: "MMMM D, YYYY h:mm A",
LLLL: "dddd, MMMM D, YYYY h:mm A",
},
invalidDate: "Invalid date",
ordinal: function (number) {
var b = number % 10,
output =
toInt((number % 100) / 10) === 1
? 'th'
: b === 1
? 'st'
: b === 2
? 'nd'
: b === 3
? 'rd'
: 'th';
return number + output;
},
dayOfMonthOrdinalParse: {
},
relativeTime: {
future: "in %s",
past: "%s ago",
s: "a few seconds",
ss: "%d seconds",
m: "a minute",
mm: "%d minutes",
h: "an hour",
hh: "%d hours",
d: "a day",
dd: "%d days",
w: "a week",
ww: "%d weeks",
M: "a month",
MM: "%d months",
y: "a year",
yy: "%d years",
},
months: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
monthsShort: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
week: {
dow: 0,
doy: 6,
},
weekdays: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
weekdaysMin: [
"Su",
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa",
],
weekdaysShort: [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
],
meridiemParse: {
},
eras: [
{
since: "0001-01-01",
until: Infinity,
offset: 1,
name: "Anno Domini",
narrow: "AD",
abbr: "AD",
},
{
since: "0000-12-31",
until: -Infinity,
offset: 1,
name: "Before Christ",
narrow: "BC",
abbr: "BC",
},
],
abbr: "en",
},
_dayOfMonthOrdinalParseLenient: {
},
},
_d: "2024-08-01T00:00:00.000Z",
_isValid: true,
},
wpEndDate: {
_isAMomentObject: true,
_i: "2029-08-01",
_f: "YYYY-MM-DD",
_isUTC: false,
_pf: {
empty: false,
unusedTokens: [
],
unusedInput: [
],
overflow: -1,
charsLeftOver: 0,
nullInput: false,
invalidEra: null,
invalidMonth: null,
invalidFormat: false,
userInvalidated: false,
iso: true,
parsedDateParts: [
2029,
7,
1,
],
era: null,
meridiem: undefined,
rfc2822: false,
weekdayMismatch: false,
},
_locale: {
_calendar: {
sameDay: "[Today at] LT",
nextDay: "[Tomorrow at] LT",
nextWeek: "dddd [at] LT",
lastDay: "[Yesterday at] LT",
lastWeek: "[Last] dddd [at] LT",
sameElse: "L",
},
_longDateFormat: {
LTS: "h:mm:ss A",
LT: "h:mm A",
L: "MM/DD/YYYY",
LL: "MMMM D, YYYY",
LLL: "MMMM D, YYYY h:mm A",
LLLL: "dddd, MMMM D, YYYY h:mm A",
},
_invalidDate: "Invalid date",
ordinal: function (number) {
var b = number % 10,
output =
toInt((number % 100) / 10) === 1
? 'th'
: b === 1
? 'st'
: b === 2
? 'nd'
: b === 3
? 'rd'
: 'th';
return number + output;
},
_dayOfMonthOrdinalParse: {
},
_relativeTime: {
future: "in %s",
past: "%s ago",
s: "a few seconds",
ss: "%d seconds",
m: "a minute",
mm: "%d minutes",
h: "an hour",
hh: "%d hours",
d: "a day",
dd: "%d days",
w: "a week",
ww: "%d weeks",
M: "a month",
MM: "%d months",
y: "a year",
yy: "%d years",
},
_months: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
_monthsShort: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
_week: {
dow: 0,
doy: 6,
},
_weekdays: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
_weekdaysMin: [
"Su",
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa",
],
_weekdaysShort: [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
],
_meridiemParse: {
},
_eras: [
{
since: "0001-01-01",
until: Infinity,
offset: 1,
name: "Anno Domini",
narrow: "AD",
abbr: "AD",
},
{
since: "0000-12-31",
until: -Infinity,
offset: 1,
name: "Before Christ",
narrow: "BC",
abbr: "BC",
},
],
_abbr: "en",
_config: {
calendar: {
sameDay: "[Today at] LT",
nextDay: "[Tomorrow at] LT",
nextWeek: "dddd [at] LT",
lastDay: "[Yesterday at] LT",
lastWeek: "[Last] dddd [at] LT",
sameElse: "L",
},
longDateFormat: {
LTS: "h:mm:ss A",
LT: "h:mm A",
L: "MM/DD/YYYY",
LL: "MMMM D, YYYY",
LLL: "MMMM D, YYYY h:mm A",
LLLL: "dddd, MMMM D, YYYY h:mm A",
},
invalidDate: "Invalid date",
ordinal: function (number) {
var b = number % 10,
output =
toInt((number % 100) / 10) === 1
? 'th'
: b === 1
? 'st'
: b === 2
? 'nd'
: b === 3
? 'rd'
: 'th';
return number + output;
},
dayOfMonthOrdinalParse: {
},
relativeTime: {
future: "in %s",
past: "%s ago",
s: "a few seconds",
ss: "%d seconds",
m: "a minute",
mm: "%d minutes",
h: "an hour",
hh: "%d hours",
d: "a day",
dd: "%d days",
w: "a week",
ww: "%d weeks",
M: "a month",
MM: "%d months",
y: "a year",
yy: "%d years",
},
months: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
monthsShort: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
week: {
dow: 0,
doy: 6,
},
weekdays: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
weekdaysMin: [
"Su",
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa",
],
weekdaysShort: [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
],
meridiemParse: {
},
eras: [
{
since: "0001-01-01",
until: Infinity,
offset: 1,
name: "Anno Domini",
narrow: "AD",
abbr: "AD",
},
{
since: "0000-12-31",
until: -Infinity,
offset: 1,
name: "Before Christ",
narrow: "BC",
abbr: "BC",
},
],
abbr: "en",
},
_dayOfMonthOrdinalParseLenient: {
},
},
_d: "2029-08-01T00:00:00.000Z",
_isValid: true,
},
yy1ExcludeBillingCfCpd: false,
},
{
projectId: "7001608034",
workPackageId: "7001608034.1.2",
workPackageName: "Creditors",
demandSet: [
],
workItemSet: [
{
projectId: "7001608034",
workPackageId: "7001608034.1.2",
workPackageName: "Creditors",
workitem: "P006",
workitemname: "Meetings/proposals without meetings",
},
{
projectId: "7001608034",
workPackageId: "7001608034.1.2",
workPackageName: "Creditors",
workitem: "P005",
workitemname: "Unsecured creditors",
},
{
projectId: "7001608034",
workPackageId: "7001608034.1.2",
workPackageName: "Creditors",
workitem: "P004",
workitemname: "Secured creditor(s)/PPSR/ROT",
},
],
[truncated]
Upvotes: 0
Views: 65
Reputation: 21
You've written you are using version 3.8.1, please try to use the latest version, 3.20.0.
From the images you've shared, it's hard to deduce possible causes of your error, therefore it would be helpful to share the code where you are using the Cloud SDK.
If the object passed to the execute function contains all the expected values, it is unlikely for the SDK client to be the cause of your issue, as the execute function forwards this object to the HTTP client.
Upvotes: 0