2006 Jun 23 9:53 AM
hi,
I want to use the dual functionality of the "Display to Change" button on the apllication toolbar, ie: when i click it the first time i should display a set of fields and when i click it again, another set of fields should appear. Subsequent clicking of the button should alternate between display of the two sets of fields.
Thanks,
Sruthy
2006 Jun 23 10:08 AM
Hi,
You can use a variable like data : DISPLAY(1) value 'X'.
in PAI you can control DISPLAY flag.
*PAI
if display eq 'X'.
display = space.
else.
display = 'X'.
endif.
*PBO
if DISPLAY eq 'X'.
loop at screen.
screen-input = 0.
modify screen.
endloop.
else.
loop at screen.
screen-input = 1.
modify screen.
endloop.
endif.
regards
ibrahim
2006 Jun 23 10:09 AM
Create the desired button on the application toolbar and for the SY-UCOMM value assigned for this button in the PF-STATUS modify the screen fields into display or change on an alternate basis in the screen flow logic.
One other option would be to use two different buttons than one.Then the job will be much easier.
2006 Jun 23 10:17 AM
hi,
Declare a flag flag_display and initialize it to 'X'.
on button click, you can check this flag and if it is 'X' then do the processing for display.
And in the last, change the flag.
So in PBO,
1. check the flag.
2. if it is display, loop at screen modify the screen with display settings.
3. if it is not display, loop at screen modify the screen with change settings.
4. Change the flag to X if it is clear elseif it is marked as X then clear it.
if v_abc = 'X',
clear v_abc.
else.
v_abc = 'X'.
endif.
Hope this solves your purpose.
Regards,
Richa
2006 Jun 23 5:29 PM
Hi,
I am assuming you require this for module pool program.
Create two internal tables : for 1st set of buttons(1st pf status) and 2nd set of buttons (2nd pf status).
eg.
it_first-value = 'Button1'.
append it_first.
it_first-value = 'Button2'.
apppend it_first.
it_second-value = 'Button3'.
append it_second.
it_second-value = 'Button4'.
append it_second.
Now do as follows :-
if ok_code = 'Toggle'.
set pf-status 'ZPF' excluding it_first.
else.
set pf-status 'ZPF' excluding it_second.
endif.
Create a pf status with all 4 buttons ( buttons1 to buttons4).
Best regards,
Prashant
2006 Jun 23 7:00 PM
Use two buttons in the GUI Status.
Set a variable to track (Display or Change).
In the PBO section, use the EXCLUDING option for SET PF-STATUS.
Only show one button at a time based on the variable.
In the PAI section, set the variable based on the ok_code.
Something like...
data: gv_mode(1) type c.
data: begin of gt_status occurs 5,
fcode(4) type c,
end of gt_status.
.....
gv_mode = 'D'.
.....
PBO...
refresh gt_status.
if gv_mode = 'D'.
gt_status-fcode = 'ZDIS'.
append gt_status.
set pf-status 'MAIN' excluding gt_status immediately.
elseif gv_mode = 'C'.
gt_status-fcode = 'ZCHG'.
append gt_status.
set pf-status 'MAIN' excluding gt_status immediately.
endif.
PAI...
ok_code_save = ok_code.
clear ok_code.
case ok_code_save.
when 'ZDIS'.
gv_mode = 'D'.
when 'ZCHG'.
gv_mode = 'C'.
endcase.