hi evryone,
I have been trying to use the function module reuse_alv_fieldcatalog_merge, but iam facing some problem with it.
can anybody tell me how to use it or if possible any small piece of code that can help.
the way iam trying to use it as follows
the internal table is i_del.
data s_fieldcat type slis_t_fieldcat_alv with header line. "declaring the field catalog
DATA REPNAME LIKE SY-REPID.
form zf_build_catalog .
data l_fieldcat type slis_fieldcat_alv.
REPNAME = SY-REPID.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = REPNAME
I_INTERNAL_TABNAME = 'I_DEL'
I_STRUCTURE_NAME = l_fieldcat
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = S_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.
loop at s_fieldcat into l_fieldcat.
case s_fieldcat-fieldname.
when 'VBELN'.
l_fieldcat-outputlen = 20.
l_fieldcat-seltext_l = 'Delivery'.
modify s_fieldcat from l_fieldcat.
when 'LFART'.
l_fieldcat-outputlen = 20.
l_fieldcat-seltext_l = 'Delivery Type'.
modify s_fieldcat from l_fieldcat.
when 'LFDAT'.
l_fieldcat-outputlen = 20.
l_fieldcat-seltext_l = 'Delivery Date'.
modify s_fieldcat from l_fieldcat.
when 'POSNR'.
l_fieldcat-outputlen = 20.
l_fieldcat-seltext_l = 'Item'.
modify s_fieldcat from l_fieldcat.
when 'MATNR'.
l_fieldcat-outputlen = 20.
l_fieldcat-seltext_l = 'Material'.
modify s_fieldcat from l_fieldcat.
endcase.
endloop.
endform. " zf_build_catalog
Hi Varun,
In the parameter I_STRUCTURE_NAME, you are passing a field catalog, which is incorrect. It should be something like 'EKKO' or 'SCARR'. Is it a custom structure ? Have you maintained/created this custom structure in database(SE11) ?
Usually, merging of field-catalogs is done in programs where a hierarchy is to be displayed. Look at this program <b>BALVHD01</b> or even better do a WHERE-USED-LIST for the function module and you might find a better program.
Regards,
Subramanian V.
Hello Varun,
table structure of 'working' example is flat: just a list of fields.
Your table structure contains some fields and a table celcol (because slis_t_specialcol_alv defines a table). If you want to include the fields, use slis_specialcol_alv.
Rgds,
Christian
Add a comment