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

display a row in the smartform based on condition

Hi,

I want to display a row in smartform table , based on condition, like, if the Fixed amount is > 0, then only print that row. the logic of calculating fixed amount has been written in cell->code.

Can I add a code at the table level? I tried to add the code->program lines at the table level. but its getting added at the last. means after rows.

Thanks and regards,

Madhuri Sonawane

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Posted on Nov 17, 2011 at 06:06 AM

    If you have the logic written. Then in the text element that you use to display teh row, there will be a Condtition tab. Just write your condition there . The text element will be displayed only if the condition is met.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 17, 2011 at 06:32 AM

    i have done some research and sample development but finally i found very simple logic.

    as follows.....

    1) take 1 integer variable in your internal table (i have used "color type i").

    2 ) in initialization i wrote

    data : val type i.

    loop at it_bseg into wa_bseg.

    val = wa_bseg-buzei mod 2.

    wa_bseg-color = val.

    modify it_bseg from wa_bseg.

    endloop.

    so that i can get true and false(which 1 and 0) value in each row of internal table number of rows.

    3 ) in main area of the table control

    i have created 2 row type lines.. each line contains different number of cells like no,name,amount....& so on....

    4 ) in 1st row type double click and select conditions tab

    apply condition : WA_BSEG-COLOR = 1

    5 ) in 2nd row type doble click and select conditions tab

    apply condition : WA_BSEG-COLOR = 0

    6 ) after completing you can switch your row type at run time

    now i have to apply color for each row type

    but table control cant support box and shadding feature..

    __________________________________________________________

    1 ) after showing above logic for doubilng row type.

    follow

    2 ) double click on table control and press table tab.

    3 ) press details button which you nevigate table control in numerical mode (where you have to specify table length and cells by number)

    4 ) copy line 1 and paste it to below that line . now you have two lines (you can press table painter button where you can see double line upside/downside)

    5 ) press button draw lines and columns now you can select any of row and color it with different color and shade.

    6 ) in table control's main area double click any of rowtype and select line type to another (which you have colored)

    7 ) activate smartform and execute it.

    you can find zebra style table row,

    hope this logic helps

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2011 at 02:25 PM

    Hi,

    In smartforms table, you are having second tab "Data" in which you have to mention the name of the internal table on which you want to loop. Just below this, you can also mention the "where" conditions for this internal table. Give your condition here and try.

    Regards,

    Mahidhar.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2011 at 07:35 AM

    Hi,

    Read the value which you want to check just before you display the row.

    and in the row in conditions tab give the condition like Fixed Amount > 0.

    Regards,

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 18, 2011 at 08:39 AM

    I assume the condition can be only evaluated based on table content. As based on this condition you want certain row to display or no, I would suggest the following:

    - create type which wraps your table with data with additional field (i.e. DISPLAY) - simply include structure of original table and add this field,

    - create a code node before table,

    - copy data to your custom table from original one, setting DISPLAY field based on condition,

    - in your table node loop through your custom table ,

    - set condition on your row (DISPLAY = 'X') - this way entire row won't get printed if condition is not met.

    Regards

    Marcin

    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.