Wednesday, 23 January 2013

EPIC-2


                           CUSTOM COMPONENT CREATION

For  Custom Component Creation  we have to follow the below steps

1.create custom component
2.create custom model
3.create custom entities
4.create Genil class.

   The Technical name of model is nothing but “Component set”.The component set have set of components.This component set is  different from our workbench component.
Note:All the partener related entities put in a componet “BP”.
In The  Component set have several components.The component it self have component set.
STEP1:MODEL CREATION
Goto tcode:spro
Customer relationship management
Crm cross applications
Generic interaction layer/object layer
Basic settings
Under dialog structure
Goto component definition
Select change mode
Click on new entries

Component name         : zkyrcomp
Description                    : component18
Implementation class   : Zcl_Demo_Genil
Object table                   : Zdemo_object
Model table                    : Zdemo_model
                        Save

Goto component set definition
                    New entris
Componentset   : Zcompset
Description        : Componentset


Goto componet Assignment
                     New entries
Compnent name   : Zkyrcomp
Description            : Component18
                       Save.

From component set definition -> select the standard BP component
 Select the object table :crmc_allobj_buil



Create Entries for object table:
Goto se11
 Database table : crmc_allobj_buil.
                        Select copy
Provide target table : zdemo_object
     Select utilities-> Create entries

Object name          : rootobj
Onjectkind             : A (f4)( root object )
Attr structure        : zkyr (user defined structure)
                            Save
Object name           : searchobj
Onjectkind              : G (f4)( dynamic search  object )
Attr structure         : zkyr (user defined structure)
Root object              : Rootobj
Result object name : resultobj
                          Save
