8/31/12

SAP CRM Technical Tutorials by Naval Bhatt.

SAP CRM Technical Tutorials by Naval Bhatt.
SAP CRM tutorials for all : Please feel free to contact me on naval.k.bhatt@gmail.com. Sunday, August 26, 2012 Search This Blog
Search

Extend BOL Model BT with custom table type relationship

Followers:Join to get regular update
Link to Content's target Space :
http://w iki.sdn.sap.com /w iki/display/CRM/CRM+Web+Client+UI+Fram ew ork

babudeep junjuri
Options

Applies to:
SAP CRM 6.0/7.0

Members (11)

Summary
Extend the standard BOL m odel BT w ith a custom relationship to accom odate your z-table. Invite your friends

Intro
There's been a few discussions in the forum s about finding a w ay to add a custom table to the standard BOL m odels. It's a bit tricky, but possible. In this WIKI, I w ill show you how to enhance the BOl m odel BT w ith a new 1..n relationship. The advantages are obvious. Any change in your custom data w ill register in the BOl layer, you w ill be able My other blogs to capture the BOl Core Reset and Order Init(revert) events, use the BOL m odel node w izards etc., Enhancing a few standard classes are in order. So, know ing how to enhance the m ethods using the im plicit enhancem ent points is necessary.

SAP BPM & Workflow tutorials My travel experiences

In this exam ple, w e w ill create the relationship under the adm inistration header(BTAdm inH). Actually, tw o relationships. One w ill be a read only relationship(sim iliar to BTItem s) that is linked and the other w ill be the 1..n relation that corresponds to your database. My custom database ZORD has the follow ing fields. CLIENT GUID REF_GUID NOTE type MANDT "Client

Me & my pursuit of happiness Wandering hermit Photography

type CRMT_OBJECT_GUID "guid of table entry(key) type CRMT_OBJECT_GUID "guid of order object "end-user usable type CHAR120 "end-user usable

EXTERN_CASE_NO type CRMT_OBJECT_ID

A structure 'ZORD_STRUCT' that corresponds to the table structure and a table type 'ZORD_STRUCT_TAB' is available.

Join me on my photography journey

Step 1 : Studying the event handler model

Maintain API Object Name
In transaction CRMC_OBJECTS, m aintain the API object nam e of our custom object. In our case, the nam e is ZORD. This inform ation w ill be used further below . This w ill allow us to define our ow n transaction events.

Maintain Object dependency
This step is to ensure that the transaction events w hich w e w ill be defining later on, w ill be called only w hen necessary. This step is optional and you should be able to figure out if your scenario needs this or not. For exam ple, if you are extending only the opportunity transaction type, declare ZORD as a sub-object of Opportunity(BUS2000111). Maintain this inform ation in view m aintenance CRMV_OBJECT_ASSI

Identify positions for defining custom events for transactions
We w ill have to define three basic events in the transaction event m odel that w ill take care of our custom objects. These are 1. Initialization -> When the order is being initialized say, during lock/revert scenarios, w e w ant our object to be initialized too. 2. Save -> When the order is being saved, save our data too. 3. Delete -> When the order is deleted, w e need to delete corresponding data from our custom table For this, you m ust identify the correct places to insert our event callback function m odules. If not already done, set your user param eterCRM_EVENT_TRACE to "X". Next, do som ething say, create transactions, m odify it, save it and delete it. After each action, look at the events raised in transaction CRMD_EVENT_TRACE. Study this data carefully and decide on the points in w hich to insert your event callback function m odules. For creating the FMs(the signature part), look at the standard FMs (they end w ith *_EC) defined for the sam e event in the trace data. Create em pty FMs for each of the three events m entioned and study the trace again. We w ill be calling our custom API class' m ethods inside these FMs. We w ill cover this later. For now , create entries in the transaction event handler table and ensure that the FMs are getting called in the correct

sapcrmtutorial.blogspot.in

1/27

8/31/12

SAP CRM Technical Tutorials by Naval Bhatt.
places for various scenarios. For exam ple, if I'm extending the Opportunity m odel, I w ill create these entries - In SPRO, go to CRM->Transactions->Basic Settings->Edit event handler table .. on Facebook

Naval Bhatt Photography
Like

1. Initialization
Choosing transaction category is opportunity w ill ensure that this FM w ill be called only for Opportunities Transaction Category Execution Tim e Priority Object Event Attribute Function 99 ZORD (Z Order Extension) INIT <*> ZORD_INIT_EC X blank BUS2000111 (Opportunity) 88 (Initialize Docum ent)

Naval Bhatt Photography .. added a new photo.

Perform Function for Docum ent Header Perform Function for Docum ent Item Call Callback 2. Save

Do Not Process Function if Event Error Occurs blank Call Just Once Per Transaction

August 10 at 8:11pm

Show More Unlike above, w e cannot choose transaction category as Opportunity here! This is because an opportunity save event w ill be raised only w hen you m ake changes in the opportunity relevant fields(eg OPPORT_H), even though you are editing an opportunity. For the below FM to trigger, w e w ill have to "rem ind" the system to do it w hen changes are m ade to our custom objects. So, you w ill not see this FM in the event trace right now till the coding part is com plete. We w ill cover this further dow n(Look further dow n at the last part of the coding part for the m ethod im plem entation for METHOD ZORD_RUN_BTIL->if_crm _runtim e_btil~m aintain_attributes). Transaction Category Execution Tim e Priority Object Event Attribute Function 99 ZORD (Z Order Extension) SAVE <*> ZORD_SAVE_EC X blank
Naval Bhatt Photography .. on Facebook

BUS20001 (CRM Bus Transactions) 80 (Save Docum ent)

460 people like Naval Bhatt Photography ..

P ratik

P eey ush

Dearest

Deepak

Perform Function for Docum ent Header Perform Function for Docum ent Item Call Callback 3. Delete

blank

S hankar

Tarun

S hahril

N ur

Do Not Process Function if Event Error Occurs

Call Just Once Per Transaction

Blog Archive ▼ 2012 (129)

For deletion also, only generic order delete event can be chosen. Inside this Fm , you should m ake sure that the scenario is right. For exam ple, m ake sure that the order being deleted is an opportunity before m aking API calls! We w ill cover this below . Transaction Category Execution Tim e Priority Object Event Attribute Function 90 ORDER (General order processing) AFTER_DELETE <*> ZORD_DEL_EC X blank blank BUS20001 (CRM Bus Transactions) 1 (Im m ediately)

▼ August (14) Extend BOL Model BT with custom table type relatio... Extend BOL Model for BP with Custom Table and Impl... How to use your custom BOL Object for webclient wi... Difference between custom and component controller... Transaction launcher

Perform Function for Docum ent Header Perform Function for Docum ent Item Call Callback

Do Not Process Function if Event Error Occurs

