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: 

Range options in screen painter

Former Member
0 Kudos

Developed an application in ABAP for employee entitlement. Most of the screens are designed in Screen painter as they has to be run for single Emp. psl no.

But screen for infosystems (2000) is designed using selection-screen as it can be run for single or multiple EMP PSL no.

This infosystems screen is called using " Call selection-screen command'.

Now whenever there is change in program the flow logic of screen 2000 is changed. Now my questions are

- How to call screen 2000 without affecting flow logic.

- How to design screen in screen painter for parameter ranges.

Kindly help as no help is available

thanks

anu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi Vijay,

Thanks a lot for such prompt reply. Now my problem is almost solved.

But still would like to know is there any way around in calling slection screen so that the Flow logic of screen doesn't regenerate with the change of program coding.

If anybody has any idea on this it would a great learning.

Thanks

anu

4 REPLIES 4

former_member188685
Active Contributor
0 Kudos

Hi,

select options in screen check this code..

REPORT  ZTEST_SCREEN                            .
DATA : BEGIN OF IT_DYNPFIELDS OCCURS 3.
        INCLUDE STRUCTURE DYNPREAD.
DATA : END OF IT_DYNPFIELDS.
DATA: TEST(10) TYPE C.
RANGES:  R_UNAME FOR SY-UNAME.
DATA:     V_USERNAME LIKE  SY-UNAME.
DATA : V_PROG LIKE D020S-PROG VALUE 'ZTEST_SCREEN',
       V_DNUM LIKE D020S-DNUM VALUE '0100'.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
  SET PF-STATUS 'TEST'.
*  SET TITLEBAR 'xxx'.

ENDMODULE.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
  CASE SY-UCOMM.

    WHEN 'BACK'.
      LEAVE TO SCREEN 0.

  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*&      Module  GET_CURSOR_USERNAME  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE GET_CURSOR_USERNAME INPUT.

  REFRESH IT_DYNPFIELDS.
  CLEAR   IT_DYNPFIELDS.

  MOVE 'V_USERNAME' TO IT_DYNPFIELDS-FIELDNAME.
  APPEND IT_DYNPFIELDS.
  CLEAR   IT_DYNPFIELDS.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      DYNAME               = V_PROG
      DYNUMB               = V_DNUM
      TRANSLATE_TO_UPPER   = 'X'
    TABLES
      DYNPFIELDS           = IT_DYNPFIELDS
    EXCEPTIONS
      INVALID_ABAPWORKAREA = 1
      INVALID_DYNPROFIELD  = 2
      INVALID_DYNPRONAME   = 3
      INVALID_DYNPRONUMMER = 4
      INVALID_REQUEST      = 5
      NO_FIELDDESCRIPTION  = 6
      INVALID_PARAMETER    = 7
      UNDEFIND_ERROR       = 8
      DOUBLE_CONVERSION    = 9
      STEPL_NOT_FOUND      = 10
      OTHERS               = 11.
  IF SY-SUBRC = 0.
    READ TABLE IT_DYNPFIELDS WITH KEY FIELDNAME = 'V_USERNAME'.
    IF SY-SUBRC = 0.
      V_USERNAME = IT_DYNPFIELDS-FIELDVALUE.
    ENDIF.
  ENDIF.
  PERFORM GET_MULTIPLE.


ENDMODULE.                 " GET_CURSOR_USERNAME  INPUT
*&---------------------------------------------------------------------*
*&      Form  GET_MULTIPLE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM GET_MULTIPLE .
* Dynamically holding Field name
  FIELD-SYMBOLS: <FST> TYPE STANDARD TABLE.
  IF  R_UNAME[] IS INITIAL.
    IF NOT V_USERNAME IS INITIAL.
      R_UNAME-SIGN = 'I'.
      R_UNAME-OPTION = 'EQ'.
      R_UNAME-LOW = V_USERNAME.
      APPEND R_UNAME.
      CLEAR  R_UNAME.
    ENDIF.
  ENDIF.

  ASSIGN R_UNAME[] TO <FST>.
  CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
    EXPORTING
      TITLE             = 'Select Multiple Value'(059)
      TEXT              = 'Finish Group'(058)
      SIGNED            = 'X'
      LOWER_CASE        = ' '
      NO_INTERVAL_CHECK = 'X'
      JUST_DISPLAY      = ' '
      JUST_INCL         = 'X'
    TABLES
      RANGE             = <FST>
    EXCEPTIONS
      NO_RANGE_TAB      = 1
      CANCELLED         = 2
      INTERNAL_ERROR    = 3
      OTHERS            = 4.

  IF SY-SUBRC = 0.
    READ TABLE R_UNAME INDEX 1.
    IF SY-SUBRC = 0.
      V_USERNAME = R_UNAME-LOW.
    ENDIF.
  ENDIF.

ENDFORM.                    " GET_MULTIPLE

Check this thread...

Regards

Vijay

Former Member
0 Kudos

hi Vijay,

Thanks a lot for such prompt reply. Now my problem is almost solved.

But still would like to know is there any way around in calling slection screen so that the Flow logic of screen doesn't regenerate with the change of program coding.

If anybody has any idea on this it would a great learning.

Thanks

anu

0 Kudos

Hello Anupama,

You cannot have a Ranges UI element on a normal screen (using the screen painter). You <i>always have to have a Selection screen</i> (which can be a subscreen).

The PBO and PAI events would be written in the Program Instead of the Flow Logic in SE51.

PBO - AT SELECTION-SCREEN OUTPUT.

PAI - AT SELECTION-SCREEN.

When there are multiple selection screens in your program, the logic is written depending on the screen number (CASE SY-DYNNR).

Regards,

Anand Mandalika.

Former Member
0 Kudos

Thanks a lot, Poornanad.

Problem is fully solved just by providing "Case sy-dynnr" in PAI.

Thanks a ton again.

anu