cancel
Showing results for 
Search instead for 
Did you mean: 

implementing Badi for additional tab page & creating views in cProjects 3.1

Former Member
0 Kudos

Hi,

I am implementing DPR_ADD_SAP_TAB_I for adding new tab page in Cprojects 3.1.

Please tell me whether we have to create any veiw?

if it is please tell me the procedure & steps

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member189058
Active Contributor
0 Kudos

Hi...

Implement the BAdI DPR_ADD_SAP_TAB_I

and write following code in its method GET_ADD_TAB_DATA

method IF_EX_DPR_ADD_SAP_TAB_I~GET_ADD_TAB_DATA .

field-symbols: <tab_data> type DPR_TS_SAP_TAB_CTRL.

data: lt_tab_data type DPR_TT_SAP_TAB_CTRL.

constants: lc_pre_ctrl type string value 'CTRL_TAB_',

lc_suff_ctrl type string value '.DO'.

lt_tab_data = ct_comp_ctrl.

loop at lt_tab_data assigning <tab_data>.

case <tab_data>-obj_type.

  • project definition

when CL_DPR_CO=>SC_OT_PROJECT.

<tab_data>-tab_title = 'otr(zotr_cust_txt/proj_txt)'.

concatenate lc_pre_ctrl CL_DPR_CO=>SC_OT_PROJECT lc_suff_ctrl

into <tab_data>-controller.

endcase.

endloop.

ct_comp_ctrl = lt_tab_data.

EV_BSP_APPL = 'CST_ADD'.

endmethod.

Regards,

Reema.

former_member189058
Active Contributor
0 Kudos

Hi,

Sorry for the delay.

Here is how you implement the BAdI:

1. Go to SE18. Enter BAdI name. DPR_ADD_SAP_TAB_I in your case.

2. Select Create from the menu Implementation.Give a name to your implementation such as Z_DPR_ADD_SAP_TAB_I Now a class automatically gets created for you implementation. Enter the code that you have written in the question in the method GET_ADD_TAB_DATA. Only replace the application name from CST_ADD to ZCST_ADD.

3. Having done that, Now create the application ZCST_ADD

3.1 Create a View under it and place certain UI elements on it. Design the View that you want to see under the additional tab page basically.

3.2 Create a contoller under it, say <abc>.do and enter the name of the contoller class: zcl<menaingful_name>.

3.2.1 Double click on the class name and create it. Under properties tab you will see that the superclass is CL_BSP_CONTROLLER2.

Now go to Methods tab. and redefine the method do_request

In that method call the view that you have created.

Now activate aal your new z objects.

and goto cProjects. at the project definition you should be able to see the additional tab page and the under that you should get the View that you have created.

Regards,

Reema.

Pl award points to all useful answers

Former Member
0 Kudos

Hello reema, could you please forward me the code that needs to be written for implementing the BADI. Also in case you have any documentation on this BADI implementation please kindly forward to me.

thanks