Skip to Content
author's profile photo
Former Member

Report with Selection screen

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    author's profile photo
    Former Member
    Sep 29, 2005 at 02:59 PM

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

    then I want to treat the user action

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo
    Former Member
    Sep 29, 2005 at 02:52 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 29, 2005 at 02:53 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 02:57 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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,

  • author's profile photo
    Former Member
    Sep 29, 2005 at 04:17 PM

    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

    Add comment
    10|10000 characters needed characters exceeded