cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Vishnu,

Thanks for your reply.

My requirement is to control only in EM UI to display only one value in detail section, to make sure nothing is changed in the Event handler and its corresponding postings/tables which we want to update as it is with same value and different indexes for this parameter.  below is the situation as per the requirement.

a) in EH_List like how the values are getting updated for event handler type (as an example) :

(we don't want to modify this, to make sure to keep the same as it is updated)

Parameter name                       Parameter value                            Index

ZCntrl_Vehicle_type                             TRUCK                               3432424


ZCntrl_Vehicle_type                             TRUCK                               3432425


ZCntrl_Vehicle_type                             TRUCK                               3432426

b)  EM UI : ( this is what we want change to display only value i.e TRUCK in detail section for vehicle type.

As is case (detail section) :     

Vehicle Type : TRUCK

                        TRUCK

                        TRUCK

To be case (detail section):

Vehicle Type : TRUCK  ( to control for display  only one value in EM UI for vehicle type).

Please let me know the method name in EM UI BADI and sample code snippet or logic for the same.

Regards

Sudhan

Former Member
0 Kudos

Hi Sudhan,

This sample code (Badi method: AFTER_SEARCH_BAPI) will work and it will not delete entries from the backend. It just deletes from UI screen and that's what you wanted.

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

     LOOP AT eventhandlerheaders INTO ls_hdr.
       CLEAR lv_cnt.
       LOOP AT controlparameters INTO ls_ctrl WHERE eh_guid = ls_hdr-eh_guid
           AND param_name = 'ZCNTRL_VEHICLE_TYPE'.
         lv_cnt = lv_cnt + 1.
         IF lv_cnt GT 1.
           DELETE controlparameters INDEX sy-tabix.
         ENDIF.

       ENDLOOP.
     ENDLOOP.

former_member190756
Active Contributor
0 Kudos

Hi Sudhan,

you can also try in the configured field customizing: /n/SAPTRX/UCCF

If you enter here 1 only one entry is displayed but the user also gets a more link to see all values.

To really hide other values completely the BADI solution is the only way.

Best regards,

Steffen

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Gopi,

I want to control only in EM UI to display only one value among multiple values for the same parameter with different indexes, only to display perspective in front end to show the user with only one value, i.e TRUCK. not to display the same value multiple times, i.e TRUCK  TRUCK TRUCK etc.

I want to remain the same in the backend tables in event handler as it is should not change anything.

As you said If I change something in Ruleset how that will affect in EM UI at front end, rule set which change the business logic to update backend tables, which I dont want to happen.

Kindly share if you have any sample logic or code how this change be achieved in EM UI via BADI in after search method.

Thanks

Sudhan

Former Member
0 Kudos

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