Common error – ALV Fatal Error – GUI Cannot be reached

By sampath kumar – SAP ABAP CERTIFIED

Purpose: This document details about the common problem faced by many consultants: “Fatal Error – GUI cannot be reached” in ALV Grid Control.

The problem: SAP® has provided us with some demo programs on ALV. We would use one of them in our scenario. BCALV_GRID_DEMO is the demo program provided by SAP® for ALV Grid Control. When you execute the program in foreground, you get the similar following output:


When you schedule the same program in background, your job is cancelled due to an error. Screenshot of the same is shown below: 


Reason:

ALV Grid control is based on the custom controls on the screen. When the program is scheduled in background, it tries to create GUI related front-end objects and hence the error “Fatal Error – GUI cannot be reached”. This type of problem is common with all the programs that use the ALV grid control to display the output.

Solution:

Whenever we execute this type of programs in background, we should be passing a blank docking container instead of the custom container as parent to our grid control. The docking container doesn’t need any of the custom controls on the screen; instead it attaches an area to any or all of the four edges of the screen (top, left, right or bottom). The behavior of the areas in the container is determined by the sequence in which they are initialized. Docking Containers are attached to the screen from the inside out. This means that when you create a second container, it is attached to the edge of the screen, and the container that was already there is pushed outwards. Let us modify the standard program (by taking a copy of it) to enable it to execute it in background.

Following modifications have to be made:

  • Define a docking container in the program

data: or_doc type ref to cl_gui_docking_container .

  • At the time of creating a custom container, check if the program is being executed in background or foreground. If the program is scheduled in background, then create a docking container instead of custom container.

if cl_gui_alv_grid=>offline( ) is initial.

    create object or_custom_container

           exporting container_name = c_container.

  create object or_grid

         exporting i_parent = or_custom_container.

else .

create object or_grid

         exporting i_parent = or_doc .

endif .

OO ALV WITH CONTAINERS

Introduction

As we know that a SAP Container is a control that accommodates other controls, such as the SAP Tree Control, SAP Picture Control, SAP Text edit Control, SAP Splitter Control, and so on. It manages these controls logically in a collection, and provides a physical area in which they are displayed. All controls live in a container. Since containers are themselves controls, you can nest them. There are five kinds of SAP Containers:

SAP Custom Container: display controls in an area defined on a normal screen using the Screen Painter. Class: CL_GUI_CUSTOM_CONTAINER

SAP Dialog Box Container: display controls in a modal dialog box or full screen.

Class: CL_GUI_DIALOGBOX_CONTAINER

SAP Docking Container: The SAP Docking Container allows you to attach a control to any of the four edges of a screen as a resizable screen area. You can also detach it so that it becomes an independent modal dialog box. Class: CL_GUI_DOCKING_CONTAINER

SAP Splitter Container: to display more than one control in a given area by dividing it into cells. Class: CL_GUI_SPLITTER_CONTAINER

SAP Easy Splitter Container: this container allows us to divide an area into two cells with a control in each. The cells are separated by a moveable splitter bar.

Class: CL_GUI_EASY_SPLITTER_CONTAINER.

1. OO ALV USING DOCKING CONTAINER

data : o_dock type ref to cl_gui_docking_container,
o_alv type ref to cl_gui_alv_grid,
it_spfli type table of spfli,
wa_spfli type spfli,
ok_code type sy-ucomm.
select-options  : p_carr for wa_spfli-carrid.


start-of-selection.
perform data_fetch.
call screen 100.

form DATA_FETCH .
select * from spfli into table it_spfli where carrid in p_carr.
endform.                    ” DATA_FETCH


module STATUS_0100 output.
SET PF-STATUS ‘STATUS’.
SET TITLEBAR ‘TITLE’.
endmodule.                 ” STATUS_0100  OUTPUT

module USER_COMMAND_0100 input.
case ok_code.
when ‘BACK’ OR ‘EXIT’ OR ‘CANCEL’.
LEAVE TO SCREEN 0.
endcase.
endmodule.                 ” USER_COMMAND_0100  INPUT
module DISPLAY_ALV output.
if  o_dock is initial.
  * EITHER PROVIDE SIDE AND EXTENSION OR RATIO TO CREATE A DOCKING CONTAINER*
