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

Internal Table Question

Former Member
0 Likes
534

Hi, I've created an internal table with 4 columns. Is it possible to somehow reference individual columns from that table? And if so, can I get the field-name of that column?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
501

Hi Warren,

i allways use this:

*

TYPE-POOLS: SLIS.

*

DATA: PROGNAME LIKE SY-REPID,

FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

*

PROGNAME = SY-REPID.

*

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = PROGNAME

I_INTERNAL_TABNAME = 'ITAB'

I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = PROGNAME

CHANGING

CT_FIELDCAT = FIELDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

*

Regards, Dieter

4 REPLIES 4
Read only

Former Member
0 Likes
501

Hi warren,

1. can I get the field-name of that column

2. using FM

GET_COMPONENT_LIST'

3.

DATA : components LIKE rstrucinfo OCCURS 0 WITH HEADER LINE.

*----


Get component list

CALL FUNCTION 'GET_COMPONENT_LIST'

EXPORTING

program = sy-repid

fieldname = 'ITAB'

TABLES

components = components.

regards,

amit m.

Read only

Former Member
0 Likes
501

I am not 100% sure of your requirement but you can reference it as itab-field

As for getting the field name etc..check the different variations of DESCRIBE.

Regards

Anurag

Read only

Former Member
0 Likes
502

Hi Warren,

i allways use this:

*

TYPE-POOLS: SLIS.

*

DATA: PROGNAME LIKE SY-REPID,

FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

*

PROGNAME = SY-REPID.

*

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = PROGNAME

I_INTERNAL_TABNAME = 'ITAB'

I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = PROGNAME

CHANGING

CT_FIELDCAT = FIELDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

*

Regards, Dieter

Read only

Former Member
0 Likes
501

Thanks for the help,I'll try your suggestions!!!