Object name           : Resultobj
Onjectkind              : E(f4) (search result object
Attr structure         : zkyr (user defined structure)
Rootobject               : Rootobj

                            Save.

Create entries in Model Table:
Copy the table from standard BP component
 Goto se11
 Database table : CRMC_MODEL_BUIL
            Copy
 Target table     : Zdemo_model->enter
 In the fields
 Select  field  object_a
 Select the check table(primary key)
  Provide the check table : zdemo_object(primary key table)
 Select the field object_b
Select the check table(primary key)
  Provide the check table : zdemo_object(primary key table)
                 Save and activate

Select utilities->create entries
   Object A            : resultobj(f4)
   Relation name   : result root rel
   ObjectB              : rootobj
   Card A               :  c(f4)
   Card B               : c(f4)
   Relation kind     : A (f4)
                           save

Genil Class Creation:
                     Goto : se24
         Class :Zcl_demo_genil.
                      Create
         Description : genil class creation
                Select  create inheritance
          Super class : CL_CRM_BUIL->enter
(This super class select from any one genil class super class of standard component)

From the methods  select the method get_object_props and redefine the method
                     
method IF_GENIL_APPL_MODEL~GET_OBJECT_PROPS.

  
select * from zcmpt_object into CORRESPONDING FIELDS OF TABLE RT_OBJ_PROPS.

endmethod.
(rt_obj_props it is a returning parameter of the method)

From the methods select the method get_model and redefine the method
method IF_GENIL_APPL_MODEL~GET_MODEL.

  
select * from zcmpt_model into CORRESPONDING FIELDS OF TABLE rt_relation_det.
endmethod.
Select * from Zdemo_model into corresponding fields of table rt_relation_det.
(rt_relation_det is the returning parameter of the method)


To Test Model:

Select tcode : Genil_Model_Browser
 Provide component set : Zcompset
      We can check our attributes under root object,search resut object and dynamic search objects

   Component Creation:
 Component : Zcus_component18
                                  Create
  Window name : mainwindow
                                    Save
   Goto runtime repository editor
   Select change mode
              
    Right click on models
     Add model
    Component set : Zcompset
                                    Save
    Right  click on views
     Create view
                 Continue
     Name : searchview
                   Continue

       Add model node
  Model nodes : searchcn
  Bol entity       : searchobj(f4)
                   Continue

  Add model attributes
           Select required fields->enter
                       Continue
                       Continue
                       Continue
 Select empty view
                  Save


Note: 1.cl_bsp_wd_advsearch_controller.This is the super class of controller
          2.cl_bsp_wd_context_node_asp.This is the super class of context node class.
          3.cl_bsp_wd_context_node_tv.This is the super class of table view
         

Changing the empty view as search view:
                
       Double click on component controller class
       Change edit mode
       Change inherit
       Change superclass instead of standard super class
       Super class : cl_bsp_wd_advsearch_controller.

       Double click on component context node class
       Change edit mode
       Change inherit
       Change superclass instead of standard super class
       Super class : cl_bsp_wd_context_node_asp.

     Goto search.htm
      open the any standard search.htm and copy the code and paste the code into our
       custom componet  search.htm

   Adding the configuration tab to search view
Goto : se80
Select bsp application
Open our custom component
Select the change mode
Click on tag browser

Drag and drop the <chtmlb.config
And drag and drop the xml tag from standard configuration
/>
Goto our custom component
Select configuration
Select new configuration
Move th fields from available to display fields
Save

Right click on view
Create view
Continue
Name : resultview
Continue
Add modelnode

Model nodes : resultcn
Bol entity      : resultobj

Select the required fields->enter
Continue
Continue
Select configuration
Continue
Continue
Select configuration and select tableview
Move the field from available to display.
Save.
Adding View to Viewset:
Right click on view
Create view set
Name : searchviewset
Line    : 2
Col      : 1
Viewarea : searchviewarea
Row         : 1
Col           : 1
Rowspan : 1
Colspan   : 1
Viewarea  : result view
Row         : 2
Col           : 1
Rowspan : 1
Colspan   : 1
Continue
Goto runtime repository editor system
Select change mode
Goto view set
Right click on searchview view area
Add view
View : searchview
Save

Goto view set
Right click on searchview view area
Add view
View : searchview
Save
Adding viewset to window:
Right click on window
                     Add window
                     View  : searchviewset
                             Save
      Test the viewset is available or added or not
          Component : zcus_component18
                            Test.
Adding buttons to custom component:
Goto se80
Open our custom component
Under view
Open searchview.htm
Open tagbrowser
From  thtmlb
Drag and drop
<thtmlb.button
Id    =   “SEARCH”
Onclick   =   “SEARCHBTN”
Text        = “search”
Enabled   = “TRUE”
/>.
                                 
Drag and drop
<thtmlb.button
Id        =   “SEARCH”
Onclick    =   “SEARCHBTN”
Text          = “search”
Enabled    = “TRUE”
/>.
Save and activate
 Maintain dropdown in searchview:
    Goto controller class of search view
          Double click on class
           From  methods
           Redefine the get_dquery_defiitions( ) method.
        method GET_DQUERY_DEFINITIONS.

  
CALL METHOD SUPER->GET_DQUERY_DEFINITIONS
  RECEIVING
    RT_RESULT =  RT_RESULT.

data : wa_result type CRMS_THTMLB_SEARCH_FIELD_INFO,
       wa_ddlb 
type CRMS_THTMLB_SEARCH_DDLB_NVP,
       v_index 
type i.

read table rt_result into wa_result with key field = 'LEADTYPE'.
if sy-subrc = 0.
  v_index = sy-tabix.
  
APPEND INITIAL LINE TO wa_result-ddlb_options.

  wa_ddlb-
key = '11'.
  wa_ddlb-
value = 'Type1'.
  
append wa_ddlb to wa_result-ddlb_options.

  wa_ddlb-
key = '12'.
  wa_ddlb-
value = 'Type2'.
  
append wa_ddlb to wa_result-ddlb_options.

  wa_ddlb-
key = '13'.
  wa_ddlb-
value = 'Type3'.
  
append wa_ddlb to wa_result-ddlb_options.
  
modify rt_result from wa_result index v_index.
  
endif.
endmethod.
Genil Class implementation:
 
       In our genil class redefine the method get_dynamic_query_result.
UNDO REDEFINE THE GET_DYNAMIC_QUERY_RESULT  IN GENIL CLASS CREATED.
THEN WE CAN SEE EMPTY METHOD  GET_DYNAMIC_QUERY_RESULT WITH OUT CODE.
AGAIN REDEFINE THE GET_DYNAMIC_QUERY_RESULT. 
  Becoz when I click on search button to get the data we to implement the above method.
method IF_GENIL_APPL_INTLAY~GET_DYNAMIC_QUERY_RESULT.


    
data : it_sel_type type STANDARD TABLE OF selopttab,
         it_sel_target 
type STANDARD TABLE OF selopttab,
         it_sel_bp 
type STANDARD TABLE OF selopttab,
         it_sel_id 
type STANDARD TABLE OF selopttab,
         it_data 
type STANDARD TABLE OF ZDEMO_CUS_LEAD,
         wa_data 
type ZDEMO_CUS_LEAD,
         wa_sel 
type selopttab,
         wa_param 
type  GENILT_SELECTION_PARAMETER,
         lr_entity 
type ref to IF_GENIL_CONT_ROOT_OBJECT,
         v_key 
type string.
  
if iv_query_name = 'SEARCHOBJ'.

    
loop at it_selection_parameters into wa_param.
      
case wa_param-attr_name.
        
when 'LEADTYPE'.
          
MOVE-CORRESPONDING wa_param to wa_sel.
          
append wa_sel to it_sel_type.
        
when 'LEADTARGET'.
          
MOVE-CORRESPONDING wa_param to wa_sel.
          
append wa_sel to it_sel_target.
        
when 'PARTNER'.
          
MOVE-CORRESPONDING wa_param to wa_sel.
          
append wa_sel to it_sel_bp.
        
when 'LEADID'.
          
MOVE-CORRESPONDING wa_param to wa_sel.
          
append wa_sel to it_sel_id.
      
ENDCASE.
    
endloop.
    
select * from ZDEMO_CUS_LEAD into table it_data
       
UP TO is_query_parameters-max_hits rows
       
where LEADTYPE in it_sel_type and
              LEADTARGET 
in it_sel_target and
              PARTNER 
in it_sel_bp and
               LEADID 
in it_sel_id.

    
loop at it_data into wa_data.
      
CONCATENATE
                  wa_data-LEADID
                  wa_data-LEADTYPE
                  
into v_key.
      
TRY.
          
CALL METHOD IV_ROOT_LIST->ADD_OBJECT
            
EXPORTING
              IV_OBJECT_NAME = 
'RESULTOBJ'
              IS_OBJECT_KEY  = v_key
*        IV_ATTR_REQ    = TRUE
*        IV_KEY_IS_ID   = FALSE
            RECEIVING
              RV_RESULT      = lr_entity.

        
CATCH CX_CRM_GENIL_DUPLICATE_REL .
        
CATCH CX_CRM_GENIL_MODEL_ERROR .
      
ENDTRY.
      
CALL METHOD LR_ENTITY->SET_ATTRIBUTES
        
EXPORTING
          IS_ATTRIBUTES = wa_data.

    
endloop.
  
endif.
endmethod.
Note:genil_bol_browser this tcode is used for we can test our search object result view is displayed or not.
Custom Controller creation:
         After creating the custom controller we have to maintain binding with the result view and acees the instance of cstom controller into search view becoz the data in search view we want to pass the data into result view so we have create custom controller and maintain the binding.
            Right click on custom controller
            Create
            Continue
Name : searchresultcuco
  Continue
Add modelnode
  Modelnode : resultcuco
  Bol entity    : resultobj
        Continue
Select required fields
 Continue
 Continue
 Continue
 Complete

Bind the result view context node with custom controller node
  Goto context node
  Right click on resultcn
 Create bind
Controller type : custom controller
Custom controller : searchresultcuco
Target : resultcuco
SEARCH EVENT HANDLER CREATION
Create SEARCHBTN EVENT HANDLER IN SEARCHVIEW
method EH_ONSEARCHBTN.

  
data : lr_qs type ref to cl_crm_bol_dquery_service,
        lr_result_col 
type ref to IF_BOL_ENTITY_COL,
        lr_cuco 
type ref to ZL_ZCUSTOM__SRCUCO_IMPL  ,
        lr_col 
type ref to if_bol_bo_col.
  lr_qs ?= typed_context->searchcn->collection_wrapper->get_current( ).
     lr_result_col ?= lr_qs->get_query_result( ).
lr_cuco ?= get_custom_controller( controller_id = 
'ZCUSTOM_COMP11/SRCUCO' ).
*lr_col ?= lr_cuco->typed_context->resultcuco->collection_wrapper.
lr_cuco->typed_context->resultcuco->collection_wrapper->clear( ).
lr_cuco->typed_context->resultcuco->collection_wrapper->add_collection(  lr_result_col ).
endmethod.



ROW LEVEL BUTTONS ADDING

  • TECHNICALLY WE CAN CALL IT AS ONE CLICK ACTIONS.
  • ROW LEVEL BUTTONS ARE PART OF CONTEXT NODE ATTRIBUTES.
  • IT HAS DIFF. STRUCTURES AND DATA ELEMENTS.
  • IT WILL COME IN SEPERATE COLUMN IN VIEW UNDER ACTIONS.
  • FOR THAT WE NEED SOME ENHACEMENT IN HTML CODE.
  • IT HAS ONLY ONE EVENT FOR ALL THE BUTTONS.
  • THESE BUTTONS ARE ENABLED EVEN WHEN THE VIEW IS IN DISPLAYMODE.
  • THESE ARE LOCAL FOR ROW NOTHING BUT ONE RECORD.

REQUIREMENT: ADDING ROW LEVEL BUTTONS TO CUSTOM VIEW.
Ø  CREATE AN ACTION ATTRIBUTE TO CONTEXT NODE ATTRIBUTE.
§  GO TO OUR CUSTOM VIEW CREATED.
§  GO TO CONTEXT .
§  CONTEXT NODES.
§  ATTRIBUTES->RIGHT CLICK ON ATTRIBUTES.
§  CREATE.
§  IT PROMPTS A WIZARD.
§  CONTINUE.
§  SELECT ADD VALUE ATTRIBUTE.
§  CONTINUE.
§  PROVIDE ATTRIBUTE : THTMLBUTN_OCA.
§  DDIC : crm_thtmlb_one_click_action.
§  CONTINUE.
§  COMPLETE.

Ø  MOVE THE ATTRIBUTE FROM AVAILABLE TO DISPLAY.
§  GO TO OUR VIEW .
§  CLICK ON CONFIGURATION TAB.
§  ACTION FIELD WE CAN SEE IN AVAILABLE FIELDS.
§  MOVE THE ACTION FIELD TO DISPLAY.
§  MAKE IT AS FIRST FIELD IN VIEW.
§  NO NEED TO CONFIGURE WITH YOUR ROLE KEY.
§  SAVE THE CONFIGURATION.
§  NOW WE CAN CHECK IN WEB-UI.
§  WE CAN SEE ACTIONS FIELD ADDED TO VIEW.

Ø  MAKE CHANGES IN GET_P _ATTR METHOD IN ATTRIBUTE.
Ø  THIS CODE WE CAN COPY FROM STANDARD COMPONENT GET_P METHOD.
§  GO TO OUR CUSTOM VIEW CREATED.
§  GO TO CONTEXT .
§  CONTEXT NODES.
§  ATTRIBUTES : THTMLBUTN_OCA.
§  GO TO GET_P METHOD OF ATTRIBUTE.
§  DOUBLE CLICK ON THAT.
§  WRITE THE CODE AS FOLLOWS.

CASE iv_property.
 WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
  rv_value = cl_bsp_dlc_view_descriptor=>field_type_oca.
    
WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
      rv_value = 
'one_click_actions'.
  
ENDCASE.
Ø  ADD BUTTONS IN CONTEXT NODE CLASS.
Ø  IN CONTEXNODE WE HAVE A METHOD  GET_OCA_T_TABLE.
Ø  DOUBLE CLICK ON THE METHOD AND WRITE A CODE FOR BUTTONS.
method GET_OCA_T_TABLE.
CALL METHOD SUPER->GET_OCA_T_TABLE
  
EXPORTING
    IV_COMPONENT = IV_COMPONENT
    IV_INDEX     = IV_INDEX
  RECEIVING
    RT_ACTIONS   = RT_ACTIONS.

    
DATA : WA_BUTTON TYPE CRMT_THTMLB_ONE_CLICK_ACTION.

    WA_BUTTON-
ID  = 'DELETEOCA'.
    WA_BUTTON-ACTIVE = 
'X'.
    WA_BUTTON-
ICON = 'DELETE.GIF'.
    
APPEND WA_BUTTON TO RT_ACTIONS.

    WA_BUTTON-
ID = 'COPYOCA'.
    WA_BUTTON-ACTIVE = 
'X'.
    WA_BUTTON-
ICON = 'COPY.GIF'.
    
APPEND WA_BUTTON TO RT_ACTIONS.

         SAVE AND ACTIVATE THE METHOD .
           F3
         ACTIVATE THE CONTEXT NODE CLASS.
Ø  CREATE EVENT HANDLER WITH SAMEN NAME AS GIVEN INTHE GET_P_ATTR METHOD.
§  GO TO OUR VIEW.
§  GO TO EVENT HANDLER.
§  CREATE EVENT FOR 'one_click_actions'
DATA:V_ID TYPE STRING,
        V_INDEX 
TYPE STRING.

  
SPLIT HTMLB_EVENT_EX->EVENT_DEFINED AT '.' INTO V_ID V_INDEX.

  
CASE V_ID.
        
WHEN 'DELETEOCA'.


          
WHEN 'COPYOCA'.


  
ENDCASE.

Ø  IN EVENT HANDLER WE HAVE TO WRITE CODE FOR DELETEOCA AND COPYOCA.




UPLOAD MASSCHANGE AND REPORT

HOW TO FIND THE ROOT OBJECTS OF CONTEXT NODES AND THEIR RELATION?
WE CAN FIND OUT BY DEBUGGING.
DEBUGGING PROCESS:
·         PUT THE EXTERNAL BREAK POINT IN DO_PREPARE_OUTPUT.
·         OPEN CRM UI.
·         IT PROMPTS DEBUGGING SCREEN.
·         IF U WANT KNOW THE ROOT NODE OF BTADMINH.
·         PROVIDE TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER IN OBJECT SPACE .
·         CLICK ON ENTER THEN WE CAN GET THE INSTANCE.
·         CLICK ON THAT INSTANCE.
·         WE GET COLLCTION_REF->CLICK ON THAT.
·         WE GET COLLECTION.
·         CLICK ON THAT COLLECTION WE WILL GET ENTITY LIST.
·         CLICK ON THAT ENTITY LIST.
·         WE WILL GET ENTITY CLASS.
·         IN THAT ENTITY CLASS THERE IS AN ATTRIBUTE CONTAINER_PROXY.
·         IN CONTAINER_ PROXY ,WE WILL HAVE DATA_REF
·         WE WILL GET DATA_REF AND PARENT.
·         KEEP ON CLICKING PARENT UNTIL WE GET PARENT AS INITIAL.
·         THEN CLICK ON DATA REF WE CAN GET ROOT OBJECT.
·         WE CAN GET RELATION NAME BY THE SAME SCREEN.

MASS UPDATE:


REPORT  ZDEMO_BOL_CHANGE.

data : lr_core type ref to cl_crm_bol_core,
       lr_factory type ref to CL_CRM_BOL_ENTITY_FACTORY,
       lr_btorder type ref to cl_crm_bol_entity,
       lr_btadminh type ref to cl_crm_bol_entity,
       lr_btpartnerset type ref to cl_crm_bol_entity,
       lr_btpartner type ref to cl_crm_bol_entity,
       lr_tx type ref to IF_BOL_TRANSACTION_CONTEXT,
       it_param type CRMT_NAME_VALUE_PAIR_TAB,
       wa_param type CRMT_NAME_VALUE_PAIR,
       v_id type string.

lr_core = cl_crm_bol_core=>get_instance( ).

lr_core->load_component_set( IV_COMPONENT_SET_NAME = 'ONEORDER' ).

*loop at it itab into wa
TRY.
CALL METHOD LR_CORE->GET_ROOT_ENTITY
  EXPORTING
    IV_OBJECT_NAME = 'BTOrder'
    IV_OBJECT_GUID = 'E244DDB061A884F19B5A001517354D1C'
  RECEIVING
    RV_RESULT      = lr_btorder .
 CATCH CX_CRM_GENIL_MODEL_ERROR .
ENDTRY.
TRY.
    CALL METHOD LR_BTORDER->GET_RELATED_ENTITY
      EXPORTING
        IV_RELATION_NAME = 'BTOrderHeader'
*    IV_MODE          = NORMAL
      RECEIVING
        RV_RESULT        = lr_btadminh.
  CATCH CX_CRM_GENIL_MODEL_ERROR .
ENDTRY.

*if lr_btadminh is not bound.
*
*  endif.

lr_btadminh->set_property_as_string( iv_attr_name = 'DESCRIPTION'
                                      iv_value = 'Test BOL Change' ). "wa-description
lr_core->modify( ).
lr_tx = lr_btorder->get_transaction( ).
if lr_tx->save( ) = abap_true.
  lr_tx->commit( ).
  v_id = lr_btadminh->get_property_as_string( iv_attr_name = 'OBJECT_ID' ).
else.
  lr_tx->rollback( ).
endif.
write v_id.
ALV REPORT
REPORT  ZDEMO_BOL_REPORT.
data : lr_core type ref to cl_crm_bol_core,
       lr_factory type ref to CL_CRM_BOL_ENTITY_FACTORY,
       lr_btorder type ref to cl_crm_bol_entity,
       lr_btadminh type ref to cl_crm_bol_entity,
       lr_btpartnerset type ref to cl_crm_bol_entity,
       lr_btpartner type ref to cl_crm_bol_entity,
       lr_tx type ref to IF_BOL_TRANSACTION_CONTEXT,
       lr_qs type ref to cl_crm_bol_dquery_service,
       it_param type CRMT_NAME_VALUE_PAIR_TAB,
       wa_param type CRMT_NAME_VALUE_PAIR,
       lr_result_col type ref to if_bol_bo_col,
       v_id type string,
       v_low type string,
       v_high type string.
tables : crmd_orderadm_h.
SELECT-OPTIONS : s_id for crmd_orderadm_h-object_id.
PARAMETERS : p_hits type GENILT_UNSIGNED_INT4.
lr_core = cl_crm_bol_core=>get_instance( ).

lr_core->load_component_set( IV_COMPONENT_SET_NAME = 'ONEORDER' ).
CALL METHOD CL_CRM_BOL_DQUERY_SERVICE=>GET_INSTANCE
  EXPORTING
    IV_QUERY_NAME = 'BTQOpp'
  RECEIVING
    RV_RESULT     = lr_qs.
loop at s_id.
  v_low = s_id-low.
  v_high = s_id-high.
CALL METHOD LR_QS->ADD_SELECTION_PARAM
  EXPORTING
    IV_ATTR_NAME = 'OBJECT_ID'
    IV_SIGN      = s_id-sign
    IV_OPTION    = s_id-option
    IV_LOW       = v_low
    IV_HIGH      = v_high.
 endloop.

v_id = p_hits.
lr_qs->set_property_as_string( iv_attr_name = 'MAX_HITS'
                                iv_value = v_id ).

*an internal table and wa with all the fields to e displayed
lr_result_col ?= lr_qs->get_query_result( ).

lr_entity ?= lr_result_col->get_first( ).

while lr_entity is bound.

*  lr_entity->get_properties( es_attributes = wa )
  TRY.
    CALL METHOD LR_entity->GET_RELATED_ENTITY
      EXPORTING
        IV_RELATION_NAME = 'BTADVSOpp'
*    IV_MODE          = NORMAL
      RECEIVING
        RV_RESULT        = lr_btorder.

  CATCH CX_CRM_GENIL_MODEL_ERROR .
ENDTRY.

*  append wa to itab
  lr_entity ?= lr_result_col->get_next( ).
  endwhile.
*loop at it itab into wa

*TRY.
*CALL METHOD LR_CORE->GET_ROOT_ENTITY
*  EXPORTING
*    IV_OBJECT_NAME = 'BTOrder'
*    IV_OBJECT_GUID = 'E244DDB061A884F19B5A001517354D1C'
*  RECEIVING
*    RV_RESULT      = lr_btorder .
*
* CATCH CX_CRM_GENIL_MODEL_ERROR .
*ENDTRY.
*
*
*TRY.
*    CALL METHOD LR_BTORDER->GET_RELATED_ENTITY
*      EXPORTING
*        IV_RELATION_NAME = 'BTOrderHeader'
**    IV_MODE          = NORMAL
*      RECEIVING
*        RV_RESULT        = lr_btadminh.
*
*  CATCH CX_CRM_GENIL_MODEL_ERROR .
*ENDTRY.


*if lr_btadminh is not bound.
*
*  endif.

*lr_btadminh->set_property_as_string( iv_attr_name = 'DESCRIPTION'
*                                      iv_value = 'Test BOL Change' ). "wa-description
*lr_core->modify( ).


lr_tx = lr_btorder->get_transaction( ).

if lr_tx->save( ) = abap_true.
  lr_tx->commit( ).
  v_id = lr_btadminh->get_property_as_string( iv_attr_name = 'OBJECT_ID' ).
else.
  lr_tx->rollback( ).
endif.write v_id.
UPLOAD

REPORT  ZDEMO_BOL_UPLOAD.

data : lr_core type ref to cl_crm_bol_core,
       lr_factory type ref to CL_CRM_BOL_ENTITY_FACTORY,
       lr_btorder type ref to cl_crm_bol_entity,
       lr_btadminh type ref to cl_crm_bol_entity,
       lr_btpartnerset type ref to cl_crm_bol_entity,
       lr_btpartner type ref to cl_crm_bol_entity,
       lr_tx type ref to IF_BOL_TRANSACTION_CONTEXT,
       it_param type CRMT_NAME_VALUE_PAIR_TAB,
       wa_param type CRMT_NAME_VALUE_PAIR,
       v_id type string.

lr_core = cl_crm_bol_core=>get_instance( ).

lr_core->load_component_set( IV_COMPONENT_SET_NAME = 'ONEORDER' ).

*loop at it itab into wa

CALL METHOD LR_CORE->GET_ENTITY_FACTORY
  EXPORTING
    IV_ENTITY_NAME = 'BTOrder'
  RECEIVING
    RV_RESULT      = lr_factory.

wa_param-name = 'OBJECT_TYPE'.
wa_param-value = 'BUS2000111'.
append wa_param to it_param.

wa_param-name = 'PROCESS_TYPE'.
wa_param-value = 'OPFS'.
append wa_param to it_param.


CALL METHOD LR_FACTORY->CREATE
  EXPORTING
    IV_PARAMS = it_param
  RECEIVING
    RV_RESULT = lr_btorder.

TRY.
    CALL METHOD LR_BTORDER->GET_RELATED_ENTITY
      EXPORTING
        IV_RELATION_NAME = 'BTOrderHeader'
*    IV_MODE          = NORMAL
      RECEIVING
        RV_RESULT        = lr_btadminh.

  CATCH CX_CRM_GENIL_MODEL_ERROR .
ENDTRY.


*if lr_btadminh is not bound.
*
*  endif.

lr_btadminh->set_property_as_string( iv_attr_name = 'DESCRIPTION'
                                      iv_value = 'Test BOL Upload' ). "wa-description
lr_core->modify( ).
TRY.
    CALL METHOD LR_BTADMINH->CREATE_RELATED_ENTITY
      EXPORTING
        IV_RELATION_NAME = 'BTHeaderPartnerSet'
      RECEIVING
        RV_RESULT        = lr_btpartnerset.
  CATCH CX_CRM_GENIL_DUPLICATE_REL .
  CATCH CX_CRM_GENIL_MODEL_ERROR .
ENDTRY.

TRY.
    CALL METHOD LR_Btpartnerset->CREATE_RELATED_ENTITY
      EXPORTING
        IV_RELATION_NAME = 'BTPartner_PFT_0006_MAIN'
      RECEIVING
        RV_RESULT        = lr_btpartner.
  CATCH CX_CRM_GENIL_DUPLICATE_REL .
  CATCH CX_CRM_GENIL_MODEL_ERROR .
ENDTRY.

lr_btpartner->set_property_as_string( iv_attr_name = 'PARTNER_NO'
                                       iv_value = '3274' )."wa-partner

lr_core->modify( ).


lr_tx = lr_btorder->get_transaction( ).

if lr_tx->save( ) = abap_true.
  lr_tx->commit( ).
  v_id = lr_btadminh->get_property_as_string( iv_attr_name = 'OBJECT_ID' ).
else.
  lr_tx->rollback( ).
endif.


write v_id.


BDOC'S
Start of Content Area
This graphic is explained in the accompanying text Creating a BDoc  Locate the document in its SAP Library structure
Procedure
...
       1.      From the SAP menu, choose Architecture and Technology  Middleware  Development   Meta Object Modeling  BDoc Modeler.
The CRM BDoc Modeler Personal Filter screen appears.
       2.      Choose Execute.
The CRM BDoc Modeler screen appears.
       3.      Choose BDoc Type  Create BDoc Type.
The BDoc Overview tab appears on the right-hand side of the screen.
       4.      In the BDoc Identity group box in the Name field, type ZGEBDOC01 as the name of the BDoc.
       5.      In the Description field, type a description of the BDoc.
       6.      In the BDoc Class group box, select the Synchronization (Write) field.
       7.      In the Mobile Application Processing Type group box, select the Standard field.
The new BDoc appears in the Business Documents window.
Result
You have created a BDoc for the ZGE01 table. You can continue with Adding a Segment to the BDoc.
Start of Content Area
This graphic is explained in the accompanying text Adding a Segment to the BDoc  Locate the document in its SAP Library structure
Procedure
...
       1.      Continuing in the BDoc Modeler, in the BDoc Overview window, select ZGEBCOC01 the BDoc you created.
       2.      Choose BDoc Type  Create Segment.
The Segment Overview tab appears in the work area.
       3.      In the Segment name field, type ZGESEGO1 as the name for the segment.
       4.      In the Description field, type Geographical information (countries and continents) as a short description for the segment.
       5.      Choose Save.
The Create Object Directory Entry dialog box appears.
       6.      Choose the Local Object pushbutton.
Result
You have added the segment to the BDoc. You can continue with Mapping the BDoc Segment to the Table.
*      End of Content Area
*      Start of Content Area
*      This graphic is explained in the accompanying text Mapping the BDoc Segment to the Table  Locate the document in its SAP Library structure
*      Procedure
*      ...
*             1.      Continuing in the BDoc Segment work area, choose the Mappings tab.
*             2.      In the Mapped table field, type or select ZGE01.
*             3.      In the Table Alias field, type ZGE01.
*             4.      Choose the Segment Overview tab and choose the Direct Map pushbutton.
*      The Direct Mapping screen appears.
*             5.      In the Mapped Tables list, select the row containing your table, ZGE01.
*             6.      Choose Get Fields.
*      The fields from the ZGE01 table appear in the Segment Fields table.
*             7.      Choose the >> pushbutton to select all fields.
*             8.      Choose Execute.
*             9.      Choose the Mappings tab and select the Update Map field.
*         10.      Choose the Segment Fields tab.
*      All fields you selected appear in the Segment Fields screen.
*         11.      In the same line as the SFAGE01 field appears, select the Key field.
*         12.      Choose Save.
*      Result
*      You have mapped the BDoc segment to the table. You can continue with Adding the BDoc Parameters.
*      End of Content Area
*      Start of Content Area
*      This graphic is explained in the accompanying text Adding the BDoc Parameters  Locate the document in its SAP Library structure
*      Procedure
*      ...
*             1.      In the Business Documents window, double click on the BDoc you created.
*             2.      Choose the Parameters tab.
*             3.      In the Name field, type SFAGE01 as the parameter.
*      Note
*      The parameter matches the information contained in the GUID entry from the Consolidated Database table.
*             4.      In the Data Element field, type SMO_GUID.
*      Note
*      This matches the information contained in the Field type field of the GUID entry in the Consolidated Database table.
*             5.      Choose Save.
*      Result
*      You have added the BDoc Parameters. You can continue with Adding the Where Clause.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Adding the Where Clause  Locate the document in its SAP Library structure
Procedure
...
       1.      From the BDoc Overview window, double click on the BDoc segment table that you created, ZGE01.
The Where Clause screen appears.
       2.      Select the Mandatory field.
       3.      Choose the Detail View This graphic is explained in the accompanying text pushbutton.
The Where 1 text box appears.
       4.      In the Where 1 text box, type <table alias name>.<fieldname><OP>:<parameter>, and choose Enter.
Example
ZGEO.SFAZCOUNTRIES=:SFAZCOUNTRIES (Make sure there are no spaces.)
       5.      Make sure that the Operator column does not contain a value.
       6.      Choose Save.
Result
You have created the Where clause. You can continue with Activating the BDoc.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Activating the BDoc  Locate the document in its SAP Library structure
Procedure
...
       1.      Choose the Check pushbutton to ensure that the BDoc does not contain any errors.
Note
If errors occur, rectify them in the BDoc, and test the changes again. For more information about the BDoc Modeler, see http://help.sap.com/saphelp_crm70/helpdata/EN/images/book.gifCRM Business Document Modeler.
       2.      Choose the Activate pushbutton to activate your new BDoc.
Result
You have activated the BDoc. Continue with Mapping the BDoc to the Site Type.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Mapping the BDoc to the Site Type  Locate the document in its SAP Library structure
Procedure
...
       1.      Continuing with the BDoc Modeler, choose Goto  Site Type Mapping.
The Maintain Table Views: Initial Screen appears.
       2.      Choose Maintain.
The Determine Work Area: Entry dialog box appears.
       3.      In the BDOC Type field, type ZGEBDOC01 and choose Enter.
The View for BDoc type/Site type mappings: Overview screen appears.
       4.      Choose New Entries.
       5.      In the Site Type ID field, type or select CDB.
Note
Press F4 to select the site type ID from the list.
       6.      Choose Save.
The Prompt for Workbench Request dialog box appears.
       7.      If you need to create a work order, choose the Create pushbutton, add a description of the transport, and then choose OK.
If you have a work order or have created a work order, choose Enter.
Result
You have mapped the BDoc to the Site ID. You can continue with Creating a Query BDoc.

End of Content AreaStart of Content Area
This graphic is explained in the accompanying text Creating a Query BDoc  Locate the document in its SAP Library structure
Use
When you create a Query BDoc, you follow the same process as you use to create a BDoc. The significant differences are that you do not add any parameters or where clauses because you need the Query BDoc to find all information for the criteria provided at runtime.
Procedure
Note
If you are continuing from Activating the BDoc, then begin with step 3.
...
       1.      From the SAP menu, choose Architecture and Technology  Middleware  Development Meta Object Modeling BDoc Modeler.
The CRM BDoc Modeler Personal Filter screen appears.
       2.      Choose Execute.
The CRM BDoc Modeler screen appears.
       3.      Choose BDoc Type  Create BDoc Type.
The BDoc Overview tab appears on the right-hand side of the screen.
       4.      In the BDoc Identity group box in the Name field, type ZGEQUERYBDOC01 as the name of the Query BDoc.
       5.      In the Description field, type a description of the BDoc.
       6.      In the BDoc Class group box, select the Synchronization (Write) field.
       7.      In the Mobile Application Processing Type group box, select the Standard field.
The new BDoc appears in the Business Documents window.
Result
You have created a BDoc for the ZGE01 table. You can continue with Adding a Segment to the Query BDoc.
*      End of Content Area
*      Start of Content Area
*      This graphic is explained in the accompanying text Adding a Segment to the Query BDoc  Locate the document in its SAP Library structure
*      Procedure
*      ...
*             1.      In the BDoc Overview window, select the BDoc you created, then choose BDoc Type  Create Segment.
*             2.      In the Segment name field, type ZGEQUERYSEG01 as the name for the segment you want to add.
*             3.      In the Description field, type Query for countries and continents as a short description for the segment.
*             4.      Clear the Cascaded Delete field.
*             5.      Choose Save.
*      Result
*      You have added the segment to the BDoc. You can continue with Mapping the Query BDoc Segment to the Table.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Mapping the Query BDoc Segment to the Table  Locate the document in its SAP Library structure
Procedure
...
       1.      Choose the Mappings tab.
       2.      In the Mapped table field, type or select ZGE01.
       3.      In the Table Alias field, type ZGE01.
       4.      Choose the Segment Overview tab and choose the Direct Map pushbutton.
The Direct Mapping screen appears.
       5.      In the Mapped Tables list, select the row containing your table, ZGE01.
       6.      Choose Get Fields.
The fields from the ZGE01 table appear in the Segment Fields table.
       7.      Choose the >> pushbutton to select all fields.
       8.      Choose Execute.
       9.      Choose the Mappings tab and select the Update Map field.
   10.      Choose the Segment Fields tab.
All fields you selected appear in the Segment Fields screen.
   11.      In the same line as the SFAGE01 field appears, select the Key field.
   12.      Choose Save.
Result
You have mapped the BDoc segment to the table. You can continue with Activating the Query BDoc.
*      End of Content Area
*      Start of Content Area
*      This graphic is explained in the accompanying text Activating the Query BDoc  Locate the document in its SAP Library structure
*      Procedure
*      ...
*             1.      Choose the Check pushbutton to ensure that the BDoc does not contain any errors.
*      Note
*      If errors occur, rectify them in the BDoc, and test the changes again. For more information about the BDoc Modeler, see http://help.sap.com/saphelp_crm70/helpdata/EN/images/book.gifCRM Business Document Modeler.
*             2.      Choose the Activate pushbutton to activate your new BDoc.
*      Result
*      You have activated the BDoc. You can continue with the Replication Modeling process.
*      End of Content Area
Start of Content Area
Process documentation Replication Modeling  Locate the document in its SAP Library structure
Purpose
You need to create a replication object so that the new fields are available for the appropriate end users in the Mobile Sales application. For more information about the Administration Console, see The Administration Console.
Process Flow
The following diagram depicts this process by machine and software. The process steps follow.
This graphic is explained in the accompanying text
...
       1.      Create a replication object.
       2.      Create a site.
       3.      Create a publication.
       4.      Create a subscription.
       5.      Create an employee.
       6.      Create a logon and password for the employee.
       7.      Assign the employee to the new site.
       8.      Subscribe to a publication.
       9.      Create a table in the IDES database.
Result
You have created a replication object and completed the setup requirements for recipients. Continue with ASCII Adapter Customization and Flow Generation.

*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Creating a Replication Object  Locate the document in its SAP Library structure
Procedure
...
       1.      Log on to the CRM server, if you do not have it running already.
       2.      Choose Architecture and Technology  Middleware  Administration  Administration Console.
The Administrative Console Object Navigator screen appears.
       3.      In the Object type dropdown box, select Replication objects, then choose Object  Create.
The Replication Object Wizard starts.
       4.      Choose Continue.
       5.      Select the Synchronization BDoc Type field, then choose Continue.
       6.      In the BDoc Type field, type or select ZGEBDOC01_WRITE, the name of the BDoc you created, and then select the Bulk field.
       7.      In the Short ID field, type ZGE as a short identifier for this replication object, and then choose Continue.
       8.      Choose Complete.
Result
You have created a replication object. You can continue with Creating a Site.
*      End of Content Area
*      Start of Content Area
*      This graphic is explained in the accompanying text Creating a Site  Locate the document in its SAP Library structure
*      Procedure
*      ...
*             1.      Log on to the CRM Server, if you do not already have it running.
*             2.      From the SAP menu screen, choose Architecture and Technology  Middleware  Administration  Administration Console.
*      The Administrative Console Object Navigator screen appears.
*             3.      In the Object type dropdown box, select Site, then choose the Display Objectspushbutton.
*      The Site Types list appears in the Objects window.
*             4.      Choose Object  Create.
*      The Administration Console Add Site screen appears.
*             5.      In the Object Information Site group box in the Name field, type a name for the site you want to create. For example, type Geo Test.
*      Note
*      If you choose to do so, you can add a short description for this site.
*             6.      In the Type dropdown box, select Mobile Client.
*             7.      Choose Site Attributes.
*      The Maintenance of Site Attributes dialog box appears.
*             8.      In the Connection Group field, select ALREADY CONNECTED.
*             9.      In the Transfer Group field, select MESSAGES ONLY TRANSFER GROUP, then choose Continue.
*         10.      Choose Save.
*      Result
*      You have created a site. You can continue with Creating a Publication.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Creating a Publication  Locate the document in its SAP Library structure
Procedure
...
       1.      Continuing with the Administration Console, in the Object type dropdown box, select Publications, then choose Object  Create.
The Publication Wizard starts.
       2.      Choose Continue.
       3.      In the Publication Name field, type GEOGRAPHYas the name for the Publication.
       4.      Select the Bulk field, and then in the Replication Object table, select the replication object, ZGEBDOC01_WRITE.
       5.      Select the Continent field and choose Continue.
       6.      Choose Complete.
Result
You have created a Publication. You can continue with Creating a Subscription.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Creating a Subscription  Locate the document in its SAP Library structure
Procedure
...
       1.      Continuing with the Administration Console, in the Object type dropdown box, select Subscriptions, then choose Object  Create.
The Subscription Wizard starts.
       2.      Choose Continue.
       3.      In the Subscription Name field, type a name for the Subscription you want to create, for example, GEOGRAPHY BY CONTINENT (EU), then choose Continue.
       4.      Select GEOGRAPHYas the Publication.
       5.      In the CONTINENT segment field, type EUR.
       6.      Choose the Assign pushbutton to assign the Site you just created, Geo Test.
       7.      Choose Complete.
       8.      Return to the SAP Easy Access menu screen.
Result
You have created a subscription and assigned it to a site. You can continue with Creating an Employee.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Creating an Employee  Locate the document in its SAP Library structure
Procedure
...
       1.      Log on to the CRM server, if you do not already have it running.
       2.      From the SAP Easy Access menu, choose Master Data  Business Partner  Maintain Business Partner.
The Process Business Partners screen appears.
       3.      Choose Business Partner  Create  Person.
The Create Person screen appears.
       4.      In the Create in Role field, select Employee.
       5.      In the Language field, enter a language for the employee, then press Enter.
       6.      Choose Create.
The Create Person Role Employee screen appears.
       7.      In the First name field, type the first name of the employee.
       8.      In the Last name field, type the last name of the employee.
       9.      In the Country field, type or select the country code for the employee.
   10.      In the Telephone field, type the telephone number for the employee.
   11.      Choose Save.
   12.      Return to the SAP Easy Access Menu.
Result
You have created an employee. You can continue with Creating a Logon and Password for the Employee.

End of Content AreaStart of Content Area
This graphic is explained in the accompanying text Creating a Logon and Password for the Employee  Locate the document in its SAP Library structure
Procedure
...
       1.      From the SAP menu screen, choose Architecture and Technology  Middleware  Administration   Administration Console.
The Administrative Console Object Navigator screen appears.
       2.      In the Object Type dropdown box, select Employee, then choose Display Objects.
       3.      Select the Employee you just created from the list by double clicking on the name.
The employee information appears on the right-hand side of the screen.
       4.      Choose Object  Display <-> Change.
       5.      In the Logon Name field, type the logon name you use on the Mobile Client Application, for example, crmuser.
       6.      In the Password field, type the appropriate password for the user.
       7.      In the Confirmation Password field, type the password again, then choose Save.
...
Result
You have completed creating a logon and password for the Employee. You can continue with Assigning an Employee to a Site.

End of Content AreaStart of Content Area
This graphic is explained in the accompanying text Assigning an Employee to a Site  Locate the document in its SAP Library structure
Procedure
...
       1.      Continuing with the Administration Console, select the employee you just created, then choose Object  Display <-> Change.
Note
If the employee that you created does not appear in the list, you must download it using transaction SMOELOAD.
       2.      In the Dependent information group box on the Assigned Sites tab, choose Assign.
       3.      In the Sites list, select GeoTest, then choose Copy.
       4.      Choose Save.
Result
You have assigned the employee to the site. You can continue with Subscribing to a Publication.

End of Content AreaStart of Content Area
This graphic is explained in the accompanying text Subscribing to a Publication  Locate the document in its SAP Library structure
Procedure
...
       1.      Continuing with the Administration Console, choose Object  Display <-> Change.
       2.      On the Assigned Subscriptions tab in the Dependent information group box, choose Assign.
       3.      In the Subscriptions list, select Geography, then choose Copy.
       4.      Choose Save.
       5.      Return to the SAP Easy Access menu screen.
Result
You have subscribed to a publication. You can continue with Creating a Table in the IDES Database.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Creating a Table in the IDES Database  Locate the document in its SAP Library structure
Procedure
...
       1.      From the path ..\Program Files\SAP\Mobile\bin, choose ClientConsole.exe.
The Client Console application opens.
       2.      In the Client Administration window, choose Generate Table Scripts.
The Table Script Generation - CRM Middleware Connection screen appears.
       3.      In the Server Details group box in the Destination field, type or select the name of the system to which you want to connect.
       4.      In the Application server field, type the system number for the server.
Note
Locate this information using SAPlogon by choosing the Server pushbutton, then selecting the system you want to use in the System Id field. The server number is provided in the Message Server field.
       5.      In the System Number field, type the system number for the server you have identified.
Note
Locate this information in the SAPlogon by choosing the Properties pushbutton. The information is provided in the System Number field of the Properties dialog box.
       6.      In the Client field, add the number of the system client that you want to access.
       7.      In the Language field, type the two-letter code for the appropriate system language. For example, type en.
       8.      In the Login Parameters group box in the Login field, type <youruserid>.
       9.      In the Password field, type <yourpassword>, then choose Connect.
The Table Script Generation screen appears.
   10.      Select the ZGE01 table from the list.
   11.      Select the Execute directly on Database IDES field, if it is not selected already, then choose Generate.
The scripts generate. The Message Description window contains the message, Table Script Generation Completed, when the process ends.
*      End of Content Area
*      Start of Content Area
*      Process documentation ASCII Adapter Customization and Flow Generation  Locate the document in its SAP Library structure
*      Purpose
*      In order to download the new object, you must customize the ASCII Adapter, carry out the delta download and start the flow process.
*      Process Flow
*      The following diagram depicts this process by machine and software. The process steps follow.
*      This graphic is explained in the accompanying text
*      ...
*             1.      Define the download object for the ASCII Adapter.
*             2.      Start the Delta Download.
*             3.      Transport Metadata.
*             4.      Generate metadata and stored procedures.
*             5.      Assign a site to a laptop.
*             6.      Starting the flow process.
*      Result
*      You have downloaded the new object and started the flow process. You can continue with Create the Mobile Sales Application.
*       
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Defining the Download Object for the ASCII Adapter  Locate the document in its SAP Library structure
Procedure
...
       1.      Log on to the CRM server, if you do not already have it running.
       2.      From the SAP User menu, select Architecture and Technology  Middleware  Data Exchange  Object Management  Customizing Objects.
The Adapter Object Overview screen appears.
       3.      Select Table View  Display <-> Change.
       4.      Select Edit  Create Object.
       5.      In the Object Name field, type ZGEBDOC01_DO as the name of the object to be downloaded. The name must be unique.
       6.      In the Linked BDoc field, type or select ZGEBDOC01.
       7.      In the Blocksize field, type 50.
       8.      On the Initial Flow Contents tab in the Source site type field, select R/3.
       9.      Select the Tables/Structures tab.
   10.      In the Table (source site) field, type ZGE01.
   11.      In the Mapped Structure (target site) field, type ZGE01.
   12.      Choose Back.
   13.      Double click on the ZGEBDOC01_DO to return to the screen.
The filter icon in the table activates.
   14.      In the Filter Settings field, choose the Filter pushbutton.
The Filters tab screen appears.
   15.      In the Source Site Name field, select CRM_DEFAULT DESTINATION.
   16.      In the Filter option field, select Filter in source and target database.
   17.      In the Field field, type CONTINENT.
   18.      In the OP field, select Equality (= Low).
   19.      In the Low field, type Europe.
Note
This field is case sensitive.
   20.      In the Incl/Excl field, select Inclusive defined set/array.
   21.      Choose Back, then choose Save.
The Include Download Objects into a transfer request pop up box appears.
   22.      Choose Yes.
The new information generates.
   23.      Return to the main menu.
Result
You have defined the download object for the ASCII Adapter. You can continue with Starting the Delta Download.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Starting the Delta Download  Locate the document in its SAP Library structure
Procedure
...
       1.      From the CRM Server menu screen, select Architecture and Technology  Middleware  Data Exchange  Delta Load from R/3 Back-End  Set Up Delta Load.
The Object Class Activation screen appears.
       2.      Select ZGE01 as the business object you want to prepare for the download, then choose Save.
Result
You have selected the table for download from the R/3 system. Continue with Transporting Metadata.

End of Content AreaStart of Content Area
This graphic is explained in the accompanying text Transporting Metadata  Locate the document in its SAP Library structure
Procedure
...
       1.      Select Architecture and Technology  Middleware  Development  Transport Meta-Data.
The Transport of Industry Specific Objects screen appears.
       2.      In the Available Objects field, type or select ZGE01_DO.
       3.      Choose Execute.
A transport change request is created automatically.
Result
You have transported the Metadata. You can continue with Generating Metadata and Stored Procedures.

End of Content AreaStart of Content Area
This graphic is explained in the accompanying text Generating Metadata and Stored Procedures  Locate the document in its SAP Library structure
Procedure
...
       1.      From the path ..\Program Files\SAP\Mobile\bin, choose ClientConsole.exe to start the Client Console.
       2.      In the Client Administration window, choose Table Script Generation.
The Table Script Generation screen appears.
       3.      In the Destination field, select XYZ (the three-character name of your CRM server.)
       4.      Supply the appropriate information for connection in the remaining fields.
       5.      Choose Connect.
A list of tables appears.
       6.      Select ZGE01.
       7.      Make sure that the Execute directly on database IDES field is selected.
       8.      Choose Generate.
The stored procedures generate.
       9.      Choose Metadata Manager.
The Metadata Manager screen appears.
   10.      In the Destination filed, select XYZ (the three-character name of your CRM server.)
   11.      Supply the appropriate information for connection in the remaining fields.
   12.      Choose Connect.
A list of BDocs appears.
   13.      Select ZGEBDOC01. and ZGEQUERY01.
   14.      Choose Generate.
The metadata and stored procedures generate. The Message Description window contains the message, Metadata Generation Completed when the process ends.
Result
You have generated the metadata and stored procedures. You can continue with Assigning a Site to a Laptop (Activating extraction).
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Assigning a Site to a Laptop (Activating extraction)  Locate the document in its SAP Library structure
Procedure
...
       1.      Continuing with the Client Console, in the Client Administration window, choose Assign Site ID.
The Table Script Generation dialog box appears.
       2.      Enter the appropriate information for the communication station connection and the appropriate login and password, then choose Connect.
The Assign Site ID screen appears.
       3.      From the Available free sites list, select Geo Test, then choose Assign.
Result
You have activated the extraction of the new object. You can continue with Starting the Flow Process.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Starting the Flow Process  Locate the document in its SAP Library structure
Procedure
...
       1.      From the Start menu, choose Programs  SAP CRM Mobile  Mobile Client Administration Tools  ConnTrans.
The ConnTrans screen appears.
       2.      On the Transfer Services tab, clear the Send field.
       3.      Choose Synchronize.
Result
You have started the flow. You can continue with the Create the Mobile Sales Application process.
*      End of Content Area
*      Start of Content Area
*      Process documentation Create the Mobile Sales Application  Locate the document in its SAP Library structure
*      Purpose
*      Now that you have configured the Middleware, you must create the application using the Mobile Application Studio.
*      Prerequisites
*      You must reserve a namespace for the customer development repository on the Mobile Repository Server before starting the Mobile Application Studio. For more information, see http://help.sap.com/saphelp_crm70/helpdata/EN/images/book.gifRegistering the Customer Namespace Y or Z.
*      Process Flow
*      The following diagram depicts this process by machine. The process steps follow.
*      This graphic is explained in the accompanying text
*      ...
*             1.      Configure the Mobile Application Studio.
*             2.      Create a business object.
*             3.      Create a business query.
*             4.      Create a detail tile.
*             5.      Create a query detail tile.
*             6.      Create a tile set.
*             7.      Create a business component.
*             8.      Create an application.
*             9.      Release the changes.
*         10.      Generate the application.
*      Result
*      You can start the application.
*       
*      End of Content Area
Start of Content Area

This graphic is explained in the accompanying text Configuring the Mobile Application Studio  Locate the document in its SAP Library structure

Procedure

...
       1.      Choose Start  Programs  SAP CRM Mobile  SAP Mobile Application Studio to start the Mobile Application Studio.
1.                                                                                i.       In the DSN field, type ars_db.
2.                                                                              ii.       In the User field, type arsadmin.
3.                                                                             iii.       Do not add a password.
4.                                                                             iv.       Choose Login.
The Select a Changelist dialog box appears.
       2.      If you want to view the development objects, choose OK.
The Mobile Application Studio Workbench screen appears.
Note
If you want to edit development objects, you can either select an existing change list, or create a new change list.
To create a new change list, use this procedure.
         Choose the New pushbutton.
The Create New Changelist dialog box appears.
         In the Changelist field, type the name for your change list.
         Choose OK.
The Select a Changelist dialog box appears again.
         Choose OK.
The Mobile Application Studio Workbench screen appears.
       3.      Choose Tools  Options.
The Options dialog box appears.
       4.      In the Generation settings list box, verify that the paths for generation of runtime files and access to the BDoc repository are accurate. Use the following table to check the path data.
Generation option
Path
RT Generation (.dat Files)
C:\Program Files\sap\Mobile\ars\
BOL VBA Generation
C:\Program Files\sap\Mobile\app\vba_dlls_msa\
UI Generation
C:\Program Files\sap\Mobile\framework\GenApps\
EXE for BOL VBA Debug
<None>
UI Template
C:\Program Files\sap\Mobile\framework\Templates\
UI Modeler Layout
C:\Program Files\sap\Mobile\framework\uimodeler\
       5.      Select the BDoc Validation option.
5.                                                                                i.       Select the BDoc Validation using R/3 Repository field.
6.                                                                              ii.       In the DSN field, type or select trrep.
7.                                                                             iii.       In the User field, type sa.
       6.      Choose Apply, then choose OK.

Result

You have configured the Mobile Application Studio. You can continue with Creating a Business Object.
*      End of Content Area
Start of Content Area
This graphic is explained in the accompanying text Creating a Business Object  Locate the document in its SAP Library structure
Procedure
...
       1.      If the Object Modeler window is not open, choose View  Object Modeler.
-or-
If the Object Modeler window is open, continue with step 2.
The Object Modeler window appears.
       2.      Choose File  New  Business Object.
The Business Object Wizard starts.
Note
         If you are working in the baseline version, you will receive a message instructing you to create a change list. Create the change list and continue with step 3.
         If you have turned the wizard function off, then you must create the new business object manually.
       3.      In the Name field, type Z_ROOM3BO.
       4.      In the BDoc Support field, select New BDoc Supported.
Note
This allows the business object to be mapped to a Write BDoc, which writes data to the IDES database at runtime.
       5.      In the Read BDoc and Write BDoc fields, select ZGE01, the name of the BDoc you created in the BDoc Modeler.
       6.      In the BDoc Segment field, select ZGE01SEG. the segment you created for the BDoc.
       7.      In the BDoc Parameter field, select the parameter that you specified as the primary key in the BDoc Modeler.
       8.      Choose Next.
       9.      Choose the Segment Field names from the BDoc for which you want to add a property.
   10.      In the Property field, type the name you want for the property.
Note
Use the segment field which you assigned to the business object.
   11.      Choose Next.
   12.      Choose Finish.
The Business Object Wizard creates the business object and closes, then the Business Object screen appears.
Result
You have created the business object. You can continue with Creating a Business Query.

*      End of Content Area

Procedure documentationCreating a Business Query Locate this document in the navigation structure

Procedure

1.      Choose   File   New   Business Queries  .
The Business Query Wizard starts.
Note NOTE
If you have turned the wizard function off, then you must create the new business query manually.
2.      In the Name field, type Z_ROOM3BQ.
3.      In the Read BDoc field, select ZGE01Q.
4.      In the BDoc Segment field, select the segment you created for the BDoc.
5.      In the Contained BO field, select Z_ROOM3BO, the business object that you created.
6.      Choose Next.
7.      Choose the Segment Field names from the BDoc for which you want to add a property.
8.      In the Property field, type the name you want for the property.
Note NOTE
Use the segment field that you assigned to the business object.
9.      Choose Next.
10.  Choose Finish.
The Business Query Wizard creates the business object and closes, then the Business Query screen appears.

Result

You have created the business query. You can continue with Creating a Detail Tile.
Start of Content Area
This graphic is explained in the accompanying text Creating a Detail Tile  Locate the document in its SAP Library structure
Procedure
...
       1.      Choose File  New  Tile  Detail.
The Tile Wizard screen appears.
       2.      Choose Next.
       3.      Select Detail Tile, if it is not already selected.
       4.      In the Caption field, type the name for the tile which appears in the application.
       5.      In the Name filed, type a new name for the tile, if desired, then choose Next.
       6.      Choose the appropriate Properties for the tile, then choose Next.
       7.      In the Available Data Sources list box, select Z_ROOM3BO, then choose Add.
       8.      Choose Finish.
The Tile Wizard creates the tile object and closes, then the Tile screen appears in the work area.
       9.      In the tile work area, make changes to the appearance of the tile.
   10.      Choose Save.
   11.      Close the tile work area.
Result
You have created the detail tile. You can continue with Creating a Query Detail Tile.
Start of Content Area
This graphic is explained in the accompanying text Creating a Query Detail Tile  Locate the document in its SAP Library structure
Procedure
...
       1.      Choose File  New  Tile  Query Detail.
The Tile Wizard screen appears.
       2.      Choose Next.
       3.      Select Query Detail Tile, if it is not already selected.
       4.      In the Caption field, type the name for the tile which you want to appear in the application.
       5.      In the Name filed, type a new name for the tile, if desired, then choose Next.
       6.      Choose Navigate between records for the tile properties, then choose Next.
       7.      In the Available Data Sources list box, select Z_ROOM3BQ, then choose Add.
       8.      Choose Finish.
The Tile Wizard creates the tile object and closes, then the Tile screen appears in the work area.
       9.      In the tile work area, make changes to the appearance of the tile.
   10.      Choose Save.
   11.      Close the tile work area.
Result
You have created the query detail tile. You can continue with Creating a Tile Set.

End of Content AreaStart of Content Area
This graphic is explained in the accompanying text Creating a Tile Set  Locate the document in its SAP Library structure
Procedure
...
       1.      Choose File  New  Tile Set  Standard.
The Tile Set Wizard screen appears.
       2.      Choose Next.
       3.      Select Standard Tile Set, if it is not already selected, then choose Next.
       4.      In the Caption field, type the name of the tile set that you want to appear in the application.
       5.      In the Name field, change the name of the tile set, if you want to, then choose Next.
       6.      In the Active tiles list box, expand the Detail Tiles folder.
       7.      In the Available Tiles list box, select and drag the tile you created and drop it in the Free Cell area.
       8.      Expand the tile to fill the entire area, then choose Next.
       9.      Select the appropriate properties for this tile set, then choose Next.
   10.      Establish a connection between the tile and the tile set, then choose Next.
   11.      Review the selections you made for the tile set, then choose Finish.
The Tile Set Wizard creates the tile set and closes, then the Tile Set screen appears in the work area.
   12.      Choose Save.
   13.      Close the tile set work area.
Result
You have created the tile set. You can continue with Creating a Business Component.

Start of Content Area

This graphic is explained in the accompanying text Creating a Business Component  Locate the document in its SAP Library structure

Procedure

...
       1.      Choose File  New  Business Component.
The Business Component screen appears.
       2.      In the Object Browser, expand the Standard Tile Sets folder.
       3.      Select and drag the new tile set and drop it in the Tile Set Containers pane in the Business Component window.
       4.      In the Business Anchors pane, click the Business Anchors folder with the secondary mouse button and choose New Anchor.
       5.      In the Business Anchors pane, select the new anchor.
       6.      In the Properties window, select the appropriate information for these fields.
1.                                              a.      In the Data Source field, select the ZGE01BQ.
2.                                              b.      In the Data Source Type field, select Business Query.
       7.      In the Tile Set pane, select and drag the tile set anchor and drop it on to the new business anchor.
The tile set anchor becomes the child of the business component anchor.
       8.      In the Business Anchors pane, select the child (tile set) anchor.
       9.      In the Properties window, select the appropriate information in these fields.
3.                                              a.      In the Supply Type field, select QueryResult.
4.                                              b.      In the Data Source Type field, select Business Collection.
   10.      In the Tile Set pane, select the Tile Set Container node.
   11.      In the Properties window, select the appropriate information for these fields.
5.                                              a.      In the MainAnchor field, select the ZGE01BQ.
6.                                              b.      In the Enabled field, select True.
12.  Choose Save.
13.  Close the business component work area.

Result

You have created the business component. You can continue with Creating an Application.

End of Content AreaStart of Content Area
This graphic is explained in the accompanying text Creating an Application  Locate the document in its SAP Library structure
Use
Note
For testing purposes, we recommend that you create a new application or to delete all other business components from the existing application you choose. This ensures that the Mobile Application Studio uses only your BDocs and does not depend on whether or not the latest MSA BDocs exist in the Middleware. It also reduces generation times.
Procedure
...
       1.      From the UI Modeler window, click the Applications folder with the secondary mouse button, and choose New.
The application work area appears.
       2.      From the UI Modeler window, select and drag the business component you created and drop it in the Business Containers pane.
       3.      Choose Save.
       4.      Close the application work area.
Result
You have created the application. You can continue with Releasing the Changes.

End of Content AreaStart of Content Area

This graphic is explained in the accompanying text Releasing the Changes  Locate the document in its SAP Library structure

Procedure

...
       1.      Choose View  Changelist Browser.
The Changelist Browser window appears on the right side of your screen.
       2.      Expand the My Open Changelists folder.
       3.      Click the change list on which you are working with the secondary mouse button, and choose Release.
The Workbench dialog box appears.
       4.      Choose Yes to confirm the release.
If the attachment of R/3 transport orders is enabled, the ChangeManagement dialog box appears. Use this procedure to continue.
7.                                              a.      Choose OK.
8.                                              b.      The Changelist screen appears.
9.                                              c.      In the Transport Order field, select the … (ellipsis) pushbutton.
10.                                          d.      Select the transport ID from the list of available orders.
11.                                          e.      Choose Save.
Note
If you are not able to release the change list, you can continue with the generation of the application. The Mobile Application Studio uses the active change list as its default.

Result

You have released the changes. You can continue with Generating the Application.

Start of Content Area
This graphic is explained in the accompanying text Generating the Application  Locate the document in its SAP Library structure
Prerequisites
Before you can generate the application, you must generate the runtime file for the business object and business query followed by the user interface development objects. This results in automatic generation of runtime files such as DLLs and the VBA project.
Procedure
...
       1.      In the Object Modeler window, click the Business Objects folder with the secondary mouse button, and choose RTGenerate.
This generates the file ARSREP.DAT for the business object.
       2.      In the Object Modeler window, click the Business Objects folder with the secondary mouse button and choose RTGenerate.
This generates the file ARSREP.DAT again with data of the business query.
       3.      Select Tools  UI Generator to generate the user interface development objects.
The UI Generator screen appears.
       4.      In the Select Interaction Components for Generation group box in the Selected Application field, select the appropriate application.
       5.      In the Select Settings for Generation group box, select the Generate Recursively field.
       6.      In the Project Name field, select the appropriate project to which this application belongs.
       7.      Choose Start Generation.
The application generation begins. If any errors occur during generation, they appear on the screen. You can open the Generation Log file to check the cause for the errors.
Result
You have generated the application. You can continue with Starting the Application.

Start of Content Area
This graphic is explained in the accompanying text Starting the Application  Locate the document in its SAP Library structure
Prerequisites
When the application generation finishes, you can view the result of your work by starting the Mobile Sales Application.
When the application generation finishes, you can view the result of your work by starting the Mobile Sales Application on the Mobile Client.
Procedure
...
       1.      Select Start  Run.
The Run dialog box appears.
       2.      In the Open field, type C:\Program Files\sap\Mobile\bin\UFContainer.exe.
Note
This path is the default. If you changed the path, then you will need to adjust these instructions accordingly.
       3.      Choose OK.
The newly generated Mobile Sales Application starts.
       4.      Log on to the Mobile Sales Application to view your results.
Result
You have completed the CRM Mobile Sales table integration.


BDOCS

  • BDOC IS NOTHING BUT BUSSINESS DOC ,IT IS USED TO TRANSFER THE DATA FROM ECC TO CRM AND VICEVERSA USING MIDDLE WARE TECHNILOGY.
  • EACH BUSSINESS DOC CONNECTED WITH ADOPTER OBJ.
  • BUSSINESS DOCUMENTS HAVING SEGMENTS.
  • SEGMET CONTAINS FIELDS .
  • IN THOSE FIELDS GUID IS KEY FIELD  IS MANDATORY.
  • WE CAN ADD MULTIPLE SEGMENTS TO ONE BDOC.
  • BDOC HAV E CRM STRUCTURE AND ECC STRUCTURE.
  • IN CRM STRUCTURE DATA IS IN CRM STRUCTURE.
  • BY ECC STRUCTURE DATA USED FOR COMMUNICATION.
  • MIDDLE WARE USED FOR DATA VALIDATIONS AND DATA TRANSFORMATION.
  • FOR DATA UP LOADING WE HAVE TWO TYPES OF LOADS THOSE ARE
  • INITIAL LOAD,DELTA LOAD
  • INITIAL LOAD: INITIAL LOAD IS THE FIRST TIME LOAD .INTHAT CASE DATA BASE IS EMPTY.IT IS ONE TIME LOAD.TC ODE FOR INITIAL LOAD - R3AS.
  • DELTA LOAD : WHEN EVER MODIFYING THE DAT A IN THE DATA BASE WE NEED DELTA LOAD.WHEN WE PERFORM DELTA LOAD OPTION WE SHOULD REMOVE INITIAL LOAD OPTION. BUT WITHOUT INITIAL LOAD WE CANT PERFORM DELTA LOAD.
  • IF I SEND A BDOC FROM CRM TO ECC THAT BDOC SHOULD NOT A IDOC.
  • THIS TRANSFORMATION INTHE FORM OF QUEUES.THE QUEUE IS STARTS WITH "CSA"  IS OUT BOUND TO CRM.
  • THE QUEUE STARTS WITH  R3AD IS IN BOUND TO CRM.
  • WHEN EVER ERROR OCCURS IN OUTBOUND ,IN THIS CASES WE NEED TO STOP THE QUEUE IN MIDDLE WARE FOR THAT TCODE IS  SMQR.
  • BY USING SMQR T CODE DEREGISTER THE QUEUE AND FIND THE ERROR BY DEBUGGING IN SYSTEM GENARATED CODE.IF QUEUE IS RIGISTARD DEBUGGING NOT ALLOWED.SYMBOLS FOR REGISTATION AND DEREGISTRATION :R & U
  • ONCE WE GOT THE ERROR THEN WE HAVE TO SOLVE THE PROBLAM AND AGAIN REGISTER THE QUEUE.D
  • TCODE FOR INBOUND QUEUE : SMQ2
  • TCODE FOR OUTBOUND QUEUE : SMQ1.


SEARCH HELP FOR AET FIELD:
TARGET1: CONVERT THE CONTEXT NODE CLASS IN TO ZCLASS.
  • GO TO WORK BENCH .
  • SELECT STANDARAD COMPONENT BT111H_OPPT WITH SELECTED ENHANCEMENT SET.
  • GO TO COMPONENT STRUCTURE BROWSER.
  • VIEWS.
  • BT11H_OPPT/DETAILS->DOUBLE CLICK ON THAT.
  • SELECT VIEW STRUCTURE->COPY THE CNTEXT NODE CLASS.
  • GO TO SE24.
  • PROVIDE CONTExT NODECLASS NAME AND CHANGE THE NAME OF THE CONTEXT NODE As ZCLASS(ZL_BT111H_O_DETAILS_CN00)-> CREATE.
  • SELECT RADIO BUTOON CLASS->ENTER->CLICK ON THE CREATE INHERITANCE BUTTON->provide superclass as context class.
  • SAVE AND ACTIVATE CLASS.
  • AGAIN GO TO WORKBENCH AND SELECT BT11H_OPPT DETAILS VIEW-> SELECT THE CONTEXT CLASS->CLICK ON THAT.
  • SELECT METHOD CREATE_BTADMINH AND REDEFINE IT->SAVE.
  • GO TO SE24->COPY THE CONTEXT CLASS NAME(CL_BT111H_O_DETAILS_CTXT)->GO TO METHOD CREATE_BTADMINH.
  • COPY THE CODE FROM THAT AND PASTE IT IN ZCLASS OF CTXT-> IN THAT CODE CHANGE THE CLASS_NAME AS ZL------CN00.
  • SAVE AND ACTIVATE.


STEP:2
  • CLICK ON CONTEXT NODE CLASS(ZCL-----00).
  • GO TO CHANGE MODE AND CREATE METHODS   1)GET_P_ZZFLD000006
                                                                                                2)GET_V_ZZFLD000006.
  • VISIBILITY:PUBLIC FOR BOTH METHODS.
  • SAVE AND ACTIVATE.
  • COPY THE PARAMETERS OF(PRESS CTRL+Y AND CTRL+C) GET_P AND GET_V METHODS OF THAT SAME CONTEXT NODE CLASS.
  • PASTE THE PARAMETERS IN GET_P_ZZFLD000006 AND SAME AS GET_V(MAKE SURE THE PASS BY VALUE AND OPTIONAL VALUE TO BE CHECKED).

