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

SSCRFIELDS in oops statement

Former Member
0 Likes
1,116

Hi Experts,

Could come one suggest me how do I get push buttons on selection screen application bar making use of sccrfields , but not defining statement TABLES : SSCRFIELDS , as this statement is no longer encouraged in OOPS.

I would like to have the same functionality of getting the push button on selection screen but not using tables statement & PF-STATUS.

Please suggest . Rewards for helpful answer.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
907

Dear Amber,

Instead of using Tables : SSCRFIELDS, try using sy-ucomm(Function Code) as below.

REPORT ZKTEST.

TYPE-POOLS icon.

SELECTION-SCREEN:

BEGIN OF SCREEN 500 AS WINDOW TITLE title,

PUSHBUTTON 2(10) but1 USER-COMMAND cli1,

PUSHBUTTON 12(30) but2 USER-COMMAND cli2

VISIBLE LENGTH 10,

END OF SCREEN 500.

AT SELECTION-SCREEN.

CASE sy-ucomm.

WHEN 'CLI1'.

...

WHEN 'CLI2'.

...

ENDCASE.

START-OF-SELECTION.

title = 'Push button'.

but1 = 'Button 1'.

CALL FUNCTION 'ICON_CREATE'

EXPORTING

name = icon_information

text = 'Button 2'

info = 'My Quickinfo'

IMPORTING

RESULT = but2

EXCEPTIONS

OTHERS = 0.

CALL SELECTION-SCREEN '0500' STARTING AT 10 10.

Regards

Kesava

2 REPLIES 2
Read only

Former Member
0 Likes
908

Dear Amber,

Instead of using Tables : SSCRFIELDS, try using sy-ucomm(Function Code) as below.

REPORT ZKTEST.

TYPE-POOLS icon.

SELECTION-SCREEN:

BEGIN OF SCREEN 500 AS WINDOW TITLE title,

PUSHBUTTON 2(10) but1 USER-COMMAND cli1,

PUSHBUTTON 12(30) but2 USER-COMMAND cli2

VISIBLE LENGTH 10,

END OF SCREEN 500.

AT SELECTION-SCREEN.

CASE sy-ucomm.

WHEN 'CLI1'.

...

WHEN 'CLI2'.

...

ENDCASE.

START-OF-SELECTION.

title = 'Push button'.

but1 = 'Button 1'.

CALL FUNCTION 'ICON_CREATE'

EXPORTING

name = icon_information

text = 'Button 2'

info = 'My Quickinfo'

IMPORTING

RESULT = but2

EXCEPTIONS

OTHERS = 0.

CALL SELECTION-SCREEN '0500' STARTING AT 10 10.

Regards

Kesava

Read only

Former Member
0 Likes
907

Hi

the way to do it:

  • declarations

DATA : l_sel_button TYPE smp_dyntxt.

INCLUDE : <ICON>.

  • selection screen

SELECTION-SCREEN FUNCTION KEY 1.

INITIALIZATION.

l_sel_button-icon_id = icon_hint.

l_sel_button-text = text-v01.

sscrfields-functxt_01 = l_sel_button.

same works for pushbutton, hope this helps

<b>Reward if usefull</b>