cancel
Showing results for 
Search instead for 
Did you mean: 

Get View name from Navigational Link ID

Former Member
0 Kudos

Hi All!

In runtime I have the navigational link ID, and from this I want to get the target view name. Is it possible somehow?

Maybe to load the repository.xml, and read the target view from it. Are there any handle class with which the repository xml can be processed?

Thanks for your help.

Regards,

Attila

Accepted Solutions (1)

Accepted Solutions (1)

JerryWang
Advisor
Advisor
0 Kudos

Hi Attila,

In the past I have written one report which can parse the runtime repository information of given UI component into ABAP internal table. Then you can extract anything you want from that internal table.

However, if you are working on cross component navigation you can not get the target view name directly from navigation link since this kind of navigation is done with help of navigation object. Please find source code of my report below. You can of course wrap it into your utility class.

Best regards,

Jerry

PARAMETERS: name TYPE O2APPLNAME DEFAULT 'SMCHS'.

types LTYPE_VIEWLINE type CL_BSP_WD_REP_VIEW=>GTYPE_VIEWLINE .
types:
    begin of GTYPE_OP_MAPPING,
             NAME type STRING,
             OP_PLUG type STRING,
             SWITCH_ID    type SFW_SWITCH_ID,
             REACTION     type SFW_SHOWHIDE,
           end of GTYPE_OP_MAPPING .

types:
    begin of GTYPE_IP_FOLLOW_UP,
             NAME type STRING,
             NAVLINK type STRING,
             SWITCH_ID    type SFW_SWITCH_ID,
             REACTION     type SFW_SHOWHIDE,
           end of GTYPE_IP_FOLLOW_UP .

types:
    begin of GTYPE_NAVLINK,
               NAME         type STRING,
               TARGETS_DONE type FLAG,
               TARGETS      type TBSP_WD_REP_NAVIGATION_TARGETS,
               SFW_DATA     type BSP_WD_SFW_DATA boxed,
             end of GTYPE_NAVLINK .

types:
    begin of GTYPE_VIEWLINE,
               VIEW              type STRING,
               ACTIVE            type ABAP_BOOL,
               VIEW_ID           type N length 4,
               PARENT_VIEWSET    type STRING,
               PARENT_VIEWAREA   type STRING,
               PARENT            type ref to CL_BSP_WD_REP_VIEW,
               INITIALS          type TBSP_WD_REP_VIEWAREA_ASSIGNS,
               INITIALS_DONE     type ABAP_BOOL,
               NAVLINKS          type sorted table of GTYPE_NAVLINK
                                      with non-unique key NAME
                                      initial size 0,
               REP_VIEW          type ref to CL_BSP_WD_REP_VIEW,
               IS_WINDOW         type ABAP_BOOL,
               IS_INTF_VIEW      type ABAP_BOOL,
               IS_DEFAULT_WINDOW type ABAP_BOOL,
               IP_FOLLOW_UPS     type hashed table of GTYPE_IP_FOLLOW_UP
                                      with unique key NAME
                                      initial size 0,
               OP_MAPPINGS       type hashed table of GTYPE_OP_MAPPING
                                      with unique key NAME
                                      initial size 0,
               SFW_DATA          type BSP_WD_SFW_DATA boxed,
      end of GTYPE_VIEWLINE .

types:
    LTYPE_VIEW_TAB type hashed table of LTYPE_VIEWLINE
                               with unique key VIEW ACTIVE
                               initial size 0 .

data:   LV_LOADER type ref to CL_BSP_WD_STREAM_LOADER,
        LV_XML    type STRING,
        lv_root   type string.

  create object LV_LOADER.
  LV_XML = LV_LOADER->LOAD_FROM_BSP_PAGE( IV_BSP_APPL                 = name
                                          IV_BSP_PAGE                 = 'Repository.xml' ). "#EC NOTEXT

data:   LT_VIEWS  type LTYPE_VIEW_TAB,
        LT_USAGES type BSP_WD_CMP_USAGE_DESCR_TAB,
        result TYPE REF TO CL_BSP_WD_REPOSITORY.

* "parse" repository xml data directly into memory
  call transformation BSP_WD_RT_REP_RUNTIME
    source xml        lv_xml
    result VIEWS    = LT_VIEWS
           ROOTVIEW = lv_root
           USAGES   = LT_USAGES.

Former Member
0 Kudos

Hello Jerry!

Thank you very much. This was exactly what I was looking for.

Thanks Leon also for the answer. I just wanted to know the the target view name from the navigational links, to save it to my custom table for a special customer claim.

Answers (1)

Answers (1)

0 Kudos

Hi Attila,

Could you please elaborate on your requirement? Why do you need this?

Thanks & Best Regards,

Leon