STEP:3
  • COPY THE CODE FORM CUSTOM VIEW(ZEPIC_APPL/EPIC)->CONTEXTCLASS->CONTEXTNODECLASS->ATTRIBUTES-> GET_P METHOD OF ATTRIBUTES(LEAD_TYPE CODE).

method GET_P_ZZFLD000006.

  
CASE IV_PROPERTY.
    
WHEN IF_BSP_WD_MODEL_SETTER_GETTER=>FP_FIELDTYPE.
      RV_VALUE = CL_BSP_DLC_VIEW_DESCRIPTOR=>FIELD_TYPE_INPUT.  
  
ENDCASE.
endmethod.

  • SAVE AND ACTIVATE.
  • SELECT GET_V METHOD WRITE THE CODE IN IT.
method GET_V_ZZFLD000006.
  
CREATE OBJECT RV_VALUEHELP_DESCRIPTOR TYPE CL_BSP_WD_VALUEHELP_NAVDESCR
  
EXPORTING
    IV_OUTBOUND_PLUG = 
'OP_TOCUSTOM'.(FROM OUTBOUND PLUG)
endmethod.
SAVE AND ACTIVATE.
STEP:3
  • GO TO WORKBENCH ->ENTER CUSTOM COMPONENTNAME -> WITH NO ENHANCEMENT SET.
  • CLICK ON DISPLAY.
  •  GO TO RUNTIME REPOSITORY EDITOR->CHANGE MODE.
  • SELECT COMPONENT INTERFACE-> RIGHTCLICK -> ADD INTERFACE VIEW(MAPPED WINDOW = Z KYRCMP/MAINWINDOW  THROUGH F4).
  • SAVE RRE.

