Application Development 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: 

Special button type

0 Kudos

Hi everybody!

I would like to learn how can I create a selection screen with these kind of buttons, as far as I know, they are not created as usual PARAMETERS or SELECT-OPTIONS...

I really appreciate any help!

Thanks 🙂

1 ACCEPTED SOLUTION

amy_king
Active Contributor

Hi Violeta,

You can create a pushbutton on a selection screen with the syntax

SELECTION-SCREEN PUSHBUTTON position(length) button_text
                 USER-COMMAND command
                 MODIF ID mid.

In the INITIALIZATION event, you can set an icon to the pushbutton

CALL FUNCTION 'ICON_CREATE'
  EXPORTING
    name = icon_okay
  IMPORTING
    result = button_text
  EXCEPTIONS
    OTHERS = 0.

And handle its USER-COMMAND in the AT SELECTION-SCREEN event. Here is the documentation.

Cheers,
Amy

7 REPLIES 7

kiran_k8
Active Contributor

amy_king
Active Contributor

Hi Violeta,

You can create a pushbutton on a selection screen with the syntax

SELECTION-SCREEN PUSHBUTTON position(length) button_text
                 USER-COMMAND command
                 MODIF ID mid.

In the INITIALIZATION event, you can set an icon to the pushbutton

CALL FUNCTION 'ICON_CREATE'
  EXPORTING
    name = icon_okay
  IMPORTING
    result = button_text
  EXCEPTIONS
    OTHERS = 0.

And handle its USER-COMMAND in the AT SELECTION-SCREEN event. Here is the documentation.

Cheers,
Amy

Thank you very much for your answer, that was helpful.

Hello,

I guess the screenshot you have mentioned is from SPRO. If so that is not a selection screen. That is a list output obtained from STREE concept. If you are looking to display these icons in list output, the below code can be used.

INCLUDE <icon>.
WRITE: / icon_display AS ICON HOTSPOT, icon_execute_object AS ICON HOTSPOT.
AT LINE-SELECTION.
  DATA: cursor(20) TYPE c.
  GET CURSOR FIELD cursor.
  CASE cursor.
    WHEN 'ICON_DISPLAY'.
      WRITE: 'display'.
    WHEN 'ICON_EXECUTE_OBJECT'.
      WRITE: 'execute'.
  ENDCASE.

If you were requirement was in selection screen then please ignore my comment.

Regards,

Aswath.

Hi, it is the idea I was looking for. I'm trying to mimic the SPRO menu but from a report, let's say.

Thank you very much for your answer.

former_member186746
Active Contributor

Hi,

You can find many examples with ABAP code in transaction DWDM There look for tree controls.

Kind regards, Rob Dielemans

0 Kudos

Thank you very much, This will be so helpful in many occasions.

🙂