CREATE OBJECT  o_dock
EXPORTING
    side = o_dock->dock_at_left “ dock_at_right,dock_at_top,dock_at_bottom

    extension  = 2000.

* CREATE OBJECT  o_dock
*   EXPORTING

* ratio                       = 60.
endif.
  if o_alv is  initial.
CREATE OBJECT o_alv
EXPORTING
i_parent          = o_dock.
CALL METHOD o_alv->set_table_for_first_display
EXPORTING
i_structure_name              = ‘SPFLI’
CHANGING
it_outtab                     = it_spfli.
endif.
endmodule.                 ” DISPLAY_ALV  OUTPUT

SCREEN FLOW LOGIC

PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
MODULE DISPLAY_ALV.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.

2. OO ALV USING CUSTOM CONTAINER

DATA : o_cust TYPE REF TO cl_gui_custom_container,
o_alv TYPE REF TO cl_gui_alv_grid,
it_spfli TYPE TABLE OF spfli,
wa_spfli TYPE spfli,
ok_code TYPE sy-ucomm.

SELECT-OPTIONS  : p_carr FOR wa_spfli-carrid.

START-OF-SELECTION.
PERFORM data_fetch.
CALL SCREEN 100.
FORM data_fetch .
SELECT * FROM spfli INTO TABLE it_spfli WHERE carrid IN p_carr.
ENDFORM.                    ” DATA_FETCH
MODULE status_0100 OUTPUT.
SET PF-STATUS ‘STATUS’.
SET TITLEBAR ‘TITLE’.

ENDMODULE.                 ” STATUS_0100  OUTPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN ‘BACK’ OR ‘EXIT’ OR ‘CANCEL’.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.                 ” USER_COMMAND_0100  INPUT
MODULE display_alv OUTPUT.

CREATE OBJECT o_cust
EXPORTING
container_name              = ‘CUSTOM’.

CREATE OBJECT o_alv
EXPORTING
i_parent          = O_CUST.

CALL METHOD o_alv->set_table_for_first_display
EXPORTING
i_structure_name              = ‘SPFLI’
CHANGING
it_outtab                     = IT_SPFLI.

ENDMODULE.                 ” DISPLAY_ALV  OUTPUT

SCREEN FLOW LOGIC

PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
MODULE DISPLAY_ALV.


PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.

 

3. OO ALV USING CUSTOM CONTAINER WITH DOUBLE CLICK EVENT

TYPES : BEGIN OF tab,
carrid TYPE spfli-carrid,
connid TYPE spfli-connid,
countryfr TYPE spfli-countryfr,
cityfrom TYPE spfli-cityfrom,
airpfrom TYPE spfli-airpfrom,
countryto TYPE spfli-countryto,
cityto TYPE spfli-cityto,
airpto TYPE spfli-airpto,
END OF tab.

DATA : it_spfli TYPE TABLE OF tab,
wa_spfli TYPE tab,
ok_code TYPE sy-ucomm,
o_cust TYPE REF TO cl_gui_custom_container,
o_alv TYPE REF TO cl_gui_alv_grid,
it_fcat TYPE lvc_t_fcat,
wa_fcat TYPE lvc_s_fcat .

DATA : IT_SFLIGHT TYPE TABLE OF SFLIGHT.
DATA : O_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER,
O_ALV1 TYPE REF TO CL_GUI_ALV_GRID.

SELECT-OPTIONS : s_carr FOR wa_spfli-carrid.


CLASS HANDLE_EVENT DEFINITION.
PUBLIC SECTION.
CLASS-METHODS : HANDLE_DOUBLE_CLICK 

FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID IMPORTING e_row .
ENDCLASS.

CLASS HANDLE_EVENT IMPLEMENTATION.
METHOD handle_double_click.
READ TABLE IT_SPFLI INTO WA_SPFLI INDEX E_ROW.
SELECT * FROM SFLIGHT INTO TABLE IT_SFLIGHT WHERE CARRID = WA_SPFLI-CARRID.
CALL SCREEN 200.
ENDMETHOD.
ENDCLASS.


START-OF-SELECTION.

