Skip to Content

In this document we will see how to create a table extension in SRM documents. This example is for PO Header but the same process can be applied to other documents.

Go to SPRO to the following path:

SAP Supplier Relationship Management -> SRM Server ->Cross-Application Basic Settings -> Extensions and Field Control (Personalization) -> Create Table Extensions and Supply with Data -> Define Customer Table Extensions on Header Level

1.JPG

And create an append estructure on header on Database and also on PO header:

–      –    Define Append for Fields of Customer Table on Header on Database

–      –    Define Append for Fields of Customer Table on PO Header

2.JPG

In this example we’re going to create a table with the fields ‘User’ and ‘Name’:

3.JPG

4.JPG

Active both structures.

Return to SPRO and go to:

Control Table Extensions and Their Fields and Actions -> Set Visibility of Table Extensions -> Configure Visibility of Table-Like Header Enhancements.

5.JPG

And add a new entry for Customer Table Ext. Header (THCUS) and PO (BUS2201).

6.JPG

Then go to:

Configure Control of Fields of Table Extensions -> Customer metadata for substructure fields in normal entries

And add one entry for each field, set the field as Visible and Enabled.

7.JPG

At this point you can assign a dynamic class and method for change the visualization of the fields in run time.

You need to add also the lines in “Default customer metadata for set fields in initial entries” if you want to be allowed to edit the lines:

8.JPG

Now, if you go to the portal or NWBC and create a new PO, you can see a subtab called “Table Extension” within the PO header. Click there and you can see the table with the two fields we’ve added:

9.JPG

As you can see the buttons for add or delete lines are disabled. For active these buttons we need to do the following. Go to “Configure Control of Actions”:

10.JPG

And a line for each button:

11.JPG

12.JPG

Then you can see the buttons enabled and you can add or delete lines:

13.JPG

Change the place where the table is displayed

If you want to change the place where the table is displayed, for example adding a new header tab, you can do the following:

Goto to the PO and with the right button of the mouse choose “More field help” :

14.JPG

Here we can see the Component name and the Configuration ID:

15.JPG

Go to se80 to the component FPM_OIF_COMPONENT and find the Configuration ID /SAPSRM/WDCC_FPM_OIF_PO_PURCH, the push the button “Start Configurator”:

16.JPG

A new internet explorer browser will be opened. Choose “Change”.

17.JPG

If you go to the Header tab and do click in the table extension subtab you can see the view is been used is IV_L_FPC_CA_DETAILS of component /SAPSRM/WDC_DODC_CT. Save somewhere this names we’ll need it later.

18.JPG

We’re going to create a new header tab, so use the button “Add Main View”:

19.JPG

A new tab will be added, change the description of that tab.

20.JPG

Then expand the node of this new tab and set the view wich we want to be displayed, adding the Component /SAPSRM/WDC_DODC_CT the view IV_L_FPC_CA_DETAILS and the Component configuration name.

21.JPG

Save the changes and go to the portal to create a new PO:

22.JPG

–          Using badi BBP_DOC_CHANGE_BADI for add or modify the table.

Go to se18 and create a new implementation for badi BBP_DOC_CHANGE_BADI.

23.JPG

Add a filter for object type BUS2201 and go to the method BBP_PO_CHANGE. We have a parameter called IT_HCF “Tabular Customer and Solution Fields on PO Header” in wich we have the data of our table.

With the following sample code you can add some initial lines to the table:

DATA: ls_i_item    LIKE LINE OF it_item,
        ls_e_item    LIKE LINE OF et_item,
        ls_i_acc     LIKE LINE OF it_acc,
        ls_e_acc     LIKE LINE OF et_acc,
        ls_hcf       LIKE LINE OF it_hcf.
* Move data from import parameter to export parameters:
  MOVE-CORRESPONDING is_header TO es_header.
  LOOP AT it_item INTO ls_i_item.
    MOVE-CORRESPONDING ls_i_item TO ls_e_item.
    APPEND ls_e_item TO et_item.
  ENDLOOP.
  LOOP AT it_acc INTO ls_i_acc.
    MOVE-CORRESPONDING ls_i_acc TO ls_e_acc.
    APPEND ls_e_acc TO et_acc. CLEAR ls_e_acc.
  ENDLOOP.
  et_partner[] =  it_partner[].
  et_orgdata[] = it_orgdata[].
  et_hcf[] = it_hcf[].
* Add some initial lines to the custom table:
  IF iv_mode EQ 'C'. "Creation mode
    CALL FUNCTION 'BBP_LA_UTILITY_GENERATE_GUID'
      IMPORTING
        e_guid = ls_hcf-guid.
    ls_hcf-p_guid = is_header-guid.   
    ls_hcf-zz_user = '0000012345'.
    ls_hcf-zz_name = 'My name'.
    APPEND ls_hcf TO et_hcf.
  ENDIF.

Related content:

http://wiki.sdn.sap.com/wiki/display/SRM/Table+extensions+in+SAP+SRM+7.0

Special Thanks to Hilario Mata for investigate with me how to do it.

a

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Gaurav Gautam

    Hello Ricardo,

    This was indeed a good step by step document!!!

    Is it possible to have more than one custom tab created using the SPRO extension option.

    Regards,

    Gaurav.

    (0) 

Leave a Reply