Generate Selection Screen as Popup dynamically

Hello to all,
is there a way to generate a selection screen popup at runtime dynamically?
Is there any guide, that explains how "generate dynpro" has to be used?
Thanks
Christian

Hello Oliver,
sorry that i didn't update this thread. I tried the way you described above and it works. Sometimes I get short dumps in the shared memory block. I didn't solve this yet.
I post you my code below:
  DATA la_dssfield TYPE /XXX/zssys_dssfield.
  CLEAR: wa_code, it_code.
  CLEAR: Ranges.
  wa_code = '*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'.
  APPEND wa_code TO it_code.
  wa_code = '*!!!!!! Generated program. Do not change anything!!!!'.
  APPEND wa_code TO it_code.
  wa_code = '*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'.
  APPEND wa_code TO it_code.
  wa_code = 'REPORT /XXX/ZSYS_GENSELSCREEN.'.
  APPEND wa_code TO it_code.
**** Generate Tables Section
  DATA lt_tmp_dssfield TYPE /XXX/ztsys_dssfield.
  lt_tmp_dssfield[] = it_dssfield[].
**** Delete Parameters
  DELETE lt_tmp_dssfield WHERE basictype EQ 'P'.
**** Delete Duplicates
  SORT lt_tmp_dssfield BY reftable.
  DELETE ADJACENT DUPLICATES FROM lt_tmp_dssfield COMPARING reftable.
**** Generate Tables Code
  LOOP AT lt_tmp_dssfield INTO la_dssfield.
    CONCATENATE 'TABLES' la_dssfield-reftable '.' INTO wa_code SEPARATED BY space.
    APPEND wa_code TO it_code.
  ENDLOOP.
**** Build Selection Screen
  DATA: l_tabix(10) TYPE c,
        l_type(128) TYPE c,
        l_desc(10) TYPE c.
  LOOP AT it_dssfield INTO la_dssfield.
    l_tabix = sy-tabix.
    CONDENSE l_tabix.
    wa_code = 'SELECTION-SCREEN BEGIN OF LINE.'.
    APPEND wa_code TO it_code.
    CONCATENATE 'SELECTION-SCREEN COMMENT 1(32) cmt' l_tabix '.' INTO wa_code.
    APPEND wa_code TO it_code.
    CONCATENATE la_dssfield-reftable la_dssfield-reffield INTO l_type SEPARATED BY '-'.
    CASE la_dssfield-basictype.
      WHEN 'P'.
        CONCATENATE 'PARAMETERS' la_dssfield-fieldname 'LIKE' l_type '.' INTO wa_code SEPARATED BY space.
      WHEN 'S'.
        CONCATENATE 'SELECT-OPTIONS' la_dssfield-fieldname 'FOR' l_type '.' INTO wa_code SEPARATED BY space.
      WHEN 'V'.
        CONCATENATE 'SELECT-OPTIONS' la_dssfield-fieldname 'FOR' l_type ' NO INTERVALS.' INTO wa_code SEPARATED BY space.
    ENDCASE.
    APPEND wa_code TO it_code.
    wa_code = 'SELECTION-SCREEN END OF LINE.'.
    APPEND wa_code TO it_code.
  ENDLOOP.
**** Initialize Comment Fields
  wa_code = 'INITIALIZATION.'.
  APPEND wa_code TO it_code.
**** Set GUI-Status
  MOVE 'SET PF-STATUS ''STATUS_1000'' OF PROGRAM ''/XXX/ZSYS_GENSELSCREEN''.' to wa_code.
  APPEND wa_code to it_code.
