Application Development 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: 

field catalog

Former Member
0 Kudos
115

hi

in alv interactive list how can i display the fields in which the fields doesn't present in database tables.

1 ACCEPTED SOLUTION

anversha_s
Active Contributor
0 Kudos
86

hi,

1. Create an Internal table with all the fields you required.

2. Create a fieldcatlog with repect to that internal table.

3. Automaticall u will get all the field in the output.

Rgds

Anversha

6 REPLIES 6

Former Member
0 Kudos
86

Hi

U can use the fm REUSE_ALV_FIELDCATALOG_MERGE to create the catalog in order of definition of output table:

 BEGIN OF T_OUTPUT OCCURS 0,
         FIELD1 LIKE .....,
         ..................
       END   OF T_OUTPUT.    
  
  
  GT_REPID = SY-REPID.
  
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            I_PROGRAM_NAME     = GT_REPID
            I_INTERNAL_TABNAME = 'T_OUTPUT'
            I_INCLNAME         = GT_REPID
       CHANGING
            CT_FIELDCAT        = GT_FIELDCAT[].

If you need u can insert the characteristics of a field in catalog table by your self:

LS_FIELDCAT-FIELDNAME = ......
....................................
APPEND LS_FIELDCAT TO GT_FIELDCAT.

Max

Former Member
0 Kudos
86

Hi

You hardcode the Values for the fields which are not there in database table

and which yopu wants to display in the output.

that is the only way to display the fields which are not there in databse.

So during the internal table population hardcode the values and fill the internal table.

Reward points if useful

Regards

Anji

Former Member
0 Kudos
86

Hi,

in that case u should prepare the fieldcat manually like shown below.

CLEAR AFIELD.

AFIELD-Col_pos = 1.

AFIELD-seltext_m = 'NAME'.

AFIELD-KEY = 'X'.

AFIELD-datatype = 'CHAR'.

AFIELD-intlen = '20'.

APPEND AFIELD TO FIELDCAT.

CLEAR FIELDCAT.

CLEAR AFIELD.

AFIELD-Col_pos = 2.

AFIELD-seltext_m = 'NUMBER'.

AFIELD-datatype = 'CHAR'.

AFIELD-intlen = '10'.

APPEND AFIELD TO FIELDCAT.

CLEAR FIELDCAT.

rgds,

bharat.

anversha_s
Active Contributor
0 Kudos
87

hi,

1. Create an Internal table with all the fields you required.

2. Create a fieldcatlog with repect to that internal table.

3. Automaticall u will get all the field in the output.

Rgds

Anversha

Former Member
0 Kudos
86

Please try to close your previous threads by rewarding points...

The question with heading <b>Count</b>

Former Member
0 Kudos
86

hi,

define an final internal table.

data : begin of itab_final,

field1 like <table name>-<fieldname>,

field2 like <table name>-<fieldname>,

end of itab_final.

d_fieldcat_wa-fieldname = 'FIELD1'.

d_fieldcat_wa-seltext_l = 'field 1'.

d_fieldcat_wa-col_pos = 1.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'FIELD2'.

d_fieldcat_wa-seltext_l = 'field 2'.

d_fieldcat_wa-col_pos = 2.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

data : gd_repid like sy-repid.

gd_repid = sy-repid.

call function module reuse_alv_grid_display.

exporting.

program name = gd_repid.

t_fieldcatalog = d_fieldcat.

importing.

t_outtab = itab.

exceptions.

Reward with points if helpful.