Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic determination of function text for function code

Former Member
0 Likes
810

Hi there,

i have coding that logs all the function codes pressed in a report, that function codes are defined in the GUI Status or dynamic created in a toolbar.

In my log i have now all the function codes, but it would be better if i also have the function text of theese function codes. Is there any chance to get the function text for a given function code?

E.G. user pressed Button "Refresh" , i log the function code "REFR", but i also want to have the text "Refresh". Is that possible?

Thanks

Steffen

7 REPLIES 7
Read only

Former Member
0 Likes
775

Hi,

You can give text description for button in GUI Status.

Just double click on Refresh icon in GUI Status in Apllication tool bar and give name next to icon Text save and activate.

BR

Dep

Read only

0 Likes
775

Hi,

yes that's clear. There are function codes defined in the GUI status and they have function texts. But the problem i have is, that i don't know theese texts when im logging the executed function during runtime of the report. At the place where i log these exectuted functions, i only have the function code. That could be any function code taht is possible in the report. And i want to have the function text for that function code during runtime. Is that possible?

regards

Steffen

Read only

0 Likes
775

Hi steffen,

try

CALL FUNCTION 'RS_CUA_INTERNAL_FETCH'
        EXPORTING
          PROGRAM         = PV_NAME
          LANGUAGE        = FS_LANGU
        IMPORTING
          ADM             = FS_ADM
        TABLES
          STA             = T_STA
          FUN             = T_FUN
          MEN             = T_MEN
          MTX             = T_MTX
          ACT             = T_ACT
          BUT             = T_BUT
          PFK             = T_PFK
          SET             = T_SET
          DOC             = T_ATRT
          TIT             = T_TIT
          BIV             = T_BIV
        EXCEPTIONS
          NOT_FOUND       = 1
          UNKNOWN_VERSION = 2
          OTHERS          = 3.

Regards

Clemens

Read only

0 Likes
775

Thank's Clemens, yes that works for function codes defined in the GUI status. But unfortunatellly not for functions defined in a toolbar control. but thank's anyway

Read only

0 Likes
775

Yes, Steffen,

I had this in mind, also the fuction will never return dynamic texts set at runtime. The (ALV) toolbar stores the text in attribute MT_TOOLBAR of the grid object. For class CL_GUI_TOOLBAR I don't know if the texts are available. You could try to access them in the handler.

Regards

Clemens

Read only

0 Likes
775

One thing you could have done to access the text of the dynamic toolbar buttons, since the MT_TOOLBAR table is not accesible in the USER_COMMAND event handler, is to store a copy of the MT_TOOLBAR in memory using an Internal table when the custom dynamic buttons are created in the TOOLBAR event handler, so in this case, once you have the UCOMM you can access this global table to get the description text.

Read only

0 Likes
775

Hi Jose,

this is a good idea, in combination with the function module that was posted by clemens, i will get all function codes and descriptions.

Thank you very much!