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: 

Semi Automatic Field catalog

Former Member
0 Kudos

Hi Experts,

I have to display 20-25 fields in o/p.Hence i have used semi-automatic field catalog.

it_vendor is internal table having fields from table lfa1,lfb1,lfbw,lfbk.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = sy-repid

I_INTERNAL_TABNAME = 'IT_VENDOR'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

  • I_INCLNAME =

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = pt_fieldcat

  • EXCEPTIONS

  • INCONSISTENT_INTERFACE = 1

  • PROGRAM_ERROR = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

but i am getting dump ,

Type conflict when calling function module "REUSE_ALV_FIELDCATALOG_MERGE".

Please suggest.

Rgds,

Kaustubh.

1 ACCEPTED SOLUTION

former_member386202
Active Contributor
0 Kudos

Hi,

It doesnt work in ECC, build manually fieldcatalog. Refer Below code

it_fieldcat-fieldname = 'ERDAT'.

it_fieldcat-seltext_m = text-005.

it_fieldcat-col_pos = 0.

it_fieldcat-outputlen = 8.

it_fieldcat-emphasize = 'X'.

it_fieldcat-key = 'X'.

APPEND it_fieldcat TO it_fieldcat.

CLEAR it_fieldcat.

it_fieldcat-fieldname = 'OLTOT'.

it_fieldcat-seltext_m = text-006.

it_fieldcat-col_pos = 1.

it_fieldcat-outputlen = 4.

APPEND it_fieldcat TO it_fieldcat.

CLEAR it_fieldcat.

it_fieldcat-fieldname = 'SOTOT'.

it_fieldcat-seltext_m = text-007.

it_fieldcat-col_pos = 2.

it_fieldcat-outputlen = 4.

APPEND it_fieldcat TO it_fieldcat.

CLEAR it_fieldcat.

it_fieldcat-fieldname = 'COREBUS'.

it_fieldcat-seltext_m = text-008.

it_fieldcat-col_pos = 3.

it_fieldcat-outputlen = 15.

APPEND it_fieldcat TO it_fieldcat.

CLEAR it_fieldcat.

it_fieldcat-fieldname = 'ONBULK'.

it_fieldcat-seltext_m = text-009.

it_fieldcat-col_pos = 4.

it_fieldcat-outputlen = 15.

APPEND it_fieldcat TO it_fieldcat.

CLEAR it_fieldcat.

Regards,

Prashant

3 REPLIES 3

former_member386202
Active Contributor
0 Kudos

Hi,

It doesnt work in ECC, build manually fieldcatalog. Refer Below code

it_fieldcat-fieldname = 'ERDAT'.

it_fieldcat-seltext_m = text-005.

it_fieldcat-col_pos = 0.

it_fieldcat-outputlen = 8.

it_fieldcat-emphasize = 'X'.

it_fieldcat-key = 'X'.

APPEND it_fieldcat TO it_fieldcat.

CLEAR it_fieldcat.

it_fieldcat-fieldname = 'OLTOT'.

it_fieldcat-seltext_m = text-006.

it_fieldcat-col_pos = 1.

it_fieldcat-outputlen = 4.

APPEND it_fieldcat TO it_fieldcat.

CLEAR it_fieldcat.

it_fieldcat-fieldname = 'SOTOT'.

it_fieldcat-seltext_m = text-007.

it_fieldcat-col_pos = 2.

it_fieldcat-outputlen = 4.

APPEND it_fieldcat TO it_fieldcat.

CLEAR it_fieldcat.

it_fieldcat-fieldname = 'COREBUS'.

it_fieldcat-seltext_m = text-008.

it_fieldcat-col_pos = 3.

it_fieldcat-outputlen = 15.

APPEND it_fieldcat TO it_fieldcat.

CLEAR it_fieldcat.

it_fieldcat-fieldname = 'ONBULK'.

it_fieldcat-seltext_m = text-009.

it_fieldcat-col_pos = 4.

it_fieldcat-outputlen = 15.

APPEND it_fieldcat TO it_fieldcat.

CLEAR it_fieldcat.

Regards,

Prashant

Former Member
0 Kudos

Hi

Have a look at this wiki.This will explains you the exact way, to do it.

[https://wiki.sdn.sap.com/wiki/display/ABAP/Fieldcatalogtypes]

Regards

Hareesh

Former Member
0 Kudos

Hi kaustabh,

instead of passing inetrnal table pass its structure as export parameter and pt_fieldcat shd be of type

slis_t_fieldcat_alv..

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = sy-repid

*I_INTERNAL_TABNAME = 'IT_VENDOR'

I_STRUCTURE_NAME = 'FS_VENDOR'

*I_CLIENT_NEVER_DISPLAY = 'X'

*I_INCLNAME =

*I_BYPASSING_BUFFER =

*I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = pt_fieldcat

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

.

IF sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards,

Mdi.Deeba