Escolar Documentos
Profissional Documentos
Cultura Documentos
SEGW
2. How to active Gateway Service? /IWFND/MAINT_SERVICE
3. How to implement Gateway Servcie��
URI
/sap/opu/odata/sap/ZGEA_DEMO02_SRV/BusinessPartnerSet
URI
/sap/opu/odata/sap/ZGEA_DEMO02_SRV/SalesOrderSet
/sap/opu/odata/sap/ZGEA_DEMO02_SRV/SalesOrderSet('10000000')
/sap/opu/odata/sap/ZGEA_DEMO02_SRV/SalesOrderSet('10000000')/SalesOrderItems
Structure: ZGEA_S_SO_HEADER
ZGEA_S_SO_ITEM
Assiociation: SalesOrder_To_Items
Navigation
Service Implementation
Mapping to Source Entity
DPC_EXT=>Sadl
4) Query By Sadl
importing parameter io_tech_request_context
sadl method _get_entity_set_request_detail.
GET EntitySet
/sap/opu/odata/sap/ZGEA_DEMO02_SRV/ZGEA_CV_BusinessPartner?$inlinecount=allpages
/sap/opu/odata/sap/ZGEA_DEMO02_SRV/ZGEA_CV_BusinessPartner/$count
/sap/opu/odata/sap/ZGEA_DEMO02_SRV/ZGEA_CV_BusinessPartner?
$filter=substringof(CompanyName, 'SAP')&$inlinecount=allpages
/sap/opu/odata/sap/ZGEA_DEMO02_SRV/ZGEA_CV_BusinessPartner?
$select=BusinessPartnerID,CompanyName
/sap/opu/odata/sap/ZGEA_SO_SRV/BusinessPartnerSet?
$select=BusinessPartnerID,CompanyName&$filter=substringof(CompanyName,
'SAP')&$orderby=CompanyName&$skip=1&$top=4&$inlinecount=allpages
/sap/opu/odata/sap/ZGEA_DEMO02_SRV/ZGEA_CV_BusinessPartner?
$select=BusinessPartnerID,CompanyName&$filter=substringof(CompanyName,
'SAP')&$orderby=CompanyName&$skip=1&$top=4&$inlinecount=allpages
GET Entity
/sap/opu/odata/sap/ZGEA_SO_SRV/SalesOrderSet('10000000')
5) CREATE/UPDATE/DELETE Entity
Header
Content-Type application/json
{
"SalesOrderID": "0010000001",
"Note": "Test 02",
"BuyerID":"0000000002",
"CurrencyCode": "CNY",
"GrossAmount":"200",
"NetAmount":"180",
"TaxAmount":"20"
}
Header
Content-Type application/json
"SalesOrderID":"0010000001",
"SalesOrderItem":"10",
"ProductID":"P1",
"Note":"10000000-P1",
"CurrencyCode":"CNY",
"GrossAmount":"100",
"NetAmount":"90",
"TaxAmount":"10",
"Quantity":"1",
"QuantityUnit":"EA"
Header
Content-Type application/json
{
"SalesOrderItem":"20",
"ProductID":"P2",
"Note":"10000000-P2",
"CurrencyCode":"CNY",
"GrossAmount":"100",
"NetAmount":"90",
"TaxAmount":"10",
"Quantity":"1",
"QuantityUnit":"EA"
URI /sap/opu/odata/sap/ZGEA_SO_SRV/SalesOrderSet
Header
Content-Type application/atom+xml
Body
<?xml version="1.0" encoding="utf-8"?>
<entry m:etag="W/"datetime'2017-07-27T06%3A12%3A05.5508910'""
xml:base="http://CNDLCT01.cndlc.sap.corp:8000/sap/opu/odata/sap/ZGEA_SO_SRV/"
xmlns="http://www.w3.org/2005/Atom"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<category term="ZGEA_SO_SRV.SalesOrder"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SalesOrderItems"
type="application/atom+xml;type=feed" title="SalesOrderItems">
<m:inline>
<feed
xml:base="http://CNDLCT01.cndlc.sap.corp:8000/sap/opu/odata/sap/ZGEA_SO_SRV/">
<author>
<name/>
</author>
<entry>
<category term="ZGEA_SO_SRV.SalesOrderItems"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:SalesOrderID>10000002</d:SalesOrderID>
<d:SalesOrderItem>10</d:SalesOrderItem>
<d:ProductID>P1</d:ProductID>
<d:Note>10000002-P1</d:Note>
<d:NoteLanguage/>
<d:CurrencyCode>CNY</d:CurrencyCode>
<d:GrossAmount>100.00</d:GrossAmount>
<d:NetAmount>90.00</d:NetAmount>
<d:TaxAmount>10.00</d:TaxAmount>
<d:DeliveryDate m:null="true"/>
<d:Quantity>1</d:Quantity>
<d:QuantityUnit>EA</d:QuantityUnit>
</m:properties>
</content>
</entry>
<entry>
<category term="ZGEA_SO_SRV.SalesOrderItems"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:SalesOrderID>10000002</d:SalesOrderID>
<d:SalesOrderItem>20</d:SalesOrderItem>
<d:ProductID>P2</d:ProductID>
<d:Note>10000002-P2</d:Note>
<d:NoteLanguage/>
<d:CurrencyCode>CNY</d:CurrencyCode>
<d:GrossAmount>100.00</d:GrossAmount>
<d:NetAmount>90.00</d:NetAmount>
<d:TaxAmount>10.00</d:TaxAmount>
<d:DeliveryDate m:null="true"/>
<d:Quantity>1</d:Quantity>
<d:QuantityUnit>EA</d:QuantityUnit>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<content type="application/xml">
<m:properties>
<d:SalesOrderID>10000002</d:SalesOrderID>
<d:Note>Test 01</d:Note>
<d:BuyerID>1</d:BuyerID>
<d:BuyerName>SAP</d:BuyerName>
<d:CurrencyCode>CNY</d:CurrencyCode>
<d:GrossAmount>100.00</d:GrossAmount>
<d:NetAmount>90.00</d:NetAmount>
<d:TaxAmount>10.00</d:TaxAmount>
<d:LifecycleStatus/>
<d:LifecycleStatusDescription/>
<d:BillingStatus/>
<d:BillingStatusDescription/>
<d:DeliveryStatus/>
<d:DeliveryStatusDescription/>
</m:properties>
</content>
</entry>
Header
Content-Type application/json
Body
{
"SalesOrderID": "0010000003",
"Note": "Test 03",
"BuyerID":"0000000002",
"CurrencyCode": "CNY",
"GrossAmount":"200",
"NetAmount":"180",
"TaxAmount":"20",
"SalesOrderItems":[
{ "SalesOrderItem":"10",
"ProductID":"P1",
"Note":"10000003-P1",
"CurrencyCode":"CNY",
"GrossAmount":"100",
"NetAmount":"90",
"TaxAmount":"10",
"Quantity":"1",
"QuantityUnit":"EA"},
{ "SalesOrderItem":"20",
"ProductID":"P2",
"Note":"10000003-P2",
"CurrencyCode":"CNY",
"GrossAmount":"100",
"NetAmount":"90",
"TaxAmount":"10",
"Quantity":"1",
"QuantityUnit":"EA"}
]
}
5.5)ChangeSet
Changeset Sample
URI /sap/opu/odata/sap/ZGEA_SO_SRV/$batch
Method POST
Header
Content-Type multipart/mixed;boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77
Body
--batch_36522ad7-fc75-4b56-8c71-56071383e77
Content-Type: multipart/mixed; boundary=changeset_36522ad7-0001
--changeset_36522ad7-0001
Content-Type: application/http
Content-Transfer-Encoding: binary
{
"BusinessPartnerID":"0000000007",
"BusinessPartnerRole":"02",
"CompanyName":"SAP Vendoer 02",
"Address":{
"AddressID":"0000010002",
"City":"Dalian",
"PostalCode":"116023",
"Street":"WuYi Road",
"Building":"24#",
"Country":"CN",
"AddressType":"02"
}
}
--changeset_36522ad7-0001
Content-Type: application/http
Content-Transfer-Encoding: binary
{
"BusinessPartnerID":"0000000008",
"BusinessPartnerRole":"02",
"CompanyName":"SAP Vendoer 03",
"Address":{
"AddressID":"0000010003",
"City":"Dalian",
"PostalCode":"116023",
"Street":"WuYi Road",
"Building":"23#",
"Country":"CN",
"AddressType":"02"
}
}
--changeset_36522ad7-0001--
--batch_36522ad7-fc75-4b56-8c71-56071383e77--
URI /sap/opu/odata/sap/ZGEA_SO_SRV/BusinessPartnerSet('6')
METHOD MERGE
Header
Content-Type application/json
If-Match W/"datetime'2017-07-26T06%3A12%3A16.1836510'"
Body
{
"CompanyName": "SAP Vendor 01"
}
Header
Content-Type multipart/mixed;boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77
--batch_36522ad7-fc75-4b56-8c71-56071383e77
Content-Type: multipart/mixed; boundary=changeset_36522ad7-0001
--changeset_36522ad7-0001
Content-Type: application/http
Content-Transfer-Encoding: binary
--changeset_36522ad7-0001
Content-Type: application/http
Content-Transfer-Encoding: binary
--changeset_36522ad7-0001--
--batch_36522ad7-fc75-4b56-8c71-56071383e77--
-----------------------------------------------------------------
Batch->Get
Batch->ChangeSet Content-ID
Batch->ChangeSet Defer
Function Import
-----------------------------------------------
MPC_EXT