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

ALV fieldcat problem

Former Member
0 Likes
803

Hello,

i filled my internal table and i can see 14 rows in this internal table.

But when loop at fieldcat to fill it as below, i can see 13 rows in my u_er_fieldcat. how can this happen?

I checked fields and internal tables there is no wrong with those.

PERFORM fieldcat_modify USING er_fieldcat[].

FORM fieldcat_modify USING u_er_fieldcat TYPE slis_t_fieldcat_alv.

DATA: xs_fieldcat TYPE slis_fieldcat_alv.

LOOP AT u_er_fieldcat INTO xs_fieldcat.

CASE xs_fieldcat-fieldname.

WHEN '...'.

xs_fieldcat-seltext_l = '...'.

xs_fieldcat-ddictxt = 'L'.

WHEN '....'. .....

7 REPLIES 7
Read only

Former Member
0 Likes
762

why don´t you use this function?


 CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name         = repid
      i_internal_tabname     = tab
      i_inclname             = repid
      i_bypassing_buffer     = ' '
      i_buffer_active        = ' '
    CHANGING
      ct_fieldcat            = it_fieldcat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.
  CHECK sy-subrc = 0.

Read only

Dasig
Participant
0 Likes
762

Hi,

Can u copy here all ur code.

Tanks.

Read only

Clemenss
Active Contributor
0 Likes
762

Hi aydnbk,

ALV is used to display internal tables. The field catalog is used to control the way each column is displayed.

The internal table has a column structure for the data. Each line of the field catalog table refers to one column of the display table.

If you use SALV technology you do not need to create the field catalog.

First check the sample programs in your system.

Regards,

Clemens

Read only

Former Member
0 Likes
762

Hi aydnbk ,

A fieldcat will determine the number of columns and not number of rows in your output.

Regards,

Jovito.

Read only

0 Likes
762

Hello,

as mentioned you ahve 14 rows in the internal table but as you get into the perform routine no. of rows become 13.

this should not happen ideally.

how many colums do you see at the time of output?

and do consider about MANDT if you have in ur field catalog?

This you need yto analyze by yourself that how and when a row from the internal table getting deleted.

Regards,

Yadesh

Read only

Former Member
0 Likes
762

Hey,

Pls check whether the internal table has declared with HEADER LINE and without clearing the WORK AREA, you may find 14 entries in the internal table.

That may be the reason...

Read only

Former Member
0 Likes
762

Hi,

As per your issue.

You should know one thing, when creating records or assigning records from one to another

Internal table is automatically expands as dynamically.

and check once where using sequence of when condition check once.

whether using correct statemnts are not.

I think it helpful for you