‎2008 Mar 28 9:42 AM
Hi all.
Help me in displaying fields dynamically using "Write Command".I have declared n internal table it_consistancy with fields like
0_tym,1_tym,2_tym.......so on so forth 12_tym.But in the display part somaetyms it may have only 4 fields n sometyms it may have 6 fields.How I can display it using simaple write command.
Plz help me out in solving the problem.
thanx in advance.
Prashant Tiwari
‎2008 Mar 28 9:48 AM
Hi,
In Loop, just before the write statment, put one condition(depends on you requirement) so that it will print what ever you need.
Regards
CS.
‎2008 Mar 28 9:48 AM
Hi,
You do like this.
loop at it_consistancy. "it_consistancy is table with header line.
write: / it_consistancy.
endloop.
What ever be the fields in the it_consistancy, you have to display.
Reward.
‎2008 Mar 28 9:51 AM
Hi Prashant,
Just loop at the internal table and incase if you have something you ll get that in the report output otherwise a blank line
loop at it_consistency. "if it_consistency is an internal table with header line
write: / it_consistency.
endloop.
If you dont want the blank line then put a condition
loop at it_consistency. "if it_consistency is an internal table with header line
if not it_consistency is initial.
write: / it_consistency.
endif.
endloop.
Hope this helps a bit ...
reward if useful ..
Cheers
Kripa Rangachari.
‎2008 Mar 28 10:24 AM
Hi Kripa, CSY,kamala,bharathi vipparthi.
Thanx u all for yr suggestion.
Bt agn i have a doubt.Plz clear it.
1) if the output has all 12 fileds
Plant 0_tym 1_tym 2_tym 3_tym 4_tym 5_tym...12_ty
pb01 1 2 0 2 1 3 2
pb01 3 2 1 5 4 2 2
2) if the output has only 3 fields
Plant 0_tym 1_tym 2_tym 3_tym 4_tym 5_tym...12_ty
pb01 1 2 0 2 -
-
---
pb01 3 2 1 5 -
-
---
In this case i need to display like:-
Plant 0_tym 1_tym 2_tym 3_tym
pb01 1 2 0 2
pb01 3 2 1 5
So nw plz tell me how to do this.
thnx in advance.
‎2008 Mar 28 9:54 AM
hi,
Just loop the internal table with a condition before loop which solves the problem
if not it_consistency is initial.
write: / it_consistency.
endif.
endloop.
reward if found useful,