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

Problem Triggering Start of Selection

Former Member
0 Likes
4,845

Hi Experts,

          I have a selection screen with a button, when I click the button I want Start of Selection to be triggered. I dont want to use the execute button, Instead I want it to be done using a push button.

Please Help

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,281

Are you asking for SELECTION-SCREEN PUSHBUTTON, just assign user-command ONLI to the button.

TABLES: sscrfields.

SELECTION-SCREEN PUSHBUTTON 2(50)  pbu1 USER-COMMAND onli VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

  CALL FUNCTION 'ICON_CREATE'

    EXPORTING

      name   = 'ICON_CHECKED'

      text   = 'Your text'

      info   = 'Your quick info'

    IMPORTING

      RESULT = pbu1

    EXCEPTIONS

      OTHERS = 0.

START-OF-SELECTION.

  WRITE: / 'Hello World!'.

Regards,

Raymond

Are you asking for SELECTION-SCREEN PUSHBUTTON, just assign user-command ONLI to the button.

TABLES: sscrfields.

SELECTION-SCREEN PUSHBUTTON 2(50)  pbu1 USER-COMMAND onli VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

  CALL FUNCTION 'ICON_CREATE'

    EXPORTING

      name   = 'ICON_CHECKED'

      text   = 'Your text'

      info   = 'Your quick info'

    IMPORTING

      RESULT = pbu1

    EXCEPTIONS

      OTHERS = 0.

START-OF-SELECTION.

  WRITE: / 'Hello World!'.

Regards,

Raymond

9 REPLIES 9
Read only

Former Member
0 Likes
3,281

Hi prthk,

sy-ucomm 'ONLI' means the user has pressed Execute button .using case stmt you can solve this issue.

START-OF SELECTION.

case sy-ucomm.

when 'ONLI' .

......

WHEN 'PUSHBUTTON FUNCTION CODE'

perform get_data.

perform display.

........

ENDCASE.



Read only

Former Member
0 Likes
3,281

Hi Prthk,

           Create your own PF-status and use as below in your program.

INITIALIZATION.

SET PF-STATUS 'ZTEST'.

Create a button and assign the Function code for the button as ONLI. 


Regards,

Vikram



Read only

Former Member
0 Likes
3,281

Hi,

      create your own pf status at either initialization or at selection-screen output event

dont use ''ONLI' OR 'WB_EXEC'. using pfstatus means customizing pushbutton and create your own function code.

case sy-ucomm.

when 'EXECUTE'.

PERFORM GET_DATA. [jst for example].

when you press your own pushbutton then sy-ucomm hold its function code which you alrady created......

hope your problem will be solved........ if yes then close your thread according to SCN rules and engagement............

Thanks

Sabyasachi

Read only

0 Likes
3,281

Thanks for your reply. But I will have to trigger Start-of -selection because i'm trying to do a database operation for which code is in start-of-selection, can you please tell me a way to trigger it.

Read only

0 Likes
3,281

Hi Prthk,

In start of selection event also you can use sy-ucomm. Just add this code.

If sy-ucomm = 'ENTER'.

  endif.

Please do let us know if your issue is not solved.

Regards

Purnand Dhingra

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,282

Are you asking for SELECTION-SCREEN PUSHBUTTON, just assign user-command ONLI to the button.

TABLES: sscrfields.

SELECTION-SCREEN PUSHBUTTON 2(50)  pbu1 USER-COMMAND onli VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

  CALL FUNCTION 'ICON_CREATE'

    EXPORTING

      name   = 'ICON_CHECKED'

      text   = 'Your text'

      info   = 'Your quick info'

    IMPORTING

      RESULT = pbu1

    EXCEPTIONS

      OTHERS = 0.

START-OF-SELECTION.

  WRITE: / 'Hello World!'.

Regards,

Raymond

Read only

3,281

Other solution : assign another function code to the pushbutton, and in AT SELECTION-SCREEN if  sscrfields-ucomm = your function code, perform some work and change its value to ONLI.

Regards,

Raymond

Read only

0 Likes
2,271

Thanks for "change its value to ONLI". You saved my day!

Read only

Former Member
0 Likes
3,281

Hi,

     initialization, at selection-screen, start-of-selection etc are event blocks executed by run-time environment automatically. You cant change the sequence or jump between blocks by youself, but can try the various methods that people have mentioned in above replies.

thank you.