Spend Management Blogs by Members
Check out community member blog posts about spend management and SAP Ariba, SAP Fieldglass, and SAP Concur solutions. Post or comment about your experiences.
cancel
Showing results for 
Search instead for 
Did you mean: 
RicardoRomero_1
Active Contributor
6,943

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

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

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

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.

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

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.

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:

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:

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”:

And a line for each button:

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

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” :

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

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”:

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

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.

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

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

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.

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

-          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.

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

9 Comments
former_member208675
Active Contributor
0 Kudos

Ricardo!

Awesome! Keep it up.

Regards,

Former Member
0 Kudos

Great work. Thank you for the step by step instructions and the explanations, I was able to implement my custom table extension.

former_member190689
Contributor
0 Kudos

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.

konstantin_anikeev
Active Contributor
0 Kudos

Thx for sharing... Haven't seen it before!

Former Member
0 Kudos

Excellent post!! Regards

0 Kudos
Hi,

I Have added the custom extention table in RFx  while creating Rfx responce we are getting below dum. Im following the same above steps. kindly help on this issue

0 Kudos
Did you find any way to have multiple custom tables created ??
0 Kudos
How can we replicate this table data while PO is replicated to ECC. On ECC side, I have same custom table and I want to transfer records from SRM table extension to custom table in ECC.

 
nilanchal
Discoverer
0 Kudos
Hello Ricardo,

 

i need to add a custom tab in SRM Shopping cart item, I tried to follow the same approach, hwoever i dont see the Table extension tab. Is there some other settings that is to be done to achive the same.

 

Thank You!

 

Regards,

Nilanchal
Top kudoed authors