ALV tables table headers

Source: Internet
Author: User

1. Definition changes

DATA: W_EVENTS like line of IT_EVENTS,

IT_EVENTS TYPE SLIS_T_EVENT.

2. Change the volume value

"Display Header in ALV Report

Call function 'reuse _ ALV_EVENTS_GET'

EXPORTING

I _LIST_TYPE = 0

IMPORTING

ET_EVENTS = IT_EVENTS.

 

Read table IT_EVENTS with key name = 'top _ OF_PAGE 'INTO W_EVENTS.

IF SY-SUBRC = 0.

MOVE 'header' TO W_EVENTS-FORM.

MODIFY IT_EVENTS FROM W_EVENTS INDEX SY-TABIX.

ENDIF.

3. Table subprogram

"Show four columns in the last ALV row

FORM header.

DATA: GT_TX_REMARK like tline occurs 0 with header line.

 

DATA: LR_CONTENT type ref to CL_SALV_FORM_ELEMENT

, LR_ROWS type ref to CL_SALV_FORM_LAYOUT_GRID

, LR_ROW type ref to CL_SALV_FORM_LAYOUT_FLOW

, LR_GRID_STATUS type ref to CL_SALV_FORM_LAYOUT_GRID

      .

Create object LR_ROWS.

LR_CONTENT = LR_ROWS.

LR_ROW = LR_ROWS-> ADD_ROW ().

LR_GRID_STATUS = LR_ROW-> CREATE_GRID ().

 

"The second line is a clear description in Chinese and English.

ADD 1 TO LI_ROW.

 

 

*, LC_Z1088 TYPE ZAUSP-Z1084 "customer optimized TYPE

*, LC_Z1083 TYPE ZAUSP-Z1083 "company TYPE license

* LC_Z1089 TYPE ZAUSP-Z1089 "investment conditions

 

IF SY-LANGU = '1' OR SY-LANGU = 'M '.

CONCATENATE: 'lc_maktx_en INTO LC_INFO SEPARATED

 

By space.

ELSE.

CONCATENATE 'Description (EN): 'lc_maktx_en INTO LC_INFO SEPARATED

 

By space.

ENDIF.

 

LR_GRID_STATUS-> CREATE_TEXT (

ROW = LI_ROW

COLUMN = 1

TEXT = LC_INFO ).

 

IF SY-LANGU = '1' OR SY-LANGU = 'M '.

CONCATENATE 'objective partition: 'lc_z1088 INTO LC_INFO SEPARATED

 

SPACE.

ELSE.

CONCATENATE'm M _ MODEL: 'lc_z1088 INTO LC_INFO SEPARATED

 

SPACE.

ENDIF.

 

LR_GRID_STATUS-> CREATE_TEXT (

ROW = LI_ROW

COLUMN = 3

TEXT = LC_INFO ).

 

"Second line of text

CLEAR GT_TX_REMARK.

Read table GT_TX_REMARK INDEX 2.

LR_GRID_STATUS-> CREATE_TEXT (

ROW = LI_ROW

COLUMN = 4

TEXT = GT_TX_REMARK-TDLINE ).

 

ENDFORM.

4. ALV

Call function 'reuse _ ALV_GRID_DISPLAY'

EXPORTING

I _CALLBACK_PROGRAM = G_REPID

IT_FIELDCAT = GT_FIELDCAT []

I _CALLBACK_PF_STATUS_SET = G_STATUS

I _CALLBACK_USER_COMMAND = 'User _ command'

IS_LAYOUT = X_LAYOUT

IT_EVENTS = IT_EVENTS "the event generation in this process is the beginning of the" ALV "table

IS_VARIANT = G_VARIANT

I _SAVE = G_SAVE "A = All => Standard & User

TABLES

T_OUTTAB = INTAB

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

ALV tables table headers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.