Call Just Once Per Transaction

Step 2 : Customizing - Extend Model BT

First, w e have som e custom izing w ork to do. Navigate to the node show n in the picture.Note that the node text m ay show up as 'Business Transactions' in your case. Or you m ay go to SM30 and put 'CRMC_OBJ_BTIL' and choose custom izing. You m ust do each of the three activities show n.

One order framework ABOUT ONE-CLICK ACTIONS. Post Processing Framework ACTIONS BTE - Business Transaction Event wande mataram .... : mother country ..

Maintain Z-objects

Sales order scenario : CRM -ERP Sales order Distribution: Required Customizing in ... SAP CRM Sales : Creating a quotation directly in E... sapcrmtutorial.blogspot.in 2/27

.. CRM – Tables and Transaction Codes TABLE NAME DESCRIPTION BUSINESS PARTNERS BUT000 BP: General data Contains Business Partner Number. Using Get_I method you can make your field . Below is a screen shot of the sample implementation.Setter methods in Web UI Using Get and Setter methods you can retrieve data to field and set specific data to field.blogspot.in 3/27 ... Partner Category.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt. sapcrmtutorial... Maintain Z-Relations Maintain handler classes for Z-objects Scope of the design layer Scope of the design layer In the UIU framework some UI/Design relevant settings can be made. Concepts of BOL programming : Get_current Get_current and get_iterator how does it works? The data you enter on the Web UI gets saved in the database tables via BOL Entities . Create a Tree view display in CRM web UI This blog gives the steps to create a Tree view display in CRM web UI... . These settings have to be made per view. ► July (26) ► June (18) ► May (11) ► April (9) ► March (28) ► February (13) ► January (10) Video Bar pow ered by Popular Posts Getter . Partne...

. DO_PREPARE_OUTPUT http://w iki. DATA: lr_btadmin. you can follow this w iki to m ake do w ith value nodes.. If you are not w illing to im plem ent the classes. GT_ZORD_DEL w ill hold entries to be deleted on save.. you m ay skip m aintaining the handler classes. How to create POP-UP window in UI Open the component and then view where the pop up is to be raised. Due to this unified buffer nature. The relationships w ill be available. Important abap function modules Useful ABAP Function Modules This page is intended to maintain documentation of useful function modules.. Methods: ZORD_CREATE Static Method Public Create ZORD_MODIFY Static Method Public Modify API data ZORD_DELETE Static Method Public Delete from API data ZORD_SAVE Static Method Public Save to DB ZORD_READ Static Method Public Initial relations reading ZORD_READ_SINGLE Static Method Public Read single entry ZORD_INIT Static Method Public Reset buffers ZORD_DELETE_WITH_ORDER Static Method Public Delete from DB w hen order is deleted sapcrmtutorial... You must be raising the popup on some event. Then. Normally we redefine this meth. Do_prepare_output and DO_PREPARE_OUTPUT method is triggered each time the view is prepared after each event.n relationship directly under On_new_focus BTAdm inH. it is very im portant to refresh this table on Order INIT events..sap. METHOD do_config_determination. here's a screenshot of the m odel w ith the new relationships expanded. SAP CRM Cross-application Authorization Objects OBJECT CLASS Definition /GC1/AUTH AAAB Authorization for Garbage Collector /SAPCND/CC AAAB Condition Technique: Authorizatio... Sample code for DO_CONFIG_DETERMINATION method This example is to set the visibility of a screen field based on another field . Submit Step 3: Implementing Handler classes API Class for our custom Object We w ill begin w ith the API class w hich w ill be responsible for all operations related to our table. You can even directly specify a single 1..sdn.. ZL_ZORD_BTIL_API -> Super class: None Class Attributes GT_ZORD Static Attribute Private Type ZORD_STRUCT_TAB API Buffer GT_ZORD_DEL Static Attribute Private Type ZORD_STRUCT_TAB API Buffer for deleted entities Note: The GT_ZORD table w ill act as a unified buffer for read and change..in 4/27 ..8/31/12 Note: SAP CRM Technical Tutorials by Naval Bhatt. Total Pageviews 2 4 6 4 2 Follow by Email Email address.com /w iki/display/CRM/How +to+display+a+z-table+in+an+assignm ent+block Moving forw ard. You will need to crea. but not usable in the real sense. This is needed because inde.....blogspot.

FEDSMOS <szr>LK LN O g_od IL-YBL: f_od IE IE F tzr.in 5/27 . class-m ethods ZORD_READ_SINGLE im porting !IV_GUID type CRMT_OBJECT_GUID exporting !ET_ZORD type ZORD_STRUCT_TAB . CEKs-ur =0 HC ysbc . EDF NI.8/31/12 Method Signatures: SAP CRM Technical Tutorials by Naval Bhatt. Method Implementations MTO zr_rae EHD odcet. MTO zr_eee EHD oddlt. I s-ur E 0 F ysbc Q . class-m ethods ZORD_CREATE im porting !IS_KEY type CRMT_OBJECT_GUID !IS_ATTRIBUTES type ZORD_STRUCT . ISR l_odIT TBEg_oddl NET szr NO AL tzr_e. *"* public com ponents of class ZL_ZORD_BTIL_API *"* do not include other source files here!!! public section. LO A i_hne_ilsASGIG<ae. RA TBEg_odWT KYgi =i_e ASGIG<szr> ED AL tzr IH E ud sky SINN f_od. EDEHD NMTO. od YE ipe <e> TP sml. l_od=i_trbts szr satiue. I s-ur E 0 F ysbc Q . <l> TP sml. sapcrmtutorial. szr-ud sky ISR l_odIT TBEg_od NET szr NO AL tzr. class-m ethods ZORD_READ im porting !IV_HEADER_GUID type CRMT_OBJECT_GUID exporting !ET_ZORD type ZORD_STRUCT_TAB . ASG CMOET<ae O SRCUEi_trbtsT <e> SIN OPNN nm> F TUTR satiue O nw. EEE tzr HR ud sky EDF NI. DT:l_odTP zr_tut AA szr YE odsrc. nw YE ipe <ae TP nm_op nm> YE aekm. OP T tcagdfed SINN nm> ASG CMOET<ae O SRCUE<szr>T <l> SIN OPNN nm> F TUTR f_od O od. EDEHD NMTO. class-m ethods ZORD_DELETE_WITH_ORDER im porting !IV_HEADER_GUID type CRMT_OBJECT_GUID optional . class-m ethods ZORD_DELETE im porting !IS_KEY type CRMT_OBJECT_GUID !IV_HEADER_GUID type CRMT_OBJECT_GUID exporting !ET_RETURN type BAPIRET2_T !ET_CHANGED_OBJECTS type CRMT_GENIL_OBJ_INSTANCE_TAB . DLT g_odWEEgi =i_e. EDEHD NMTO. class-m ethods ZORD_MODIFY im porting !IS_KEY type CRMT_OBJECT_GUID !IV_HEADER_GUID type CRMT_OBJECT_GUID !IS_ATTRIBUTES type ZORD_STRUCT !IT_CHANGED_FIELDS type CRMT_ATTR_NAME_TAB exporting !ET_RETURN type BAPIRET2_T !ET_CHANGED_OBJECTS type CRMT_GENIL_OBJ_INSTANCE_TAB . class-m ethods ZORD_SAVE im porting !IV_HEADER_GUID type CRMT_OBJECT_GUID . CEKs-ur =0 HC ysbc . class-m ethods ZORD_INIT im porting !IV_HEADER_GUID type CRMT_OBJECT_GUID optional . MTO zr_oiy EHD odmdf. MTO zr_ae EHD odsv. l_odgi =i_e. EDOP NLO.blogspot. DT:l_odLK LN O g_od AA szr IE IE F tzr. RA TBEg_odWT KYgi =i_e IT l_od ED AL tzr IH E ud sky NO szr. <l>=<e> od nw.

