Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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.
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
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
A structure 'ZORD_STRUCT' that corresponds to the table structure and a table type 'ZORD_STRUCT_TAB' is available.
sapcrmtutorial.blogspot.in
1/27
8/31/12
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)
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
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
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
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
8/31/12
SAP CRM Technical Tutorials by Naval Bhatt. July (26) June (18) May (11) April (9) March (28) February (13) January (10)
Video Bar
pow ered by
Popular Posts Getter - Setter methods in Web UI Using Get and Setter methods you can retrieve data to field and set specific data to field. Using Get_I method you can make your field ... 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. Below is a screen shot of the sample implementation. ...
Maintain Z-Relations
Scope of the design layer Scope of the design layer In the UIU framework some UI/Design relevant settings can be made. These settings have to be made per view... CRM Tables and Transaction Codes TABLE NAME DESCRIPTION BUSINESS PARTNERS BUT000 BP: General data Contains Business Partner Number, Partner Category, Partne...
sapcrmtutorial.blogspot.in
3/27
8/31/12
Note:
SAP CRM Technical Tutorials by Naval Bhatt. Do_prepare_output and DO_PREPARE_OUTPUT method is triggered each time the view is prepared after each event. Normally we redefine this meth... 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 ... METHOD do_config_determination. DATA: lr_btadmin... How to create POP-UP window in UI Open the component and then view where the pop up is to be raised. You must be raising the popup on some event... You will need to crea... Important abap function modules Useful ABAP Function Modules This page is intended to maintain documentation of useful function modules. This is needed because inde...
If you are not w illing to im plem ent the classes, you m ay skip m aintaining the handler classes. You can even directly specify a single 1..n relationship directly under On_new_focus BTAdm inH. The relationships w ill be available, but not usable in the real sense. Then, you can follow this w iki to m ake do w ith value nodes. DO_PREPARE_OUTPUT http://w iki.sdn.sap.com /w iki/display/CRM/How +to+display+a+z-table+in+an+assignm ent+block Moving forw ard, here's a screenshot of the m odel w ith the new relationships expanded.
Total Pageviews
2 4 6 4 2
Follow by Email
Email address... Submit
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.blogspot.in
4/27
8/31/12
Method Signatures:
*"* public com ponents of class ZL_ZORD_BTIL_API *"* do not include other source files here!!! public section. class-m ethods ZORD_CREATE im porting !IS_KEY type CRMT_OBJECT_GUID !IS_ATTRIBUTES type ZORD_STRUCT . 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_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 . class-m ethods ZORD_SAVE im porting !IV_HEADER_GUID type CRMT_OBJECT_GUID . class-m ethods ZORD_READ im porting !IV_HEADER_GUID type CRMT_OBJECT_GUID exporting !ET_ZORD type ZORD_STRUCT_TAB . class-m ethods ZORD_READ_SINGLE im porting !IV_GUID type CRMT_OBJECT_GUID exporting !ET_ZORD type ZORD_STRUCT_TAB . class-m ethods ZORD_INIT im porting !IV_HEADER_GUID type CRMT_OBJECT_GUID optional . class-m ethods ZORD_DELETE_WITH_ORDER im porting !IV_HEADER_GUID type CRMT_OBJECT_GUID optional .
Method Implementations
MTO zr_rae EHD odcet. DT:l_odTP zr_tut AA szr YE odsrc. l_od=i_trbts szr satiue. l_odgi =i_e. szr-ud sky ISR l_odIT TBEg_od NET szr NO AL tzr. EDEHD NMTO. MTO zr_oiy EHD odmdf. FEDSMOS <szr>LK LN O g_od IL-YBL: f_od IE IE F tzr, <l> TP sml, od YE ipe <e> TP sml, nw YE ipe <ae TP nm_op nm> YE aekm. RA TBEg_odWT KYgi =i_e ASGIG<szr> ED AL tzr IH E ud sky SINN f_od. I s-ur E 0 F ysbc Q . LO A i_hne_ilsASGIG<ae. OP T tcagdfed SINN nm> ASG CMOET<ae O SRCUE<szr>T <l> SIN OPNN nm> F TUTR f_od O od. CEKs-ur =0 HC ysbc . ASG CMOET<ae O SRCUEi_trbtsT <e> SIN OPNN nm> F TUTR satiue O nw. CEKs-ur =0 HC ysbc . <l>=<e> od nw. EDOP NLO. EDF NI. EDEHD NMTO. MTO zr_eee EHD oddlt. 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. I s-ur E 0 F ysbc Q . ISR l_odIT TBEg_oddl NET szr NO AL tzr_e. DLT g_odWEEgi =i_e. EEE tzr HR ud sky EDF NI. EDEHD NMTO. MTO zr_ae EHD odsv.
sapcrmtutorial.blogspot.in
5/27
8/31/12
sapcrmtutorial.blogspot.in
6/27
8/31/12
MTO I_R_UTM_TLMITI_TRBTS EHD FCMRNIEBI~ANANATIUE. DT:l_et TP cm_et. AA vdla YE rtdla ** * *hsi ara-nyrlto,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( . I l_et E i_otoj>et_rae. F vdla Q rcn_b-dlacetd TY R. i_otoj>e_e(i_e_ud) rcn_b-stky vrfgi . CTHc_r_i_ulct_nr. AC xcmccdpiaeety EDR. NTY EDF NI. *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 . EDEHD NMTO. MTO MDF_HLRN. EHD OIYCIDE *ontrdfn ti mto!Sprcaswl tk cr o ti D o eeie hs ehd ue ls il ae ae f hs EDEHD NMTO.
MTO fedhc. EHD ilcek *eeie t peetsse loigfruipeetdF rdfnd o rvn ytm okn o nmlmne M *mt,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, l_udTP cm_betgi, vgi YE rtojc_ud l_is TP cm_ola VLEtu, vfrt YE rtboen AU re l_eain TP cm_eainnm. vrlto YE rtrlto_ae DT:l_odiTP RFT zr_tuttb AA rzr_ YE E O odsrc_a, l_odiTP zr_tuttb tzr_ YE odsrc_a, l_trposTP RFT i_ei_b_trpoete, rat_rp YE E O fgnlojat_rpris l_otojTP RFT i_ei_otie_bet rcn_b YE E O fgnlcnanrojc. FEDSMOS <szr_>TP zr_tut IL-YBL: l_odi YE odsrc, <saidt> l_p_aa TP cm_nlygt YE rtita_e, <taidt> l_p_aa TP cm_nlygttb YE rtita_e_a. ** * CL MTO z_odbi_p=zr_ed AL EHD lzr_tlai>odra
sapcrmtutorial.blogspot.in
7/27
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_. CL MTO i_otoj>e_aetrlto AL EHD rcn_b-gtprn_eain IPRIG MOTN e_eainnm =l_eain vrlto_ae vrlto.
LO A l_odiASGIG<szr_> OP T tzr_ SINN l_odi. TY R. I l_is E tu. F vfrt Q re l_is =fle vfrt as. l_otoj=i_otoj rcn_b rcn_b. l_otoj>e_e(<szr_>gi ) rcn_b-stky l_odi-ud . ES. 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 . CEKl_otojI BUD HC rcn_b S ON. EDF NI. CTHc_r_i_ulct_nr. AC xcmccdpiaeety TY R. 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 . CTHc_r_ei_eea_ro. AC xcmgnlgnrlerr CNIU. OTNE EDR. NTY CTHc_r_ei_oe_ro. AC xcmgnlmdlerr CNIU. OTNE EDR. NTY I l_otoj>hc_trrqetd )E tu. 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 . l_trpos=l_otoj>e_trposoj ) rat_rp rcn_b-gtat_rp_b( . l_trpos>e_l_rpris i_ei_b_trpoete=cagal ) rat_rp-stalpoete( fgnlojat_rpris>hnebe . 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 . 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 . 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 . RFGI EDF NI. I l_otoj>hc_esrqetd )E tu. 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 . EDF NI. EDOP NLO. EDEHD NMTO. *
MTO i_r_utm_tlmiti_trbts EHD fcmrniebi~ananatiue. ICUEcmmd_o. NLD r_oecn DT:l_et AA vdla TP cm_et. YE rtdla DT:l_hne_betTP cm_ei_b_ntne AA scagdojc YE rtgnlojisac. DT:l_ae TP cm_trnm_a. AA tnms YE rtat_aetb DT:l_trposTP RFT i_ei_b_trpoete. AA rat_rp YE E O fgnlojat_rpris FEDSMOS <saidt>TP cmtodrmiti, IL-YBL: l_p_aa YE rs_re_anan <vnm> l_ae TP nm_op YE aekm. ** * DT:l_rp_b AA vposoj TP RFT i_ei_b_trpoete, YE E O fgnlojat_rpris l_hne_trTP cm_trnm_a, tcagdat YE rtat_aetb l_trbts satiue TP zr_tut YE odsrc, l_ud vgi TP cm_betgi, YE rtojc_ud * l_eun trtr TP bprt_, YE aie2t * l_s_ot vmgcn TP RFT c_r_ei_aims_ot YE E O lcmgnlbp_escn, l_b_nt sojis TP cm_ei_b_ntne YE rtgnlojisac, l_edr vhae TP RFT i_ei_otie_bet YE E O fgnlcnanrojc, l_edrgi vhae_ud TP cm_ei_betgi, YE rtgnlojc_ud l_edrat shae_tr TP cmtgi_tl YE rs_udbi. CEKi_otoj>e_ae )='OD. HC rcn_b-gtnm( ZR' l_b_ntojc_ae='OD. 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( . CL MTO l_edr>e_e AL EHD vhae-gtky IPRIG MOTN e_e =l_edrgi. sky vhae_ud CL MTO l_edr>e_trbts AL EHD vhae-gtatiue IPRIG MOTN e_trbts=l_edrat. satiue shae_tr *rtiv tedlafa eree h et lg l_et =i_otoj>e_et_lg ) vdla rcn_b-gtdlafa( . *bac acrigt tedlafa.Dpnetojcsmyb cetd mdfe,o dltd rnh codn o h et lg eedn bet a e rae, oiid r eee.
sapcrmtutorial.blogspot.in
8/27
8/31/12
* * * *
WE i_ei_otsml_bet>et_rae. 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. * * bidteky ul h e * CL FNTO 'UDCET' AL UCIN GI_RAE * IPRIG MOTN * e_ud1 =l_ud vgi_6 vgi. i_otoj>e_e(IPRIGe_e =l_ud) rcn_b-gtky MOTN sky vgi . l_trbtsrfgi =l_edrgi. 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. * IPRIG MOTN * e_eun trtr =l_eun trtr. l_trbtsgi =l_ud satiue-ud vgi. i_otoj>e_trbts l_trbts) rcn_b-statiue( satiue . * * stnwky e e e TY R. i_otoj>e_e(l_ud) rcn_b-stky vgi . CTHc_r_ei_ulct_e. AC xcmgnldpiaeky EDR. NTY l_b_ntojc_d=c_r_ei_otie_ol=bidojc_d l_ud) sojis-beti lcmgnlcnanrtos>ul_beti( vgi . ISR l_b_ntIT TBEg_nly>tcagdojcs NET sojis NO AL rita-g_hne_bet.
WE i_ei_otsml_bet>et_eee. 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. * 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. vhae_ud vhae_ud * IPRIG MOTN * e_eun trtr =l_eun trtr * e_hne_bet =l_hne_bet. tcagdojcs tcagdojcs l_b_ntojc_d=c_r_ei_otie_ol=bidojc_d l_ud) sojis-beti lcmgnlcnanrtos>ul_beti( vgi . ISR l_b_ntIT TBEg_nly>tcagdojcs NET sojis NO AL rita-g_hne_bet. EDAE NCS. * *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. EDEHD NMTO.
sapcrmtutorial.blogspot.in
9/27
8/31/12
1. Initialization
FNTO zr_nte. 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. CL MTO Z_ODBI_P=ZR_NT AL EHD LZR_TLAI>ODII EPRIG XOTN i_edrgi =i_edrgi. vhae_ud vhae_ud EDF NI. EDUCIN NFNTO.
2. Save
FNTO zr_aee. 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. aa vhae_ud ye rtojc_ud lo a i_edrgi it l_edrgi. 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 edop nlo. EDUCIN NFNTO.
3. Delete
FNTO zr_e_c UCIN oddle. *----------------------------------"----------------------------------**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. *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. vhae_ud vhae_ud EDF NI. EDUCIN NFNTO.
sapcrmtutorial.blogspot.in
10/27
8/31/12
Results:
Here are a few screens show ing the results
No comments:
Labels: Extend BOL Model BT with custom table type relationship, sap crm tutorial, SAP CRM
sapcrmtutorial.blogspot.in
11/27
8/31/12
tutorials
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 . http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/4048d161-9ac1-2e10-3bbfbaef73d78109?QuickLink=index&overridelayout=true
No comments:
Labels: Extend BOL Model for BP with Custom Table and Implement GenIL Class, GENIL class, SAP CRM tutorials, sap crm BOL programming, sap crm tutorial
How to use your custom BOL Object for webclient within assignment block.
How to use your custom BOL Object for webclient within assignment block.
We created the BOL object in one of our old blog http://sapcrmtutorial.blogspot.sg/2012/02/create-z-bol-object.html that meet your personal requirements. Now that w e have our BOL Object w e might w ant to use it for our purposes. Let's say that w e w ant to add several fields to assignment block and display them on the screen, for instance w e take the fields from our Z table that w e use in the creation of our BOL Object. We also w ant to keep the connection for the original transaction context . 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 . 2) Perform the adjustment for the Z Table. 3) Search for the right BP_GUID that fit to our user account. 4) create new record that contain the details that w e w ant to display for the specific account. See the follow ing screen shot.
Now w e need to perform some adjustment for our table . choose the Database Utility from the menu . See the follow ing screen shot.
sapcrmtutorial.blogspot.in
12/27
8/31/12
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, 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 , so you should consider the use of Database Utility very careful. 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 . 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 . To find the right BP_GUID enter transaction GENIL_BOL_BROWSER and insert the BP_APPL_COND in the component set field. See the follow ing screen shot.
sapcrmtutorial.blogspot.in
13/27
8/31/12
w hen you enter to the component set choose the predefined search named BuilEm pSearch See the follow ing screen shot.
Now w e can look for any partner , 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, BP_GUID , First and last names. See the follow ing screen shot.
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.blogspot.in
14/27
8/31/12
different searching options.
So let's go to transaction SE24 and put ZCL_OWN_BOL in the input filed. click on Local Types button and put the lines inside : *------------------------------------------------------------TYPES: BEGIN OF ty_general_rng , sign TYPE bapisign, option TYPE bapioption, low TYPE string , high TYPE string , END OF ty_general_rng . TYPES: tt_general_rng TYPE STANDARD TABLE OF ty_general_rng . 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. DATA: lr_object TYPE REF TO if_genil_cont_root_object, lt_result TYPE TABLE OF zusr_bol_st, lv_dyn_w here TYPE string, lv_len TYPE i , ls_range TYPE ty_general_rng. DATA: lt_bp_guid TYPE tt_general_rng, lt_bname_range TYPE tt_general_rng, lt_name_first TYPE tt_general_rng, lt_name_last TYPE tt_general_rng. FIELD-SYMBOLS: <lfs_result> TYPE zusr_bol_st, <lfs_selection_range> TYPE genilt_selection_parameter. decomposition of selection parameters and build a dynamic w here condition LOOP AT it_selection_parameters[] ASSIGNING <lfs_selection_range>. MOVE: <lfs_selection_range>-sign TO ls_range-sign , <lfs_selection_range>-option TO ls_range-option , <lfs_selection_range>-low TO ls_range-low , <lfs_selection_range>-high TO ls_range-high. CASE <lfs_selection_range>-attr_name. WHEN 'BNAME'. APPEND ls_range TO lt_bname_range[]. CONCATENATE lv_dyn_w here 'bname in lt_bname_range[] and' INTO lv_dyn_w here SEPARATED BY space . WHEN 'BP_GUID'. APPEND ls_range TO lt_bp_guid[]. CONCATENATE lv_dyn_w here 'bp_guid in lt_bp_guid[] and' INTO lv_dyn_w here SEPARATED BY space . WHEN 'NAME_FIRST'. APPEND ls_range TO lt_name_first[]. CONCATENATE lv_dyn_w here 'name_first in lt_name_first[] and' INTO lv_dyn_w here SEPARATED BY space .
sapcrmtutorial.blogspot.in
15/27
8/31/12
WHEN 'NAME_LAST'.
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. See the follow ing screen shot.
sapcrmtutorial.blogspot.in
16/27
8/31/12
Now choose the appropriate component set w hich is in our case BP_APPL_COND. See the follow ing screen shot.
Now click on component assignment make new entry and add our BOL object named ZBOLOB. See the follow ing screen shot.
Don't forget to save the new entry. 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, w e w ant to check here that w e can see our BOL entity ready for use. See the follow ing screen shot.
sapcrmtutorial.blogspot.in
17/27
8/31/12
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. We w ill go to Component Structure Brow ser tab and create our view . See the follow ing screen shot.
We'll choose a name for our view . See the follow ing screen shot.
sapcrmtutorial.blogspot.in
18/27
8/31/12
After w e named the view w e need to add 2 model nodes, one for BuilHeader and one For our Root BOL object. 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 . See the follow ing screen shot.
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. We start w ith the BuilHeader fields. See the follow ing screen shot.
sapcrmtutorial.blogspot.in
19/27
8/31/12
We use also attributes from the Root BOL object . See the follow ing screen shot.
We got the w hole attributes as show n bellow . See the follow ing screen shot.
We move to the next step. Here w e need to define the view type and its properties.
sapcrmtutorial.blogspot.in
20/27
8/31/12
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. See the follow ing screen shot.
sapcrmtutorial.blogspot.in
21/27
8/31/12
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. See the follow ing screen shot.
sapcrmtutorial.blogspot.in
22/27
8/31/12
We w ill create the binding for our context node to the same context node in the custom controller. See the follow ing screen shot.
After w e create the appropriate binding w e need to add the attributes to the view . 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. 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. In our case w e w ill add the attributes from the Root BOL object. See the follow ing screen shot.
After w e add the attributes to our view w e need to add our view as an assignment block. First w e need to add our view to the BPHEADOverview view set , 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 . See the follow ing screen shot.
sapcrmtutorial.blogspot.in
23/27
8/31/12
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 . See the follow ing screen shot.
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 . 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.
sapcrmtutorial.blogspot.in
24/27
8/31/12
Put the next ilnes into the method save and aactivate the method. *------------------------------------------------------------------------------------------method IF_BSP_MODEL~INIT. TYPES: BEGIN OF ltype_attr_struct, mandt TYPE mandt, bp_guid TYPE bu_partner_guid, bname TYPE xubname, name_last TYPE bu_namep_l, name_first TYPE bu_namep_f, END OF ltype_attr_struct. DATA: lrf_data_struct TYPE REF TO ltype_attr_struct, lrf_value_node TYPE REF TO cl_bsp_w d_value_node, lrf_bol_collection TYPE REF TO if_bol_bo_col. super->if_bsp_model~init( id = id ow ner = ow ner ). CREATE DATA lrf_data_struct. CREATE OBJECT lrf_value_node EXPORTING iv_data_ref = lrf_data_struct. CREATE OBJECT lrf_bol_collection TYPE cl_crm_bol_bo_col. lrf_bol_collection->add( lrf_value_node ). me->set_collection( lrf_bol_collection ). endmethod. *------------------------------------------------------------------------------------------After w e add the above lines to the method w e w ill go to the implementation class of our view , w hich is in our case is ZL_ZBP_HEAD_TESTBOLROOT_IMPL. 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. 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 . After that w e w ill redefine the method DO_PREPARE_OUTPUT. so let's create a new method named root_query w hich is an Instance Method , and the visibility of it is Private. put the next lines to the method . *-----------------------------------------------------------------------------------------METHOD root_query. DATA: lrf_advanced_query TYPE REF TO cl_crm_bol_dquery_service, lrf_root_result_collection TYPE REF TO if_bol_entity_col, lrf_root_result_bol_entity TYPE REF TO cl_crm_bol_entity, lrf_current_root TYPE REF TO if_bol_bo_property_access, lrf_current_builheader TYPE REF TO if_bol_bo_property_access, lt_params TYPE crmt_name_value_pair_tab, ls_params TYPE crmt_name_value_pair, ls_builheader_properties TYPE crmst_header_object_buil, lv_low _value TYPE string , ls_root_properties TYPE zusr_bol_st. ls_params-name = 'MAX_HITS' . ls_params-value = '1'. "w e don't need in this case more the single record for result
sapcrmtutorial.blogspot.in
25/27
8/31/12
sapcrmtutorial.blogspot.in
26/27
8/31/12
No comments:
Labels: How to use your custom BOL Object for webclient within assignment block. custom bol in assignment block, SAP CRM tutorials, sap crm BOL programming
Home
Subscribe to: Posts (Atom)
Older Posts
sapcrmtutorial.blogspot.in
27/27