Skip to Content
Author's profile photo Rohit Mahajan

SAP TM Collaboration Portal — Adding Custom Fields on Tendering Quotation Table

SAP TM Collaboration Portal — Adding Custom Fields on Table


SAP TM collaboration portal for collaboration between you and your business partners.


This document from Jan Rumig provides an overview of which extensions are possible and how to create them.

SAP TM Collaboration Portal – Customer Extensions


I have tried the option to provide customer-specific fields for existing functionality.

Capture.PNG

These are steps which can be  followed to achieved this. I have tried with Tendering — Quotation View


Step 1:–


Add a new field in include <CI_QUOTATION>  for Structure /SCMTMS/S_GW_TEND_QUOTATION.

Capture.PNG


The fields must start with ZZ or YY.

Capture.PNG



Step 2:–  Activate the structure.


Step 3 :–Open the Enhancement Spot /SCMTMS/ES_GW_CUST_ENH.


Capture.PNG


Step 4:–  Provide a BAdI implementation for BAdI /SCMTMS/BADI_GW_CUST_ENH which is contained in enhancement spot

/SCMTMS/ES_GW_CUST_ENH. The BAdI has to implement the interface /SCMTMS/IF_GW_CUST_ENH.

These are the five methods which we have to implement.

Capture.PNG



Step 5:-  In method /SCMTMS/IF_GW_CUST_ENH~ADD_PROPERTIES


This method is used to add new Properties to gateway entity.


DATA:

       lo_property    TYPE REF TO /iwbep/if_mgw_odata_property,

       lo_entity_type TYPE REF TO /iwbep/if_mgw_odata_entity_typ.


CASE iv_service_name.

       WHEN ‘/SCMTMS/TENDERING’.


lo_entity_type = io_model->get_entity_type( iv_entity_name = ‘Quotation’ ).

              lo_property = lo_entity_type->create_property( iv_property_name = ‘ZZCustomerBoolean’ iv_abap_fieldname = ‘ZZBOOLE’ ).

               lo_property->set_type_edm_boolean( ).

               lo_property->set_creatable( abap_false ).

               lo_property->set_updatable( abap_false ).

               lo_property->set_nullable( abap_true ).

               lo_property->set_filterable( abap_false ).

               lo_property = lo_entity_type->create_property( iv_property_name = ‘YYCustomerText’ iv_abap_fieldname = ‘YYTEST’ ).

               lo_property->set_type_edm_string( ).

               lo_property->set_maxlength( iv_max_length = 20 ).

               lo_property->set_creatable( abap_false ).

               lo_property->set_updatable( abap_false ).

               lo_property->set_nullable( abap_true ).

               lo_property->set_filterable( abap_true ).

     ENDCASE.

Step 6:– In method /SCMTMS/IF_GW_CUST_ENH~MAP_DATA_TO_PROPERTIES

This method is used to add new data to the added property entities.



DATA:

       lv_boolean TYPE boolean,

       lv_text    TYPE char10.

     FIELD-SYMBOLS:

       <ls_data>    TYPE any,

       <lv_boolean> TYPE boolean,

       <lv_text>    TYPE char20.

CASE iv_service_name.

       WHEN ‘/SCMTMS/TENDERING’.

     LOOP AT ct_result ASSIGNING <ls_data>.

               ASSIGN COMPONENT ‘ZZBOOLE’  OF STRUCTURE <ls_data> TO <lv_boolean>.

               ASSIGN COMPONENT ‘YYTEST’   OF STRUCTURE <ls_data> TO <lv_text>.

                lv_boolean = abap_true.

              <lv_boolean> = lv_boolean.

               lv_text = sytabix.

               CONCATENATE ‘TEXT’ lv_text INTO <lv_text> SEPARATED BY space.

               CONDENSE <lv_text>.

     ENDLOOP.

ENDCASE.



Step 7:– In the method  /SCMTMS/IF_GW_CUST_ENH~SET_LAST_MODIFIED


Sets the last modified time for gateway service.


rv_last_modified = ‘20141031120025’.


Step 8: — Activate the class


Step 9: — Lunch the portal application.

Capture_1.PNG


IN the end of table once you scroll, you will see these added columns.


Capture.PNG


Best regards,

Rohit

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi all,

      I need to add a new column to the price per ton in this case but I can not do this because I am unable to validate the values of each line. I did all the steps listed above and the field appeared correctly, but when I need to read the values of other Standards columns I did not find them.

      Someone can help me with this?

      Author's profile photo Rohit Mahajan
      Rohit Mahajan
      Blog Post Author

      Hi Renato,

      Please give some more details about the usecase, Not able to completely understand this.

      Best regards.

      Rohit

      Author's profile photo Former Member
      Former Member

      Hi Rohit, thanks for your help... Follow more details:

      I needed to add a new column in Freight Quotations structure, follow the steps listed above and the column appeared correctly but need to read the values filled in each row to calculate the value of the ton and so fill the new column added.

      As can be seen below, the column was properly added.

      By doing Enhancement Spot / SCMTMS / ES_GW_CUST_ENH mentioned above, a class was created with / SCMTMS / IF_GW_CUST_ENH interface in MAP_DATA_TO_PROPERTIES method, I have an entry table that is CT_RESULT, but she's not helping me because it comes some strange data I'm not finding on any table.

      Could someone help me where I can read the data that are coming out in Freight Quotations structure which added the column to calculate these values Ton?

      /wp-content/uploads/2015/09/image_786835.jpg

      Author's profile photo Jan Rumig
      Jan Rumig

      Hi Renato,

      The table, that you get into MAP_DATA_TO_PROPERTIES, is the quotation UUID which is the key of node TENDERINGRESPONSE and all the extension fields. With that UUID, you should be able to read all needed data from the Freight Order starting for the tendering response node.

      Regards,

      Jan

      Author's profile photo Former Member
      Former Member

      Hi Jan,

      But, what table I can use this UUID?

      I tried search in lot of tables but I can't locate.

      Could help me?

      Thanks for all.

      BR.

      Renato Okamoto

      Author's profile photo Jan Rumig
      Jan Rumig

      Hi Renato,

      you can find out the table name from transaction /BOBF/CONF_UI. Open the BO /SCMTMS/TOR and check the node details of node TENDERINGRESPONSE.

      There you find the database table /SCMTMS/D_TORTRE.

      Regards,
      Jan

      Author's profile photo Former Member
      Former Member

      Hey Jan good. Thnaks a lot. I'll try it.

      BR.

      Renato Okamoto