‎2008 May 14 5:29 PM
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,
‎2008 May 14 5:53 PM
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.
‎2008 May 14 5:32 PM
‎2008 May 14 5:33 PM
is your table IAN is with header line , if yes the pass IAN[] to the method and see,
Regards
Arun
‎2008 May 14 5:53 PM
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.