PERFORM DATA_FETCH.
PERFORM BUILD_FIELDCATALOG.
CALL SCREEN 100.

form DATA_FETCH .
SELECT carrid
connid
countryfr
cityfrom
airpfrom
countryto
cityto
airpto FROM spfli INTO TABLE it_spfli WHERE carrid IN s_carr.
endform.                    ” DATA_FETCH

form BUILD_FIELDCATALOG .
CLEAR wa_fcat.
WA_FCAT-col_pos = 1.
WA_FCAT-fieldname = ‘CARRID’.
WA_FCAT-tabname = ‘IT_SPFLI’.
WA_FCAT-COLTEXT = ‘CARRID’.
APPEND wa_fcat TO IT_FCAT.
CLEAR wa_fcat.

WA_FCAT-col_pos = 2.
WA_FCAT-fieldname = ‘CONNID’.
WA_FCAT-tabname = ‘IT_SPFLI’.
WA_FCAT-COLTEXT = ‘CONNID’.
APPEND wa_fcat TO IT_FCAT.
CLEAR wa_fcat.

WA_FCAT-col_pos = 3.
WA_FCAT-fieldname = ‘COUNTRYFR’.
WA_FCAT-tabname = ‘IT_SPFLI’.
WA_FCAT-COLTEXT = ‘COUNTRY FROM’.
APPEND wa_fcat TO IT_FCAT.
CLEAR wa_fcat.

WA_FCAT-col_pos = 4.
WA_FCAT-fieldname = ‘CITYFROM’.
WA_FCAT-tabname = ‘IT_SPFLI’.
WA_FCAT-COLTEXT = ‘COUNTRY TO’..
APPEND wa_fcat TO IT_FCAT.
CLEAR wa_fcat.

WA_FCAT-col_pos = 5.
WA_FCAT-fieldname = ‘AIRPFROM’.
WA_FCAT-tabname = ‘IT_SPFLI’.
WA_FCAT-COLTEXT = ‘AIRPORT FROM’.
APPEND wa_fcat TO IT_FCAT.
CLEAR wa_fcat.

WA_FCAT-col_pos = 6.
WA_FCAT-fieldname = ‘COUNTRYTO’.
WA_FCAT-tabname = ‘IT_SPFLI’.
WA_FCAT-COLTEXT = ‘COUNTRY TO’.
APPEND wa_fcat TO IT_FCAT.
CLEAR wa_fcat.

WA_FCAT-col_pos = 7.
WA_FCAT-fieldname = ‘CITYTO’.
WA_FCAT-tabname = ‘IT_SPFLI’.
WA_FCAT-COLTEXT = ‘CITY TO’.
APPEND wa_fcat TO IT_FCAT.
CLEAR wa_fcat.

WA_FCAT-col_pos = 8.
WA_FCAT-fieldname = ‘AIRPTO’.
WA_FCAT-tabname = ‘IT_SPFLI’.
WA_FCAT-COLTEXT = ‘AIRPORT TO’.
APPEND wa_fcat TO IT_FCAT.
CLEAR wa_fcat.
endform.                    ” BUILD_FIELDCATALOG

module STATUS_0100 output.
SET PF-STATUS ‘STAT’.
SET TITLEBAR ‘TITLT’.

endmodule.                 ” STATUS_0100  OUTPUT

module DISPLAY_ALV output.

IF o_cust IS NOT BOUND.
CREATE OBJECT o_cust
EXPORTING
container_name              = ‘CONTAINER’.
ENDIF.

IF O_ALV IS NOT BOUND.
CREATE OBJECT o_alv
EXPORTING
i_parent          = O_CUST.

SET HANDLER HANDLE_EVENT=>HANDLE_DOUBLE_CLICK FOR O_ALV.

CALL METHOD o_alv->set_table_for_first_display
CHANGING
it_outtab                     = IT_SPFLI
it_fieldcatalog               = IT_FCAT.

ENDIF.
endmodule.                 ” DISPLAY_ALV  OUTPUT

module USER_COMMAND_0100 input.
CASE  OK_CODE.
WHEN ‘BACK’.
LEAVE TO SCREEN 0.
ENDCASE.
endmodule.                 ” USER_COMMAND_0100  INPUT

