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

Former Member
0 Likes
1,025

Dear Experts,

Please see the below report. While Debugging,after select query select query the control passes to the <b>CALL FUNCTION 'CONTROL_CHECK_WARNING_STATUS'</b> which is not used in my program and the message at status bar is <b>'the specified table name not</b> <b>recognised'</b> and also internal table (ig_ek)contains values after select query.When it has been executed the ALV doesn't contains any values.

REPORT zreport .

TYPES : BEGIN OF ig_ekt,

c1 TYPE zinfo6-zcol1,

c2 TYPE zinfo9-zcol2,

END OF ig_ekt.

data ig_ek type ig_ekt occurs 0.

DATA alv_list1 TYPE REF TO cl_gui_alv_grid.

SELECT zcol1 zcol2 FROM zinfo6 INTO TABLE ig_ek.

CREATE OBJECT alv_list1

EXPORTING i_parent = cl_gui_container=>screen0.

CALL METHOD alv_list1->set_table_for_first_display

EXPORTING

i_structure_name = 'ZInfo6'

CHANGING

it_outtab = ig_ek[].

CALL SCREEN 221.

I suspect the error has occured at declaration part of structure and internal table.

If it is so,Can any one write down the syntax for declaring an internal table which is of type structure.The structure contains fields come from more than one tables in abap objects programming?

Hope to get answers from SAP community,

Thanks,

Raj

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
972

Hello,

If the structure of ZINFO9 is same as IG_EKT1, then declare IG_EK as:-

DATA ig_ek type table of ZINFO9.

If the structure is different, then you need to create a FIELD CATALOG with same fields as your TYPE IG_EKT1. And pass this FIELD CATALOG to the Method to create ALV and not the structure name ZINFO9.

Regards,

Beejal

**reward if this helps

7 REPLIES 7
Read only

Former Member
0 Likes
972

Hi,

Give structure name in capital letters

i_structure_name = 'ZINFO6'

Thanks,

Naren

Read only

0 Likes
972

Hi Naren,

Thanks for ur reply.

Even after changing the case of zinfo6, the problem is same.

Regards,

Raj

Read only

Former Member
0 Likes
973

Hello,

If the structure of ZINFO9 is same as IG_EKT1, then declare IG_EK as:-

DATA ig_ek type table of ZINFO9.

If the structure is different, then you need to create a FIELD CATALOG with same fields as your TYPE IG_EKT1. And pass this FIELD CATALOG to the Method to create ALV and not the structure name ZINFO9.

Regards,

Beejal

**reward if this helps

Read only

0 Likes
972

Hello Beejwal,

Hearty Thanks

Raj

Read only

0 Likes
972

Hi Beejal,

Below is the modified program as u said.

REPORT ZREPORT .

DATA: G_CONT TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

alv_list1 TYPE REF TO cl_gui_alv_grid,

G_FCAT TYPE LVC_T_FCAT,

W_FCAT TYPE LVC_S_FCAT.

TYPES : BEGIN OF ig_ekt1,

c1 TYPE zinfo6-zcol1,

c2 TYPE zinfo9-zcol2,

END OF ig_ekt1.

data ig_ek type ig_ekt1 occurs 0.

start-of-selection.

SELECT zcol1 zcol2 FROM zinfo6 INTO TABLE ig_ek.

W_FCAT-FIELDNAME = 'zcol1'.

W_FCAT-TABNAME = 'zinfo6'.

W_FCAT-COLTEXT = 'COLUMN1'.

W_FCAT-OUTPUTLEN = '20'.

APPEND W_FCAT TO G_FCAT.

W_FCAT-FIELDNAME = 'zcol2'.

W_FCAT-TABNAME = 'zinfo6'.

W_FCAT-COLTEXT = 'COLUMN2'.

W_FCAT-OUTPUTLEN = '20'.

APPEND W_FCAT TO G_FCAT.

CREATE OBJECT alv_list1

EXPORTING i_parent = cl_gui_container=>screen0.

CALL METHOD alv_list1->set_table_for_first_display

CHANGING

it_outtab = ig_ek[]

IT_FIELDCATALOG = G_FCAT.

CALL SCREEN 221.

Still the final ALV shows empty fields.

Can u pls check it out?

I would be much happy if get back reply from u soon.

Thanks,

Raj bala

Read only

0 Likes
972

Hi

Try this:

W_FCAT-FIELDNAME = 'C1'.
W_FCAT-TABNAME   = 'IG_EK'.
W_FCAT-REF_FIELD = 'ZCOL1'.
W_FCAT-REF_TABLE = 'ZINFO6'.
W_FCAT-COLTEXT = 'COLUMN1'.
W_FCAT-OUTPUTLEN = '20'.
APPEND W_FCAT TO G_FCAT.
W_FCAT-FIELDNAME = 'C2'.
W_FCAT-TABNAME   = 'IG_EK'.
W_FCAT-REF_FIELD = 'ZCOL2'.
W_FCAT-REF_TABLE = 'ZINFO6'.
W_FCAT-COLTEXT = 'COLUMN2'.
W_FCAT-OUTPUTLEN = '20'.
APPEND W_FCAT TO G_FCAT.

Max

Read only

0 Likes
972

Dear Max Bianchi,

Hearty thanks for ur reply.

This works good.

Thanks and Regards,

Raj Bala