‎2008 Mar 10 1:26 PM
Suppose I have an internal table in which for some records all the columns are zero. I dont want to display this records having zero values for all the columns in the final output. How do we do it?
‎2008 Mar 10 1:37 PM
hi Jamnun,
you did not mention, if you display the content of the internal table the classical way or with ALV...
classic:
LOOP AT itab WHERE field NE 0.
WRITE ...
ENDLOOP.
ALV:
you have to delete the entries from the internal table before passing to the FM.
hope this helps
ec
‎2008 Mar 10 1:37 PM
Jamnun,
As per ur Question,
U have an Internal Table with Some fields,Among that fields , Some of them are Null values.
If U know that fields,which r having Null values, filter those fields(Using Codition) at the Write Statement in the End-of-selection.
Hope It s Helpful.
Thanks,
Shiva
‎2008 Mar 10 1:50 PM
Use this function Module
CONVERSION_EXIT_MATN1_OUTPUT.
ex.
DATA: v_number TYPE N.
v_number = 00000000009.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT
EXPORTING
input = v_number
IMPORTING
output = v_number_aux.
write: v_number_aux.
Regards, Balbino
‎2008 Mar 10 1:39 PM
You can use this way
data: begin of it_vbap occurs 0,
vbeln type vbap-vbeln,
netwr type vbap-netwr,
end of it_vbap.
select vbeln netwr from vbap into table it_vbap up to 50 rows.
data: count type sy-tabix.
loop at it_vbap.
count = sy-tabix.
if it_vbap-netwr is initial.
delete it_vbap index count.
endif.
endloop.
loop at it_vbap.
write: it_vbap-vbeln, it_vbap-netwr.
endloop.
‎2008 Mar 10 1:43 PM
Hi,
I think what you can do is, first delete those particular records from the internal table prior to diplaying them in the output.One way to do that would be to use the keyword 'DELETE'.
An e.g. would be:
Delete itab from wa where f1 = space f2 -= space f3 = space and so on.I think you have to check for all the fields and then only delete the row.The reason for this being that at any time any other record can have any field empty so you just can check for some fields.You have check for all the fields being empty and then delete it.
Hope it works,
Thanks,
Sandeep.
‎2008 Mar 10 1:51 PM
There are two ways:
1. Add another column in the internal table and keep the sum value there of all the columns and while writing check if this new field is not ZERO write otherwise don't.
2. Declare a another parameter type CHAR(1) and While writing (looping....) check if any one field has NON ZERO, set this flag and write the values then reset the flag otherwise don't.
Hope it helps.
‎2008 Mar 10 2:03 PM
Hi,
You can do as below:
loop at itab.
"Assuming if dmbtr is equal to zero then that line items should not be displayed.
if itab-dmbtr eq 0.
delete itab.
clear itab.
exit.
else.
write : itab-fieldnames.
endif.
endloop.
Thanks,
Sriram POnna.