module STATUS_0200 output.
SET PF-STATUS ‘STSA’.
*  SET TITLEBAR ‘xxx’.
IF O_DOCK IS NOT BOUND.
CREATE OBJECT o_dock
EXPORTING
side = CL_GUI_DOCKING_CONTAINER=>dock_at_left
extension = 5000.
ENDIF.

IF O_ALV1 IS NOT BOUND.
CREATE OBJECT o_alv1
EXPORTING
i_parent          = O_DOCK.

CALL METHOD o_alv1->set_table_for_first_display
EXPORTING
i_structure_name              = ‘SFLIGHT’
CHANGING
it_outtab                     = IT_SFLIGHT.

ENDIF.
CALL METHOD o_alv1->refresh_table_display.


endmodule.                 ” STATUS_0200  OUTPUT

module USER_COMMAND_0200 input.
CASE OK_CODE.
WHEN  ‘BACK’.
LEAVE TO SCREEN 0.
ENDCASE.
endmodule.                 ” USER_COMMAND_0200  INPUT

SCREEN 100 FLOW LOGIC

PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
MODULE DISPLAY_ALV.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.

SCREEN 200 FLOW LOGIC

PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0200.

4. SPLITTING CUSTOM CONTAINER BY SPLITTER CONTAINER AND DISPLAYING INTERACTIVE ALV

DATA : it_spfli TYPE TABLE OF spfli,
wa_spfli TYPE spfli,
it_sflight TYPE TABLE OF sflight,
wa_sflight TYPE sflight,
o_cust TYPE REF TO cl_gui_custom_container,
o_spli TYPE REF TO cl_gui_splitter_container,
o_ref1 TYPE REF TO cl_gui_container,
o_ref2 TYPE REF TO cl_gui_container,
o_alv1 TYPE REF TO cl_gui_alv_grid,
o_alv2 TYPE REF TO cl_gui_alv_grid,
ok_code TYPE sy-ucomm.

CLASS handle_event DEFINITION.
PUBLIC SECTION.
CLASS-METHODS handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row.
ENDCLASS.                    “HANDLE_EVENT DEFINITION

CLASS handle_event IMPLEMENTATION.
METHOD handle_double_click.
READ TABLE it_spfli INTO wa_spfli INDEX e_row.SELECT * FROM sflight INTO TABLE it_sflight WHERE carrid = wa_spfli-carrid.
IF o_alv2 IS NOT BOUND.
CREATE OBJECT o_alv2
EXPORTING
i_parent = o_ref2.

CALL METHOD o_alv2->set_table_for_first_display
EXPORTING
i_structure_name = ‘SFLIGHT’
CHANGING
it_outtab        = it_sflight.
ENDIF.

CALL METHOD o_alv2->refresh_table_display.
ENDMETHOD.                    “HANDLE_DOUBLE_CLICK
ENDCLASS.                    “HANDLE_EVENT IMPLEMENTATION

START-OF-SELECTION.
PERFORM fetch_data_from_spfli.
CALL SCREEN 100.

*———————————————————————-*
FORM fetch_data_from_spfli .
SELECT * FROM spfli INTO TABLE it_spfli.
ENDFORM.                    ” FETCH_DATA_FROM_SPFLI

MODULE status_0100 OUTPUT.
SET PF-STATUS ‘STATUS’.
SET TITLEBAR ‘TITLE’.

ENDMODULE.                 ” STATUS_0100  OUTPUT

MODULE split_container OUTPUT.
IF o_cust IS NOT BOUND.
CREATE OBJECT o_cust
EXPORTING
container_name = ‘CONTAINER’.

CREATE OBJECT o_spli
EXPORTING
parent  = o_cust
rows    = 2
columns = 1.
CALL METHOD o_spli->get_container
EXPORTING
row       = 1
column    = 1
RECEIVING
container = o_ref1.

CALL METHOD o_spli->get_container
EXPORTING
row       = 2
column    = 1
RECEIVING
container = o_ref2.

ENDIF.
ENDMODULE.                 ” SPLIT_CONTAINER  OUTPUT