**** Set title
  DATA: l_stitle type string,
        l_sprog type string,
        l_stitletxt type string.
  MOVE '''TITLE_1000''' To l_stitle.
  MOVE '''/XXX/ZSYS_GENSELSCREEN''' to l_sprog.
  CONCATENATE 'SET TITLEBAR' l_stitle 'OF PROGRAM' l_sprog 'WITH'
               INTO wa_code SEPARATED BY space.
  APPEND wa_code TO it_code.
  CONCATENATE '''' i_title '''' into wa_code.
  append wa_code to it_code.
  MOVE '.' to wa_code.
  APPEND wa_code TO it_code.
  LOOP AT it_dssfield INTO la_dssfield.
    l_tabix = sy-tabix.
    CONDENSE l_tabix.
    CONCATENATE 'cmt' l_tabix INTO l_tabix.
    CONCATENATE l_tabix ' = ''' la_dssfield-descr '''.' INTO wa_code.
    APPEND wa_code TO it_code.
  ENDLOOP.
*** Start of Selection
*  wa_code = 'START-OF-SELECTION.'.
*  APPEND wa_code TO it_code.
**** AT SELECTION-SCREEN
  wa_code = 'AT SELECTION-SCREEN.'.
  APPEND wa_code TO it_code.
  wa_code = 'DATA: okcode type SYUCOMM.'.
  APPEND wa_code TO it_code.
  wa_code = 'MOVE sy-ucomm to okcode.'.
  APPEND wa_code TO it_code.
* Data types for shared objects
  wa_code = 'DATA t_ranges TYPE ACE_FIELD_RANGES_T.'.
  APPEND wa_code TO it_code.
  wa_code = 'DATA wa_ranges LIKE LINE OF t_ranges.'.
  APPEND wa_code TO it_code.
  wa_code = 'DATA t_fldrange TYPE ACE_GENERIC_RANGE_T.'.
  APPEND wa_code TO it_code.
  wa_code = 'DATA wa_fldrange TYPE ACE_GENERIC_RANGE.'.
  APPEND wa_code TO it_code.
* Read the input from the selection screen and
*  store it in Shared Objects
  LOOP AT it_dssfield INTO la_dssfield.
*   Assign the fieldname in the variable
    CONCATENATE 'wa_ranges-fieldname = '''
                 la_dssfield-fieldname '''.'
      INTO wa_code SEPARATED BY space.
    APPEND wa_code TO it_code.
    wa_code = 'REFRESH t_fldrange.'.
    APPEND wa_code TO it_code.
*   Processing for SELECT-OPTIONS
*   Loop and move data to the shared memory
    IF la_dssfield-basictype EQ 'S'
       OR la_dssfield-basictype EQ 'V'.
      CONCATENATE 'LOOP AT ' la_dssfield-fieldname '.'
        INTO wa_code SEPARATED BY space.
      APPEND wa_code TO it_code.
      wa_code = 'CLEAR wa_fldrange.'.
      APPEND wa_code TO it_code.
      CONCATENATE 'MOVE-CORRESPONDING ' la_dssfield-fieldname 'TO' 'wa_fldrange.'
         INTO wa_code SEPARATED BY space.
      APPEND wa_code TO it_code.
      wa_code = 'APPEND wa_fldrange TO t_fldrange.'.
      APPEND wa_code TO it_code.
      wa_code = 'ENDLOOP.'.
      APPEND wa_code TO it_code.
      wa_code = 'wa_ranges-fieldrange[] = t_fldrange[].'.
      APPEND wa_code TO it_code.
      wa_code = 'APPEND wa_ranges TO t_ranges.'.
      APPEND wa_code TO it_code.
    ELSEIF la_dssfield-basictype EQ 'P'.
*   Processing for PARAMETERS
      wa_code = 'CLEAR wa_fldrange.'.
      APPEND wa_code TO it_code.
*     Process if the parameter is not initial
      CONCATENATE 'IF ' la_dssfield-fieldname 'IS NOT INITIAL.'
        INTO wa_code SEPARATED BY space.
      APPEND wa_code TO it_code.
      wa_code = 'wa_fldrange-sign = ''I''.'.
      APPEND wa_code TO it_code.
      wa_code = 'wa_fldrange-option = ''EQ''.'.
      APPEND wa_code TO it_code.
      CONCATENATE 'wa_fldrange-low = ' la_dssfield-fieldname '.'
        INTO wa_code SEPARATED BY space.
      APPEND wa_code TO it_code.
      wa_code = 'APPEND wa_fldrange TO t_fldrange.'.
      APPEND wa_code TO it_code.
      wa_code = 'ENDIF.'.
      APPEND wa_code TO it_code.
      wa_code = 'wa_ranges-fieldrange[] = t_fldrange[].'.
      APPEND wa_code TO it_code.
      wa_code = 'APPEND wa_ranges TO t_ranges.'.
      APPEND wa_code TO it_code.
    ENDIF.
  ENDLOOP.
  wa_code = 'DATA: area type ref to /XXX/zsmasys_genselscreen.'.
  APPEND wa_code TO it_code.
  wa_code = 'DATA root type REF to /XXX/zclsys_genselscreen.'.
  APPEND wa_code TO it_code.
* Get ref to the shared memory
  wa_code = 'area = /XXX/zsmasys_genselscreen=>attach_for_write( ).'.
  APPEND wa_code TO it_code.
  wa_code = 'create object root area handle area.'.
  APPEND wa_code TO it_code.
* Store the value in memory
  wa_code = 'root->set_fields( t_ranges ).'.
  APPEND wa_code TO it_code.
* Store ok_code in memory
  wa_code = ' root->set_okcode( okcode ).'.
  APPEND wa_code TO it_code.
  wa_code = 'area->set_root(  root ).'.
  APPEND wa_code TO it_code.
* Commit and detatch
  wa_code = 'area->detach_commit( ).'.
  APPEND wa_code TO it_code.
* Quit the program: Return to the main code
  wa_code = 'LEAVE PROGRAM.'.
  APPEND wa_code TO it_code.
* Generate the report program
  INSERT REPORT '/XXX/ZSYS_GENSELSCREEN' FROM it_code.
  COMMIT WORK.
* Execute the report
  SUBMIT /XXX/zsys_genselscreen VIA SELECTION-SCREEN AND RETURN.
Importing parameters are:
it_dssfield type /XXX/zTsys_dssfield
i_title type title_txt
/XXX/ztsys_dssfield has the following line structure:
FIELDNAME     CHAR08
REFTABLE     TABNAME
REFFIELD     FIELDNAME
BASICTYPE     CHAR01
DESCR     CHAR30_BRO
I hope It helps you!
I'm looking for a way to do the same in a selection-screen Pop-Up.
For further questens contact me!
Regards Christian

Similar Messages

  • How do I add validation to a system-generated Selection Screen?

    As HR ABAPers know, using the Logical Database approach (I'm using PNPCE) gives you a system-generated Selection Screen.  Part of the specs I have for this report involves making sure that the begin and end dates for the period selected are for a two-week period.  If not, I should display an error message until the user enters a period such that the period (pn-begda and pn-endda) reflect a two-week period.
    The code for the validation is easy enough, and I put it in the AT SELECTION-SCREEN event.  But here's the problem -- the code fires every time the user clicks the "Reporting Period" drop-down box, never giving the user a chance to specify a two-week period.  It fires because pn-begda and pn-endda are still all zeroes.  Even if I select "Other Period" from the drop-down list, the text boxes to allow me to specify the begin and end dates don't appear.
    I've been working on this for quite a while, trying all kinds of things, but I'm spinning my wheels now.  I just want that check to happen when the user clicks the Execute button on the Selection Screen, not when he/she is still trying to enter criteria.  I'm thinking screen field validation for a system-generated Selection Screen has to be a pretty common thing, and there must be a good solution out there.
    Any ideas?

    Rich,
    Absolutely beautiful -- that's exactly what I needed to learn.  Thank you so much.
    Rob, I thought about that.  I even proposed to the users that I could default in a two-week range beginning with today, exactly as you suggested, but they didn't want that.  They felt that this report would more often than not be run to reflect data from two-week periods not necessarily starting today.  Still thought it was a good idea, but that's their call. _
    Again, thanks Rich.  Points awarded.

  • Dynamically generating selection screen variants

    Hi,
    I have a report for which i have to create a variant. This report will be executed in background. There is a parameter Planning Date on the selection screen of this report. The format of this date is week.year i.e., ww.yyyy. Week should change automatically based on the week it is executed. For example, lets suppose that the current planning date is 19.2007. When you execute this report in the next week, the date should be 20.2007.
    Please suggest me on how to do this.
    Best Regards,
    Phani.

    Hi,
    Create two variants for the below program say VAR1 and VAR2.
    For the variant VAR1 take the default values say 12 and 3.
    and for VAR2 take the values 10 and 5.
    Now execute the program by selecting the variants VAR1 and VAR2. You can see the difference.
    when you select VAR1 the parameters can be seen in disable mode.
    parameters: p_num1 type i default 12,
                      p_num2 type i default 3.
    at selection-screen output.
    if sy-slset = 'VAR1'.
    loop at screen.
      if screen-name = 'P_NUM1' or
         screen-name = 'P_NUM2'.
         screen-input =  0.
      endif.
      modify screen.
    endloop.
    endif.
    write:/5 p_num1, 35 p_num2.
    Edited by: Velangini Showry Maria Kumar Bandanadham on Apr 14, 2008 12:52 PM

  • Auto generated selection screen in Modulepool program

    Hi Experts!!
    How to develop/Desing auto-generated screen for accepting values from the user as criteria for database selections while running a report.
    pls. guide me.
    Thanks in advance

    Use this - two FMS-
    here is the code -
    FORM extended_selection.
      DATA : t_dyn    LIKE rsdsfields OCCURS 0 WITH HEADER LINE.
    *Work Areas.
      DATA : wa_range  TYPE LINE OF rsds_trange,
             wa_ranget TYPE rsds_frange_t,
             wa_line   TYPE LINE OF rsds_frange_t,
             t_selopt  TYPE rsds_selopt_t.
    *Fields to be Put on the dynamic selection screen
      t_dyn-tablename = 'KNA1'.
      t_dyn-fieldname = 'KUNNR'.
      APPEND t_dyn.
      CLEAR  t_dyn.
      t_dyn-tablename = 'CEPC'.
      t_dyn-fieldname = 'PRCTR'.
      APPEND t_dyn.
      CLEAR  t_dyn.
      IF ( ( g_sel IS INITIAL ) OR ( t_ranges[] IS INITIAL ) ).
    *Initialize Free Selection Mode.
        CALL FUNCTION 'FREE_SELECTIONS_INIT'
             EXPORTING
                  kind                     = 'F'
             IMPORTING
                  selection_id             = g_sel
             TABLES
                  fields_tab               = t_dyn
             EXCEPTIONS
                  fields_incomplete        = 1
                  fields_no_join           = 2
                  field_not_found          = 3
                  no_tables                = 4
                  table_not_found          = 5
                  expression_not_supported = 6
                  incorrect_expression     = 7
                  illegal_kind             = 8
                  area_not_found           = 9
                  inconsistent_area        = 10
                  kind_f_no_fields_left    = 11
                  kind_f_no_fields         = 12
                  too_many_fields          = 13
                  dup_field                = 14
                  field_no_type            = 15
                  field_ill_type           = 16
                  dup_event_field          = 17
                  node_not_in_ldb          = 18
                  area_no_field            = 19
                  OTHERS                   = 20.
        IF sy-subrc NE 0.
          MESSAGE e717(db).
        ENDIF.
      ENDIF.
    *Dialog for Selection.
      REFRESH t_ranges.
      CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
           EXPORTING
                selection_id    = g_sel
                title           = 'Extended Selection'(s12)
                as_window       = true
                start_row       = 5
                start_col       = 20
                tree_visible    = space
           IMPORTING
                field_ranges    = t_ranges
           TABLES
                fields_tab      = t_dyn
           EXCEPTIONS
                internal_error  = 1
                no_action       = 2
                selid_not_found = 3
                illegal_status  = 4
                OTHERS          = 5.
      IF sy-subrc NE 0.
        CHECK sy-subrc NE 2.
        MESSAGE e717(db).
      ENDIF.
    This will create a dynamic selection screen for you. For more information u can refer to the documentations of those function mdoules.
    Hope it solves ur prob.

  • Selection-screen function key  dynamically ?

    Dear all,
    I wonder if it is possible to have a function key dynamically appearing on the selection screen of an ABAP. For example the button for reading the documentation of an ABAP is shown dynamically only if there is a documenation available.
    I have tried several methods at SELECTION-SCREEN OUTPUT
    - SET PF-STATUS EXCLUDING 'FC0x' : no reaction
    - Blanking the icon via CLEAR: SSCRFIELDS-FUNCTXT: Result blank button
    - In LOOP AT SCREEN nothing can be found concerning function keys.
    I assume that the crucial point is the SELECTION-SCREEN FUNCTION KEY statement, which generates the button.
    Thanx for your help
    Rabanus Diehl

    You mention about the 'Documentation' button.
    However, SE38 is a dialog program so this why it is easy to do. You are writing a report program. You could have the pushbutton on the screen itseld instead of the status bar. You should then be able to use LOOP AT SCREEN to hide. Here is some code to put a pushbutton on a screen.
    INCLUDE <list>.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN PUSHBUTTON 01(35) garment
      USER-COMMAND garment.
    SELECTION-SCREEN END OF LINE.
    INITIALIZATION.
      PERFORM f_setup_pushbutton_text USING icon_execute_object text-s01
                                      CHANGING garment.
    FORM f_setup_pushbutton_text USING    p_icon
                                          p_text
                                 CHANGING p_result.
      DATA: l_result(50).
      CALL FUNCTION 'ICON_CREATE'
           EXPORTING
                name                  = p_icon
                text                  = p_text
                add_stdinf            = space
           IMPORTING
                RESULT                = l_result
           EXCEPTIONS
                EXCEPTIONS
                icon_not_found        = 1
                outputfield_too_short = 2
                OTHERS                = 3.
      IF sy-subrc EQ 0. ENDIF.
      p_result = l_result.
    ENDFORM.                               " F_SETUP_PUSHBUTTON_TEXT

  • Add new field in selection-screen and output dynamically

    hi gurus,
      i need to add field in selectio-screen.
    i need to validate the field with existing fields.
    i need to add this in alv grid output list dynamically.
    thanks & regards,
       kgn9.

    Hi
    Try to use EXIT_SAPMM07M_001, it's to update the item (not header) text, but you can try to use it:
    FIELD-SYMBOLS: <BKTXT> TYPE MKPF-BKTXT.
    ASSIGN ('(SAPMM07M)MKPF-BKTXT') TO <BKTXT>.
    IF SY-SUBRC = 0.
      <BKTXT> = <.....>.
    ENDIF.
    Max

  • Dynamic selection-screen in a method

    <b>I need to generate selection-screen dynamically from a method of the class.</b>
    There are can be select options and parameters on the selection-screen.
    At runtime, it's needed to generate a program containing selection-screen and pass a table into the program in order to get results of the user selection (there should be a query to the database in the program). Notice, that dynamic program is called from a method of the class.
    Best regards.

    Hi,
    Just check this code sample.This is the sample I got in SDN some time back.May be this can help you.If so,reward points.
    START-OF-SELECTION.
    PERFORM DYNAMIC_CODE.
    FORM DYNAMIC_CODE.
    APPEND 'REPORT ZSEARCH NO STANDARD PAGE HEADING.' TO ITAB.
    APPEND 'TABLES : DD03L,DD02L.' TO ITAB.
    DATA TAB LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.
    APPEND 'SELECTION-SCREEN BEGIN OF BLOCK BLK' TO ITAB.
    APPEND 'WITH FRAME TITLE TEXT-001.' TO ITAB.
    DO P4 TIMES.
    REC_CNT = SY-INDEX.
    CONDENSE REC_CNT NO-GAPS.
    IF P1 = 'X'.
    CONCATENATE 'PARAMETERS:F' REC_CNT
    ' LIKE DD03L-FIELDNAME OBLIGATORY.'
    INTO WA.
    APPEND WA TO ITAB.
    TAB-ID = 'S'.
    CONCATENATE 'F' REC_CNT INTO WA.
    TAB-KEY = WA.
    CONCATENATE'$$$$$$$$' 'Field Name' REC_CNT INTO WA.
    TAB-ENTRY = WA.
    ENDIF.
    IF P2 = 'X'.
    CONCATENATE 'PARAMETERS:D' REC_CNT
    ' LIKE DD03L-ROLLNAME OBLIGATORY.'
    INTO WA.
    APPEND WA TO ITAB.
    TAB-ID = 'S'.
    CONCATENATE 'D' REC_CNT INTO WA.
    TAB-KEY = WA.
    CONCATENATE'$$$$$$$$' 'Data Element' REC_CNT INTO WA.
    TAB-ENTRY = WA.
    ENDIF.
    IF P3 = 'X'.
    APPEND 'SELECTION-SCREEN BEGIN OF LINE.' TO ITAB.
    CONCATENATE 'SELECTION-SCREEN COMMENT (15) FOR FIELD DT'
    REC_CNT '.' INTO WA.
    APPEND WA TO ITAB.
    CONCATENATE 'PARAMETERS:DT' REC_CNT
    ' LIKE DD03L-DATATYPE OBLIGATORY.'
    INTO WA.
    APPEND WA TO ITAB.
    CONCATENATE 'SELECTION-SCREEN COMMENT (16) FOR FIELD SIZE'
    REC_CNT '.' INTO WA.
    APPEND WA TO ITAB.
    CONCATENATE 'PARAMETERS:SIZE' REC_CNT
    ' LIKE DD03L-LENG OBLIGATORY.' INTO WA.
    APPEND WA TO ITAB.
    APPEND 'SELECTION-SCREEN END OF LINE.' TO ITAB.
    TAB-ID = 'S'.
    CONCATENATE 'DT' REC_CNT INTO WA.
    TAB-KEY = WA.
    CONCATENATE'$$$$$$$$' 'Data Type' REC_CNT INTO WA.
    TAB-ENTRY = WA.
    APPEND TAB.
    TAB-ID = 'S'.
    CONCATENATE 'SIZE' REC_CNT INTO WA.
    TAB-KEY = WA.
    CONCATENATE'$$$$$$$$' 'Len. of Field' REC_CNT INTO WA.
    TAB-ENTRY = WA.
    ENDIF.
    APPEND TAB.
    ENDDO.
    APPEND 'SELECTION-SCREEN END OF BLOCK BLK.' TO ITAB.
    ENDFORM. " DYNAMIC_CODE

  • Dynamic selectionof selection-screen

    parameters table1.
    parameters input.
    i have enter dynamic text into table1
    like table1 = vbak.
    i like to see instead of input as table1(i.e vbak) on selection-screen
    when user dynamically gives value of table1 
    help me plz
    <b></b><b></b><b></b><b></b>
    Message was edited by:
            shravan ramidi

    Hi Shravan
    declare like this
    PARAMETERS : COMPANY LIKE BSEG-BUKRS.
    or you can declare like this
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 25(23) text-002.
    SELECT-OPTIONS: S_ebelp FOR eKPO-ebelp.
    PARAMETERS:p_lifnr LIKE ekko-lifnr .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    and on the editor goto Text elements then goto change mode and there goto selection texts there u declare your name which you want to display outside for user
    Reward all helpfull answers
    Regards
    Pavan

  • Dynamic program on selection screen

    hi friends i want to add one insert button on selection screen and when someone click that insert button a new parameter field should gets add on the screen.

    Hi,
    Chk this code.But here i took radio buttons instead of pushbuttons.Hope it will help you out.
    *& Report ZHAR_DYN_SELSCR.
    *& This program demonstrates how easy it is to set selection screen
    *& element properties dynamically
    *& The program uses 3 radio buttons to set the display and input
    *& properties of selection screen fields dynamically
    *& URL: http://allaboutsap.blogspot.com
    REPORT ZHAR_DYN_SELSCR.
    DATABASE TABLES
    tables : mara.
    SELECTION SCREEN
    selection-screen begin of block b1 with frame.
    *--- Radio buttons to set properties
    PARAMETERS:
    rad1 RADIOBUTTON GROUP rad default 'X' USER-COMMAND radio,
    rad2 RADIOBUTTON GROUP rad,
    rad3 RADIOBUTTON GROUP rad.
    *--- Selection Screen fields
    SELECT-OPTIONS:
    s_matnr FOR mara-matnr MODIF ID MI1,
    s_mtart FOR mara-mtart MODIF ID MI1,
    s_mbrsh FOR mara-mbrsh MODIF ID MI2,
    s_matkl FOR mara-matkl MODIF ID MI2.
    selection-screen end of block b1.
    AT SELECTION SCREEN
    at selection-screen output.
    loop at screen.
    *--- If Radio Button 1 is checked
    IF rad1 = 'X'.
    IF screen-group1 = 'MI2'.
    *--- Fields with MODIF ID MI2 disappear from the screen
    screen-input = 0.
    screen-invisible = 1.
    ENDIF.
    *--- If Radio Button 2 is checked
    ELSEIF rad2 = 'X'.
    IF screen-group1 = 'MI1'.
    *--- Fields with MODIF ID MI1 are input-disabled
    screen-input = 0.
    ENDIF.
    *--- If Radio Button 3 is checked
    ELSEIF rad3 = 'X'.
    IF screen-group1 = 'MI1' or screen-group1 = 'MI2'.
    *--- All fields will appear input-enabled
    screen-input = 1.
    ENDIF.
    ENDIF.
    *--- MODIFY SCREEN mandatory addition to apply changes to the screen
    Modify screen.
    endloop.
    Reward if helpful.
    Regards,
    Harini.S

  • How to create dynamic selection-screen

    Hi all,
    I want to create dynamic selection-screen.in that dynamic selectio-screen i want to display date fields based on table name given in the selection-screen.
    Regards,
    Billa

    Hi Billa,
    Look into the function group SSEL, this has some SAP standard functions to work with dynamic selection screens.
    Below is sample FM, I wrote making use of standard FM from the above. This FM will take table name as input and will display a screen with all the fields within that table for selection. This can also be customized to restrict the fields for display.
    Hope this helps,
    Sumant.
    FUNCTION y_ss_test_dynamic_selection.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(TABNAME) LIKE  DD02L-TABNAME
    *"  EXPORTING
    *"     REFERENCE(DS_CLAUSES) TYPE  RSDS_WHERE
    *"  EXCEPTIONS
    *"      TABLE_NOT_VALID
    *"      OTHER_ERROR
      DATA texpr TYPE rsds_texpr.
      DATA twhere TYPE rsds_twhere.
      DATA trange TYPE rsds_trange.
      DATA BEGIN OF qcat.                    "Selections View for
              INCLUDE STRUCTURE rsdsqcat.    "Free Selectoptions
      DATA END OF qcat.
      DATA BEGIN OF tabs OCCURS 10.
              INCLUDE STRUCTURE rsdstabs.
      DATA END   OF tabs.
      DATA BEGIN OF fields OCCURS 10.
              INCLUDE STRUCTURE rsdsfields.
      DATA END   OF fields.
      DATA BEGIN OF efields OCCURS 10.
              INCLUDE STRUCTURE rsdsfields.
      DATA END   OF efields.
      DATA selid LIKE rsdynsel-selid.
      DATA actnum LIKE sy-tfill.
      DATA title LIKE sy-title VALUE 'Selection Screen'.
      DATA: maxnum LIKE sy-subrc VALUE '69'.
      CLEAR    tabs.
      tabs-prim_tab = tabname.
      COLLECT  tabs.
      DATA: position LIKE dd03l-position.
      DATA: keyflag  LIKE dd03l-keyflag.
      CLEAR fields.
      fields-tablename = tabname.
      fields-sign      = 'I'.
      DATA: step LIKE sy-subrc.
      SELECT fieldname keyflag position
        INTO (fields-fieldname, keyflag, position)
        FROM dd03l
        WHERE tabname = tabname
          AND fieldname NOT LIKE '.INCLU%'
          AND datatype NE 'CLNT'
        ORDER BY position.
        ADD 1 TO step.
        CHECK step LE maxnum.
        IF keyflag <> 'X'.
          efields = fields.
          APPEND efields.
        ENDIF.
        APPEND fields.
      ENDSELECT.
      IF sy-subrc <> 0.
        RAISE table_not_valid.
      ENDIF.
      CALL FUNCTION 'FREE_SELECTIONS_INIT'
           EXPORTING
                expressions              = texpr
                kind                     = 'F'
           IMPORTING
                selection_id             = selid
                expressions              = texpr
                where_clauses            = twhere
                field_ranges             = trange
                number_of_active_fields  = actnum
           TABLES
                tables_tab               = tabs
                fields_tab               = fields
                fields_not_selected      = efields
           EXCEPTIONS
                fields_incomplete        = 01
                fields_no_join           = 02
                field_not_found          = 03
                no_tables                = 04
                table_not_found          = 05
                expression_not_supported = 06
                incorrect_expression     = 07
                illegal_kind             = 08
                area_not_found           = 09
                inconsistent_area        = 10
                kind_f_no_fields_left    = 11
                kind_f_no_fields         = 12
                too_many_fields          = 13.
      IF sy-subrc = 0.
        CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
             EXPORTING
                  selection_id            = selid
                  title                   = title
             IMPORTING
                  where_clauses           = twhere
                  expressions             = texpr
                  field_ranges            = trange
                  number_of_active_fields = actnum
             TABLES
                  fields_tab              = fields
             EXCEPTIONS
                  internal_error          = 01
                  no_action               = 02
                  no_fields_selected      = 03
                  no_tables_selected      = 04
                  selid_not_found         = 05.
        IF sy-subrc = 0.
          CLEAR ds_clauses.
          MOVE tabname TO ds_clauses-tablename.
          READ TABLE twhere WITH KEY ds_clauses-tablename INTO ds_clauses.
          IF sy-subrc <> 0.
            RAISE other_error.
          ENDIF.
        ELSE.
          RAISE other_error.
        ENDIF.
      ELSE.
        RAISE other_error.
      ENDIF.
    ENDFUNCTION.

  • How to call dynamic selection screen from another report

    hi,
    i have transaction ZFAGLL03.
    it has got standard selection screen.. and dynamic selection screen...
    i am calling this transaction from another report, now how do i display this dynamic selection screen.....

    Try following code and see if it helps:
    TYPE-POOLS : rsds.
    TABLES:tgsb.
    DATA: trange TYPE rsds_trange,
           trange_line
             LIKE LINE OF trange,
           trange_frange_t_line
             LIKE LINE OF trange_line-frange_t,
           trange_frange_t_selopt_t_line
             LIKE LINE OF trange_frange_t_line-selopt_t,
              trange_line1
             LIKE LINE OF trange,
           trange_frange_t_line1
             LIKE LINE OF trange_line-frange_t,
           trange_frange_t_selopt_t_line1
             LIKE LINE OF trange_frange_t_line-selopt_t,
           texpr TYPE rsds_texpr.
    DATA: seltab TYPE TABLE OF rsparams WITH HEADER LINE,seltex TYPE rsds_texpr.
    SELECT-OPTIONS:so_gsber FOR tgsb-gsber.
    LOOP AT so_gsber.
       trange_line-tablename = 'FAGLFLEXA_FS'.
       trange_frange_t_line-fieldname = 'RBUSA'.
       MOVE-CORRESPONDING so_gsber TO trange_frange_t_selopt_t_line.
       APPEND trange_frange_t_selopt_t_line
       TO trange_frange_t_line-selopt_t.
    ENDLOOP.
    APPEND trange_frange_t_line TO trange_line-frange_t.
    APPEND trange_line TO trange.
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
       EXPORTING
         field_ranges = trange
       IMPORTING
         expressions  = texpr.
    submit FAGL_ACCOUNT_ITEMS_GL with FREE SELECTIONS texpr   AND RETURN .

  • How to pass selection screen value to LDB dynamic field.

    Hello everybody,
    In my program, I am using standard LDB(PSJ) for getting data. And there is a requirement that I have to display some dynamic fields on my selection screen like plant , person responsible ( which are mandatory also ) etc. and inside the program I have to fill those dynamic fields for which the user has entered the value in selection screen.
    Could you please tell me how to pass some of selection screen values to ldb dynamic fields before GET statement.
    Thanks !!!
    Regards,
    Mitra

    >
    Pavan Bhamidipati wrote:
    > Hi,
    >
    >
    I have to fill those dynamic fields for which the user has entered the value in selection screen.
    >
    >
    > This means that the user is going to enter the values in the selection screen for the dynamic field values so
    >
    > SET PARAMETERID 'XYZ' FIELD p_field.
    >
    > where p_field is a parameter on the selection screen
    >
    > Regards
    > Pavan
    You can capture the values selected through the dynamic selections using some of the functions modules below, just search the forum for the below FM's, perhaps you can find some sample code
    FREE_SELECTIONS_EX_2_RANGE
    FREE_SELECTIONS_EX_2_WHERE
    FREE_SELECTIONS_RANGE_2_EX
    FREE_SELECTIONS_RANGE_2_WHERE
    FREE_SELECTIONS_WHERE_2_EX
    FREE_SELECTIONS_WHERE_2_RANGE

  • Help Needed for selection screen

    Hi Experts
    I'm doing one report of pm module using one standard program called me RIQMEL10
                 my query is if u execute this stand.prog u'll get one selection screen ,and having three selction-screen blocks.  first sel-scr block name is Notification status this selection screen is calling dynamically by using sap stand.prog SAPDBQMI
                    SCR NO : 1000
    can any one send me the default code of this selection screen block ( Notification status ) which sap is providing .

    INCLUDE DBQMISEL
    It will be automatically included into the database program.
    If the source code is automatically generated,
    please perform the following steps:
    1. Replace ? by suitable names (at most 8 characters).
    2. Activate SELECT-OPTIONS and PARAMTERS (delete stars).
    3. Save source code.
    4. Edit database program
    Hint: Syntax-Check is not possible within this Include!
    It will be checked during syntax-check of database program.
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-011.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS dy_ofn LIKE rihea-dy_ofn FOR TABLE diqmel.
    SELECTION-SCREEN COMMENT 3(11) text-001
                                          FOR FIELD dy_ofn ID 001.
    PARAMETERS dy_rst LIKE rihea-dy_rst FOR TABLE diqmel.
    SELECTION-SCREEN COMMENT 16(10) text-002
                                           FOR FIELD dy_rst ID 002.
    PARAMETERS dy_iar LIKE rihea-dy_iar FOR TABLE diqmel.
    SELECTION-SCREEN COMMENT 29(10) text-003
                                           FOR FIELD dy_iar ID 003.
    PARAMETERS dy_mab LIKE rihea-dy_mab FOR TABLE diqmel.
    SELECTION-SCREEN COMMENT 42(10) text-004
                                           FOR FIELD dy_mab ID 004.
    SELECTION-SCREEN COMMENT 52(10) text-005
                                           FOR FIELD selschem ID 005.
    PARAMETERS: selschem LIKE tj48t-selid FOR TABLE diqmel.
    SELECTION-SCREEN PUSHBUTTON 73(5) p_addr USER-COMMAND addr
    FOR TABLE diqmel ID 006.
    PARAMETERS dy_adrfl NO-DISPLAY FOR TABLE diqmel.
    SELECTION-SCREEN COMMENT 79(30) ad_icon FOR TABLE diqmel ID ic1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK block1.
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-012.
    SELECT-OPTIONS:
      qmnum                  FOR diqmel-qmnum MATCHCODE OBJECT qmeg,
      qmart                  FOR diqmel-qmart,
      tplnr                  FOR diqmel-tplnr NO-DISPLAY,
      strno                  FOR diqmel-strno MATCHCODE OBJECT iflm,
      equnr                  FOR diqmel-equnr MATCHCODE OBJECT equi,
      matnr                  FOR diqmel-matnr MATCHCODE OBJECT mat1,
      serialnr               FOR diqmel-serialnr,
      deviceid               FOR diqmel-deviceid,
      aufnr                  FOR diqmel-aufnr MATCHCODE OBJECT orde.
    *--- date from - until
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(28) text-009 FOR FIELD datuv.
    SELECTION-SCREEN POSITION 33 FOR TABLE diqmel.
    PARAMETERS datuv LIKE rihea-termab FOR TABLE diqmel DEFAULT sy-datum.
    SELECTION-SCREEN COMMENT 51(6) text-010 FOR FIELD datub.
    PARAMETERS datub LIKE rihea-termbi FOR TABLE diqmel DEFAULT sy-datum.
    SELECTION-SCREEN END OF LINE.
    *--- partner function, partner
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(9) text-006 FOR FIELD dy_parvw.
    SELECTION-SCREEN POSITION 10 FOR TABLE diqmel.
    PARAMETERS  dy_parvw LIKE ihpa-parvw FOR TABLE diqmel
                AS LISTBOX VISIBLE LENGTH 22.
    SELECTION-SCREEN POSITION 33 FOR TABLE diqmel.
    PARAMETERS  dy_parnr LIKE ihpa-parnr FOR TABLE diqmel VALUE-REQUEST.
    *--- button classification
    SELECTION-SCREEN PUSHBUTTON 73(5) text-013 USER-COMMAND clse
    FOR TABLE diqmel.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK block2.
    *--- freie Abgrenzungen für log.Datenbankselektion -
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE diqmel ID 010.
    SELECTION-SCREEN BEGIN OF VERSION 001 text-v01.
    SELECTION-SCREEN EXCLUDE PARAMETERS: dy_mab, dy_ofn, dy_rst, dy_iar,
                                         selschem, dy_adrfl.
    SELECTION-SCREEN EXCLUDE IDS: 001, 002, 003, 004, 005, 006, 010, ic1.
    SELECTION-SCREEN END   OF VERSION 001.
    SELECTION-SCREEN BEGIN OF VERSION 002 text-v02.
    SELECTION-SCREEN EXCLUDE IDS: 010.
    SELECTION-SCREEN END   OF VERSION 002.
    *--- Parameter für Selektionssteuerung -> es sollen nicht     -
    *--- automatisch alle Segmente der log.DB selektiert werden   -
    *--- neu mit P30K047900                                       -
    PARAMETERS: ldb_ihpa NO-DISPLAY DEFAULT 'X' FOR TABLE diihpa,
                ldb_iflo NO-DISPLAY DEFAULT 'X' FOR TABLE diiflo,
                ldb_equi NO-DISPLAY DEFAULT 'X' FOR TABLE diequi,
                ldb_qmfe NO-DISPLAY DEFAULT 'X' FOR TABLE diqmfe,
                ldb_qmma NO-DISPLAY DEFAULT 'X' FOR TABLE diqmma,
                ldb_qmmx NO-DISPLAY DEFAULT 'X' FOR TABLE diqmmax,
                ldb_clas NO-DISPLAY DEFAULT 'X' FOR TABLE diclass,
                ldb_clda NO-DISPLAY DEFAULT 'X' FOR TABLE dicldat,
                ldb_qmsm NO-DISPLAY DEFAULT 'X' FOR TABLE diqmsm,
                ldb_qmsx NO-DISPLAY DEFAULT 'X' FOR TABLE diqmsmx,
                ldb_aufk NO-DISPLAY DEFAULT 'X' FOR TABLE diaufk.
    regards
    vinod

  • How to Add a new fields in the selection screen of LDB.

    Hi All,
    I want to add a new fields in the selection screen of LDB & then i need to select the data for that fields.
    So could you please tell me for that where i need to add the code for selecting the data.
    Thanks
    Roli

    Hi
    welcome to SDN forum
    If you are designing your own LDB with your own tables you can define tree structure and then the selection screen for the tables
    if you wants to modify the std LDB of SAp means take the access key and to modify that code
    if you add the extra field you have to modify the where conditions in the code also
    see the doc
    A logical database is a special ABAP/4 program which combines the contents of certain database tables. You can link a logical database to an ABAP/4 report program as an attribute. The logical database then supplies the report program with a set of hierarchically structured table lines which can be taken from different database tables.
    LDB offers an easy-to-use selection screens. You can modify the pre-generated selection screen to your needs. It offers check functions to check whether user input is complete, correct, and plausible. It offers reasonable data selections. It contains central authorization checks for data base accesses. Enhancements such as improved performance immediately apply to all report programs that use the logical database.
    Less coding s required to retrieve data compared to normal internel tables.
    Tables used LDB are in hierarchial structure.
    Mainly we used LDBs in HR Abap Programming.
    Where all tables are highly inter related so LDBs can optimize the performance there.
    Check this Document. All abt LDB's
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=%2flibrary%2fabap%2fabap-code-samples%2fldb+browser.doc
    GO THROUGH LINKS -
    http://www.sap-basis-abap.com/saptab.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm
    /people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
    Re: **LDB**
    www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_Logical_Database_FAQ.html
    www.sap-img.com/abap/abap-interview-question.htm
    www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9bb935c111d1829f0000e829fbfe/content.htm
    Gothru the blog which provides info on LDB's:
    /people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
    Sample code
    TABLES: SPFLI,
    SFLIGHT,
    SBOOK,
    SCARR.
    START-OF-SELECTION.
    GET SPFLI.
    WRITE:/ ’SPFLI: ’, SPFLI-CARRID, SPFLI-CONNID,
    SPFLI-AIRPFROM, SPFLI-AIRPTO.
    GET SFLIGHT.
    WRITE:/ ’ SFLIGHT: ’, SFLIGHT-CARRID, SFLIGHT-CONNID, SFLIGHT-FLDATE.
    GET SBOOK.
    WRITE:/ ’ SBOOK: ’, SBOOK-CARRID, SBOOK-CONNID,
    SBOOK-FLDATE, SBOOK-BOOKID.
    GET SFLIGHT LATE.
    WRITE:/ ’ GET SFLIGHT LATE: ’, SFLIGHT-FLDATE.
    Regards
    anji

  • Report without a selection-screen, just a dynpro

    Hi experts,
    I wrote a small report, which reads out a file. After this I want to display it in a tablecontrol of my dynpro. In the dynpro there is a button to push the data of the tablecontrol in the R/3 via BDC.
    Now I have the problem of a automatic generated Selection-Screen. Which has some fields of my used variables (e.g. file-name, file-typ) and even maybe 10 fields (input-fields and checkboxes) from the BDC program.
    The fact is that it is not possible to use this code, simply without any "START-OF-SELECTION" statement:
    REPORT ZMM_REPORT01.
    TABLES: mseg.
    TYPES:  BEGIN of input_struk,
              matnr TYPE mseg-matnr,
              erfmg TYPE mseg-erfmg,
            END   of input_struk,
           tt_input TYPE TABLE OF input_struk.
    DATA: it_input TYPE tt_input.
    DATA: wa_input LIKE LINE OF it_input.
    CALL SCREEN 100.
    The error is: "Statement 'CALL SCREEN 100' couldnt be reached."
    If I use the program-type M for PROGRAM and not type 1 for REPORT. Then fails with the necessary INCLUDE statement of the BDC program.
    Regards,
    Steffen

    ok, if I decode your big letters, I have to put the CALL SCREEN at the end of my program.
    so I do that but I didn't work . error: the call-statement could be reached.
    REPORT ZMM_REPORT01.
    TABLES: mseg.
    TYPES:  BEGIN of input_struk,
              matnr TYPE mseg-matnr,
              erfmg TYPE mseg-erfmg,
            END   of input_struk,
           tt_input TYPE TABLE OF input_struk.
    DATA: it_input TYPE tt_input.
    DATA: wa_input LIKE LINE OF it_input.
    PARAMETERS: fname TYPE rlgrap-filename DEFAULT 'c:lagerver.dat',
                ftype TYPE rlgrap-filetype DEFAULT 'ASC',
                bwart TYPE MSEG-BWART DEFAULT 201,
                werks TYPE MSEG-WERKS DEFAULT 2000,
                lgort TYPE MSEG-LGORT DEFAULT 2500,
                kostl TYPE COBL-KOSTL DEFAULT 201300.
    START-OF-SELECTION.
    * PBO Module
    MODULE pbo_0100 OUTPUT.
      SET TITLEBAR 'TITLE_100'.
      SET PF-STATUS 'SCREEN_100'.
      PERFORM z_daten_input.
      PERFORM z_convert_dummy.
    ENDMODULE.
    * PAI Module
    MODULE pai_0100 INPUT.
      IF sy-ucomm = 'BACK' OR
         sy-ucomm = 'EXIT' OR
         sy-ucomm = 'CANCEL'.
         LEAVE PROGRAM.
      ELSE.
      DATA: l_date TYPE sy-datum.
      >THE BDC PROGRAM statements<
      ENDIF.
    ENDMODULE.
    FORM z_daten_input.
    DATA: filename TYPE string,   " UNICODE
          result   TYPE boolean.
          filename = fname.
    REFRESH: it_input.
    CALL METHOD cl_gui_frontend_services=>file_exist
      EXPORTING    file       = filename
      RECEIVING    RESULT     = result.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       filename                      = filename
       filetype                      = 'ASC'
       READ_BY_LINE                  = 'X'
       REPLACEMENT                   = '#'
    CHANGING
       data_tab                      = t_dummy[].
    ENDFORM.
    FORM z_convert_dummy.
      LOOP AT T_DUMMY.
        wa_input-matnr = T_DUMMY-VAR+0(11).
        wa_input-erfmg = T_DUMMY-VAR+33(5).
        APPEND wa_input TO it_input.
      ENDLOOP.
    ENDFORM.
    *&spwizard: declaration of tablecontrol 'TC_FILE' itself
    controls: TC_FILE type tableview using screen 0100.
    *&spwizard: output module for tc 'TC_FILE'. do not change this line!
    *&spwizard: update lines for equivalent scrollbar
    module TC_FILE_change_tc_attr output.
      describe table IT_INPUT lines TC_FILE-lines.
    endmodule.
    CALL SCREEN 100.

Maybe you are looking for

  • Safari 4.0 - Quicktime Plug-In Issue

    Hey Everyone, Hoping that I might be able to get a little bit of help here. Safari 4.0 is almost running fine for me. The only problem that I have is playing any Quicktime movie. Trailers, Keynote, etc. Whenever I try, I get the following message: Th

  • Can't get videos to work in iTunes(OR QuickTime)

    I have the latest version of iTunes, and I can't seem to get any videos to play. .mp4, .m4v, .mov, or .avi. I've been encoding using SUPERs iPod setting, and trying a few settings I found on google. These are SUPERs settings: Container - mp4 Video Co

  • Help, ghost image appearing in composition background

    Hello I have an issue of a ghost image appearing in the composition background. I can't figure out how it got there or how to remove it. It's really annoyong as the image also appears in rendered videos. This only seems to appear when my composition

  • Problem displaying datatable colum value

    hi , Below is my JSPcode <h:dataTable value ="#{DatabaseBean.table}" var= "row"> <h:column><h:outputText value ="#{row.Description}"/></h:column> Here is bean code I am using ArrayList. I put objects of another Bean User in ArrayList name d 'Question

  • How to re download pages, iMovie, etc. for free

    I purchased an iPhone 6 and it came preinstalled with iMovie, pages, etc. I deleted them thinking I had no use for them. However, I would like to know if there is a way to get the apps back on my phone for free. Thanks.