Skip to Content
avatar image
Former Member

text data in to template

Dear all,

my requirement is that i want to display text which i checked in selction screen must be displayed in form. These texts are classified

into 4 groups with check boxes in selction screen. consider only one group with 10 check boxes(ie within these 10 texts if i check 4 checkboxes randomly, than these texts should be displayed orderly.

iam using here template. iam getting space which didnt checked text.i want to display continuously the texts excluding which i doesnt checked.

with regards,

prasad

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Oct 21, 2008 at 07:33 AM

    Hi,

    When ever you have checked the check boxes, then fill a internal table with one field.

    Fill the internal table with the entries with those values what you need to print in that.

    p_check1 to p_check8 are the check boxes available.

    create an internal table with 1 field

    if p_check1 is not initial.

    move text1 to itab.

    append itab.

    endif.

    do it for all the check boxes.

    loop this itab.

    case sy-tabix.

    when 1.

    move itab-field to struc-field1.

    when 2.

    move itab-field to struc-field2.

    when 3.

    move itab-field to struc-field3.

    .

    .

    .

    .

    when 8.

    move itab-field to struc-field8.

    endloop.

    Here you need to create a structure with 8 fields .

    Now display these values in the template.

    You will not get any blank spaces in between.

    Regards,

    Venkatesh.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi ,

      refer this ....

      type : begin of ty_str,

      VTEXT type VTEXT ,

      end of ty_str .

      data : it_str type standard table of ty_str,

      wa_str type ty_str .

      if p_1 is not initial .

      read the description of p_1 to wa_str-vtext .

      append wa_str to it_str .

      endif .

      " "

      " "

      " "

      if p_4 is not initial .

      read the description of p_4 to wa_str-vtext .

      append wa_str to it_str .

      endif .

      now pass it_str to form ...

      loop through it_str and print them ........

  • avatar image
    Former Member
    Oct 21, 2008 at 09:10 AM

    Hi ,

    Create a internal table with DESCRIPTION as field .

    now for all the parameters check whether its checked ...

    if yes put the description of that parameter to the internal table u created ...

    pass that internal table to form

    Now in the for create a LOOP ...

    loop through the internal table u passed ...

    print check box and description with the help of table line ,...

    Hope it helps ...........

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 22, 2008 at 07:40 AM

    Hi Prasadbabu,

    Instead putting the text into the template, kindly put the text into internal table as has been suggested with you.

    Print program wise:

    -


    PARAMETERS: p_check1 AS checkbox,
                p_check2 AS checkbox,
                p_check3 AS checkbox,
                ".... continued from 4 to 9
                p_check10 AS checkbox.
    
    IF p_check1 IS NOT INITIAL.
        wa_option = 'TEXT1'.
        APPEND wa_option TO gt_option.
    ENDIF.
    IF p_check2 IS NOT INITIAL.
        wa_option = 'TEXT2'.
        APPEND wa_option TO gt_option.
    ENDIF.
    "....continued for text 3 to 9
    IF p_check10 IS NOT INITIAL.
        wa_option = 'TEXT10'.
        APPEND wa_option TO gt_option.
    ENDIF.

    *Then pass this gt_option internal table to the smartforms.

    SMARTFORMS wise:

    -


    In the smartforms

    1. Create a Window is necessary

    2. Create a table, and on the DATA tab, put the gt_option INTO wa_option.

    3. Create a linetype consisting the columnt you want to show

    4. On the defined column, put TEXT will pass the wa_option-description on your form.

    As using the internal table, your form will dynamically follow any records ticked by the user on the

    screen.

    Note that the code snippet is a rough logic. Please use your enhanced logic to make

    a good program.

    Good Luck.

    Add comment
    10|10000 characters needed characters exceeded