Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8526

Re: Problems of GET_ENTITY&GET_ENTITYSET In Netweaver Gateway Odata

$
0
0

Hello,

          My method has implemented Get_Entity_Set for the entity "WKXCC_USER" and it runs well in the backend if I enter parameter in the " IT_KEY_TAB ",this is my codes of it, Can you help me with this problem?Thanks a lot  ! ^_^

 

method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET.

**TRY.

*CALL METHOD SUPER->/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET

**  EXPORTING

**    IV_ENTITY_NAME           =

**    IV_ENTITY_SET_NAME       =

**    IV_SOURCE_NAME           =

**    IT_FILTER_SELECT_OPTIONS =

**    IT_ORDER                 =

**    IS_PAGING                =

**    IT_NAVIGATION_PATH       =

**    IT_KEY_TAB               =

**    IV_FILTER_STRING         =

**    IV_SEARCH_STRING         =

**    IO_TECH_REQUEST_CONTEXT  =

**  IMPORTING

**    ER_ENTITYSET             =

**    ES_RESPONSE_CONTEXT      =

*    .

** CATCH /IWBEP/CX_MGW_BUSI_EXCEPTION .

** CATCH /IWBEP/CX_MGW_TECH_EXCEPTION .

**ENDTRY.

 

     DATA:

       ls_wkxcc_user        TYPE z_cl_model_provider=>wkxcc_user,

       l_costcenter           TYPE KOSTL,

       ll_costcenter          TYPE KOSTL,

       l_LT_USER_LIST               TYPE STANDARD TABLE OF ZIT_CC_USER,

       wa_LT_USER_LIST              LIKE  LINE OF l_LT_USER_LIST ,

       lt_temp                    TYPE STANDARD TABLE OF  z_cl_model_provider=>wkxcc_user,

       lt_wkxcc_users       TYPE STANDARD TABLE OF  z_cl_model_provider=>wkxcc_user,

       ls_filter_user      TYPE /iwbep/s_mgw_select_option.

 

     DATAls_key_tab  TYPE /iwbep/s_mgw_name_value_pair,

          lv_costcenter    TYPE KOSTL.

FIELD-SYMBOLS:

      <wkxcc_user>       type z_cl_model_provider=>wkxcc_user,

      <key>           type /iwbep/s_mgw_name_value_pair,

*      <so_user>        TYPE /iwbep/s_mgw_select_option,

      <fs_wkxcc_users>    type z_cl_model_provider=>wkxcc_users_t.

 

CREATE DATA er_entityset TYPE z_cl_model_provider=>wkxcc_users_t.

ASSIGN er_entityset->* to <fs_wkxcc_users>.

 

   ls_wkxcc_user-userid = sy-uname.

 

*    read table it_key_tab assigning <key> index 1.

*  l_costcenter = <key>-value.

 

   READ TABLE it_key_tab WITH KEY NAME = 'COSTCENTER' INTO ls_key_tab.

 

   lv_costcenter = ls_key_tab-value.

 

  l_costcenter = lv_costcenter.

 

   call FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

   EXPORTING

     INPUT       =     l_costcenter

   IMPORTING

     OUTPUT      =     ll_costcenter.

 

   call FUNCTION 'Z_GETCOSTCENTER_USERLIST'

     EXPORTING

     USERID        =     'I004218'

     COSTCENTERNOIN        =     ll_costcenter

     TABLES

     ZZ_ZIT_CC_USER    =       l_LT_USER_LIST.

 

 

   loop at l_LT_USER_LIST into wa_LT_USER_LIST.

   ls_wkxcc_user-userid = sy-uname.

   ls_wkxcc_user-userout = sy-uname.

   ls_wkxcc_user-costcenternoin = l_costcenter.

   ls_wkxcc_user-costcenternoout = l_costcenter.

   ls_wkxcc_user-id = wa_LT_USER_LIST-id.

   ls_wkxcc_user-costcenter = wa_LT_USER_LIST-costcenterno.

   ls_wkxcc_user-sapid = wa_LT_USER_LIST-sapid.

   ls_wkxcc_user-USERNAME  = wa_LT_USER_LIST-USERNAME .

   APPEND ls_wkxcc_user to lt_wkxcc_users.

   ENDLOOP.

 

if it_navigation_path is INITIAL.

       loop at lt_wkxcc_users assigning <wkxcc_user>.

 

         append <wkxcc_user> to lt_temp.

       endloop.

   ELSE.

*  READ TABLE IT_FILTER_SELECT_OPTIONS ASSIGNING <so_user> WITH KEY property = 'CcUserDetailinfo'.

       loop at lt_wkxcc_users INTO ls_wkxcc_user .

         APPEND ls_wkxcc_user to lt_temp.

       ENDLOOP.

 

endif.

 

   loop at  lt_temp ASSIGNING <wkxcc_user>.

     append <wkxcc_user> to <fs_wkxcc_users>.

     ENDLOOP.

   endmethod.


Viewing all articles
Browse latest Browse all 8526

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>