0% found this document useful (0 votes)
89 views5 pages

I - INTERFACE - CHECK of ALV FM(S) Must Contain X'

This document discusses enabling an ALV interface check in ABAP to identify any errors or inconsistencies in the interface parameters passed between programs. The check is enabled by setting the interface parameter I_INTERFACE_CHECK of the ALV function module to 'X'. This will display additional screens to show any warnings or error messages before presenting the final ALV output. It is recommended to perform this check during development to troubleshoot any issues before delivering the final code.

Uploaded by

assign79
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views5 pages

I - INTERFACE - CHECK of ALV FM(S) Must Contain X'

This document discusses enabling an ALV interface check in ABAP to identify any errors or inconsistencies in the interface parameters passed between programs. The check is enabled by setting the interface parameter I_INTERFACE_CHECK of the ALV function module to 'X'. This will display additional screens to show any warnings or error messages before presenting the final ALV output. It is recommended to perform this check during development to troubleshoot any issues before delivering the final code.

Uploaded by

assign79
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

ALV interface check

By Joyjit Ghosh, IBM India

In ALV we have an option to check the interface parameters, which we are passing from our program.
This check will identify any problem(s) that may occur during calling the ALV FM or ALV class method. It
is advisable to perform this check before formal submission of the code to avoid any inconsistency that
can lead to problem(s), even program termination in worst case. To enable this check interface parameter
I_INTERFACE_CHECK of ALV FM(s) must contain ‘X’.

Example:
*&-------------------------------------------------------------*
*& Report Z_ALV_INTERFACE_CHECK *
*& *
*&--------------------------------------------------------------
REPORT z_alv_interface_check .
***************************************************************
* Type pool declaration for ALV
***************************************************************
TYPE-POOLS: slis.
***************************************************************
* Table
***************************************************************
TABLES: sbook.
***************************************************************
* Type declaration for SBOOK table
***************************************************************
TYPES: BEGIN OF ty_sbook,
carrid TYPE s_carr_id, " Airline Code
connid TYPE s_conn_id, " Flight Connection Number
fldate TYPE s_date, " Flight date
bookid TYPE s_book_id, " Booking number
customid TYPE s_customer," Customer Number
END OF ty_sbook.
*****************************************************************
* Table declaration for SBOOK table
*****************************************************************
DATA: i_sbook TYPE STANDARD TABLE OF ty_sbook INITIAL SIZE 0,

****************************************************************
* Table declaration for field catalog
****************************************************************
i_fcata TYPE slis_t_fieldcat_alv.
****************************************************************
* Workarea declaration for field catalog table
****************************************************************
DATA: w_fcata TYPE slis_fieldcat_alv.
****************************************************************
* Selection screen
**************************************************************
SELECT-OPTIONS: s_carrid FOR sbook-carrid.
***************************************************************
* Start-of-selection event
****************************************************************
* Fetch data from sbook table
PERFORM fetch_data.
* Populate field catalog
PERFORM populate_catalog.
* Display data in ALV
PERFORM display_alv.
*&--------------------------------------------------------------
*& Form fetch_data
*&-------------------------------------------------------------
FORM fetch_data .
SELECT carrid " Airline Code
connid " Flight Connection Number
fldate " Flight date
bookid " Booking number
customid " Customer Number
FROM sbook
INTO TABLE i_sbook
WHERE carrid IN s_carrid.
IF sy-subrc = 0.
SORT i_sbook BY carrid.
ENDIF.
ENDFORM. " fetch_data
*&-------------------------------------------------------------*
*& Form populate_catalog
*&--------------------------------------------------------------
FORM populate_catalog .
w_fcata-fieldname = 'CARRID'.
w_fcata-tabname = 'I_SBOOK'.
w_fcata-seltext_m = 'Airline Code'(001).
w_fcata-ddictxt = 'M'.
APPEND w_fcata to i_fcata.
w_fcata-fieldname = 'CONNID'.
w_fcata-tabname = 'I_SBOOK'.
w_fcata-seltext_m = 'Flight Connection Number'(002).
w_fcata-ddictxt = 'M'.
APPEND w_fcata to i_fcata.
* Wrong field name FIDATE
w_fcata-fieldname = 'FIDATE'.
w_fcata-tabname = 'I_SBOOK'.
w_fcata-seltext_m = 'Flight date'(003).
w_fcata-ddictxt = 'M'.
APPEND w_fcata to i_fcata.
* Wrong field name BOOKLD
w_fcata-fieldname = 'BOOKLD'.
w_fcata-tabname = 'I_SBOOK'.
w_fcata-seltext_m = 'Booking number'(004).
w_fcata-ddictxt = 'M'.
APPEND w_fcata to i_fcata.
w_fcata-fieldname = 'CUSTOMID'.
w_fcata-tabname = 'I_SBOOK'.
w_fcata-seltext_m = 'Customer Number'(005).
w_fcata-ddictxt = 'M'.
APPEND w_fcata to i_fcata.
ENDFORM. " populate_catalog
*&----------------------------------------------------------
*& Form display_alv
*&-----------------------------------------------------------
form display_alv .
data: l_repid type sy-repid.
l_repid = sy-repid.
* Interface check parameter, we have to pass ‘X’ as value in this parameter
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = 'X'
I_CALLBACK_PROGRAM = l_repid
IT_FIELDCAT = i_fcata
TABLES
t_outtab = i_sbook
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " display_alv

Selection screen:

Output:

Additional screen (before showing the final output) to show the error or warning or success
message(s) 

Also various buttons are present on the application tool bar to check contents of Fieldcatalog, 
Layout, Sort, Filter, Events, Variant, and Special Fieldgroup. 

Fieldcatalog:
 

Layout:

Sort:

Filter:

Event:

Variant:
 

Field group:

From the initial screen if we press back button then it will display the final output. 

Final output:

Note:

1. Always remember to switch off this check before formal code delivery otherwise these extra screen(s)
can confuse the end user.
2. In ECC 5.0, I have seen that this check does not work with FM REUSE_ALV_GRID_DISPLAY, in that
case we need to convert grid to list temporarily to implement this check.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy