on 12-14-2015 3:51 PM
Hi,
We have two different entity sets for header and line item data in SAP. We defined the association to link header and line item details. We are able to post the document in SAP using XML template.
We designed the frontend using UI5 elements and need to post the document. Need the solution for the below issues.
1) How do we map the data of a view to ODATA model?
2) How do push the header and line item data of ODATA model to SAP using CREATE method?
As far as I know, we can specify one Entity Set in CREATE method. Our requirement is to push data to two different Entity Set using CREATE method.
Regards
Nidhi
Hi Rob,
Thanks a lot.
Yep, we have created a method called CUSTOME_CREATE_DEEP_ENTITY.
The document is focused only on SEGW. Now we need to consume this service in front end. We are not aware of pushing the data from front end to SAP. It would be really helpful if you share any relevant documents which consumes the deep entity method from front end.
Regards
Nidhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nidhi,
I think you will get better answer in SAP UI5 Forum because you are trying to send the whole Create data into XML/JSON formate using POST call.
In my understanding, you have to make whole XML/JSON of POST into data part as request Header parameter in AJAX call or inside odata Model call.
data will contain XML or JSON data which will create
Example in AJAX call :
$.ajax({
type:"post",
data: ls_data,
contentType : 'application/json',
dataType : 'json',
crossDomain: true,
url:<service_url>,
headers: {
"Content-Type": "application/atom+xml;type=entry; charset=utf-8",
"X-CSRF-TOKEN":"Fetch"
},
//beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', 'Basic ' + btoa(usr+":"+pwd) ); },
success : function(json,status,request) {
------------------------------
-------------------------
},
error : function(jqXHR, textStatus, errorThrown) {
errorMsg+=" Sorry! Error in getting User Details";
}
});
Regards
Vivek
Hi,
If you provide header and item date it will go to the create_deep_entity method.
Just check this blog, I think it will answer all of your questions.
Kind regards, Rob Dielemans
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.