2007 Aug 23 10:17 AM
Hi,
i try this short example:
TYPE-POOLS: KKBLO.
DATA: PROGNAME LIKE SY-REPID,
FIELDCAT_LVC TYPE LVC_T_FCAT,
FIELDCAT_KKBLO TYPE KKBLO_T_FIELDCAT,
LAYOUT_KKBLO TYPE KKBLO_LAYOUT.
*
DATA: ITAB TYPE TABLE OF MARA.
*
SELECT * FROM MARA INTO TABLE ITAB UP TO 10 ROWS.
*
PROGNAME = SY-REPID.
*
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'MARA'
I_CLIENT_NEVER_DISPLAY = 'X'
CHANGING
CT_FIELDCAT = FIELDCAT_LVC
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
*
IF SY-SUBRC <> 0.
ENDIF.
*
CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
EXPORTING
IT_FIELDCAT_LVC = FIELDCAT_LVC
IMPORTING
ET_FIELDCAT_KKBLO = FIELDCAT_KKBLO
ES_LAYOUT_KKBLO = LAYOUT_KKBLO.
*
IF SY-SUBRC <> 0.
ENDIF.
*
CALL FUNCTION 'ALV_XXL_CALL'
EXPORTING
I_TABNAME = 'ITAB'
IT_FIELDCAT = FIELDCAT_KKBLO
IS_LAYOUT = LAYOUT_KKBLO
TABLES
IT_OUTTAB = ITAB
EXCEPTIONS
FATAL_ERROR = 1
NO_DISPLAY_POSSIBLE = 2
OTHERS = 3.
*
I get a fatal-error in ALV_XXL_CALL.
When i set: I_TABNAME = '1' it works OK.
Can anyone tell me why?
In execl i don't get all column (89 instead of 214 in FIELDCAT_KKBLO).
Can anyone tell me why?
Thanks.
regards, Dieter
2007 Aug 23 11:47 AM
add these lines too -
data : wa_kkblo type line of KKBLO_T_FIELDCAT.
wa_kkblo-tabname = 'ITAB'.
MODIFY FIELDCAT_KKBLO FROM WA_KKBLO
TRANSPORTING TABNAME WHERE TABNAME <> SPACE.
-
Untill you do this the FM wont know which internakl table is getting displayed, when it does not find anythinh , it defaults it to 1. thats why it works.
You can see it in debugging mode.
Hope it solves ur problem.
2007 Aug 23 11:47 AM
add these lines too -
data : wa_kkblo type line of KKBLO_T_FIELDCAT.
wa_kkblo-tabname = 'ITAB'.
MODIFY FIELDCAT_KKBLO FROM WA_KKBLO
TRANSPORTING TABNAME WHERE TABNAME <> SPACE.
-
Untill you do this the FM wont know which internakl table is getting displayed, when it does not find anythinh , it defaults it to 1. thats why it works.
You can see it in debugging mode.
Hope it solves ur problem.
2007 Aug 23 12:02 PM
Hi SKC,
that's it. thanks.
Do you have an idea to mey second question?
In execl i don't get all column (89 instead of 214 in FIELDCAT_KKBLO).
Regards, Dieter
2007 Aug 23 12:29 PM
Yes-
FM- LVC_FIELDCATALOG_MERGE by default tuns NO_OUT = 'X' from column # 89 onwards.
So you will need to handle that in your code too -
so thats the trick for 89 instead of 214.
Hope it solves the problem !!!
2007 Aug 23 1:04 PM
Hi SKC,
many thanks, it works very good.
I thinks sometimes it's better to use the debugger before
post a thread??
Regards, Dieter
2007 Aug 23 1:06 PM
2024 Mar 15 5:09 AM
I want to open the excel output as preview in excel format. Could you provide more modifications?