Professional Documents
Culture Documents
Crm-Abap: BOL Program # 4
Crm-Abap: BOL Program # 4
Crm-Abap: BOL Program # 4
24, 2009
BOL Program # 4
REPORT ZBSP_BOL154.
*&---------------------------------------------------------------------*
*& Report ZBSP_BOL151
*&
*&---------------------------------------------------------------------*
*&BOL Report to get Contact Person Entities
*&
*&---------------------------------------------------------------------*
*BOL Declarations
data: lr_core type ref to cl_crm_bol_core,
lr_query type ref to CL_CRM_BOL_DQUERY_SERVICE,
LR_RESULT TYPE REF TO IF_BOL_ENTITY_COL,
LR_ENTITY TYPE REF TO cl_crm_bol_entity,
LV_STRING TYPE STRING.
*Application Declarations
Data : Begin of ITAB occurs 0,
STRING1 type string,
STRING2 type string,
STRING3 type string,
STRING4 type string,
STRING5 type string,
STRING6 type string,
STRING7 type string,
End of ITAB.
*ALV Declarations
TYPE-POOLS: SLIS.
data: FIELD_CAT TYPE SLIS_T_FIELDCAT_ALV.
*--------------------------------------------------------------*START-OF-SELECTION
*---------------------------------------------------------------START-OF-SELECTION.
*Get the BOL Core instance
lr_core = cl_Crm_bol_core=>get_instance( ).
*Load the component set
LR_CORE->LOAD_COMPONENT_SET( 'BP_APPL' ).
*---------------------------------------------------------------*Create the query instance by passing the search object name
lr_query = CL_CRM_BOL_DQUERY_SERVICE=>get_instance(
iv_query_name = 'BuilContactAdvancedSearch' ).
BOL Program # 3
REPORT ZBSP_BOL153.
*&---------------------------------------------------------------------*
*& Report ZBSP_BOL153
*&
*&---------------------------------------------------------------------*
*&BOL Report to get Business Parter "Customer Account"
*&
*&---------------------------------------------------------------------*
*BOL Declarations
data: lr_core type ref to cl_crm_bol_core,
lr_query type ref to CL_CRM_BOL_QUERY_SERVICE,
LR_RESULT TYPE REF TO IF_BOL_ENTITY_COL,
LR_ENTITY TYPE REF TO cl_crm_bol_entity,
LV_STRING TYPE STRING.
*Application Declarations
Data : Begin of ITAB occurs 0,
STRING1 type string,
STRING2 type string,
STRING3 type string,
STRING4 type string,
STRING5 type string,
STRING6 type string,
STRING7 type string,
End of ITAB.
*ALV Declarations
TYPE-POOLS: SLIS.
data: FIELD_CAT TYPE SLIS_T_FIELDCAT_ALV.
*--------------------------------------------------------------*START-OF-SELECTION
*---------------------------------------------------------------START-OF-SELECTION.
*Get the BOL Core instance
lr_core = cl_Crm_bol_core=>get_instance( ).
*Load the component set
LR_CORE->LOAD_COMPONENT_SET( 'BP_APPL' ).
*---------------------------------------------------------------*Create the query instance by passing the search object name
lr_query = CL_CRM_BOL_QUERY_SERVICE=>get_instance(
iv_query_name = 'BuilHeaderSearch' ).
Data IT_PARMS TYPE CRMT_NAME_VALUE_PAIR_TAB.
Data WA_PARMS TYPE CRMT_NAME_VALUE_PAIR.
WA_PARMS-NAME = 'PARTNER'.
WA_PARMS-VALUE = '404050'.
Append WA_PARMS to IT_PARMS.
*Add the selection parameters
CALL METHOD LR_QUERY->SET_QUERY_PARAMETERS
EXPORTING
IT_PARAMETERS = IT_PARMS.
*Get the result list
LR_RESULT = LR_QUERY->GET_QUERY_RESULT( ).
* -->P_GT_FIELDCAT[] text
*----------------------------------------------------------------------*
FORM fieldcat_init USING
P_FIELDCAT type SLIS_T_FIELDCAT_ALV.
data: L_FIELDCAT type slis_fieldcat_alv.
data : pos type i value 1.
*
clear L_FIELDCAT.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING1'.
l_fieldcat-SELTEXT_M = 'BP Number'.
append l_fieldcat to p_fieldcat.
*
pos = pos + 1.
clear l_fieldcat.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING2'.
l_fieldcat-SELTEXT_M = 'Full Name'.
append l_fieldcat to p_fieldcat.
*
pos = pos + 1.
clear l_fieldcat.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING3'.
l_fieldcat-SELTEXT_M = 'Nationality'.
append l_fieldcat to p_fieldcat.
*
clear L_FIELDCAT.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING4'.
l_fieldcat-SELTEXT_M = 'BP Category'.
append l_fieldcat to p_fieldcat.
*
pos = pos + 1.
clear l_fieldcat.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING5'.
l_fieldcat-SELTEXT_M = 'BP Group'.
append l_fieldcat to p_fieldcat.
*
pos = pos + 1.
clear l_fieldcat.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING6'.
l_fieldcat-SELTEXT_M = 'PersonnelNo'.
append l_fieldcat to p_fieldcat.
*
pos = pos + 1.
clear l_fieldcat.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING7'.
l_fieldcat-SELTEXT_M = 'Account name'.
append l_fieldcat to p_fieldcat.
ENDFORM. " fieldcat_init
Posted by Karan at 7:48 AM 0 comments
BOL Programme # 2
REPORT ZBSP_BOL152.
*&---------------------------------------------------------------------*
*& Report ZBSP_BOL152
*&
*&---------------------------------------------------------------------*
*&BOL Report to get Employee Entities
*&
*&---------------------------------------------------------------------*
*BOL Declarations
data: lr_core type ref to cl_crm_bol_core,
lr_query type ref to CL_CRM_BOL_QUERY_SERVICE,
LR_RESULT TYPE REF TO IF_BOL_ENTITY_COL,
LR_ENTITY TYPE REF TO cl_crm_bol_entity,
LV_STRING TYPE STRING.
*Application Declarations
Data : Begin of ITAB occurs 0,
STRING1 type string,
STRING2 type string,
STRING3 type string,
STRING4 type string,
STRING5 type string,
STRING6 type string,
STRING7 type string,
End of ITAB.
*ALV Declarations
TYPE-POOLS: SLIS.
Append itab.
*Go to the next entity
LR_ENTITY ?= LR_RESULT->GET_NEXT( ).
ENDWHILE.
*--------------------------------------------------------------*END-OF-SELECTION
*---------------------------------------------------------------END-OF-SELECTION.
*Fill field catalog details:
perform fieldcat_init using FIELD_CAT[].
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING2'.
l_fieldcat-SELTEXT_M = 'Full Name'.
append l_fieldcat to p_fieldcat.
*
pos = pos + 1.
clear l_fieldcat.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING3'.
l_fieldcat-SELTEXT_M = 'Search term'.
append l_fieldcat to p_fieldcat.
*
clear L_FIELDCAT.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING4'.
l_fieldcat-SELTEXT_M = 'BP Category'.
append l_fieldcat to p_fieldcat.
*
pos = pos + 1.
clear l_fieldcat.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING5'.
l_fieldcat-SELTEXT_M = 'BP Group'.
append l_fieldcat to p_fieldcat.
*
pos = pos + 1.
clear l_fieldcat.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING6'.
l_fieldcat-SELTEXT_M = 'Account Name'.
append l_fieldcat to p_fieldcat.
*
pos = pos + 1.
clear l_fieldcat.
l_fieldcat-col_pos = POS.
l_fieldcat-fieldname = 'STRING7'.
l_fieldcat-SELTEXT_M = 'Username'.
append l_fieldcat to p_fieldcat.
ENDFORM. " fieldcat_init
Posted by Karan at 7:47 AM 0 comments
BOL Program #1
REPORT ZBSP_BOL151.
*&---------------------------------------------------------------------*
*& Report ZBSP_BOL151
*&
*&---------------------------------------------------------------------*
*&BOL Report to get Contact Person Entities
*&
*&---------------------------------------------------------------------*
*1. BOL Declarations
data: lr_core type ref to cl_crm_bol_core,
lr_query type ref to CL_CRM_BOL_QUERY_SERVICE,
LR_RESULT TYPE REF TO IF_BOL_ENTITY_COL,
LR_ENTITY TYPE REF TO cl_crm_bol_entity,
LV_STRING TYPE STRING.
Data IT_PARMS TYPE CRMT_NAME_VALUE_PAIR_TAB.
Data WA_PARMS TYPE CRMT_NAME_VALUE_PAIR.
*2. Application Declarations
Data : Begin of ITAB occurs 0,
STRING1 type string,
STRING2 type string,
STRING3 type string,
STRING4 type string,
STRING5 type string,
STRING6 type string,
STRING7 type string,
End of ITAB.
*3. ALV Declarations
TYPE-POOLS: SLIS.
data: FIELD_CAT TYPE SLIS_T_FIELDCAT_ALV.
*--------------------------------------------------------------*START-OF-SELECTION
*---------------------------------------------------------------START-OF-SELECTION.
*1. Get the BOL Core instance
lr_core = cl_Crm_bol_core=>get_instance( ).
*2. Load the component set: Group of BOL Objects
LR_CORE->LOAD_COMPONENT_SET( 'BP_APPL' ).
*---------------------------------------------------------------*3. Create the query instance , passing the search object name
lr_query = CL_CRM_BOL_QUERY_SERVICE=>get_instance(
iv_query_name = 'BuilContactPersonSearch' ).