Skip to Content
avatar image
Former Member

Input Field range in screen painter

Presently using Screen painter for designing Selection screen. Single input field I can cretae just by selecting input/output field option.

But if I want range or multiple options for input field how to define that. In normal coding we use selection-options for this purpose.

pls help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

10 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 05, 2005 at 04:36 AM

    One thing more. I'm sure that you cannot define a select-options on your screen using the screen-painter.

    If you want to have some other elements on your screen besides the selec-options which you want to design using the screen-painter, then your only option is to use a subscreen and call a selection-screen into that.

    Regards,

    Anand Mandalika.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 05, 2005 at 04:34 AM

    Hello Anupama,

    In my experience, I have never designed a selection-screen with the screen-painter. I'm not even sure if it is correct to do so.

    Is there any compelling reason why you cannot define your selection-screen using the program ?

    Regards,

    Anand Mandalika.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 05, 2005 at 05:00 AM

    Hi,

    The best way is to use selection screen.

    In screen painter,use a table control with columns high,low,sign,option.

    Then you can use it as select-option

    if you are entering all the values for those fields.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jayanthi,

      What is the point in asking the user to enter the values for sign and option? The reason why the select-option is desirable is that it hides such technical details from the user. It is only the programmer who needs to be concerned with these details.

      It is important that we think about making sense with our solution, <i>instead of just being bent on making it work</i>.

      Regards,

      Anand Mandalika.

  • avatar image
    Former Member
    Jul 05, 2005 at 10:32 AM

    hI Anand,

    THANKS for ur prompt replies. I think there is some confusion. what i wanted to ask is how one can define range or multiple options in screen using Screen Painter.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 20, 2009 at 12:24 PM

    Hi,

    You cant create input field with ranges in Screen Painter. So Create a Sub screen in that Particular Screen and Define that Sub Screen in Program with Selection option.

    Use the Below Code.

    *** In Main Prg Define the Subscreen
    SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
    SELECT-OPTIONS : so_matnr FOR matnr.
    SELECTION-SCREEN END OF SCREEN 300 .
    
    *** Put code in PBO and PA1 of screen 100
    
    PROCESS BEFORE OUTPUT.
     MODULE STATUS_0100.
     call subscreen sub_1 including sy-repid '0300'.
    
    
    PROCESS AFTER INPUT.
     CALL SUBSCREEN sub_1.
     MODULE USER_COMMAND_0100.
    

    Hope it will Useful For You.

    with Regards

    Kesavaperumal

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 20, 2009 at 12:27 PM

    Define a sub-screen selection screen and include it in your dynpro

    - SAP documentation at [Selection Screens as Subscreens (link)|http://help.sap.com/saphelp_nw04/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/frameset.htm]

    - multiple threads at sdn - [search forums (link)|http://forums.sdn.sap.com/search.jspa?q=selection-screensubscreenmodule]

    - [search wiki (link)|http://wiki.sdn.sap.com/wiki/dosearchsite.action?searchQuery.queryString=selection-screensubscreenmodule&searchQuery.spaceKey=conf_global] for samples

    NB: COMPLEX_SELECTIONS_DIALOG is useful for dynamic selections.

    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 20, 2009 at 12:27 PM

    Hi anya,

    Alexandr's idea will work although it is not exactly what you want.

    It should be possible to define a subscreen area in your field. This subscreen should be called at PBO and PAI. The subscreen itself can be defined anywhere in the program coding as

    SELECTION-SCREEN BEGIN OF SCREN nnn AS SUBSCREEN.
    SELECT-OPTIONS: ...
    SELECTION-SCREEN END OF SCREN nnn.

    To be honest: I did not try myself but I do not see any reason why it should not work.

    Let us know if (or why it does not) work .

    Regards,

    Clemens Li

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 20, 2009 at 12:37 PM

    Hi Anya,

    As per your requirement SAP dont have any selec-option kind of scenario for screen painter. You can achieve it by calling

    subscreen like the example given above , Or another techniq is you can design the screen like a selection screen.

    just take two text box and a pushbutton beside it . Arrange it in a same way like select-option. Then in PAI of your program

    write the code for the pushbutton like below :

    DATA: BEGIN OF rtab OCCURS 0,

    sign(1) TYPE c,

    option(2) TYPE c,

    low LIKE LQUA-LGTYP,

    high LIKE LQUA-LGTYP,

    END OF RTAB.

    TAB_FIELD-FIELDNAME = 'LGTYP'. "Your field , here in example it is LGTYP

    TAB_FIELD-TABLENAME = 'LQUA'.

    CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG' "This function module will call the same window for range that we see in

    EXPORTING "select option

    TITLE = ' '

    TEXT = 'Storage Types'

    • SIGNED = 'X'

    • LOWER_CASE = ' '

    • NO_INTERVAL_CHECK = ' '

    • JUST_DISPLAY = ' '

    • JUST_INCL = ' '

    • EXCLUDED_OPTIONS =

    • DESCRIPTION =

    • HELP_FIELD =

    • SEARCH_HELP =

    TAB_AND_FIELD = TAB_FIELD

    TABLES

    range = RTAB " Range table, it will automatically getas populated, structure

    EXCEPTIONS " Described above.

    NO_RANGE_TAB = 1

    CANCELLED = 2

    INTERNAL_ERROR = 3

    INVALID_FIELDNAME = 4

    OTHERS = 5

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    DATA:LAST TYPE SY-TABIX.

    DESCRIBE TABLE RTAB LINES LAST.

    IF NOT rTAB[] IS INITIAL.

    • Read the very first entry of the range table and pass it to

    • dynpro screen field

    READ TABLE rTAB INDEX 1.

    IF sy-subrc = 0.

    P_LGTYP1 = rTAB-low.

    ENDIF.

    READ TABLE RTAB INDEX LAST.

    IF sy-subrc = 0.

    P_LGTYP1U = rTAB-LOW.

    ENDIF.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 20, 2009 at 12:42 PM

    Hi

    You need to create a container for Subscreen in your screen layout .

    Regards

    Rahul

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 03, 2013 at 11:36 AM

    Hi ,

          You mean you need to design a select option in a screen painter.  I have tried to do this and was successful . You need to create 2 i/o fields in screen painter.

    eg.   designing select-option for material . create a text field name Material and then 2 i/o fields to its right as u see in select-options. Set the property of the i/o fields with name = LOW and HIGH respectively .  If you want u can give search help too for this fields .

    Now in PAI  use " Material  BETWEEN LOW  AND  HIGH "  as per your requirement.

    Regards,

    Lohit.

    Add comment
    10|10000 characters needed characters exceeded