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

Problem with ALV

Former Member
0 Likes
545

HI,

I am creating ALV report. I have declared one internal table with fields

like tables ables, anlv, anek,anlz, anlcv..tec. I am using Logial database

to select the data for internal table. After selecting all the required data

to internal table, I am facing the following problem.

When I use the following code to create ALV I am getting the error saying

.."IAN (Internal table) is not compatible with formal parameter "IT_OUTTAB"

MODULE PBO OUTPUT.

SET PF-STATUS 'MAIN100'.

IF G_CUSTOM_CONTAINER IS INITIAL.

CREATE OBJECT G_CUSTOM_CONTAINER

EXPORTING CONTAINER_NAME = G_CONTAINER.

CREATE OBJECT GRID1

EXPORTING I_PARENT = G_CUSTOM_CONTAINER.

CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY

CHANGING

IT_OUTTAB = IAN.

ENDIF.

ENDMODULE.

But when I use single table only like ANLV there is no problem..

Thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
517

Yes such problem comes in case of ALV.

Now to resolve the same in 2 ways :

1. You can create a User defined structure in SAP and refer

to the sam when writing the code. As in following code

ZSFLIGHT.

*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>

CALL METHOD grid->set_table_for_first_display

EXPORTING

I_STRUCTURE_NAME = 'ZSFLIGHT' =93Structure data

CHANGING

IT_OUTTAB = gt_sflight. =93 Output table

*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<

OTHERWISE,

2. Create a field catalog and use the same integrating with your ALV

for that you have to use

*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>

call function 'LVC_FIELDCATALOG_MERGE'

exporting

i_structure_name = 'STRUCT / table'

changing

ct_fieldcat = p_invfieldcat[].

***then associate the same with set_table_for_first_display as follows.

call method grid->set_table_for_first_display

exporting

is_layout = gs_layout

changing

it_fieldcatalog = invfieldcat[]

it_outtab = outinvoice.

*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<

One more option is to USE full screen ALV.

3 REPLIES 3
Read only

Former Member
0 Likes
517

Hi,

Can you elaborate your requirement.

Read only

Former Member
0 Likes
517

is your table IAN is with header line , if yes the pass IAN[] to the method and see,

Regards

Arun

Read only

Former Member
0 Likes
518

Yes such problem comes in case of ALV.

Now to resolve the same in 2 ways :

1. You can create a User defined structure in SAP and refer

to the sam when writing the code. As in following code

ZSFLIGHT.

*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>

CALL METHOD grid->set_table_for_first_display

EXPORTING

I_STRUCTURE_NAME = 'ZSFLIGHT' =93Structure data

CHANGING

IT_OUTTAB = gt_sflight. =93 Output table

*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<

OTHERWISE,

2. Create a field catalog and use the same integrating with your ALV

for that you have to use

*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>

call function 'LVC_FIELDCATALOG_MERGE'

exporting

i_structure_name = 'STRUCT / table'

changing

ct_fieldcat = p_invfieldcat[].

***then associate the same with set_table_for_first_display as follows.

call method grid->set_table_for_first_display

exporting

is_layout = gs_layout

changing

it_fieldcatalog = invfieldcat[]

it_outtab = outinvoice.

*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<

One more option is to USE full screen ALV.