Step by Step Addition of Toolbar Button in Bidder Response at Runtime
It’s sometime useful to create toolbar button at runtime to meet the dynamic requirements. For example, we may want to give print of comparative statement to bidder after successful evaluation of bids submitted.
To create the “Comparative Statement” button at runtime as shown above.
Step – 1 : Create Enhancement Implementation for the View “CNR_VIEW” of the WDA Component “FPM_OIF_COMPONENT“.
Step – 2 : Create Post-Exit for the method “WDDOMODIFYVIEW” of “CNR_VIEW“.
Step – 3 : Write the following Codes in the Post Exit of WDDOMODIFYVIEW.
DATA l_cmp_api TYPE REF TO if_wd_component.
DATA l_key TYPE wdy_config_key.
* Get the Configuration ID
l_cmp_api = wd_comp_controller->wd_get_api( ).
CALL METHOD l_cmp_api->GET_CONFIGURATION_KEY
RECEIVING
CONFIG_KEY = l_key.
* Add Button Only in Bidder Screen
IF l_key–CONFIG_ID = ‘/SAPSRM/WDCC_FPM_OIF_QTE_BIDDER’.
DATA lo_fpm TYPE REF TO if_fpm.
DATA lo_oif TYPE REF TO if_fpm_cnr_oif.
* Get reference to FPM service object
lo_fpm = cl_fpm_factory=>get_instance( ).
* Get reference to Toolbar service object
lo_oif ?= lo_fpm->get_service( cl_fpm_service_manager=>gc_key_cnr_oif ).
CALL METHOD lo_oif->DEFINE_BUTTON
EXPORTING
IV_VARIANT_ID = ‘VARIANT_QTE_BIDD’ ” Bidder Varient
IV_FUNCTION = ‘OTHER_FUNCTIONS’
IV_ELEMENT_ID = ‘EXTENSIBILITY1’ ” ‘BIDDER_CS’
IV_VISIBILITY = ’02’ ” Yes
IV_SEQUENCE_ID = ’40’
IV_ENABLED = ‘X’ ” Yes
IV_EXPLANATION = ‘Comparative Statement – Bidder Version’
IV_TOOLTIP = ‘Comparative Statement – Bidder Version’
IV_TEXT = ‘Comparative Statement’
IV_ON_ACTION = ‘ZBIDDER_CS’. ” Action
* Render buttons
WD_THIS->MO_CNR->RENDER_BUTTONS( ).
* Render button choices
WD_THIS->MO_CNR->RENDER_BUTTON_CHOICES( ).
* Render separators
WD_THIS->MO_CNR->RENDER_SEPARATORS( ).
* Render duplicate_toolbar
WD_THIS->MO_CNR->RENDER_DUPLICATE_TOOLBAR( ).
* Render YOU CAN ALSO
WD_THIS->MO_CNR->RENDER_YOU_CAN_ALSO( ).
* Render RELATED_LINKS
WD_THIS->MO_CNR->RENDER_RELATED_LINKS( ).
CALL METHOD WD_ASSIST->PREPARE_TOOLBAR
EXPORTING
IV_FIRST_TIME = FIRST_TIME
IO_VIEW = VIEW
IO_CONTEXT = WD_COMP_CONTROLLER->MO_TOOLBAR_NODE.
Step – 4 : Create Post-Exit for the method “ONACTIONBUTTON_PRESSED” of “CNR_VIEW“.
Step – 5 : Write the Codes in the Post Exit of method “ONACTIONBUTTON_PRESSED” to give print of comparative statement to bidder when button is pressed.