Application Development 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: 

Question to: ALV_XXL_CALL

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

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 !!!

0 Kudos

Hi SKC,

many thanks, it works very good.

I thinks sometimes it's better to use the debugger before

post a thread??

Regards, Dieter

0 Kudos

Right.. very true.

0 Kudos

I want to open the excel output as preview in excel format. Could you provide more modifications?