STEP:4
·         GO TO WORKBENCH->ENTER STANDARD COMPONENT-> (BT111H_OPPT) WITH ENHANCEMENT SET.
·         DISPLAY.
·         GO TO  RUN TIME REPOSITORY EDITOR->CHANGE MODE->
·         COMPONENT USAGE->RIGHTCLICK->ADD COMPONENT USAGE->                       PROVIDE  ID(OPTIONAL ANY NAME)-> SAVE RRE.

STEP:4(BT111H_OPPT/DETAILS)
  • CREATE OUTBOUND PLUG: TO CUSTOM.
  • SELECT VIEW STRUCTURE TAB ->OUTBOUNDPLUG->RIGHTCLICK->CREATE.(TO CUSTOM).
  • GO TO IMPLEMENTATION CLASS(VIEW CONTROLLER CLASS) OF OP_TO CUSTOM->PUBLIC.
  • GO TO OUTBOUND PLUG->DOUBLE CLICK  ON TO CUSTOM->WRITE THE CODE.

method OP_TOCUSTOM.
                                   
* Added by wizard: Outbound plug 'TOCUSTOM'

  
CALL METHOD COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP
   
EXPORTING
     IV_INTERFACE_VIEW_NAME = 
'ZCUSRJ/MainWindow'(ZCUSRJ:INTERFACE VIEW NAME CLASS).
     IV_USAGE_NAME          = 
