Skip to Content
avatar image
Former Member

how to control EM UI field in detail section to display value uniquely. ( even it has multiple indexes)

Hi All,

Kindly get back to me if this requirement is possible to achieve  via configuration or it is must with the code changes via EM UI BADI.

We have a EM UI configured field as a control parameter displayed in detail section on EM UI which is getting updated in event handler with same value but with different index , hence the value of this field in EM UI is showing up multiple times.

for example :  vehicle type is a control parameter which is getting updated in event handler with different index and the value of control parameter is TRUCK which has two indexes 10001( index 1), 10002 ( index 2), 10003( index 3). hence the value of vehicle type in EM UI  in detail section is showing as  below.

EM UI detail section for vehicle type as below :

TRUCK

TRUCK

TRUCK

But I want to display only one value as TRUCK in EM UI in detail section for vehicle type, even though event handler has updated with different indexes for the same value in the back end for control parameter ZContorl_Vehicle_type.

Please let us know if this can be achieved via EM configuration or any code changes required, please share the sample code snippet to achieve the same.

Best Regards

Sudhan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 18, 2016 at 08:29 PM

    Hi Sudhan,

    I do not think you can restrict by config. Only thing you can do is show one value unless user clicks on the link to show all. You can do this by making "No. Indexed Values" to be 1.

    If you are updating the value via event, why don't you check the value before you add it? If you want to go this route, please let me know how you are getting this value into EM. Is it via Event Type or External Event or AO Type? Based on this I can give you pointers.

    If you still want to take care of it in EM UI, then here is the sample code for method: AFTER_SEARCH_BAPI

    DATA: ls_ctrl TYPE /saptrx/bapi_eh_control_params,
               ls_hdr  TYPE /saptrx/bapi_eh_disp_hdr.

         LOOP AT eventhandlerheaders INTO ls_hdr.
           LOOP AT controlparameters INTO ls_ctrl WHERE eh_guid = ls_hdr-eh_guid

                                                                           and param_name = 'ZVEHICLE_TYPE'.
      
               "--here use the counter for multiple entries
               "  and modify/delete the entries for your control params.
          
           ENDLOOP.
         ENDLOOP.

    Above code is just an idea and please modify it to your needs and also check for performance.

    Thanks,

    Vishnu

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 18, 2016 at 07:25 PM

    Hi Sudhan,

    The vehicle type when it updates you can control through ruleset to update only one time instead of many times.  Can you check these rule sets PARAMETER_CHANGE 649525 - New Activity - ACT_CHANGE_PARAM and PARAMETER_CHANGE_NEW  1890458 - New activity method to update system parameters .

    If you still want to fetch first or latest parameter value in detail view, then you can check this BADI /SAPTRX/BADI_WDA_UI -> /SAPTRX/IF_BADI_WDA_UI->  AFTER_SEARCH_BAPI.


    Regards
    GGOPII

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sudhan,

      As I mentioned earlier, you can use this BADI /SAPTRX/BADI_WDA_UI -> Interface /SAPTRX/IF_BADI_WDA_UI-> Method AFTER_SEARCH_BAPI to implement the logic.


      Vishnu is already posted for you now.  If doesn't work then let's know.


      Regards


      GGOPII