DT:l_odTP zr_tuttb AA tzr YE odsrc_a. MTO zr_nt EHD odii. LE RFEHe_od ERS tzr. EDEHD NMTO.n ne t cekD a woebfe i ue. RFEHl_od ERS tzr. EET RM od NO AL tzr HR e_ud vhae_ud ISR LNSO e_odIT TBEg_od NET IE F tzr NO AL tzr. no further changes are required. EDF NI. LE RFEHg_od ERS tzr. MTO zr_ed EHD odra. LE RA TBEg_oddlWT KYrfgi =i_edrgi TASOTN N FED. LE SLC *FO zr IT TBEe_odWEEgi =i_ud EET RM od NO AL tzr HR ud vgi.in 6/27 . ZORD_SET_RUN_BTIL -> Super class: CL_CRM_RUNTIME_BTIL ZORD_RUN_BTIL -> Super class: CL_CRM_RUNTIME_BTIL ZORD_SET_RUN_BTIL .8/31/12 SAP CRM Technical Tutorials by Naval Bhatt. LO A g_oddl IT l_odWEErfgi =i_edrgi.Redefined Methods sapcrmtutorial. So. EDF NI. MDF zr FO TBEl_od OIY od RM AL tzr. EDOP NLO. DLT g_odWEErfgi =i_edrgi. I nre r on n ufr o ed o hc B s hl ufr s sd *oseilpoiin frdltdies n pca rvsos o eee tm RA TBEg_odWT KYgi =i_udIT l_od ED AL tzr IH E ud vgi NO szr. EEE tzr HR e_ud vhae_ud DLT g_oddlWEErfgi =i_edrgi.blogspot. *eee etiseiti bfe! = Tbehsaraybe bfee = N D Ra dltd nre xs n ufr! > al a led en ufrd > o B ed EI. EDEHD NMTO. l_odLK LN O l_od szr IE IE F tzr. *hc bfe frt Cek ufr is *fetisaefudi bfe. LO A g_od IT l_odWEErfgi =i_edrgi. I l_od]I NTIIIL F tzr[ S O NTA. SLC *FO zr IT TBEe_odWEErfgi =i_edrgi. ES. RFEHg_oddl ERS tzr_e. XT ES. I nre r on n ufr o ed o hc B s hl ufr s sd *oseilpoiin frdltdies n pca rvsos o eee tm RA TBEg_odWT KYrfgi =i_edrgi TASOTN N FED. e_od]=g_od] tzr[ tzr[. MTO zr_edsnl. EDEHD NMTO. I s-ur E 0 F ysbc Q . ZORD_SET_DESIGN_BTIL -> Super class: CL_CRM_DESIGNTIME_BTIL ZORD_DESIGN_BTIL -> Super class: CL_CRM_DESIGNTIME_BTIL For the design classes. l_odLK LN O l_od szr IE IE F tzr. EEE tzr_e HR e_ud vhae_ud ES. DT:l_odTP zr_tuttb AA tzr YE odsrc_a. ED AL tzr IH E e_ud vhae_ud RNPRIG O ILS I s-ur E 0 F ysbc Q . ISR l_odIT tbee_od NET szr NO al tzr. DLT zr FO TBEl_od EEE od RM AL tzr. EHD odra_ige DT:l_odTP zr_tuttb AA tzr YE odsrc_a. I l_od]I NTIIIL F tzr[ S O NTA. EHD ODDLT_IHODR DLT FO zr WEErfgi =i_edrgi. ED AL tzr_e IH E e_ud vhae_ud RNPRIG O ILS I s-ur E 0 F ysbc Q . EDF NI. I i_edrgi I NTIIIL F vhae_ud S O NTA. DT:l_odTP zr_tuttb AA tzr YE odsrc_a. OP T tzr NO szr HR e_ud vhae_ud ISR l_odIT TBEl_od NET szr NO AL tzr. l_odLK LN O l_od szr IE IE F tzr. Essentially a _RUN_BTIL and a _DESIGN_BTIL is appended to w hat you have specified in custom izing. l_odLK LN O l_od szr IE IE F tzr. EDEHD NMTO. DLT e_odWEErfgi N i_edrgi. EEE tzr HR e_ud E vhae_ud ES. EDF NI. Handler classes for our objects The nam es of the classes w ill be derived at runtim e follow ing som e conventions. go ahead and create the classes. ISR LNSO e_odIT TBEg_od NET IE F tzr NO AL tzr. EDF NI. EDOP NLO. EEE RM od HR e_ud vhae_ud EDEHD NMTO. You m ay w ant to redefine the constructor if you w ish to validate the object nam e. EDF NI. OP T tzr_e NO szr HR e_ud vhae_ud ISR l_odIT TBEl_od NET szr NO AL tzr. *hc bfe frt Cek ufr is *fetisaefudi bfe.n ne t cekD a woebfe i ue. MTO ZR_EEEWT_RE.

F rcn_b-cekrl_euse( Q re m-acs_hlrn i_otoj=i_otoj e>cescide( rcn_b rcn_b i_aa rdt =i_p_aa raidt i_e_ud=i_e_ud vrfgi vrfgi i_e_id=i_e_id) vrfkn vrfkn .8/31/12 SAP CRM Technical Tutorials by Naval Bhatt. l_trposTP RFT i_ei_b_trpoete. vrlto YE rtrlto_ae DT:l_odiTP RFT zr_tuttb AA rzr_ YE E O odsrc_a. l_udTP cm_betgi. * EDEHD NMTO. vgi YE rtojc_ud l_is TP cm_ola VLEtu. ** * CL MTO z_odbi_p=zr_ed AL EHD lzr_tlai>odra sapcrmtutorial. CTHc_r_i_ulct_nr. <taidt> l_p_aa TP cm_nlygttb YE rtita_e_a. F rcn_b-cekat_euse( Q re l_udcmgi =i_e_ud sgi-r_ud vrfgi. I l_et E i_otoj>et_rae.in 7/27 . F vdla Q rcn_b-dlacetd TY R. EHD ilcek *eeie t peetsse loigfruipeetdF rdfnd o rvn ytm okn o nmlmne M *mt. l_odiTP zr_tuttb tzr_ YE odsrc_a. AA vdla YE rtdla ** * *hsi ara-nyrlto. MTO i_r_utm_tlra_trbts EHD fcmrniebi~edatiue.ntigmc t d hr ecp ihrtGI fo Odrojc Ti s edol eain ohn uh o o ee xet nei UD rm re bet l_et =i_otoj>e_et_lg ) vdla rcn_b-gtdlafa( .Redefined methods MTO fedhc. DT:l_et TP cm_et.blogspot. *aecr o udryn rltos Tk ae f nelig eain m-mdf_hlrn i_otoj e>oiycide( rcn_b =i_otoj rcn_b i_aa rdt =i_p_aa raidt i_nu_ils=i_nu_ils riptfed riptfed i_e_id vrfkn =i_e_id vrfkn i_e_ud vrfgi =i_e_ud) vrfgi . AC xcmccdpiaeety EDR. NTY I i_otoj>hc_trrqetd )E tu. EDF NI. AC xcmccdpiaeety EDR. MTO MDF_HLRN. rat_rp YE E O fgnlojat_rpris l_otojTP RFT i_ei_otie_bet rcn_b YE E O fgnlcnanrojc. EHD OIYCIDE *ontrdfn ti mto!Sprcaswl tk cr o ti D o eeie hs ehd ue ls il ae ae f hs EDEHD NMTO. NTY EDF NI. i_otoj>e_e(i_e_ud) rcn_b-stky vrfgi . EDEHD NMTO. FEDSMOS <szr_>TP zr_tut IL-YBL: l_odi YE odsrc. EDF NI. m-statiue(i_otoj e>e_trbts rcn_b =i_otoj rcn_b i_trbts=l_ud satiue sgi i_e_id vrfkn =i_e_id vrfkn i_o_e vlgky =i_e_ud) vrfgi . <saidt> l_p_aa TP cm_nlygt YE rtita_e. DT:l_udTP cmtgi_tl AA sgi YE rs_udbi. ZORD_RUN_BTIL . *hsi asai ra-nyrlto. MTO I_R_UTM_TLMITI_TRBTS EHD FCMRNIEBI~ANANATIUE. CTHc_r_i_ulct_nr. *edudryn rltos Ra nelig eain I i_otoj>hc_esrqetd )E tu.cet yu onipeetto epy rae or w mlmnain edehd nmto. MTO i_r_utm_tlra_trbts EHD fcmrniebi~edatiue. DT:l_otcnanrTP RFT i_ei_otie_bet AA rro_otie YE E O fgnlcnanrojc. Ti s ttc edol eain *nei GI fo odr Ihrt UD rm re TY R. vfrt YE rtboen AU re l_eain TP cm_eainnm. i_otoj>e_e(i_e_ud) rcn_b-stky vrfgi .

OTNE EDR.Dpnetojcsmyb cetd mdfe. YE rtgnlojc_ud l_edrat shae_tr TP cmtgi_tl YE rs_udbi. NTY I l_otoj>hc_trrqetd )E tu. YE aie2t * l_s_ot vmgcn TP RFT c_r_ei_aims_ot YE E O lcmgnlbp_escn. AC xcmccdpiaeety TY R. ** * DT:l_rp_b AA vposoj TP RFT i_ei_b_trpoete. ICUEcmmd_o.8/31/12 CL MTO z_odbi_p=zr_ed AL EHD lzr_tlai>odra EPRIG XOTN i_edrgi =i_e_ud"re GI vhae_ud vrfgi Odr UD IPRIG MOTN e_od tzr =l_odi tzr_. NLD r_oecn DT:l_et AA vdla TP cm_et. sapcrmtutorial. SAP CRM Technical Tutorials by Naval Bhatt. OTNE EDR. CL MTO i_otoj>e_aetrlto AL EHD rcn_b-gtprn_eain IPRIG MOTN e_eainnm =l_eain vrlto_ae vrlto. l_otoj=m-tr_ah i_otoj rcn_b e>unpt( rcn_b =i_otoj rcn_b i_eainnm =l_eain vrlto_ae vrlto i_e sky =<szr_>gi ) l_odi-ud . YE E O fgnlojat_rpris l_hne_trTP cm_trnm_a. CEKi_otoj>e_ae )='OD. Cin l_trpos>e_rpryb_d(i_ne rat_rp-stpoet_yix vidx =2 i_au =i_ei_b_trpoete=tcncl) "UD vvle fgnlojat_rpris>ehia . l_edr vhae TP RFT i_ei_otie_bet YE E O fgnlcnanrojc. YE rtojc_ud * l_eun trtr TP bprt_. CL MTO l_edr>e_e AL EHD vhae-gtky IPRIG MOTN e_e =l_edrgi. I l_is E tu. EDF NI. RFGI EDF NI. l_trpos>e_rpryb_d(i_ne rat_rp-stpoet_yix vidx =1 i_au =i_ei_b_trpoete=ra_ny) "let vvle fgnlojat_rpris>edol . LO A l_odiASGIG<szr_> OP T tzr_ SINN l_odi. IL-YBL: l_p_aa YE rs_re_anan <vnm> l_ae TP nm_op YE aekm. EDEHD NMTO. EDF NI. l_otoj>e_e(<szr_>gi ) rcn_b-stky l_odi-ud . NTY CTHc_r_ei_oe_ro. AA tnms YE rtat_aetb DT:l_trposTP RFT i_ei_b_trpoete. YE rtdla DT:l_hne_betTP cm_ei_b_ntne AA scagdojc YE rtgnlojisac. AA rat_rp YE E O fgnlojat_rpris FEDSMOS <saidt>TP cmtodrmiti. ES. l_ud vgi TP cm_betgi. TY R. F rcn_b-cekrl_euse( Q re m-gtfrini(i_otoj=l_otoj e>e_oeg_d rcn_b rcn_b i_aa sdt =<szr_>) l_odi . satiue shae_tr *rtiv tedlafa eree h et lg l_et =i_otoj>e_et_lg ) vdla rcn_b-gtdlafa( . l_b_nt sojis TP cm_ei_b_ntne YE rtgnlojisac. AC xcmgnlgnrlerr CNIU. GI l_trpos>e_rpryb_d(i_ne rat_rp-stpoet_yix vidx =3 i_au =i_ei_b_trpoete=tcncl) "E_UD vvle fgnlojat_rpris>ehia . *bac acrigt tedlafa. CTHc_r_ei_eea_ro. HC rcn_b-gtnm( ZR' l_b_ntojc_ae='OD.o dltd rnh codn o h et lg eedn bet a e rae. * MTO i_r_utm_tlmiti_trbts EHD fcmrniebi~ananatiue. sojis-betnm ZR' "E NTX #C OET *rtiv teGI o tehae eree h UD f h edr l_edr=i_otoj>e_aet ) vhae rcn_b-gtprn( . LE l_otoj=i_otoj>oysl_ihsrcue rcn_b rcn_b-cp_efwt_tutr( i_betky sojc_e =<szr_>gi l_odi-ud i_eainnm =l_eain) vrlto_ae vrlto . l_trpos=l_otoj>e_trposoj ) rat_rp rcn_b-gtat_rp_b( . F vfrt Q re l_is =fle vfrt as. l_trpos>e_l_rpris i_ei_b_trpoete=cagal ) rat_rp-stalpoete( fgnlojat_rpris>hnebe . sky vhae_ud CL MTO l_edr>e_trbts AL EHD vhae-gtatiue IPRIG MOTN e_trbts=l_edrat. F rcn_b-cekat_euse( Q re m-statiue(i_otoj e>e_trbts rcn_b =l_otoj rcn_b i_trbts=<szr_> satiue l_odi i_e_id vrfkn =i_e_id vrfkn i_o_e vlgky =<szr_>gi ) l_odi-ud . AC xcmgnlmdlerr CNIU. l_otoj=i_otoj rcn_b rcn_b. tcagdat YE rtat_aetb l_trbts satiue TP zr_tut YE odsrc. oiid r eee. CEKl_otojI BUD HC rcn_b S ON.in 8/27 . DT:l_ae TP cm_trnm_a. l_edrgi vhae_ud TP cm_ei_betgi. I l_otoj>hc_esrqetd )E tu.blogspot. CTHc_r_i_ulct_nr. EDOP NLO.

in 9/27 . EDEHD NMTO. * cl teAI al h P CL MTO z_odbi_p=zr_oiy AL EHD lzr_tlai>odmdf EPRIG XOTN i_e sky =l_ud vgi i_edrgi vhae_ud =l_edrgi vhae_ud i_trbts satiue =l_trbts satiue i_hne_ils=l_hne_tr tcagdfed tcagdat. satiue-e_ud vhae_ud * cl teAI al h P CL MTO z_odbi_p=zr_rae AL EHD lzr_tlai>odcet EPRIG XOTN i_e sky =l_ud vgi i_trbts=l_trbts satiue satiue. AE vdla WE i_ei_otsml_bet>et_hne. HN fgnlcn_ipeojc=dladltd gtojc ky e bet e CL MTO i_otoj>e_e AL EHD rcn_b-gtky IPRIG MOTN e_e =l_ud sky vgi. * * * * WE i_ei_otsml_bet>et_rae. EDAE NCS. * wihatiue wr mdfe? hc trbts ee oiid CL MTO l_rp_b-gtnm_a__rpry AL EHD vposoj>e_aetb4poet EPRIG XOTN i_rpry=i_ei_b_trpoete=mdfe vpoet fgnlojat_rpris>oiid IPRIG MOTN e_ae tnms =l_hne_tr tcagdat. ISR l_b_ntIT TBEg_nly>tcagdojcs NET sojis NO AL rita-g_hne_bet. AC xcmgnldpiaeky EDR. WE i_ei_otsml_bet>et_eee. tcagdojcs tcagdojcs l_b_ntojc_d=c_r_ei_otie_ol=bidojc_d l_ud) sojis-beti lcmgnlcnanrtos>ul_beti( vgi . l_trbtsgi =l_ud satiue-ud vgi.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt. i_otoj>e_trbts l_trbts) rcn_b-statiue( satiue . CTHc_r_ei_ulct_e. HN fgnlcn_ipeojc=dlacetd gtteatiuesrcue e h trbt tutr CL MTO i_otoj>e_trbts AL EHD rcn_b-gtatiue IPRIG MOTN e_trbts=l_trbts satiue satiue. i_otoj>e_e(l_ud) rcn_b-stky vgi . i_otoj>e_e(IPRIGe_e =l_ud) rcn_b-gtky MOTN sky vgi . tcagdojcs tcagdojcs l_b_ntojc_d=c_r_ei_otie_ol=bidojc_d l_ud) sojis-beti lcmgnlcnanrtos>ul_beti( vgi . CL MTO i_otoj>e_e AL EHD rcn_b-gtky IPRIG MOTN e_e =l_ud sky vgi. NTY l_b_ntojc_d=c_r_ei_otie_ol=bidojc_d l_ud) sojis-beti lcmgnlcnanrtos>ul_beti( vgi . sapcrmtutorial. * *elteOdrAIta acag hshpee Tl h re P ht hne a apnd *hswl rgse orojc frsv (h F w rgsee frSV eeti eethnlrtbe Ti il eitr u bet o ae Te M e eitrd o AE vn n vn ade al) CL FNTO 'R_VN_ULS_W AL UCIN CMEETPBIHO' EPRIG XOTN i_b_ae='OD vojnm ZR' i_udh vgi_i =l_edrgi vhae_ud i_idh vkn_i =g_betkn-reamh cojc_idodrd_ i_vn veet =g_vn-fe_hne ceetatrcag.blogspot. CS l_et. * * bidteky ul h e * CL FNTO 'UDCET' AL UCIN GI_RAE * IPRIG MOTN * e_ud1 =l_ud vgi_6 vgi. ISR l_b_ntIT TBEg_nly>tcagdojcs NET sojis NO AL rita-g_hne_bet. CL MTO i_otoj>e_trbts AL EHD rcn_b-gtatiue IPRIG MOTN e_trbts=l_trbts satiue satiue. adojc t tecagdojcsls d bet o h hne bet it ISR l_b_ntIT TBEg_nly>tcagdojcs NET sojis NO AL rita-g_hne_bet. Step 4 . * * stnwky e e e TY R. IPRIG MOTN e_eun trtr =l_eun trtr e_hne_bet =l_hne_bet. * IPRIG MOTN * e_eun trtr =l_eun trtr. * cl teAI al h P CL MTO z_odbi_p=zr_eee AL EHD lzr_tlai>oddlt EPRIG XOTN i_e sky =l_ud vgi i_edrgi =l_edrgi.Implement Event callback Function Modules Rem em ber the three event callback function m odules that w e registered in the transaction event handler table? Call the correct API m ethods inside each FM. vhae_ud vhae_ud * IPRIG MOTN * e_eun trtr =l_eun trtr * e_hne_bet =l_hne_bet. l_trbtsrfgi =l_edrgi. HN fgnlcn_ipeojc=dlacagd * rtiv teatiuepoet ojc t gttemdf dtis eree h trbt rpry bet o e h oiy eal l_rp_b =i_otoj>e_trposoj ) vposoj rcn_b-gtat_rp_b( .

UCIN odii_c *----------------------------------"----------------------------------**LclItrae ""oa nefc: * " IPRIG MOTN * " RFRNEI_EDRGI)TP EEEC(VHAE_UD YE CM_BETGI OTOA RTOJC_UD PINL *----------------------------------"----------------------------------I i_edrgi I NTIIIL F vhae_ud S O NTA. Initialization SAP CRM Technical Tutorials by Naval Bhatt. *eeefo ojc bfe Dlt rm bet ufr CL MTO Z_ODBI_P=ZR_NT AL EHD LZR_TLAI>ODII EPRIG XOTN i_edrgi =i_edrgi. vhae_ud vhae_ud *eeefo dtbs Dlt rm aaae CL MTO Z_ODBI_P=ZR_EEEWT_RE AL EHD LZR_TLAI>ODDLT_IHODR EPRIG XOTN i_edrgi =i_edrgi.blogspot. 3. EDUCIN NFNTO. FNTO zr_nte. Save FNTO zr_aee. EDUCIN NFNTO.in 10/27 . Delete FNTO zr_e_c UCIN oddle. sapcrmtutorial. UCIN odsv_c *----------------------------------"----------------------------------**LclItrae ""oa nefc: * " IPRIG MOTN * " RFRNEI_BETNM)TP EEEC(VOJC_AE YE CM_BETNM RTOJC_AE * " RFRNEI_VN_XTM)TP EEEC(VEETEEIE YE CM_VN_XTM RTEETEEIE * " RFRNEI_VN)TP EEEC(VEET YE CM_VN RTEET * " RFRNEI_EDRGI)TP EEEC(THAE_UD YE CM_BETGI_A RTOJC_UDTB *----------------------------------"----------------------------------Dt:l_edrgi tp cm_betgi. EDUCIN NFNTO. *----------------------------------"----------------------------------**LclItrae ""oa nefc: * " IPRIG MOTN * " RFRNEI_BETNM)TP EEEC(VOJC_AE YE CM_BETNM RTOJC_AE * " RFRNEI_VN_XTM)TP EEEC(VEETEEIE YE CM_VN_XTM RTEETEEIE * " RFRNEI_VN)TP EEEC(VEET YE CM_VN RTEET * " RFRNEI_EDRGI)TP EEEC(VHAE_UD YE CM_BETGI OTOA RTOJC_UD PINL *----------------------------------"----------------------------------*s F "R_REAMHRA_B wt icuedltdhae oto t esr ta ojc i rlvn t u Ue M CMODRD__EDO" ih nld_eee_edr pin o nue ht bet s eeat o s *-bfr cligAImto eoe aln P ehd I i_edrgi I NTIIIL F vhae_ud S O NTA. vhae_ud vhae_ud edop nlo. CL MTO Z_ODBI_P=ZR_NT AL EHD LZR_TLAI>ODII EPRIG XOTN i_edrgi =i_edrgi. 2. op t thae_ud no vhae_ud CL MTO Z_ODBI_P=ZR_AE AL EHD LZR_TLAI>ODSV EPRIG XOTN i_edrgi =l_edrgi. vhae_ud vhae_ud EDF NI. vhae_ud vhae_ud EDF NI. aa vhae_ud ye rtojc_ud lo a i_edrgi it l_edrgi.8/31/12 1.

in 11/27 . Posted by Naval Bhatt at 9:01 AM No comments: +2 Recommend this on Google Labels: Extend BOL Model BT with custom table type relationship. SAP CRM sapcrmtutorial.blogspot. Results: Here are a few screens show ing the results Here's the table view after deleting line4 and save. sap crm tutorial.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt.

sapcrmtutorial. Friday. We created the BOL object in one of our old blog http://sapcrmtutorial. Now w e need to perform some adjustment for our table .com/irj/scn/go/portal/prtroot/docs/library/uuid/4048d161-9ac1-2e10-3bbfbaef73d78109?QuickLink=index&overridelayout=true Posted by Naval Bhatt at 10:04 PM No comments: +2 Recommend this on Google Labels: Extend BOL Model for BP with Custom Table and Implement GenIL Class. sap crm BOL programming.8/31/12 tutorials SAP CRM Technical Tutorials by Naval Bhatt. Let's say that w e w ant to add several fields to assignment block and display them on the screen. 2012 How to use your custom BOL Object for webclient within assignment block. August 21. See the follow ing screen shot.blogspot.blogspot. sap crm tutorial Tuesday. August 24. choose the Database Utility from the menu .in 12/27 . GENIL class. See the follow ing screen shot.sg/2012/02/create-z-bol-object. 4) create new record that contain the details that w e w ant to display for the specific account. http://www.sdn. We also w ant to keep the connection for the original transaction context . for instance w e take the fields from our Z table that w e use in the creation of our BOL Object. SAP CRM tutorials. The steps for doing that are : 1) We need to add a field to our Z table BP_GUID w hich w ill keep us connected to the main transaction context . 3) Search for the right BP_GUID that fit to our user account.sap. Now that w e have our BOL Object w e might w ant to use it for our purposes. How to use your custom BOL Object for webclient within assignment block. 2) Perform the adjustment for the Z Table. 2012 Extend BOL Model for BP with Custom Table and Implement GenIL Class Details of how to Extend BOL Model for BP with Custom Table and Implement GenIL Class are in the below PDF link .html that meet your personal requirements.

in 13/27 . once you choose this option you'll get the next screen : In our case w e w ill choose the Delete data option becuse w e w ant to create a new record. See the follow ing screen shot. After w e perform the adjustment and activated the table w e can step forw ard to the next step w hich is the creation of a new record w ith the details that w e w ant to display on the screen . sapcrmtutorial.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt. you also have to know that if you choose the Save data option there's no 100 percent guarantee that your data in the table w ill be saved . To find the right BP_GUID enter transaction GENIL_BOL_BROWSER and insert the BP_APPL_COND in the component set field. First to the record creation w e should find the key w hich is the BP_GUID that w ill connect us to the account context . so you should consider the use of Database Utility very careful.blogspot.

For now w e finish w ith the database side and w e w iil go to perform some improvement in our BOL object to support the sapcrmtutorial. BP_GUID . First and last names. See the follow ing screen shot.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt. w hen you enter to the component set choose the predefined search named BuilEm pSearch See the follow ing screen shot.blogspot. in my case i'll choose to search my user and i'll get the compatible BP_GUID w hich is : DF21EBC73A26F8F1A2B0001F29644FC0 See the follow ing screen shot. Now let's create a new record in the DataBase table ZUSR_BOL_TB w ith user name.in 14/27 . Now w e can look for any partner .

<lfs_selection_range>-low TO ls_range-low .8/31/12 different searching options. APPEND ls_range TO lt_bp_guid[]. See the follow ing screen shot: Now go back to the method list and edit the method :IF_GENIL_APPL_INTLAY~GET_DYNAMIC_QUERY_RESULT replace the exisiting code w ith the bellow lines: *------------------------------------------------------------------------------------------METHOD if_genil_appl_intlay~get_dynamic_query_result. high TYPE string . lt_name_last TYPE tt_general_rng. lv_len TYPE i . CONCATENATE lv_dyn_w here 'bp_guid in lt_bp_guid[] and' INTO lv_dyn_w here SEPARATED BY space . CONCATENATE lv_dyn_w here 'name_first in lt_name_first[] and' INTO lv_dyn_w here SEPARATED BY space . DATA: lt_bp_guid TYPE tt_general_rng. WHEN 'NAME_FIRST'. WHEN 'BP_GUID'. WHEN 'BNAME'. low TYPE string . lv_dyn_w here TYPE string. CONCATENATE lv_dyn_w here 'bname in lt_bname_range[] and' INTO lv_dyn_w here SEPARATED BY space . click on Local Types button and put the lines inside : *------------------------------------------------------------TYPES: BEGIN OF ty_general_rng . ls_range TYPE ty_general_rng. APPEND ls_range TO lt_bname_range[]. <lfs_selection_range>-option TO ls_range-option . lt_name_first TYPE tt_general_rng. FIELD-SYMBOLS: <lfs_result> TYPE zusr_bol_st. DATA: lr_object TYPE REF TO if_genil_cont_root_object. sign TYPE bapisign. lt_result TYPE TABLE OF zusr_bol_st. decomposition of selection parameters and build a dynamic w here condition LOOP AT it_selection_parameters[] ASSIGNING <lfs_selection_range>. APPEND ls_range TO lt_name_first[]. So let's go to transaction SE24 and put ZCL_OWN_BOL in the input filed. lt_bname_range TYPE tt_general_rng. sapcrmtutorial. <lfs_selection_range> TYPE genilt_selection_parameter.in 15/27 .blogspot. option TYPE bapioption. SAP CRM Technical Tutorials by Naval Bhatt. <lfs_selection_range>-high TO ls_range-high. MOVE: <lfs_selection_range>-sign TO ls_range-sign . END OF ty_general_rng . CASE <lfs_selection_range>-attr_name. TYPES: tt_general_rng TYPE STANDARD TABLE OF ty_general_rng .

NAME_FIRST fields to a view that w e w ill create Personally I choose the BP_HEAD component but you can choose any component that you may use.4 . ENDCASE. LOOP AT lt_result[] ASSIGNING <lfs_result>. *-------------------------------------------------------------------------------------------------------------------Save and activate your code. OK. ENDLOOP. lr_object = iv_root_list->add_object( iv_object_name = 'Root' is_object_key = <lfs_result>-bname ). CONCATENATE lv_dyn_w here 'name_last in lt_name_last[] and' INTO lv_dyn_w here SEPARATED BY space . open the MODELS folder to see w ith w hich BOL component set the BP_HEAD component use. sapcrmtutorial. CHECK lr_object IS BOUND. ENDLOOP. TRANSLATE lv_dyn_w here TO UPPER CASE. lv_len = STRLEN( lv_dyn_w here ) .NAME_LAST. APPEND ls_range TO lt_name_last[]. CHECK LINES( lt_result[] ) > 0.8/31/12 WHEN 'NAME_LAST'. See the follow ing screen shot. CHECK STRLEN( lv_dyn_w here ) > 0. See the follow ing screen shot. "remove the last 'AND' in the condition lv_dyn_w here = lv_dyn_w here(lv_len) . SAP CRM Technical Tutorials by Naval Bhatt. So let's get in and execute transaction BSP_WD_CMPWB_NEW and choose BP_HEAD component w ith our enhancement set w hich is specifically in my case called ZENH_CRM and hit the display button and go to Runtime Repository Editor. ENDMETHOD.blogspot. We can see now that the component BP_HEAD use the Model BP_APPL_COND and w e w ant that our BOL object w ill appear in the repository of the BP_HEAD component so that w e can use it for our purpose. To do that w e need to go to the component set definition. We might w ant to add the BNAME . lr_object->set_query_root( abap_true ). SELECT * FROM zusr_bol_tb INTO TABLE lt_result[] WHERE (lv_dyn_w here).in 16/27 .

sapcrmtutorial. See the follow ing screen shot. w e w ant to check here that w e can see our BOL entity ready for use. See the follow ing screen shot.in 17/27 . After you saved it successfully enter again to BSP_WD_CMPWB_NEW transaction w ith BP_HEAD component and click on the BOL Model Brow ser tab. Now click on component assignment make new entry and add our BOL object named ZBOLOB. Now choose the appropriate component set w hich is in our case BP_APPL_COND. Don't forget to save the new entry.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt.blogspot. See the follow ing screen shot.

Now w e can see that our BOL entity Root that w e created is ready for use in the enhancement of BP_HEAD component. See the follow ing screen shot. We'll choose a name for our view . sapcrmtutorial. See the follow ing screen shot.in 18/27 .blogspot. We w ill go to Component Structure Brow ser tab and create our view .8/31/12 SAP CRM Technical Tutorials by Naval Bhatt.

The next step is to add the fields that w e might use in our view to context w hich w e w orking on. The first one is for getting the relevant BP_GUID from the custom controller and get the appropriate first name last name and user name according to our table . We start w ith the BuilHeader fields. After w e named the view w e need to add 2 model nodes. one for BuilHeader and one For our Root BOL object. See the follow ing screen shot.in 19/27 . sapcrmtutorial.blogspot. See the follow ing screen shot.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt.

We use also attributes from the Root BOL object .8/31/12 SAP CRM Technical Tutorials by Naval Bhatt. Here w e need to define the view type and its properties.in 20/27 . See the follow ing screen shot.blogspot. See the follow ing screen shot. sapcrmtutorial. We got the w hole attributes as show n bellow . We move to the next step.

8/31/12 SAP CRM Technical Tutorials by Naval Bhatt.blogspot. See the follow ing screen shot. The view type w e choose form view w ithout buttons and in the properties w e make it configurable and that for keep to our self the option to Add/Remove Attributes from the view . sapcrmtutorial. See the follow ing screen shot.in 21/27 . Now w e finish the view addition w ith the w izard w e w ill see that our view is listed w ith the other view s in the component.

After w e added the view w e should create a binding to the custom controller context node BUILHEADER. So w e put the mouse curser on the context node BUILHEADER pressing the right mouse Click and create the binding.in 22/27 . See the follow ing screen shot. sapcrmtutorial.blogspot.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt.

in 23/27 . So w e move to the configuration tab w hen w e w orking on the view and then w e sw itch to edit mode. to do this w e w ill go to the Runtime Repository Editor and w e w ill add our view to the Overview Page of BPHEADOverview view set . After w e add the attributes to our view w e need to add our view as an assignment block. See the follow ing screen shot. See the follow ing screen shot. See the follow ing screen shot.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt. We see that w e have the 2 BOL objects that w e added w hen w e w orking w ith the w izard in time of the view creation. sapcrmtutorial.blogspot. We w ill create the binding for our context node to the same context node in the custom controller. First w e need to add our view to the BPHEADOverview view set . In our case w e w ill add the attributes from the Root BOL object. After w e create the appropriate binding w e need to add the attributes to the view .

After w e added the view to the BPHEADOverview view set w e w ill go to the configuration tab of BPHEADOverview view set and sw itch to edit mode and add our view TestBOLroot to the list of view s that appears as an assignment blocks in the BPHEADOverview view set by click on the arrow button and moving it from the left side to the right side . After w e handle the addition of adding our view as an assignment block w e need to handle some code addtions for the right treatment in the attributes in our view . sapcrmtutorial. First w e w ill go to the ROOT context node w ithin our view and redefine the method IF_BSP_MODEL~INIT. See the follow ing screen shot.in 24/27 . See the follow ing screen shot.blogspot.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt.

super->if_bsp_model~init( id = id ow ner = ow ner ).blogspot. Put the next ilnes into the method save and aactivate the method. lv_low _value TYPE string . END OF ltype_attr_struct. lrf_bol_collection TYPE REF TO if_bol_bo_col. ls_root_properties TYPE zusr_bol_st. put the next lines to the method . The first thing to do is to w rite our ow n method for performing the right query w hen w e need to display the attributes on the screen . bname TYPE xubname. lt_params TYPE crmt_name_value_pair_tab. lrf_current_builheader TYPE REF TO if_bol_bo_property_access. me->set_collection( lrf_bol_collection ). lrf_root_result_bol_entity TYPE REF TO cl_crm_bol_entity. lrf_value_node TYPE REF TO cl_bsp_w d_value_node. and the visibility of it is Private.8/31/12 SAP CRM Technical Tutorials by Naval Bhatt. *------------------------------------------------------------------------------------------method IF_BSP_MODEL~INIT. bp_guid TYPE bu_partner_guid. name_first TYPE bu_namep_f.in 25/27 . ls_params-value = '1'. w e w ill double click on the class name and w e w ill move to display mode of the class in a w ay that all the method could be show n. w hich is in our case is ZL_ZBP_HEAD_TESTBOLROOT_IMPL. TYPES: BEGIN OF ltype_attr_struct. *------------------------------------------------------------------------------------------After w e add the above lines to the method w e w ill go to the implementation class of our view . mandt TYPE mandt. so let's create a new method named root_query w hich is an Instance Method . endmethod. ls_builheader_properties TYPE crmst_header_object_buil. DATA: lrf_advanced_query TYPE REF TO cl_crm_bol_dquery_service. lrf_root_result_collection TYPE REF TO if_bol_entity_col. ls_params-name = 'MAX_HITS' . CREATE OBJECT lrf_bol_collection TYPE cl_crm_bol_bo_col. After that w e w ill redefine the method DO_PREPARE_OUTPUT. "w e don't need in this case more the single record for result sapcrmtutorial. CREATE OBJECT lrf_value_node EXPORTING iv_data_ref = lrf_data_struct. lrf_current_root TYPE REF TO if_bol_bo_property_access. CREATE DATA lrf_data_struct. name_last TYPE bu_namep_l. ls_params TYPE crmt_name_value_pair. DATA: lrf_data_struct TYPE REF TO ltype_attr_struct. lrf_bol_collection->add( lrf_value_node ). *-----------------------------------------------------------------------------------------METHOD root_query.

8/31/12 SAP CRM Technical Tutorials by Naval Bhatt. " means that w e don't have any values in our "fields and therfore w i'll excute the query lrf_current_builheader ?= me->typed_context->builheader->collection_w rapper->get_current( ).in 26/27 . APPEND ls_params TO lt_params. lrf_current_root->set_properties( is_attributes = ls_root_properties ). the next step is to redefine the method DO_PREPARE_OUTPUT. CALL METHOD SUPER->DO_PREPARE_OUTPUT EXPORTING iv_first_time = iv_first_time. lrf_root_result_bol_entity->get_properties( IMPORTING es_attributes = ls_root_properties ).blogspot. sapcrmtutorial. lrf_advanced_query->set_query_parameters( it_parameters = lt_params ). lrf_root_result_collection = lrf_advanced_query->get_query_result( ). me->ROOT_QUERY( ). "if w e found something that match our selection lrf_root_result_bol_entity = lrf_root_result_collection->get_first( ). See the follow ing screen shot. w e can see that w e have our attributes show n on the screen . CHECK ls_root_properties IS INITIAL . lrf_advanced_query = cl_crm_bol_dquery_service=>get_instance( 'Search' ). CHECK lrf_current_root IS BOUND . *---------------------------------------------------------------------------------------method DO_PREPARE_OUTPUT. ENDIF. *---------------------------------------------------------------------------------------Save and activate your code . choose our account and display it . IF lrf_root_result_collection IS BOUND . We w ill go to the w ebclient . lrf_current_root ?= me->typed_context->root->collection_w rapper->get_current( ). ENDMETHOD. put the next lines into the method . endmethod. CHECK ls_builheader_properties-bp_guid IS NOT INITIAL . Now all job is done our BOL object is w roking like a Rolls-Royce and it's time to derive pleasure from . *---------------------------------------------------------------------------------------save and activate your code . lrf_advanced_query->add_selection_param( iv_attr_name = 'BP_GUID' iv_sign = 'I' iv_option = 'EQ' iv_low = lv_low _value iv_high = '' ). lv_low _value = ls_builheader_properties-bp_guid. lrf_current_builheader->get_properties( IMPORTING es_attributes = ls_builheader_properties ). CHECK lrf_current_builheader IS BOUND . lrf_current_root->get_properties( IMPORTING es_attributes = ls_root_properties ).

8/31/12 SAP CRM Technical Tutorials by Naval Bhatt.blogspot. SAP CRM tutorials. Awesome Inc. custom bol in assignment block. sap crm BOL programming Home Subscribe to: Posts (Atom) Older Posts © Naval bhatt 2012. template.in 27/27 . Posted by Naval Bhatt at 8:08 AM No comments: +2 Recommend this on Google Labels: How to use your custom BOL Object for webclient within assignment block. sapcrmtutorial. Powered by Blogger.

Sign up to vote on this title
UsefulNot useful