cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble in Applying Batch-Parent-Child in UI5

and23_julius
Participant
0 Kudos
889

Hi Expert,

I was looking at this great blog https://blogs.sap.com/2016/02/15/introduction-odata-batch-processing-with-content-id-in-sap-gateway by Kenichi Unnai, then I was trying to create the UI5 code to simulate normal payload (i.e.: $1/Nav), but I have some problem.

oModel.createEntry("/HeadSet", { 
	"groupId": "foo",
	"headers":{"Content-ID":1},
	properties: aHead
});
.....
oModel.createEntry("$1/HeadItemNav", { <-- ERROR HERE: No Metadata for collection found
	"groupId": "foo",
	properties: aItem
});
.....                                  NOTE: HeadItemNav is linked to ItemSet
oModel.submitChanges({
	"groupId": "foo",
	success: function(oData){
		MessageToast.show("SUCCESS");
	},
	error: function(oError){
		MessageToast.show("ERROR");
	}
});

Meanwhile if I just use like below, it got through, but I have a difficulty in getting pushing in value for IT_OPERATION_INFO-CONTENT_ID_REF in CHANGESET_BEGIN.

oModel.createEntry("/ItemSet", {        <-- this got through to CHANGESET_BEGIN
	"groupId": "foo",
	"headers":{"Content-ID-Ref":1}, <-- This Does not seem to pass to CONTENT_ID_REF
	properties: aItem
});

How do I pass value to IT_OPERATION_INFO-CONTENT_ID_REF I wonder? Appreciate your expertise and advice on this matter

Best Regards

Andre Julius

View Entire Topic
maheshpalavalli
Active Contributor
0 Kudos

Hi Andre,

The "Content-ID" you are passing is incorrect. it should be "content-ID" and It should work for normal "create" but not sure if it works for "createEntry".

					"headers": {
						"content-ID": 1
					}

Let me know if you get any issues.

I am not sure why "$1/Nav" is not working, not even sure if ui5 supports it(Never tried 😞 ).

Instead you can use the deep structure format to send the data, but you might have to call "Create" function for this and you will be able to get the data in deep format in changesetprocess method.

** UPDATE **

you need to mention "/$1/navigation" . you missed the '/' before the content id.

BR,

Mahesh

and23_julius
Participant
0 Kudos

Just to add context: "/$1/navigation" it does work, with "create", but not with "createEntry"

Hopefully "create" works well with my Offline app...

maheshpalavalli
Active Contributor
0 Kudos

Hi Andre, yeah, saw that in open ui5 git issues, it said that it won't work in createEntry

BR,

Mahesh