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: 

why do u specify i_structure_name in FM 'REUSE_ALV_FIELDCATALOG_MERGE'

mallikarjun_vaja
Participant
0 Kudos
1,272

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

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos
220

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

4 REPLIES 4

Former Member
0 Kudos
220

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

Former Member
0 Kudos
220

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

former_member188685
Active Contributor
0 Kudos
221

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