‎2011 Aug 05 12:43 PM
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
‎2011 Aug 05 1:04 PM
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
‎2011 Aug 05 1:12 PM
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
‎2011 Aug 05 1:36 PM
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
‎2011 Aug 05 1:58 PM
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
‎2011 Aug 05 2:18 PM
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
‎2011 Aug 05 4:18 PM
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.
‎2011 Aug 08 7:08 AM
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!