Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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