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

Customized Button code not working on selection screen.

Former Member
0 Likes
832

Hello Experts,

I have a button on the selection screen next to Execute button on the Application Tool Bar.

I have written some validations on the button.It was defined on the PF-Status and its funtion text i have given as 'Show'.

But the problem is that the code is not working.When I execute the button,the screen just remains their.

The sy-comm always returns the value of 'UCOM' for whatever even takes place on the screen.The execution of the program does not stops their in debugger.

Can anyone help me with some sample code and also provide the value of sy-ucomm which i should use for the customized button.

Good points will be rewarded.

4 REPLIES 4
Read only

Former Member
0 Likes
577

Hi

First of all you need to set function code of that button in PF status

then write code as

In PAI

caes sy-ucomm

when 'FCODE'.

-


endcase.

Regards

Aditya

Read only

Former Member
0 Likes
577

Hi,

case sy-ucomm.

when 'FCODE'.

<codings>

.

.

.

when 'FCODE2'.

<codings>

.

.

.

endcase.

hope it will help..

Edited by: prabhu p on Jul 21, 2008 12:16 PM

Read only

Former Member
0 Likes
577

hi..

first of all in SET PF-STATUS 'TAB_STATUS'.

in application tool bar create your FCODE button of normal application type.

after that in your PAI write

CASE ok_code.

WHEN 'FCODE'.

hope this will help you.

regards

Lokesh

Read only

Former Member
0 Likes
577

Here is the short program which will show how to do it. You are simply checking for the USER-COMMAND value CHK and changing it to ONLI which is the F8 button, then the START-OF-SELECTION will be fired and you can output the list.

REPORT zyou_0001.

TABLES: sscrfields.

SELECTION-SCREEN PUSHBUTTON 2(10) pbut1 USER-COMMAND chk.

AT SELECTION-SCREEN OUTPUT.

pbut1 = 'Test This'.

AT SELECTION-SCREEN.

IF sscrfields-ucomm = 'CHK'.

sscrfields-ucomm = 'ONLI'.

ENDIF.

START-OF-SELECTION.

DO 10 TIMES.

WRITE:/ sy-index.

ENDDO.

Regards,.

Mohammed