MODULE display_alv OUTPUT.
IF o_alv1 IS NOT BOUND.
CREATE OBJECT o_alv1
EXPORTING
i_parent = o_ref1.
SET HANDLER handle_event=>handle_double_click FOR o_alv1.
CALL METHOD o_alv1->set_table_for_first_display
EXPORTING
i_structure_name = ‘SPFLI’
CHANGING
it_outtab        = it_spfli.
ENDIF.
ENDMODULE.                 ” DISPLAY_ALV  OUTPUT

MODULE user_command_0100 INPUT.
CASE  ok_code.
WHEN ‘BACK’.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.                 ” USER_COMMAND_0100  INPUT

SCREEN 100 FLOW LOGIC

PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE split_container.
MODULE display_alv.

PROCESS AFTER INPUT.
MODULE user_command_0100.

‘ border=0 v:shapes=”_x0000_i1026″>

5. OO ALV WITH TOP_OF_PAGE EVENT TO DISPLAY HEADER

DATA : it_spfli TYPE TABLE OF spfli,
wa_spfli TYPE spfli,
o_cust TYPE REF TO cl_gui_custom_container,
o_spli TYPE REF TO cl_gui_splitter_container,
o_ref1 TYPE REF TO cl_gui_container,
o_ref2 TYPE REF TO cl_gui_container,
o_alv TYPE REF TO cl_gui_alv_grid,
o_docu TYPE REF TO cl_dd_document,
ok_code TYPE sy-ucomm.

*———————————————————————-*
CLASS handle_event DEFINITION.
PUBLIC SECTION.

CLASS-METHODS : page_head FOR EVENT
top_of_page OF cl_gui_alv_grid 
IMPORTING e_dyndoc_id table_index.
                                                                                  
ENDCLASS.                    “HANDLE_EVENT DEFINITION

*———————————————————————-*
CLASS handle_event IMPLEMENTATION.

METHOD page_head.
*—————-try this one———————————*

    DATA : text TYPE sdydo_text_element.
text = ‘FLIGHT DETAILS’.
CALL METHOD o_docu->add_text
EXPORTING
text        = text
sap_color    = cl_dd_document=>list_positive
sap_fontsize = cl_dd_document=>large.

CALL METHOD o_docu->add_picture
EXPORTING
picture_id = ‘HEADER’. ” Object uploaded by OAER Transaction
CALL METHOD o_docu->display_document
EXPORTING
parent = o_ref1.

*———————-or try this ——————————–*
    DATA : text TYPE sdydo_text_element .
DATA : date TYPE char10.
WRITE sydatum TO date USING EDIT MASK ‘__/__/____’. CONCATENATE : ‘FLIGHT DETAILS ON ‘ date INTO text SEPARATED BY space.
CALL METHOD o_docu->add_text
EXPORTING
text        = text
sap_style    = cl_dd_document=>heading
sap_color    = cl_dd_document=>list_heading_int
sap_fontsize = cl_dd_document=>large.
CALL METHOD o_docu->new_line.
CLEAR text.
CONCATENATE : ‘BY USER :’ syuname INTO text SEPARATED BY space.
CALL METHOD o_docu->add_text
EXPORTING
text        = text
sap_style    = cl_dd_document=>heading
sap_color    = cl_dd_document=>list_heading_int
sap_fontsize = cl_dd_document=>large.
CALL METHOD o_docu->set_document_background
EXPORTING
picture_id = ‘HEADER1’. ” Object uploaded by OAER Transaction
CALL METHOD o_docu->display_document
EXPORTING
reuse_control = ‘X’
parent        = o_ref1.

  ENDMETHOD.                    “PAGE_HEAD
ENDCLASS.                    “HANDLE_EVENT IMPLEMENTATION

START-OF-SELECTION.
PERFORM fetch_data_from_spfli.
CALL SCREEN 100.
*&———————————————————————*
FORM fetch_data_from_spfli .
SELECT * FROM spfli INTO TABLE it_spfli.
ENDFORM.                    ” FETCH_DATA_FROM_SPFLI
*&———————————————————————*

MODULE status_0100 OUTPUT.
SET PF-STATUS ‘STATUS’.
SET TITLEBAR ‘TITLE’.
ENDMODULE.                 ” STATUS_0100  OUTPUT

