2018 Apr 11 2:40 PM
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 🙂
2018 Apr 11 7:21 PM
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
2018 Apr 11 2:44 PM
2018 Apr 11 7:21 PM
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
2018 Apr 12 9:51 AM
2018 Apr 12 11:16 AM
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.
2018 Apr 12 11:26 AM
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.
2018 Apr 12 12:08 PM
Hi,
You can find many examples with ABAP code in transaction DWDM There look for tree controls.
Kind regards, Rob Dielemans
2018 Apr 12 12:17 PM
Thank you very much, This will be so helpful in many occasions.
🙂