Skip to Content
author's profile photo Former Member
Former Member

Displaying checkboxes dynamically in selection-screen for db table values

I have a database table which contains report name & report description as fields.based on the number of rows of data present in the table i have to display check box for each entry & the corresponding controls in the selection-screen.how it can be done??? Reply is most urgent...

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 06, 2005 at 12:47 PM

    declare a variable as check box.

    now, in initialization.

    select data from the table into int'table. loop this and add a check box for every entry.

    When u run the program, initialization triggers and later the selection screen appears.

    Hope this will solve ur problem.

    Pl. award appropriate points.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 06, 2005 at 01:02 PM

    Hi

    Welcome to SDN.

    I think it is not possible at all..

    REgards,

    Abdul

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 06, 2005 at 01:29 PM

    Hi Varadharajan,

    Check this code on selection-screen. This could help you for dynamic selection screen.

    &----


    *& Report ZSREE_SELECTION *

    *& *

    &----


    *& *

    *& *

    &----


    report zsree_selection .

    tables: vbak.

    data: v_spart type vbak-spart, " Division

    v_vbeln type vbak-vbeln, " Sales document

    v_bstkd type vbkd-bstkd, " Customer purchase order number

    v_kunnr type vbak-kunnr, " Customer number 1

    v_werks type vbap-werks, " Plant (own or external)

    v_lifsk type vbak-lifsk, " Delivery block

    v_lfgsk type vbuk-lfgsk, " Delivery block (Document Header)

    v_lfgsa type vbup-lfgsa, " Overall delivery status of the item

    v_spart1 type vbap-spart, " Division

    v_prctr type vbap-prctr. " Profit Center

    *--- SELECTION OPTIONS -


    selection-screen begin of block b1 with frame title text-001.

    select-options: s_vbeln for vbak-vbeln modif id xyz."Sales order number

    selection-screen end of block b1.

    selection-screen begin of block b2 with frame title text-002.

    parameters: p_radio1 radiobutton group g1 default 'X' modif id xyz

    user-command kant,

    p_radio2 radiobutton group g1 modif id xyz.

    selection-screen end of block b2.

    selection-screen begin of block b3 with frame title text-003.

    parameters: p_check1 as checkbox modif id abc user-command sree,

    p_check2 as checkbox modif id abc user-command babu.

    selection-screen end of block b3.

    selection-screen begin of block b4 with frame title text-004.

    selection-screen begin of line.

    selection-screen comment 1(15) text-001 for field p_sree.

    parameters: p_sree type c.

    selection-screen comment 30(15) text-001 for field p_kant.

    parameters: p_kant type c.

    selection-screen end of line.

    selection-screen end of block b4.

    *----


    • Tabbed Screen

    *----


    *---Subscreen 1

    selection-screen begin of screen 310 as subscreen.

    selection-screen begin of block b5 with frame.

    select-options: s_vbeln1 for v_vbeln, " Sales document

    s_bstkd for v_bstkd, " Customer purchase

    s_kunnr for v_kunnr, " Customer number

    s_werks for v_werks, " Plant (Own or External)

    s_lifsk for v_lifsk. " Delivery block

    " (document header)

    selection-screen end of block b5.

    selection-screen end of screen 310.

    *---Subscreen 2

    selection-screen begin of screen 320 as subscreen.

    selection-screen begin of block b6 with frame.

    select-options: s_lfgsk for v_lfgsk, " Delivery block

    s_lfgsa for v_lfgsa, " Overall delivery

    s_spart1 for v_spart1, " Division

    s_prctr for v_prctr. " Profit center

    selection-screen end of block b6.

    selection-screen end of screen 320.

    *---Tab 3 for Selection screen

    selection-screen: begin of tabbed block mytab for 7 lines,

    tab (20) button1 user-command push1,

    tab (20) button2 user-command push2,

    end of block mytab.

    *----


    • Initialization

    *----


    initialization.

    perform initialization.

    *----


    • At Selection Screen

    *----


    at selection-screen.

    perform at_selection_screen.

    *----


    • At Selection Screen Output

    *----


    at selection-screen output.

    if p_radio1 = 'X'.

    loop at screen.

    check screen-group1 = 'ABC'.

    screen-active = 0.

    p_check1 = ' '.

    p_check2 = ' '.

    modify screen.

    endloop.

    endif.

    if p_radio2 = 'X'.

    loop at screen.

    check screen-group1 = 'ABC'.

    screen-active = '1'.

    modify screen.

    endloop.

    endif.

    if p_check1 = 'X'.

    loop at screen.

    if screen-name = 'S_VBELN-LOW'.

    screen-active = '0'.

    modify screen.

    endif.

    endloop.

    endif.

    if p_check2 = 'X'.

    loop at screen.

    if screen-name = 'S_VBELN-HIGH'.

    screen-active = '0'.

    modify screen.

    endif.

    endloop.

    endif.

    *PARAMETERS CONNID LIKE SBOOK-CONNID VALUE CHECK. " This will Check the

    *value from Database

    *PARAMETERS p TYPE spfli-carrid AS LISTBOX VISIBLE LENGTH 20. " this

    *will declare as list box.

    *SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.

    *

    &----


    *& Form INITIALIZATION

    &----


    • text

    ----


    form initialization .

    button1 = text-003. " Button1 Text

    button2 = text-002. " Button2 Text

    mytab-prog = sy-repid. " Program Name

    mytab-dynnr = 310. " Default Screen

    mytab-activetab = 'BUTTON1'. " Default Tab

    endform. " INITIALIZATION

    &----


    *& Form AT_SELECTION_SCREEN

    &----


    • text

    ----


    form at_selection_screen .

    *---Choosing A Particular Screen When Clicking On A Particular Button

    case sy-ucomm.

    when 'PUSH1'.

    mytab-dynnr = 310.

    mytab-activetab = 'BUTTON1'.

    when 'PUSH2'.

    mytab-dynnr = 320.

    mytab-activetab = 'BUTTON2'.

    endcase.

    endform. " AT_SELECTION_SCREEN

    Thanks,

    Sreekanth

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.