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

push button in application tool bar

Former Member
0 Likes
1,811

Hi All ,

i have a requirment on module pool.

i.e. keep one push button in application tollbar, if once select the push buttonn fields should be in change mode again select the same push button the fields should be in display mode.

how can it posible please tell me................

thanku,

Rohini

8 REPLIES 8
Read only

Former Member
0 Likes
1,257

Hi,

use set pf-status 'XYZ'.

In this u can create buttons for processing.

Read only

Former Member
0 Likes
1,257

Hi,

You can use SET PF-STATUS command to create your own status and you can add push buttons in that status. After adding you can place the code using AT USER-COMMAND and SY-UCOMM .

Regards

Harris

Read only

0 Likes
1,257

hi

i created set pf-status and cteated push butoton in application tool bar.

but i can use that one push button to two different actions, i.e. change and display.

that is my problem

please help on that one.

Thanks

Rohini

Read only

0 Likes
1,257

Hi,

Create two buttons CHANGE and DISPLAY

if condition

set pf-status 'XYZ' excluding 'CHANGE' immediately.

else.

set pf-status 'XYZ' excluding 'DISPLAY' immediately.

endif.

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
1,257

Hi,

Write the below code in pbo.

" Define a variable wa_fcode in top include 
  " Data : wa_fcode(10).
Case ok_code.
when 'FCODE'
wa_fcode = ok_code.
" This is for input Disable
loop at screen.
if screen-name = 'SCREENNAMES'.
screen-input = 0.
modify screen.
endloop.
endcase.

" This is for input enble
if wa_fcode = 'FCODE' "------function code of button in Application tool baar.
clear wa_fcode.
loop at screen.
if screen-name = 'SCREENNAMES'.
screen-input = 1.
modify screen.
endloop.
endif.

Thanks & Regards

Always Learner

Read only

Former Member
0 Likes
1,257

Hi,

do like this..

data:

w_flag type i value 1.

set pf-status 'GUI'.

*Just double click on GUI and crete u r own button.

at user-command.

case sy-ucomm.

when 'PushButton'.

if w_flag eq 1.

perform change.

w_flag = w_f;ag + 1.

else.

perform change.

endcase.

Regards

Kiran

Read only

Former Member
0 Likes
1,257

Hi,

Try this...

Suppose the textboxes that you want to enable or diable are txt1 and txt2. Assue that when the program runs for the first time both are enabled. In the PBO of the screen under module

if sy-ucomm = 'CHANGE'.

if flag = 1.

loop at screen.

if screen-group1 = '111'.

screen-input = 0.

modify screen.

endif.

endloop.

flag = 0.

else.

loop at screen.

if screen-group1 = '111'.

screen-input = 0.

modify screen.

endif.

endloop.

flag = 1.

endif.

endif.

both the textboxes must be assigned group1 as 111 in design mode (just double click on the element and on the element attribute enter 111 in the first group box.).

When you press CHANGE it will check the value of flag and accordingly change (enable/disable) and everytime it will toggle as the value of flag is changed.

Hope this helps.

Regards,

Sachin

Read only

Former Member
0 Likes
1,257

Hi,

Use the below logic,

Say for example your field name is field and fcode of pbutton is PUSHBUTTON.

CASE ok_code
when 'PUSHBUTTON'.
    LOOP AT SCREEN.
      IF screen-name = 'FIELD'.
        IF screen-input = 1. " If it is 1
          screen-input = 0. " change it to 0
        ELSE. "Else if it is 0
          screen-input =  1. "Change it to 1
        ENDIF.
        MODIFY SCREEN.
      ENDIF.
      ...
  ENDCASE.

Regards,

Manoj Kumar P