0% found this document useful (0 votes)
812 views9 pages

Crud Operation Create - Deep - Entity. Odata

This document provides a step-by-step guide for developing a CREATE_DEEP_ENTITY operation in SAP Gateway. It describes creating entity types, entity sets, associations and navigations for a deep entity. It also covers generating runtime artifacts, registering the OData service, and building custom types and methods to handle the deep entity creation.

Uploaded by

carmen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
812 views9 pages

Crud Operation Create - Deep - Entity. Odata

This document provides a step-by-step guide for developing a CREATE_DEEP_ENTITY operation in SAP Gateway. It describes creating entity types, entity sets, associations and navigations for a deep entity. It also covers generating runtime artifacts, registering the OData service, and building custom types and methods to handle the deep entity creation.

Uploaded by

carmen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

9/12/2016

StepbyStepdevelopmentforCREATE_DEEP_ENTITY...|SCN

GettingStarted Newsletters

Hi,Guest

LogOn

JoinUs

Store

SearchtheCommunity

Products

Services&Support

AboutSCN

Downloads

Industries

Training&Education

Partnership

DeveloperCenter

Activity

LinesofBusiness

UniversityAlliances

Events&Webinars

Innovation

Browse

Communications

Actions

SAPGateway

StepbyStepdevelopmentfor
CREATE_DEEP_ENTITYoperation
PostedbySyamBabuinSAPGatewayonApr27,20148:10:56AM
Share

Tweet

Like

ThisblogIwillexplaincreaonofSAPNWGWODataservicewhichwillimplementCreateDeepEntyoperaon.

SAPdocumentaonfordeepunderstanding.
DeepInsertSAPNetWeaverGatewaySAPLibrary

CreateCustomRFCgivenbelowStructures.
Structure1Header
Structure2ItemO
Structure3ItemT

http://scn.sap.com/community/gateway/blog/2014/04/27/stepbystepdevelopmentguideforcreatedeepentityoperation

1/29

9/12/2016

StepbyStepdevelopmentforCREATE_DEEP_ENTITY...|SCN

CreateProjectinSEGW

CreatethreeentytypesandEntySets
EntyType1Header
EntyType2ItemO
EntyType3ItemT
EntySet1HeaderSet
EntySet2ItemOSet
http://scn.sap.com/community/gateway/blog/2014/04/27/stepbystepdevelopmentguideforcreatedeepentityoperation

2/29

9/12/2016

StepbyStepdevelopmentforCREATE_DEEP_ENTITY...|SCN

EntySet3ItemTSet

EntyTypeHeader

EntyTypeItemO

EntyTypeItemT

EntySetsHeaderSet,ItemOSet,ItemTSet

CreateAssociaonsgivenbelow

http://scn.sap.com/community/gateway/blog/2014/04/27/stepbystepdevelopmentguideforcreatedeepentityoperation

3/29

9/12/2016

StepbyStepdevelopmentforCREATE_DEEP_ENTITY...|SCN

Associaon1Header_ItemO(Withoutkeyeldsmapping)
Associaon2Header_ItemT(Withoutkeyeldsmapping)

CreateNavigaongivenbelow
Navigaon1HeadItemO
Navigaon2HeadItemT

Nowletsgeneraterunmearfacts.Clickongeneraterunmeobjectsbuon.Itwilldisplay
popup.Keepthedefaultclassnamesasisandclickonenterbuon.

Oncegeneraonissuccessful,youwillget4classes.2forDataproviderand2forModelprovider.

http://scn.sap.com/community/gateway/blog/2014/04/27/stepbystepdevelopmentguideforcreatedeepentityoperation

4/29

9/12/2016

StepbyStepdevelopmentforCREATE_DEEP_ENTITY...|SCN

Onceregistraondonesuccessfully.GotoGatewayClient(calltransacon/IWFND/GW_CLIENTtoopenSAPNWGateway
client)
Append$metatdatobaseserviceURLandpressexecutebuon.IfeverythingisnethenyouwillHTTP
Responseasbelow.MetadataprovidesinformaonsuchasEntytype,keyproperty,properesandEntySet
nameandalsocheckservicedocumentappend?$format=xml.

http://scn.sap.com/community/gateway/blog/2014/04/27/stepbystepdevelopmentguideforcreatedeepentityoperation

5/29

9/12/2016

StepbyStepdevelopmentforCREATE_DEEP_ENTITY...|SCN

BuildTypesforDeepEnty

http://scn.sap.com/community/gateway/blog/2014/04/27/stepbystepdevelopmentguideforcreatedeepentityoperation

6/29

9/12/2016

StepbyStepdevelopmentforCREATE_DEEP_ENTITY...|SCN

CodeSnippet

**
*CLASSZCL_ZPROJ_GR_MULTIDEEP_MPC_EXTDEFINITION
**
*
**
CLASSzcl_zproj_gr_muldeep_mpc_extDEFINITION
PUBLIC
INHERITINGFROMzcl_zproj_gr_muldeep_mpc
CREATEPUBLIC.
PUBLICSECTION.

http://scn.sap.com/community/gateway/blog/2014/04/27/stepbystepdevelopmentguideforcreatedeepentityoperation

7/29

9/12/2016

StepbyStepdevelopmentforCREATE_DEEP_ENTITY...|SCN

TYPES:
BEGINOFts_deep_enty,
idTYPEchar10,
nameTYPEchar30,
name2TYPEchar30,
headitemoTYPESTANDARDTABLEOFts_itemoWITHDEFAULTKEY,
headitemtTYPESTANDARDTABLEOFts_itemtWITHDEFAULTKEY,
ENDOFts_deep_enty.
METHODSdene
REDEFINITION.

RedenetheDEFINEmethodofExtendedModelProviderclass
ZCL_ZPROJ_GR_MULTIDEEP_MPC_EXT

CodeSnippet

METHODdene.
super>dene().
DATA:
lo_annotaonTYPEREFTO/iwbep/if_mgw_odata_annotaon,
lo_enty_typeTYPEREFTO/iwbep/if_mgw_odata_enty_typ,
http://scn.sap.com/community/gateway/blog/2014/04/27/stepbystepdevelopmentguideforcreatedeepentityoperation

8/29

9/12/2016

StepbyStepdevelopmentforCREATE_DEEP_ENTITY...|SCN

lo_complex_typeTYPEREFTO/iwbep/if_mgw_odata_cmplx_type,
lo_propertyTYPEREFTO/iwbep/if_mgw_odata_property,
lo_enty_setTYPEREFTO/iwbep/if_mgw_odata_enty_set.
***********************************************************************************************************************************
*ENTITYDeepEnty
***********************************************************************************************************************************
lo_enty_type=model>get_enty_type(iv_enty_name='Header')."#ECNOTEXT
lo_enty_type>bind_structure(iv_structure_name='ZCL_ZPROJ_GR_MULTIDEEP_MPC_EXT=>TS_DEEP_ENTITY').
"#ECNOTEXT
ENDMETHOD.

Nowwehavecreateonecustommethod(CUSTOME_CREATE_DEEP_ENTITY)inclass
ZCL_ZPROJ_GR_MULTIDEEP_DPC_EXT

http://scn.sap.com/community/gateway/blog/2014/04/27/stepbystepdevelopmentguideforcreatedeepentityoperation

9/29

You might also like