*———————————————————————-*
MODULE split_container OUTPUT.
IF o_cust IS NOT BOUND.
CREATE OBJECT o_cust
EXPORTING
container_name = ‘CONTAINER’.
CREATE OBJECT o_spli
EXPORTING
parent  = o_cust
rows    = 2
columns = 1.
CALL METHOD o_spli->get_container
EXPORTING
row       = 1
column    = 1
RECEIVING
container = o_ref1.
CALL METHOD o_spli->set_row_height
EXPORTING
id    = 1
height = 35.
CALL METHOD o_spli->get_container
EXPORTING
row       = 2
column    = 1
RECEIVING
container = o_ref2.

CREATE OBJECT o_docu
EXPORTING
style = ‘ALV_GRID’.
ENDIF.
ENDMODULE.                 ” SPLIT_CONTAINER  OUTPUT
*———————————————————————-*
MODULE display_alv OUTPUT.
IF o_alv IS NOT BOUND.
CREATE OBJECT o_alv
EXPORTING
i_parent = o_ref2.

SET HANDLER handle_event=>page_head FOR o_alv.

CALL METHOD o_alv->set_table_for_first_display
EXPORTING
i_structure_name = ‘SPFLI’
CHANGING
it_outtab        = it_spfli.

CALL METHOD o_alv->list_processing_events
EXPORTING
i_event_name = ‘TOP_OF_PAGE’
i_dyndoc_id  = o_docu.
ENDIF.
ENDMODULE.                 ” DISPLAY_ALV  OUTPUT
*———————————————————————-*
MODULE user_command_0100 INPUT.
CASE  ok_code.
WHEN ‘BACK’.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.                 ” USER_COMMAND_0100  INPUT

SCREEN 100 FLOW LOGIC

PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE split_container.
MODULE display_alv.

PROCESS AFTER INPUT.
MODULE user_command_0100.

v:shapes=”_x0000_i1027″>

6. OO ALV WITH SUBTOTAL AND TOTAL TEXT

TYPES : BEGIN OF tab,
carrid
TYPE sflight-carrid,
connid
TYPE sflight-connid,
fldate
TYPE sflight-fldate,
price
TYPE sflight-price,
text1(20),
” FOR TOTAL TEXT
text2(20),
” FOR SUBTOTAL TEXT
END OF tab.

DATA : it_flight TYPE TABLE OF tab,
wa_flight
TYPE tab,
it_fcat 
TYPE lvc_t_fcat,
wa_fcat
TYPE lvc_s_fcat,
wa_layo
TYPE lvc_s_layo,
it_sort
TYPE lvc_t_sort,
wa_sort
TYPE lvc_s_sort,
o_cust
TYPE REF TO cl_gui_custom_container,
o_alv
TYPE REF TO cl_gui_alv_grid,
ok_code
TYPE sy-ucomm.

START-OF-SELECTION.
PERFORM fetch_data.
PERFORM build_text.
PERFORM build_fieldcat.
PERFORM build_layout.
PERFORM build_sort.

END-OF-SELECTION.
CALL SCREEN 100.
*———————————————————————-*
FORM fetch_data .
SELECT carrid
connid
fldate price
FROM sflight INTO CORRESPONDING FIELDS OF TABLE it_flight.
SORT it_flight BY carrid ASCENDING.
ENDFORM.                   
” FETCH_DATA

*———————————————————————-*
FORM build_text .
DATA : carr TYPE sflight-carrid,
txt
TYPE char20.
LOOP AT it_flight INTO wa_flight.
wa_flight-text1 =
‘Total Price = ‘.
IF wa_flight-carrid NE carr.
carr = wa_flight-carrid.
CONCATENATE ‘Subtotal (‘ carr ‘) =’ INTO txt SEPARATED BY space.
ENDIF.
wa_flight-text2 = txt.
MODIFY it_flight FROM wa_flight.
ENDLOOP.
ENDFORM.                   
” BUILD_TEXT

*———————————————————————-*
FORM build_fieldcat .
wa_fcat-col_pos  =
1.
wa_fcat-fieldname =
‘TEXT1’.
wa_fcat-tech =
‘X’.
wa_fcat-no_out =
‘X’.
APPEND