Вы находитесь на странице: 1из 4

8/26/2015

CreationofbusinesspartnerusingBOLprogramming:

20thMarch2014 CreationofbusinesspartnerusingBOLprogramming:
Fieldsupdated:
Firstname,
lastname,
Street,
postalcode,
country,
gender&
email.
Code:
*&*
*&ReportZMV_BOL_BP_CREATE
*&
*&*
*&
*&
*&*
REPORTZMV_BOL_BP_CREATE.
*Declarionofobjects
DATA:lr_coreTYPEREFTOcl_crm_bol_core.
DATA:lr_entityTYPEREFTOcl_crm_bol_entity.
DATA:lr_entity_adrTYPEREFTOcl_crm_bol_entity.
DATA:lr_entity_mailTYPEREFTOcl_crm_bol_entity.
DATA:lr_entity_gendTYPEREFTOcl_crm_bol_entity.
DATA:lr_factoryTYPEREFTOcl_crm_bol_entity_factory.
DATA:lr_transactionTYPEREFTOif_bol_transaction_context.
*Declarationofworkareas
DATA:ls_addrTYPECRMT_BUPA_IL_ADDRESS.
DATA:ls_dataTYPEcrmst_header_object_buil.
data:ls_mailTYPECRMST_EMAIL_BUIL.
data:ls_genderTYPECRMT_ICM_BP_DESCR_UI.
DATA:ls_paramsTYPEcrmt_name_value_pair.
*Declarationofinternaltable
DATA:lt_paramsTYPEcrmt_name_value_pair_tab.
*Declarationofvariables
DATA:lv_bpnoTYPEstring.
*Creatinginstancetobusinessobjectlayer
http://sapcrmbasicsrelatedtowebui.blogspot.in/2014/03/creationofbusinesspartnerusingbol.html

1/4

8/26/2015

CreationofbusinesspartnerusingBOLprogramming:

lr_core=cl_crm_bol_core=>get_instance().
TRY.
lr_core>start_up('BP_APPL').
CATCHcx_crm_genil_general_error.
ENDTRY.
lr_factory=lr_core>get_entity_factory('BuilHeader').
*AssigningBusinesscategoryandgrouptoaBP.
ls_paramsname='BP_CATEGORY'.
ls_paramsvalue='1'.
APPENDls_paramsTOlt_params.
ls_paramsname='BP_GROUP'.
ls_paramsvalue='0001'.
APPENDls_paramsTOlt_params.
lr_entity=lr_factory>create(lt_params).
*ProvidingfirstnameandlastnametoBP.
ls_datafirstname='CRM'.
ls_datalastname='TEC'.
lr_entity>set_properties(ls_data).
lr_entity_adr=lr_entity>CREATE_RELATED_ENTITY('BuilAddressRel').
*AssigningaddresstoaBP
ls_addrSTREET='MichiganAvenue'.
ls_addrPOSTL_COD1='12345'.
ls_addrCOUNTRY='US'.
lr_entity_adr>set_properties(ls_addr).
lr_entity_mail=lr_entity_adr>CREATE_RELATED_ENTITY('BuilAddressEMailRel').
*AssigningmailidtoaBP
ls_mailE_MAIL='abc@abc.com'.
lr_entity_mail>set_properties(ls_mail).
lr_entity_gend=lr_entity>CREATE_RELATED_ENTITY('BuilICMPersonalDescriptionRel').
*Assigninggenderasfemale
ls_genderGENDER='1'.
lr_entity_gend>set_properties(ls_gender).
*WhenweinstatiatemodifymethodthenonlydatagetsavedinBOLlayer
http://sapcrmbasicsrelatedtowebui.blogspot.in/2014/03/creationofbusinesspartnerusingbol.html

2/4

8/26/2015

CreationofbusinesspartnerusingBOLprogramming:

*untillthendatagetstoredinbuffer
lr_core>modify().
*GettingBPthatwecreated
lv_bpno=lr_entity>get_property_as_string('BP_NUMBER').
WRITE:lv_bpno.
*Committhedata
lr_transaction=lr_core>get_transaction().
lr_transaction>save().
iflr_transaction>save()=abap_true.
lr_transaction>commit(abap_true).
ENDIF.
DataatTransactionlevel:

http://sapcrmbasicsrelatedtowebui.blogspot.in/2014/03/creationofbusinesspartnerusingbol.html

3/4

8/26/2015

CreationofbusinesspartnerusingBOLprogramming:

Posted20thMarch2014bySAPCRMWEBUIBasics
0 Addacomment

Enteryourcomment...

Commentas:

Publish

GoogleAccount

Preview

http://sapcrmbasicsrelatedtowebui.blogspot.in/2014/03/creationofbusinesspartnerusingbol.html

4/4