09-18-2009 11:07 AM
HI,
I want some example where in internal table if the coulumn is filled then only it should be displayed in ALV output.
E.g
PERIOD AMNT1 AMNT2 AMNT3
2 100 200
3 200
Now here AMNT3 is empty so it should not be displayed in my ALV output.
And later if AMNT3 gets filled it should come.
Thanks
Anurodh
09-18-2009 11:10 AM
Hi
U need to set the field NO_OUT in catalog table
LOOP AT IT_FIELDCAT.
IF <.........>.
IT_FIELDCAT-NO_OUT = 'X'.
Max
09-18-2009 11:12 AM
While building the fieldcatalog use the following option:
no_zero = 'X'.
09-18-2009 11:14 AM
09-18-2009 11:15 AM
Hi Anurodh Jindal ,
One way is ...
After Filling your internal table...
You can write a logic like
Check if there is any record where AMNT3 is not initial (Means it's having value...) either using LOOP or READ
Set One Flag for FLAG_AMNT3 = 'X'.
Now while creating fieldcat you check the above Flag...
if FLAG_AMNT3 = 'X'.
Append Fieldcat.
endif.
Repeat above logic for all the columns.. if there are limited number of columns..
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
ilesh Nandaniya
09-18-2009 11:23 AM
hi,
while passing the values to the final table, set a flag if that is not initial.
like..
loop at it_temp1 into is_temp1.
...
. ...
if is_temp1-amnt1 is not initial.
flag1 = 'X'.
is_final-amnt1= is_temp1-amnt1.
endif.
if is_temp1-amnt2 is not initial.
flag2 = 'X'.
is_final-amnt2= is_temp1-amnt2.
endif.
if is_temp1-amnt3 is not initial.
flag3 = 'X'.
is_final-amnt3= is_temp1-amnt3.
endif.
append is_final to it_final.
endloop.
"now while creating field catalog
if flag1 is not initial.
populate field catalog for amnt1.
endif.
if flag2 is not initial.
populate field catalog for amnt2.
endif.
if flag3 is not initial.
populate field catalog for amnt3.
endif.
09-18-2009 12:40 PM
HI All,
Thanks for your instant reply...but i have one problem i need to check whole column and if column is empty then i have to remove that.
Anurodh
09-18-2009 12:41 PM
anirudh,
did you get through the code i provided above, this checks for each line.