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.
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.
The fields must start with ZZ or YY.
Step 2:– Activate the structure.
Step 3 :–Open the Enhancement Spot /SCMTMS/ES_GW_CUST_ENH.
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.
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 = sy–tabix.
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.
IN the end of table once you scroll, you will see these added columns.
Best regards,
Rohit
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?
Hi Renato,
Please give some more details about the usecase, Not able to completely understand this.
Best regards.
Rohit
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?
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
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
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
Hey Jan good. Thnaks a lot. I'll try it.
BR.
Renato Okamoto