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

Report with Selection screen

Former Member
0 Likes
1,208

I have a stupid report.

In the initialization event I have put that

initialization.

set pf-status '123'.

But in the start of selection/at user-command

sy-ucomm is empty ... any idea is welcome

REWARD PROMISED

Message was edited by: STEPHAN KAMINSKI

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,122

I want my report to have a selection screen with some additional button!

then I want to treat the user action

10 REPLIES 10
Read only

Former Member
0 Likes
1,122

Hi

don't use INITIALIZATION event to load a status gui

If you want to load it in selection screen use AT SELECTION-SCREEN OUTPUT, if you want to load it in your list use START-OF-SELECTION. So:

AT SELECTION-SCREEN OUTPUT

set pf-status '123'.

or

START-OF-SELECTION

set pf-status '123'.

Max

Read only

0 Likes
1,122

oK MAX

but i have to put the code then

at user-command or

at selection-screen

to handle the user action!

Read only

Former Member
0 Likes
1,122

Hi Stephan,

you have choosen the wrong event for setting status.

Please use AT SELECTION-SCREEN OUTPUT.

See also http://help.sap.com/saphelp_nw04/helpdata/de/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm

Read only

Former Member
0 Likes
1,122

Stephan - sy-ucomm will be empty until the user presses a PF key or selects a line.

The pf keys have to be defined in status '123'. Double click on it to define it.

Check sy-ucomm at user-command or at line-selection.

Rob

Message was edited by: Rob Burbank

Read only

0 Likes
1,122

Stephen,

Initialization event is not used for setting the PF status. It is basically used for assigning values to variables.

SET PF STATUS is an event which should be used either in

AT SELECTION SCREEN OUTPUT OR

START OF SELECTION

Untill and uliess you click the key the function code will not be copied to the sy-ucomm field.

Thanks,

Read only

Former Member
0 Likes
1,123

I want my report to have a selection screen with some additional button!

then I want to treat the user action

Read only

0 Likes
1,122

THIS IS THE CODE

DATA : BEGIN OF itab OCCURS 0.

INCLUDE STRUCTURE zconvention.

DATA : name1 LIKE lfa1-name1.

DATA : END OF itab.

  • selection-screen.

SELECT-OPTIONS: s_conv FOR zconvention-conv,

s_lifnr FOR zconvention-lifnr,

s_erdat FOR zconvention-erdat,

s_datab FOR zconvention-datab,

s_datbi FOR zconvention-datbi,

s_descr FOR zconvention-descrip,

s_refr FOR zconvention-refr,

s_kostl FOR zconvention-kostl,

s_gest FOR zconvention-gestion,

s_ornam FOR zconvention-ornam,

s_adrs1 FOR zconvention-adrs1,

s_adrs2 FOR zconvention-adrs2,

s_adrs3 FOR zconvention-adrs3,

s_zenga FOR zconvention-zengagm,

s_waers FOR zconvention-waers,

s_montan FOR zconvention-montant,

s_divers FOR zconvention-divers.

AT SELECTION-SCREEN OUTPUT.

SET PF-STATUS '0001' .

AT USER-COMMAND.

break devsopra.

CASE sy-ucomm.

it doesn't work :((((

Read only

0 Likes
1,122

Hi Stephan,

see following code as example for your requirement.

REPORT demo_sel_screen_function_key.

TABLES sscrfields.

PARAMETERS: p_carrid TYPE s_carr_id,
            p_cityfr TYPE s_from_cit.

SELECTION-SCREEN: FUNCTION KEY 1,
                  FUNCTION KEY 2.

INITIALIZATION.
  sscrfields-functxt_01 = 'LH'.
  sscrfields-functxt_02 = 'UA'.

AT SELECTION-SCREEN.
  CASE sscrfields-ucomm.
      WHEN'FC01'.
      p_carrid = 'LH'.
      p_cityfr = 'Frankfurt'.
    WHEN 'FC02'.
      p_carrid = 'UA'.
      p_cityfr = 'Chicago'.
  ENDCASE.

START-OF-SELECTION.
  WRITE / 'START-OF-SELECTION'.

Read only

0 Likes
1,122

SELECTION-SCREEN PUSHBUTTON fmt name USER-COMMAND ucom.

SELECTION-SCREEN FUNCTION KEY <Number>. "This is for displaying in Application Toolbar.

Check the following help documentation..

SELECTION-SCREEN PUSHBUTTON fmt name USER-COMMAND ucom.

Addition: MODIF ID modid.

Effect

Generates a pushbutton on the selection screen. When you define the button, you also define a user command ucom (no inverted commas), up to 20 characters long, which is triggered when the user pushes the button. The rest of the syntax is the same as for SELECTION-SCREEN COMMENT

You can define the name name either statically or at runtime (see also the BEGIN OF BLOCK, COMMENT and SELECTION-SCREEN BEGIN OF SCREEN variants).

When you define a pushbutton, you must always specify a format fmt.

By specifying a Modif ID, you can assign the pushbutton to a modification group.

Notes

The best way of reacting to the pushbutton is in the AT SELECTION-SCREEN event, or, for pushbuttons in the selection include, in the PAI routine (with FNAME = '*' and MARK = SPACE) in the database program SAPDBldb. The field SSCRFIELDS-UCOMM contains the user command ucom. (You need to declare the SSCRFIELDS table using the TABLES statement).

You can create your own pushbuttons in the application toolbar using the FUNCTION KEY n addition.

Within the selectoin include : Additions FOR NODE node ,FOR TABLE dbtab und ID id.

Example

TABLES SSCRFIELDS.

...

SELECTION-SCREEN PUSHBUTTON /10(20) CHARLY USER-COMMAND ABCD.

...

INITIALIZATION.

MOVE 'My text' TO CHARLY.

...

AT SELECTION-SCREEN.

IF SSCRFIELDS-UCOMM = 'ABCD'.

...

ENDIF.

A pushbutton appears on the selection screen with the text 'My text'. In the AT SELECTION-SCREEN event, the field SSCRFIELDS-UCOMM has the contents ABCD after the button has been pushed.

Read only

Former Member
0 Likes
1,122

If you want to use Gui Status in selection screen different from the standard one use FM 'RS_SET_SELSCREEN_STATUS'.

http://help.sap.com/saphelp_nw04/helpdata/en/e7/0eb237e29bc368e10000009b38f8cf/frameset.htm

Svetlin