Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Decimal place in dynamic table

0 Likes
1,269

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

5 REPLIES 5
Read only

Former Member
0 Likes
913

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.

Read only

0 Likes
913

Hi Vijay,

I did't find the field name fieldc* in lvc_ table.

Could you explain little more.

Thanks,

Balamuruagan.R

Read only

0 Likes
913

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.

Read only

0 Likes
913

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

Read only

0 Likes
913

yes they are sufficient.