2008 Oct 23 4:48 PM
Hi All,
I have created a dynamic table with selected fields.
Copied data from one internal table to dynmic table. For DEC type data I am getting only integer part no decimal part, where as for CURR it is showing full (inclding decimal)
How to solve this problem.
I am using lvc_t_fcat
for RFMNG form vbap.
in lvc_t_fcat it is showing intlen = 5 and datatype = DEC inttype = P.
But the data transfering only interger part.
-- Field catalog with the fields the user selected, used as input
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_alv_cat[]
IMPORTING
ep_table = t_new_table.
*-- Create ref to the newly generated table <fs_table>
*-- Plus a new Line with the same structure as the table.
ASSIGN t_new_table->* TO <fs_table>.
IF <fs_table> IS ASSIGNED.
CREATE DATA w_new_line LIKE LINE OF <fs_table>.
ASSIGN w_new_line->* TO <fs_line>.
ENDIF.
CREATE DATA w_new_line_ori LIKE LINE OF t_datatable.
ASSIGN w_new_line_ori->* TO <fs_line_ori>.
LOOP AT t_datatable ASSIGNING <fs_line_ori>.
MOVE-CORRESPONDING <fs_line_ori> TO <fs_line>.
APPEND <fs_line> TO <fs_table>.
ENDLOOP.
Advance Thanks
Balamurugan.R
Hi All,
I have created a dynamic table with selected fields.
Copied data from one internal table to dynmic table. For DEC type data I am getting only integer part no decimal part, where as for CURR it is showing full (inclding decimal)
How to solve this problem.
I am using lvc_t_fcat
for RFMNG form vbap.
in lvc_t_fcat it is showing intlen = 5 and datatype = DEC inttype = P.
But the data transfering only interger part.
-- Field catalog with the fields the user selected, used as input
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_alv_cat[]
IMPORTING
ep_table = t_new_table.
*-- Create ref to the newly generated table <fs_table>
*-- Plus a new Line with the same structure as the table.
ASSIGN t_new_table->* TO <fs_table>.
IF <fs_table> IS ASSIGNED.
CREATE DATA w_new_line LIKE LINE OF <fs_table>.
ASSIGN w_new_line->* TO <fs_line>.
ENDIF.
CREATE DATA w_new_line_ori LIKE LINE OF t_datatable.
ASSIGN w_new_line_ori->* TO <fs_line_ori>.
LOOP AT t_datatable ASSIGNING <fs_line_ori>.
MOVE-CORRESPONDING <fs_line_ori> TO <fs_line>.
APPEND <fs_line> TO <fs_table>.
ENDLOOP.
Advance Thanks
Balamurugan.R
2008 Oct 23 5:20 PM
you need to send these information when you are working with dynamic tables , if possible try to mention ref_field , ref_table
fieldc-fieldname = details-name .
fieldc-datatype = details-type_kind.
fieldc-inttype = details-type_kind.
fieldc-intlen = details-length.
fieldc-decimals = details-decimals.
2008 Oct 24 8:08 AM
Hi Vijay,
I did't find the field name fieldc* in lvc_ table.
Could you explain little more.
Thanks,
Balamuruagan.R
2008 Oct 24 8:29 AM
in my above post fieldc is of type lvc_s_fcat. then how you coded in your previous post.
go to lvc_s_fcat check it once. you can find all the fields what ever i mentioned.
2008 Oct 24 10:28 AM
Hi vijay,
Thank you. It helped me.
So, to create dynamic table , the following fields are enough?.
Ref_field
ref_table
decimals
fieldname
datatype
inttype
intlen
Thanks,
Balamurugan.R
2008 Oct 24 10:34 AM