cancel
Showing results for 
Search instead for 
Did you mean: 

cProjects Additional Tab BAdi

Former Member
0 Kudos

Hi ,

I am trying to implement Badi DPR_ADD_SAP_TAB_I to have additional tab in cProjects.

The documentation on the IMG describes the procedure, but I am clueless on how to implement this BAdi.

I copied the code from the documentation into the method GET_ADD_TAB_DATA. This shows an additional tab on the Project Header. But when I open the tab, the system times out.



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.

1) Can anyone list out steps on how you implement this BAdi?

2) Do I need to create a BSP page.

Any input is appreciated.

Pat

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member189058
Active Contributor
0 Kudos

Hi Pat,

Sorry for the delay.

Here is how you implement the BAdI:

1. Go to <b>SE18</b>. Enter BAdI name.<b> DPR_ADD_SAP_TAB_I</b> in your case.

2. Select Create from the menu Implementation.Give a name to your implementation such as ZPV_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<<i>menaingful_name</i>>.

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

Hi Reema,

We had to create a new tab page and we followed the procedures given in this thread. There is a problem in the last step i.e Call the view in the method do_request

When you double click on this method, the system pops up an information window stating "Method DO_REQUEST is implemented in class

CL_BSP_CONTROLLER". Then the do_request page opens in display mode. When I try to change this to Change Mode it asks for an Access Key.

(Even though we proceeded further. A new Tab Page was created - Glad to see this. When you click on this tab it gives a BSP Error - BSP Exception: Das Objekt CONTROLPLAN.DO in der URL /sap(bD1lbiZjPTIwMCZkPW1pbg==)/bc/bsp/sap/cprojects/projects.do ist nicht gültig)

I just want to know whether I am in the right path and how to proceed further. It would be of immense help to me if you can help me cross this obstacle.

Regards,

Rajesh Kumar

former_member189058
Active Contributor
0 Kudos

Dear Rajesh,

The methods have to be redefined and not changed.

when you open the class and see the method for the first time, in order to write your code in it, you need to click on the redefine button. Only then will you be able to open it in editable mode.

Regards,

Reema.

Former Member
0 Kudos

Hai Reema,

Thanks.

Rajesh Kumar

Former Member
0 Kudos

Hi, were you able to solve this problem? Can you share with me the code that you used for this? Meanwhile is it possible to add actions to the tab that we put? I mean by executing this is it possible to generate any reports?

former_member189058
Active Contributor
0 Kudos

Hey Pat,

In your case, this code calls the controller "<b>CTRL_TAB_DPO.DO</b>" in the application "<b>CST_ADD</b>".

Now so taht you can see a page under the tab, you have to define a view and call that view from this controllers DOREQUEST method.

Regards,

Reema.

PS: pl award points for answers that solve yoyr problem.

Former Member
0 Kudos

Reema,

thanks for the response

Could you please provide more details on how I do this.

Pat

Former Member
0 Kudos

Reema,

I am trying to implement the BADi. I see that the BAdi refers to application CST_ADD

.

It would be great if you can provide more information on how to implement CST_ADD.

Rajesh

Former Member
0 Kudos

Hi Reema,

Will you list down the procedure to implement the Badi for additional tab pages in cprojects.

I need to have an additional tab page in the project definition. How can we layout that tab page.

Thanks in advance.

Amit