SHARE
TWEET

popup medhod example

Olegster Oct 18th, 2019 141 in 240 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. method ZPOPUPWINDOW .
  2.  
  3.  
  4.    DATA lo_nd_role_att TYPE REF TO if_wd_context_node.
  5.    DATA lo_el_role_att TYPE REF TO if_wd_context_element.
  6.    DATA ls_role_att TYPE wd_this->Element_role_att.
  7.  
  8. *  navigate from <CONTEXT> to <ROLE_ATT> via lead selection
  9.    lo_nd_role_att = wd_context->get_child_node( name = wd_this->wdctx_role_att ).
  10.  
  11. *  get element via lead selection
  12.    lo_el_role_att = lo_nd_role_att->get_element( ).
  13.  
  14. *  get all declared attributes
  15.    lo_el_role_att->get_static_attributes(
  16.      IMPORTING
  17.        static_attributes = ls_role_att ).
  18.  
  19. ***********************************************************************
  20. *
  21. " there was description of relationship of roles.
  22.  
  23. **********************************************************************
  24. *********************************************************************
  25.  
  26.  " Преобразование данных под нужный формат
  27.   DATA:
  28.         val_1 type string,
  29.         len type i.
  30.  
  31.   data numb type i VALUE 32.  " Стандартная длина ID роли. Надо подумать как определять динамически
  32.  
  33.     val_1 = ls_role_att-roleid.
  34.     len = strlen( ls_role_att-roleid ) - numb.
  35.     val_1 = substring( val = val_1 off = ( len ) ).
  36.  
  37.     " I had something logic and i used it.
  38. *********************************************************************************************
  39. DATA lt_text TYPE string_table. "string table for append information (some text)
  40. *********************************************************************************************
  41. *********************************************************************************************
  42.  
  43.   types: BEGIN OF ty_role_relat,
  44.             rolename type gracrole-role_name,
  45.             roleid1 type gracrolerelat-roleid1,
  46.             roleid2 type gracrolerelat-roleid2,
  47.             relat_type type gracrolerelat-relat_type,
  48.            end of ty_role_relat.
  49.  
  50.   DATA: lt_join type table of ty_role_relat,
  51.           wa_join like line OF lt_join.
  52.  
  53.  
  54.   APPEND 'Your current role exists into next communicate roles:' to lt_text.
  55.  
  56.   select * from gracrole
  57.     join gracrolerelat
  58.     on gracrole~roleid eq gracrolerelat~roleid1
  59.     where gracrolerelat~roleid2 eq @val_1
  60.     INTO CORRESPONDING FIELDS OF TABLE @lt_join.
  61.  
  62.   data temp_string type string.
  63.   loop at lt_join into wa_join.
  64.     select role_name from gracrole where roleid eq @wa_join-roleid1 into @temp_string.
  65.     ENDSELECT.
  66.     APPEND temp_string to lt_text.
  67.   endloop.
  68.  
  69. *********************************************************************************************
  70.  
  71. *********************************************************************************************
  72. *********************************************************************************************
  73.  
  74.         DATA lo_window_manager TYPE REF TO if_wd_window_manager.
  75.         DATA lo_api_component  TYPE REF TO if_wd_component.
  76.         DATA lo_window         TYPE REF TO if_wd_window.
  77.         DATA lt_buttons        TYPE wdr_popup_button_list.
  78.         DATA ls_canc_action    TYPE wdr_popup_button_action.
  79.  
  80.         lo_api_component           = wd_this->wd_get_api( ).
  81.         lo_window_manager          = lo_api_component->get_window_manager( ).
  82.  
  83.         lo_window = lo_window_manager->create_popup_to_confirm(
  84.         text = lt_text    "some text. Like example information about current role.
  85. *        button_kind = if_wd_window=>co_buttons_yesno
  86.         button_kind = if_wd_window=>CO_BUTTONS_OK
  87.         message_type         = if_wd_window=>co_msg_type_information
  88.         close_button = abap_true
  89.         window_title = 'Message'
  90.         default_button = if_wd_window=>co_button_ok
  91.         ).
  92.  
  93.         lo_window->OPEN( ).
  94.  
  95. endmethod.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top