hi experts
I have an entity 'Project' with keys = ObjectType & Guid
This project has attachments, and the navigation to the attachment is 'ToAttachment'. The attachment entity has its own set of keys (one of the key is 'ParentFolderGuid')
I managed to create the file 'hhhh' directly under Project using this URI:
POST:
/sap/opu/odata/sap/xxxxxxxxxxxxxx/ProjectSet(ObjectType='DPO',Guid='00215A9CF3301EDABFC364CE8F39B4B1')/ToAttachment
Calling the above URI will trigger the CREATE_STREAM method and not the ATTACHMENTSET_CREATE_ENTITY method.
My question is, how should i call the URI in order to create new file under 'new subfolder'?

Calling using these URI are not valid:
POST:
/sap/opu/odata/sap/xxxxxxxxxxxxxxxx/ProjectSet(ObjectType='DPO',Guid='00215A9CF3301EDABFC364CE8F39B4B1')/ToAttachment(ParentFolderGuid='00215A9CF3301EEB859BBC0F30861A61')
/sap/opu/odata/sap/xxxxxxxxxxxxxxxx/ProjectSet(ObjectType='DPO',Guid='00215A9CF3301EDABFC364CE8F39B4B1',ParentFolderGuid='00215A9CF3301EEB859BBC0F30861A61')/ToAttachment
I cannot pass the Attachment entity data as request body too, because in the CREATE_STREAM, there is no io_data_provider->read_entry_data to get the entity data.
The only possible solution i can think of is to pass the ParentFolderGuid as the request header, but surely there is some official way to do this?
Please advise.
Thanks
Request clarification before answering.
The best practise is to do like this. You will get the data in the media structure.. and if you attach the document via navigation, you can read the header keys there and if you want to pass any additional data then you can pass them in the header request parameters.
https://blogs.sap.com/2014/09/23/file-uploaddownload-through-netweaver-gateway/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.