Skip to Content
avatar image
Former Member

displaying alternate shaded and non shaded lines in smartforms

hi.

I have got a requirement which says we need to display records on smartforms. It should have 50 lines on the page with alternating shaded and non shaded lines. I am using one internal table which contains all the data which is to be displayed. How can I proceed so that even when i have less than 50 records in the internal table it should display all the 50 lines on the form.

thanks in advance

Chetan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 12, 2007 at 03:28 PM

    If I undertood, you have to print a zebra type report with 50 lines allways (25 shaded and 25 nonshaded).

    I think the better way is to have two superposed windows in same page. One of them shold allways print the shaded/nonshaded background for 50 lines. The other should print the content of the internal table. It obviously can have less than 50 lines. If it has more a new page will be printed with all 50 shaded/nonshaded lines in the other window.

    Hope it helps.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Chetan u just creater a dummy internal table for those blank lines and loop it by counting 50-no of existing line(maintable).

      award if it help u out..

      -Anil.

  • avatar image
    Former Member
    Mar 13, 2007 at 08:36 AM

    hi chetan,

    <b>1.</b>create a table-->create 2 line types(1 is plain and another one is with shading u cabn give shading by selecting the SHADING and sturation in TABLE TAB of table)...

    <b>2.</b>then insert two lines in the MAINAREA of the table by righte clck create table line(for this give line type1), then inset the fields u want . create another table line in the main area but with the line type2.. insetr the the text u want as in first line.

    if u run the smartform will get the output with 100 record (supoose u have 50 records) because u r using 2 table lines in the mainarea of the table so each line is printing 2 time one with plain and another is with shaded.

    Now we have to avoid this repitation... u have to print the alternate one.... to achive this...

    maintain a variable with v_flag type c.

    by default v_flag = 'X'.

    <b>3.</b>for the firstline in the mainarea of the table <b>CONDITION TA</b>B give the conditon v_flag = 'X'.

    for the second gve the condtion v_flag = 'Y'.

    now 2 line will trigger if the condition is valid.. our goal is to chage the value in the f_flag alternatively... for this

    <b>4.</b> create PROGRAM LINES in the main of the table after the 2 lines..in this chage the value of v_flag. as follows

    IF V_FLAG = 'X'.
    V_FLAG = 'Y'.
    ELSE.
    V_FLAG = 'X'.
    ENDIF.

    now first time plain line will be triggered in the each loop pass and the v_flag value will be chaged in each loop pass so next time shaded line will be triggered. it will be repeated for all the records.

    if u run the from now u will get 50 records with alternatinveshaded lines.

    i hope the solution is clear.. if not read agin i am sure it works.

    do not hesitate to come agiani if u r faciong any problems while implementing this.

    Please Close this thread.. when u r problem is solved

    Reward if Helpful

    Regards

    Naresh Reddy K

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 14, 2007 at 08:45 AM

    hi

    chetan have u solved u rproblem???

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Naresh,

      I was looking up at your solution for displaying alternate shaded and non shaded lines in smartforms but i was having trouble creating the PROGRAM LINES under the MAIN AREA below the line types. As it is not allowing to create under it. can you suggest...If we can able to create the program lines under the MAIN area it woulf solve the issue but it doesnot look like it allows it.