‎2012 Dec 24 3:46 AM
hi,
i have a button in gui status called validate.. if i need to change the button name to success how can i do that ... i tried many coding from net ..can anyone help me on dis.. with some useful codes..
regards
kaushik
‎2012 Dec 24 5:13 AM
Hi,
For this understand the following example....
In Menu painter, create a function. When asked for the text type, pick 'dynamic' (default is 'static') then press <Green_Tick(TM)>.
This will now open an additional field asking for the placeholder field for the dynamic attributes. Put in a field name (this will then be added by you to the calling ABAP). This field must be of structure SMP_DYNTXT.
In the example below I put in function 'DYN' and fieldname 'DYNAMIC'.
Note, the GUI status will not work with just dynamic functions, so include some statics as well, i.e. 'BACK', 'CANCEL', etc.
This example adds a button to the app toolbar. Each time you click it it cycles through another of 5 options. On options 2 & 4 it removes the icon.
You could change the icon if you wanted to.
report zrps .
data: dynamic type smp_dyntxt.
include <icon>.
initialization.
dynamic-text = 'DynOpt1'.
dynamic-icon_id = icon_check.
dynamic-icon_text = dynamic-text.
dynamic-quickinfo = 'Dynamic option 1'.
start-of-selection.
set pf-status 'LIST'.
write: 'List started...'.
at user-command.
if sy-ucomm = 'DYN'.
translate dynamic-text using '1223344551'.
translate dynamic-quickinfo using '1223344551'.
dynamic-icon_text = dynamic-text.
dynamic-icon_id = icon_check.
if dynamic-text ca '24'.
clear dynamic-icon_id.
endif.
endif.
‎2012 Dec 24 9:47 AM
hi sudheer,
i tried all these it does work.
i have a button name validate and i have given name temp . when i press validate button it does all the validation i.e calculation and other stuffs and when all these things are done . i want the button shud appear as confirm.
pls can u write a logic if possible.
regards
kaushik
‎2012 Dec 26 5:57 AM
could you post a snapshot of your current screen which is having the buttons, so that i can understand your requirement properly....
‎2012 Dec 24 5:48 AM
Hi,
You need to define your button as dynamic.
Define as global :
DATA: st_funckey_1 TYPE smp_dyntxt .
DATA: g_status TYPE abap_bool .
In your PBO:
IF g_status EQ abap_true .
st_funckey_1-icon_id = icon_checked .
st_funckey_1-text = text-i01 .
st_funckey_1-icon_text = text-i01 .
ELSE .
st_funckey_1-icon_id = icon_incomplete .
st_funckey_1-text = text-i02 .
st_funckey_1-icon_text = text-i02 .
ENDIF .
Result
‎2012 Dec 24 6:42 AM
hi eitan,
what is that abap_b001.. m not able to understand that...
regards
kaushik
‎2012 Dec 24 6:47 AM
‎2012 Dec 24 6:53 AM
‎2012 Dec 24 9:48 AM
hi eitan,
what is this icon_check and complete i am getting some error in that.
regards
kaushik
‎2012 Dec 24 9:52 AM
‎2012 Dec 24 8:24 AM
Hi,
Define two gui status, and give the name.
You can run wanted.
Example;
In alv :
i_callback_pf_status_set = w_status
if sy-ucomm = 'FIRSTBUTTON'.
w_status = 'FIRSTSTATUS'.
elseif sy-ucomm = 'SECONDBUTTON'.
w_status = 'SECONDSTATUS'.
endif.
or you can write in initilazion.