SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Creating LVC fieldcatalog Using Internal table through SLIS



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ALV Grid / ALV Tree / ALV List
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Sep 13, 2008 7:29 pm    Post subject: Creating LVC fieldcatalog Using Internal table through SLIS Reply with quote

Author: Vijay Babu Dudla

Description : Creating LVC fieldcatalog from Internal table is Directly not possible, first create the SLIS fieldcatalog using the Internal table, and then Transfer the SLIS fieldcatalog to LVC fieldcatalog using the Function module LVC_TRANSFER_FROM_SLIS.

Check the sample code.

Code:
REPORT zslis_to_lvc_fieldcatlog.
TYPE-POOLS: slis.
DATA: BEGIN OF it_data OCCURS 0,
             vbeln LIKE vbak-vbeln,
             matnr LIKE mara-matnr,
          END OF it_data.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
           it_lvcfcat TYPE lvc_t_fcat.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
      i_program_name = sy-repid
      i_internal_tabname = 'IT_DATA'
      i_inclname = sy-repid
  CHANGING
     ct_fieldcat = it_fieldcat
  EXCEPTIONS
     inconsistent_interface = 1
     program_error = 2
     OTHERS = 3.
  IF sy-subrc NE 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
 
CALL FUNCTION 'LVC_TRANSFER_FROM_SLIS'
  EXPORTING
     it_fieldcat_alv = it_fieldcat
  IMPORTING
     et_fieldcat_lvc = it_lvcfcat
  TABLES
    it_data = it_data
  EXCEPTIONS
    it_data_missing = 1
    OTHERS = 2.
  IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ALV Grid / ALV Tree / ALV List All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.