2007 May 16 5:48 PM
Hi,
my query is :
plz expalin abt the feilds i structurename and
I_INTERNAL_TABNAME
in FM 'REUSE_ALV_FIELDCATALOG_MERGE'
and when these 2 fields are used??
Iam getting confused with this?
plz explain me clearly???
regards
mallik
2007 May 16 6:33 PM
hi mallikarjun,
If you have a structure existing in SE11(data dictionary) and you want to show the fields in your output using the same structure then you can use the I_STRUCTURE_NAME.
if you have an internal table (globally declared one) declared using occurs 0 and specified the fields using LIKE then you can use the Internal table,for this you should pass the i_inclname (check it once) as sy-repid along with internal table name.
if you want to show the fields both from structure and internal table then you can use both of them.
Regards
Vijay
2007 May 16 6:06 PM
Hi,
I_STRUCTURE_NAME is used for getting for field catalog based on the DDIC structure name..
I_INTERNAL_TABNAME is used for getting the field catalog based on the internal table declaration..For this you should declare the internal table using LIKE statements..
Check this example..
TYPE-POOLS: slis.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: BEGIN OF wa_ekko,
ebeln like ekko-ebeln,
ekorg like ekko-ekorg,
ekgrp like ekko-ekgrp,
END OF wa_ekko.
DATA: v_repid TYPE syrepid.
v_repid = sy-repid.
DATA it_ekko LIKE STANDARD TABLE OF wa_ekko WITH HEADER LINE.
SELECT * UP TO 100 ROWS
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE it_ekko.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'WA_EKKO'
i_inclname = v_repid
CHANGING
ct_fieldcat = gt_fieldcat.
* have hotspot for a PO.
DATA: s_fieldcat LIKE LINE OF gt_fieldcat.
s_fieldcat-hotspot = 'X'.
MODIFY gt_fieldcat FROM s_fieldcat TRANSPORTING hotspot
WHERE fieldname = 'EBELN'.
* Pass the program.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = gt_fieldcat
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = it_ekko.
*---------------------------------------------------------------------*
* FORM display_detail *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> UCOMM *
* --> SELFIELD *
*---------------------------------------------------------------------*
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
IF ucomm = '&IC1' AND selfield-fieldname = 'EBELN'.
READ TABLE it_ekko INDEX selfield-tabindex.
IF sy-subrc = 0.
SET PARAMETER ID 'BES' FIELD it_ekko-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDFORM.
Thanks,
Naren
2007 May 16 6:07 PM
Hi
i structurename = Structure name that has to be passed
I_INTERNAL_TABNAME = internal table name on which the field catalog has to be built
The internal table to be output has the same structure as a Data Dictionary structure which is referred to in the internal table declaration using LIKE or INCLUDE STRUCTURE.all fields in this structure are to be output
the structure name is passed to ALV in the parameter I_STRUCTURE_NAME.
Reward points if useful
Regards
Anji
2007 May 16 6:33 PM
hi mallikarjun,
If you have a structure existing in SE11(data dictionary) and you want to show the fields in your output using the same structure then you can use the I_STRUCTURE_NAME.
if you have an internal table (globally declared one) declared using occurs 0 and specified the fields using LIKE then you can use the Internal table,for this you should pass the i_inclname (check it once) as sy-repid along with internal table name.
if you want to show the fields both from structure and internal table then you can use both of them.
Regards
Vijay
2007 May 16 7:24 PM