11-14-2007 11:01 PM
Hi Experts,
In an ALV Report's Output Iam getting a field values in a strange manner. For some records it showing the values with decimals and for some it is not showing.
Can you please let me know what is the reason? Thanks for your help.
(The reference field is: EKBE-MENGE)
For eg:
0.000
1200
154,560
0
0.000
11-14-2007 11:06 PM
Looks like, your field doesn't have reference in the fieldcatalog.
fcat-ref_fieldname = 'MENGE'.
fcat-ref_tabname = 'EKBE'.
Regards
Naimesh Patel
11-14-2007 11:06 PM
Looks like, your field doesn't have reference in the fieldcatalog.
fcat-ref_fieldname = 'MENGE'.
fcat-ref_tabname = 'EKBE'.
Regards
Naimesh Patel
11-14-2007 11:23 PM
I gave the reference. But it still is not working. Thanks for the reply though.
11-14-2007 11:30 PM
Hi Sam,
Can you paste your code of fieldcatlog creation.
Regards,
Atish
11-14-2007 11:36 PM
Hi,
Here's the fieldcatalog:
*----
form init_field_catalog.
data: l_colpos type i.
refresh i_fieldcat.
clear i_fieldcat.
*--- Data fields.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = w_repid
i_internal_tabname = 'I_OUTPUT'
i_inclname = w_repid
changing
ct_fieldcat = i_fieldcat[]
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
*--- Modify field catalog.
loop at i_fieldcat.
case i_fieldcat-fieldname.
when 'MATNR'.
i_fieldcat-col_pos = 1.
i_fieldcat-key = 'X'.
when 'MAKTX'.
i_fieldcat-col_pos = 2.
i_fieldcat-ddic_outputlen = 40.
when 'LIFNR'.
i_fieldcat-col_pos = 3.
when 'MEINS'.
i_fieldcat-col_pos = 4.
i_fieldcat-reptext_ddic = 'UoM'.
when 'WAERS'.
i_fieldcat-col_pos = 5.
when 'SPAMT'.
i_fieldcat-col_pos = 6.
i_fieldcat-ddic_outputlen = 20.
i_fieldcat-seltext_l = 'Spend to Crnt Dt'.
i_fieldcat-reptext_ddic = 'Spend to Crnt Dt'.
when 'SPQTY'.
i_fieldcat-col_pos = 7.
i_fieldcat-ref_tabname = 'EKBE'.
i_fieldcat-ref_fieldname = 'MENGE'.
i_fieldcat-reptext_ddic = 'QTY to Current Dt'.
i_fieldcat-seltext_l = 'QTY to Current Dt'.
when others.
i_fieldcat-no_out = 'X'.
i_fieldcat-col_pos = 0.
endcase.
modify i_fieldcat.
endloop.
11-15-2007 12:17 AM
Hi Sam,
Change code as below and try
when 'SPQTY'.
i_fieldcat-col_pos = 7.
i_fieldcat-ref_tabname = 'EKBE'.
i_fieldcat-ref_fieldname = 'MENGE'.
<b>i_fieldcat-ref_qfieldname = 'MEINS'.
i_fieldcat-ref_qtabname = 'EKPO'.</b>
i_fieldcat-reptext_ddic = 'QTY to Current Dt'.
i_fieldcat-seltext_l = 'QTY to Current Dt'.
Regards,
Atish
11-15-2007 3:35 PM
Hi Atish,
I worked. But it worked with this logic:
when 'SPQTY'.
i_fieldcat-col_pos = 7.
i_fieldcat-qfieldname = 'MENGE'.
i_fieldcat-qtabname = 'EKBE'.
i_fieldcat-reptext_ddic = 'QTY to Current Dt'.
i_fieldcat-seltext_l = 'QTY to Current Dt'.
Thanks for your help though.