Application Development and Automation 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: 
Read only

ALV:field catalogue for structure defined in program

Former Member
0 Likes
652

Dear freiends,

how do i pass a structure defined in a program (not global

structure) to function LVC_FIELDCATALOG_MERGE to build field catalogue.

kind regards

kaushik

Dear freiends,

how do i pass a structure defined in a program (not global

structure) to function LVC_FIELDCATALOG_MERGE to build field catalogue.

kind regards

kaushik

3 REPLIES 3
Read only

athavanraja
Active Contributor
0 Likes
575

You need to use the following

move: sy-repid to wf_repid  ,
        'INT_OUTPUT' to int_tab_name . (name of the itab)

  call function 'REUSE_ALV_FIELDCATALOG_MERGE'
   exporting
     i_program_name              = wf_repid
     i_internal_tabname          = int_tab_name
*   I_STRUCTURE_NAME             =
*   I_CLIENT_NEVER_DISPLAY       = 'X'
    i_inclname                   = wf_repid
    i_bypassing_buffer           = 'X'
*   I_BUFFER_ACTIVE              =
    changing
      ct_fieldcat                  = wf_fld_cat[]
   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

Raja

Read only

andreas_mann3
Active Contributor
0 Likes
575

Hi kaushik,

and have a look to this thread:

regards Andreas

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
575

Hi Kaushik

Try to create a DDIC structure like the one you define in your program and use it.

Other way ise to use "REUSE_FIELDCATALOG_MERGE", take its field catalog output of type "slis..." and use a transfer function. You can find it by searching. Its name should contain 'TRANSFER'. But you may need an intermediary transformation to "kkblo..." type fieldcatalog if the transfer function is not directly transforming it.

<u>i.e.</u>
slis  --> lvc
OR
slis  --> kkblo ( Transfer FM 1 )
kkblo --> lvc . ( Transfer FM 2 )

As you see, this way is more boring. So, I recommend using a DDIC structure.

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>