SAP CRM Programming : BOL
The below guide includes most of the details required to code in CRM:
The steps are as given below .
- Get the BOL Core instance
- Load the Component
- Create the Query Instance by passing search Object
- Pass the required attributes
- get the data and process the data.
given below code explains the program technically
Data Declaration :-
1) Get the BOL Core instance
2 ) Load the component set
3 )Create the query instance by passing the search object name
4) Pass the required attributes
you can observe this data declaration in any standard search and result objects
To check whether data is correct or not use the GENIL_BOL_BROWSER
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
NOTE : REFER http://sapcrmtutorial.blogspot.com/2012/01/concepts-of-bol-programming-getcurrent.html -----------------------------------------------------------------------------------
The BOL API consists of various interfaces and classes that you can use to access business
data:
CL_CRM_BOL_QUERY_SERVICE
You use this class to select business objects.
CL_CRM_BOL_ENTITY
You use this class for implementing business objects.
IF_BOL_TRANSACTION_CONTEXT
You use this interface to control transaction behavior.
IF_BOL_BO_COL
You use this interface to provide collections to hold business objects.
Access Properties and Related Entities
The following code shows how to access entities of the query result and how to read their
properties. Note that the methods are the same for all types of business objects.
Syntax
* Use iterator to access entities in query result
*""""""""""""""""""""""""""""""""""""""""""""""""""""""*
DATA:lv_iterator TYPE REF TO if_bol_entity_col_iterator.
DATA:lv_iterator TYPE REF TO if_bol_entity_col_iterator.
1 Business Object Layer
14 <July 2008>
lv_iterator = lv_result->get_iterator.
DATA: lv_entity TYPE REF TO cl_crm_bol_entity.
lv_entity = lv_iterator->get_first( ). “Entity is business partner
here
WHILE lv_entity IS BOUND.
* Access attributes of business objects selected
DATA: lv_firstname TYPE string,
lv_lastname TYPE string.
lv_firstname = lv_entity->get_property_as_string( ‘FirstName’ ).
lv_lastname = lv_entity->get_property_as_string( ‘LastName’ ).
* Get a 1:1 related entity
DATA: lv_default_address TYPE REF TO cl_crm_bol_entity.
lv_default_address = lv_entity->get_related_entity(
‘DefaultAddress’ ).
* Get a list of 1:N related entities
DATA: lv_addresses TYPE REF TO if_bol_entity_col.
lv_addresses = lv_entity->get_related_entities( ‘Addresses’ ).
*
lv_entity = lv_iterator->get_next( ).
ENDWHILE.
*""""""""""""""""""""""""""""""""""""""""""""""""""""""*
Contact us for all your SAP Consulting , Implementation and Support requirements www.anniesummerconsulting.com
It will be very helpful if you can visit my youtube channel
https://www.youtube.com/user/nkbhatt
Donate ETH: 0x4ae0be2fd21779f39d2e3be51aac3973de67b37a
Donate BTC: DRq7gASSRVV3SZxqLHpTe2PQ3chuYFw1jo
Donate LTC: LWqCXBUBtHNQL2chM4AQhCmJ7C3eSNU5bJ
Donate:DOGE: DRq7gASSRVV3SZxqLHpTe2PQ3chuYFw1jo