0% found this document useful (0 votes)
179 views4 pages

Creation of Business Partner Using BOL Programming

The document describes code used to create a business partner using BOL programming in SAP CRM. It sets fields like first name, last name, address, gender and email for the new business partner. It creates BOL objects, assigns properties, saves the data and commits the transaction. The code provides an example of how to create a business partner record programmatically using the BOL API.

Uploaded by

akbarhs
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)
179 views4 pages

Creation of Business Partner Using BOL Programming

The document describes code used to create a business partner using BOL programming in SAP CRM. It sets fields like first name, last name, address, gender and email for the new business partner. It creates BOL objects, assigns properties, saves the data and commits the transaction. The code provides an example of how to create a business partner record programmatically using the BOL API.

Uploaded by

akbarhs
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/ 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='[email protected]'.
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

You might also like