'cucustomcomp'. ("BT111H_OPPT->RRE->COMPONENT USAGE NAME: CUCUSTOMCOMP)
     IV_TITLE               = 
'SEARCH FOR OPPT_TYPE'
  RECEIVING
     RV_RESULT              = GR_CUSTOM_POPUP.("DOUBLE CLICK ON GR_CUSTOM_POPUP-> CHOOSE PUBLIC->TYPE REF TO->interface:IF_BSP_WD_POPUP )

  
CALL METHOD GR_CUSTOM_POPUP->SET_ON_CLOSE_EVENT

        
EXPORTING
          IV_VIEW = ME
          IV_EVENT_NAME = 
'CUSTOM_POPUP_CLOSED'.



DATA : LR_COL TYPE REF TO CL_BSP_WD_COLLECTION_WRAPPER.
DATA : LR_BTADMINH TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.
DATA  : LR_BTOPPORTH TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.
CREATE OBJECT LR_COL.
LR_BTADMINH ?= TYPED_CONTEXT->BTADMINH-> COLLECTION_WRAPPER->GET_CURRENT( ).
LR_COL->ADD( LR_BTADMINH ).
LR_BTOPPORTH ?= TYPED_CONTEXT->BTOPPORTH->  COLLECTION_WRAPPER->GET_CURRENT( ).
LR_COL->ADD( LR_BTOPPORTH ).
GR_CUSTOM_POPUP->OPEN
         ( IV_INBOUND_PLUG = 'FROMOPPT' IV_COLLECTION = LR_COL ).


endmethod.
STEP:5

·         GO TO WORKBENCH AND PROVIDE CUSTOM COMPONENT
     (ZKYCOMP)->DISPLAY.
·         GO TO COMPONENT STRUCTURE BROWSER.
·         DOUBLE CLICK ON COMPONENT CONTROLLER->SELECT CONTEXT NODES->RIGHT CLICK ->CREATE.
·         NOW WIZARD WILL OPEN
·           IN THAT STEPS:
Ø  NAME: RESULTCOCO
Ø  PROVIDE BOL ENTITY:RESULT OBJ->CONTINUE
Ø  MODEL ATRRINUTES->SELECT +ICON -> SELECT ID,TYPE,TARGET,BP->CONTINUE.
Ø  CONTINUE->TILL COMPLETE.


·         GO TO RRE->CHANGE MODE->EXPAND COMPONENT INTERFACE->EXPAND INTERFACE CONTROLLER->RIGHT CLICK ON CONTEXT->ADD CONTEXT NODE(CONTEXT NODE = RESULT COCO)->SAVE.
·         GOTO COMPONENT STRUCTURE BROWSER->EXPAND VIEWS->SELECT RESULT VIEW->DOUBLE CLICK ON THAT->GO TO EVENT HANDLER->DOUBLE CLICK ON EH_SELECT -> ADD THE BELOW CODE.

method EH_ONSELECT.
*CALL METHOD SUPER->EH_ONSELECT
*  EXPORTING
*    HTMLB_EVENT    =  HTMLB_EVENT
*    HTMLB_EVENT_EX =  HTMLB_EVENT_EX.
  data: lv_event TYPE REF TO cl_htmlb_event_tableview.
 lv_event ?= htmlb_event.
me->typed_context->resultcn->eh_on_row_selection(
       iv_htmlb_event    = lv_event
       iv_htmlb_event_ex = htmlb_event_ex ).
  data:lr_entity type ref to if_bol_bo_property_access,
        v_index type i,
 lr_coco type ref to ZL_ZCUSRJ_BSPWDCOMPONENT_IMPL, ("COMPONENT CONTROLLER IMPLEMENTATION CLASS IN CUSTOM COMPONET:ZCUSRJ)
 lr_window type ref to ZL_ZCUSRJ_MAINWINDOW_IMPL .("WINDOW CONTROLLER IN CUSTOM COMPONENT :ZCUSRJ).
  v_index = typed_context->resultcn->selected_index.
  lr_entity ?= typed_context->resultcn->collection_wrapper->find( iv_index = v_index ).
  lr_coco ?= comp_controller.
  lr_coco->typed_context->resultcoco->collection_wrapper->clear( ).
  lr_coco->typed_context->resultcoco->collection_wrapper->add( lr_entity ).
  lr_window ?= view_manager->get_window_controller( ).
  lr_window->op_tooppt( ).
endmethod.

SAVE .

STEP:6

·         SELECT CUSTOM COMPONENT:ZCUSRJ
·         SELECT COMPONENT STRUCTURE BROWSER->EXPAND WINDOWS-> DOUBLE CLICK ON MAIN WINDOW.
·         SELECT OUTBOUND PLUG->RIGHTCLICK ON THAT->CREATE(PROVIDE:TOOPPT).
·         GO TO WINDOW CONTROLLER IMPL CLASS-> CHANGE MODE->UNDO REDEFINITION TO OPPT METHOD->
      GO TO PROPERTIES->DOUBLE CLICK ON SUPER  CLASS(CL_BSP_WD_WINDOW)->SELECT METHODS-> CHANGE MODE-> CHANGE VISISBILITY OF OPPT METHOD FORM PROTECTED TO PUBLIC->SAVE AND ACTIVATE.
·         SELECT PROPERTIES->BACK->AGAIN METHODS->CHECK THE METHOD OPPT METHOD AND REDEFINE THAT METHOD.
·         SAVE AND ACTIVATE.

 code for op_tooppt()
              
                               fire_outbound_plug( iv_outbound_plug = 'op_tooppt').
  • SAVE AND ACTIVATE.
  • NOW GO TO RESULT VIEW->EVENTHANDLER-> EH_ONSELECT-> ACTIVATE.

STEP:7

·         GO TO STANDARD COMPONENT(BT111H_OPPT)
·         GO TO COMPONENT STRUCTURE BROWSER->VIEWS-> SELECT BT111H_OPPT/DETAILS.
·         EVENTHANDLER->RIGHT CLICK ->CREATE(FROM OP_CUTOM CODE:PROVIDENAME HERE:CUSTOM_POPUP_CLOSED )


      method EH_ONCUSTOM_POPUP_CLOSED.
               
* Added by wizard: Handler for event 'custom_popup_closed'

  
check gr_custom_popup->get_fired_outbound_plug( ) is not initial.

  
data:lr_cn type ref to cl_bsp_wd_context_node,
        lr_btadminh 
type ref to if_bol_bo_property_access,
        lr_entity 
type ref to if_bol_bo_property_access,
        v_type 
type string.

  lr_cn ?= gr_custom_popup->get_context_node( iv_cnode_name = 
'resultcoco').
  lr_entity ?= lr_cn->collection_wrapper->get_current( ).
  v_type = lr_entity->get_property_as_string( iv_attr_name = 
'oppt_type' ).
  lr_btadminh ?= typed_context->btadminh->collection_wrapper->get_current( ).
  lr_btadminh->set_property_as_string( iv_attr_name = 
'ZZFLD000006' IV_VALUE = V_TYPE ).


endmethod.
SAVE AND ACTIVATE.
STEP:8
  • GOTO CUSTOM COMPONET->SELECT WINDOWS->
  • DOUBLECLICK ON THAT->SELECT INBOUBDPLUG->CREATE(PROVIDE NAME: FROMOPPT).

method IP_FROMOPPT.

  
check iv_collection is BOUND.

  
data : lr_entity type ref to cl_crm_bol_entity,
         lr_viewset 
type ref to ZL_ZCUSRJ_SEARCHRESULTVIE_IMPL ,("VEIWSET CONTROLLER CLASS)
         lr_search 
type ref to ZL_ZCUSRJ_SEARCHVIEW_IMPL  ,("SEARCH VIEW CONTROLLER CLASS).
         lr_qs 
type ref to cl_crm_bol_dquery_service,
          v_type 
type string.

  lr_entity ?= iv_collection->get_first( ).
  
while lr_entity is bound.

    
if lr_entity->get_name( ) = 'BTAdminH'.
      v_type = lr_entity->get_property_as_string( iv_attr_name = 
'ZZFLD000006' ).("AET FIELD ATRRIBUTE NAME).
      
endif.
    lr_entity ?= iv_collection->get_next( ).
    
endwhile.

lr_viewset ?= get_subcontroller_by_viewname( iv_viewname = 
'ZCUSRJ/searchresultviewset' ).("ZCUSRJ:VIEWS->COPY THE VIEWSET NAME)

lr_search ?= lr_viewset->get_subcontroller_by_viewname( iv_viewname = 
'ZCUSRJ/searchview' ).("ZCUSRJ:VIEWS->COPY THE SEEARCH VIEW NAME).

lr_qs ?= lr_search->typed_context->searchcn->collection_wrapper->get_current( ).("CHANGE TYPED_CONTEXT VISIBILITY TO PUBLIC FROM PROTECTED IN SUPER CLASS).

CALL METHOD LR_QS->ADD_SELECTION_PARAM
  
EXPORTING
    IV_ATTR_NAME = 
'OPPT_TYPE'
    IV_SIGN      = 
'I'
    IV_OPTION    = 
'EQ'
    IV_LOW       = v_type.

endmethod.
SAVE AND ACTIVATE.
SEE THE RESULT WITH ENHANCEMENTSET  IN SM30. CHECK IN WEBUI.PRESS F4 ON THE AET FIELD.









11 comments:

  1. Cosmos online training is the Industry leader in providing SAP CRM Training across the globe. Our online training methodology focus on hands on experience of SAP CRM.

    http://cosmosonlinetraining.com/sap-crm-training

    ReplyDelete
  2. We provide you SAP MM Online Training | SAP SD Online Training from the experienced staff of Pragna Technologies...

    ReplyDelete
  3. You post is very helpful for me. thanks for sharing it with us.
    SAP FICO Training in Hyderabad | SAP FSCM Online Training

    ReplyDelete
  4. This post is much helpful for us. It was an excellent article to hear from you which is very useful. Thank you for sharing. We also offer efficient yet affordable SAP CRM Training with quality as the main objective.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Pretty good post. I just came across your site and wanted to say that I’ve really enjoyed reading your posts. In any case I’ll be subscribing to your feed and I hope you will keep a good work!Cheer!
    Download SAP CRM Resumes

    ReplyDelete
  7. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor led live training in SAP CRM, kindly Contact GRONYSA
    Click for SAP CRM Course details SAP CRM
    GRONYSA Offer World Class Virtual Instructor led training on SAP CRM. We have industry expert trainer. We provide Training Material and Software Support. GRONYSA has successfully conducted 10,000 + trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Nitesh Kumar
    GRONYSA
    E-mail: nitesh.kumar@gronysa.com
    Ph: +91-9632072659/ +1-2142700660
    www.GRONYSA.com



    ReplyDelete
  8. Great Post!!! I have read your blog and it's very informative & really impressed .
    Thanks for sharing it. Keep continue your post.
    SAP FIORI TRAINING ONLINE
    SAP FICO TRAINING ONLINE

    ReplyDelete
  9. I truly appreciate this post. I’ve been looking all over for this! Thank goodness I found it on Bing. You have made my day! Thanks again! Keep update more excellent posts..
    CRM Software in Dubai
    CRM Software in UAE
    CRM Software
    Best CRM Software
    Customer Relationship Management Software
    CRM Software for Small Business

    ReplyDelete