SlideShare a Scribd company logo
Contoh/Example Syntax ALV Grid / List (ALV
Programming)
27/07/2010 — eryanta

Untukkeperluan reporting, SAP menyediakan Function Module ALV (ABAP List
Viewer/Apllication List Viewer).Berikutinicontoh syntax untukmembuat ALV Grid atau List.

Syntax di Include TOP

type-POOLs: slis, icon.
TYPES : BEGIN OF ty_ekpo,
cell,
icon(5),
ebeln TYPE ekpo-ebeln,
ebeln1 TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
line_color(4),
END OF ty_ekpo.

data: t_ekpo TYPE TABLE OF ty_ekpo,
x_ekpo TYPE ty_ekpo.

*ALV Data declaration
data: t_fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
d_tab_group TYPE slis_t_sp_group_alv,
x_layout TYPE slis_layout_alv,
d_repid like sy-repid,
t_events TYPE slis_t_event,
x_prntparams TYPE slis_print_alv,
t_sort TYPE slis_t_sortinfo_alv,
t_alv_isort TYPE slis_t_sortinfo_alv WITH HEADER LINE,
t_alv_extab TYPE slis_t_extab WITH HEADER LINE.

Syntax di Include F01

PERFORM f_get_data.
PERFORM f_build_fieldcatalog.
PERFORM f_build_layout.
PERFORM f_build_events.
PERFORM f_build_print_params.
PERFORM f_display_alv_report.
*&———————————————————————*
*& Form F_GET_DATA
*&———————————————————————*
FORM f_get_data .
DATA ld_color.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
UP TO 10 ROWS FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE t_ekpo.

*Populate field with color attributes
LOOP AT t_ekpo INTO x_ekpo.
x_ekpo-ebeln1 = x_ekpo-ebeln.
* Populate color variable with colour properties
* Char 1 = C (This is a color property)
* Char 2 = 3 (Color codes: 1 - 7)
* Char 3 = Intensified on/off ( 1 or 0 )
* Char 4 = Inverse display on/off ( 1 or 0 )
*       i.e. wa_ekpo-line_color = ’C410′
ld_color = ld_color + 1.

* Only 7 colours so need to reset color value
IF ld_color = 8.
ld_color = 1.
ENDIF.
CONCATENATE ’C' ld_color ’10′ INTO x_ekpo-line_color.

* Show Icon
IF ld_color = 1.
x_ekpo-icon = ’@08@’.
ELSEif ld_color = 2.
x_ekpo-icon = ’@09@’.
else.
x_ekpo-icon = ’@0A@’.
ENDIF.

* wa_ekpo-line_color = ’C410′.
MODIFY t_ekpo FROM x_ekpo.
ENDLOOP.
ENDFORM.“ F_GET_DATA

*&———————————————————————*
*& Form F_BUILD_FIELDCATALOG
*&———————————————————————*
FORM f_build_fieldcatalog .
PERFORM f_sub_fill_alv_field_catalog USING:
’01′ ’01′ ’ICON’ ’T_EKPO’ ’R' ’Light Status’ ” ” ” ”,
’01′ ’02′ ’EBELN1′ ’T_EKPO’ ’L' ’Purchase Order’ ” ” ” ”,
’01′ ’02′ ’EBELN’ ’T_EKPO’ ’L' ’Purchase Order’ ’X' ’X' ” ”,
’01′ ’03′ ’EBELP’ ’T_EKPO’ ’L' ’PO Item’      ” ” ” ”,
’01′ ’04′ ’STATU’ ’T_EKPO’ ’L' ’Statu’      ” ” ” ”,
’01′ ’05′ ’AEDAT’ ’T_EKPO’ ’L' ’Item change date’ ” ” ” ”,
’01′ ’06′ ’MATNR’ ’T_EKPO’ ’L' ’Material Number’ ” ” ” ”,
’01′ ’07′ ’MENGE’ ’T_EKPO’ ’L' ’PO Quantity’     ” ” ” ”,
’01′ ’08′ ’MEINS’ ’T_EKPO’ ’L' ’Order Unit’    ” ” ” ”,
’01′ ’09′ ’NETPR’ ’T_EKPO’ ’R' ’Net Price’    ” ” ” ”,
’01′ ’10′ ’PEINH’ ’T_EKPO’ ’L' ’Price Unit’   ” ” ” ”.

* DATA SORTING AND SUBTOTAL
DATA: lx_sort TYPE slis_sortinfo_alv.
CLEAR lx_sort.
lx_sort-fieldname = ’EBELN’.
lx_sort-spos = 1.
lx_sort-up = ’X’.
lx_sort-subtot = ’X’.
APPEND lx_sort to t_sort.
ENDFORM.“ F_BUILD_FIELDCATALOG
*&———————————————————————*
*& Form F_BUILD_LAYOUT
*&———————————————————————*
FORM f_build_layout .
x_layout-colwidth_optimize = ’X’.
x_layout-box_tabname = ’T_EKPO’.
x_layout-zebra = ’X’.
*x_layout-edit = ’X’.
x_layout-info_fieldname = ’LINE_COLOR’.
x_layout-box_fieldname = ’CELL’.
ENDFORM.“ F_BUILD_LAYOUT
*&———————————————————————*
*& Form F_BUILD_EVENTS
*&———————————————————————*
FORM f_build_events .
DATA: lx_events TYPE slis_alv_event.

CONSTANTS: c_formname_subtotal_text TYPE slis_formname
VALUE ’F_SUBTOTAL_TEXT’.

CALL FUNCTION ’REUSE_ALV_EVENTS_GET’
EXPORTING
i_list_type = 0
IMPORTING
et_events    = t_events[]
EXCEPTIONS
list_type_wrong = 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.

LOOP AT t_events INTO lx_events.
CASE lx_events-name.
WHEN slis_ev_top_of_page.
MOVE ’F_TOP_OF_PAGE’ TO lx_events-form.

ENDCASE.
MODIFY t_events FROM lx_events.
ENDLOOP.

*Subtotal
CLEAR lx_events.
READ TABLE t_events INTO lx_events
WITH KEY name = slis_ev_subtotal_text.

if sy-subrc eq 0.
MOVE c_formname_subtotal_text to lx_events-form.
MODIFY t_events FROM lx_events INDEX sy-tabix.
ENDIF.

ENDFORM.“ F_BUILD_EVENTS
*&———————————————————————*
*& Form F_BUILD_PRINT_PARAMS
*&———————————————————————*
FORM f_build_print_params .

ENDFORM.“ F_BUILD_PRINT_PARAMS
*&———————————————————————*
*& Form F_DISPLAY_ALV_REPORT
*&———————————————————————*
FORM f_display_alv_report .

d_repid = sy-repid.
CALL FUNCTION ’REUSE_ALV_GRID_DISPLAY’
EXPORTING
* I_INTERFACE_CHECK        =’’
* I_BYPASSING_BUFFER                   =’’
* I_BUFFER_ACTIVE                   =’’
i_callback_program            = d_repid
i_callback_pf_status_set       = ’F_ALV_STATUS’
i_callback_user_command           = ’F_USER_COMMAND’
* I_CALLBACK_TOP_OF_PAGE                   =’’
* I_CALLBACK_HTML_TOP_OF_PAGE                  =’’
* I_CALLBACK_HTML_END_OF_LIST                =’’
* I_STRUCTURE_NAME                     =
* I_BACKGROUND_ID                     =’’
* I_GRID_TITLE                   =
* I_GRID_SETTINGS                   =
is_layout                = x_layout
it_fieldcat             = t_fieldcatalog[]
* IT_EXCLUDING                    =
* IT_SPECIAL_GROUPS                   =
IT_SORT                   = t_sort
* IT_FILTER                   =
* IS_SEL_HIDE                   =
i_default               = ’X’
i_save                 = ’A’
* IS_VARIANT                   =
it_events               = t_events
* IT_EVENT_EXIT                   =
is_print               = x_prntparams
* IS_REPREP_ID                   =
* I_SCREEN_START_COLUMN                   =0
* I_SCREEN_START_LINE                  =0
* I_SCREEN_END_COLUMN                    =0
* I_SCREEN_END_LINE                   =0
* I_HTML_HEIGHT_TOP                    =0
* I_HTML_HEIGHT_END                    =0
* IT_ALV_GRAPHICS                   =
* IT_HYPERLINK                    =
* IT_ADD_FIELDCAT                    =
* IT_EXCEPT_QINFO                    =
* IR_SALV_FULLSCREEN_ADAPTER                 =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER                  =
* ES_EXIT_CAUSED_BY_USER                  =
TABLES
t_outtab                = t_ekpo
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.        ” F_DISPLAY_ALV_REPORT
*&———————————————————————*
*& Form F_SUB_FILL_ALV_FIELD_CATALOG
*&———————————————————————*

FORM f_sub_fill_alv_field_catalog USING

p_rowpos TYPE sycurow
p_colpos TYPE sycucol
p_fldnam TYPE fieldname
p_tabnam TYPE tabname
p_justif TYPE char1
p_seltext TYPE dd03p-scrtext_l
p_out TYPE char1
p_tech TYPE char1
p_qfield TYPE slis_fieldname
p_qtab TYPE slis_tabname.

DATA: lx_fcat TYPE slis_fieldcat_alv.

lx_fcat-row_pos = p_rowpos.
lx_fcat-col_pos = p_colpos.
lx_fcat-fieldname = p_fldnam.
lx_fcat-tabname = p_tabnam.
lx_fcat-just = p_justif.
lx_fcat-seltext_l = p_seltext.
lx_fcat-no_out = p_out.
lx_fcat-tech = p_tech.
lx_fcat-qfieldname = p_qfield.
lx_fcat-qtabname = p_qtab.

IF p_fldnam = ’NETPR’.
lx_fcat-do_sum = ’X’.
ENDIF.

APPEND lx_fcat TO t_fieldcatalog.
CLEAR lx_fcat.

ENDFORM.“ F_SUB_FILL_ALV_FIELD_CATALOG
*&———————————————————————*
*& Form F_TOP_OF_PAGE
*&———————————————————————*

FORM f_top_of_page.
*ALV Header Declarations
DATA: lt_header TYPE slis_t_listheader,
lx_header TYPE slis_listheader,
lt_line LIKE lx_header-info,
ld_lines TYPE i,
ld_linesc(10) TYPE c.

*Title
lx_header-typ = ’H’.
lx_header-info = ’EKPO Table Report’.
APPEND lx_header TO lt_header.
CLEAR lx_header.

*Date
lx_header-typ = ’S’.
lx_header-key = ’Date: ’.
CONCATENATE sy-datum+6(2) ’.’
sy-datum+4(2) ’.’
sy-datum(4) INTO lx_header-info.
APPEND lx_header TO lt_header.
CLEAR lx_header.

*Total No. of records Selected
DESCRIBE TABLE t_ekpo LINES ld_lines.
ld_linesc = ld_lines.
CONCATENATE ’Total No. of records Selected: ’ ld_linesc
INTO lt_line SEPARATED BY space.
lx_header-typ = ’A’.
lx_header-info = lt_line.
APPEND lx_header TO lt_header.
CLEAR: lx_header, lt_line.

CALL FUNCTION ’REUSE_ALV_COMMENTARY_WRITE’
EXPORTING
it_list_commentary = lt_header
* I_LOGO           = ’PHOTOTRI’
* I_END_OF_LIST_GRID       =
* I_ALV_FORM           =
.
ENDFORM. “F_TOP_OF_PAGE
*&———————————————————————*
*& Form F_ALV_STATUS
*&———————————————————————*

FORM f_alv_status USING fu_extab TYPE slis_t_extab.
REFRESH fu_extab.
SET PF-STATUS ’STANDARD’ EXCLUDING fu_extab.
ENDFORM. “F_ALV_STATUS

*&———————————————————————*
*& Form F_USER_COMMAND
*&———————————————————————*

FORM f_user_command USING ld_r_ucomm LIKE sy-ucomm
lx_rs_selfield TYPE slis_selfield.

CASE ld_r_ucomm.
WHEN ’&IC1′.
IF lx_rs_selfield-fieldname = ’EBELN1′.
READ TABLE t_ekpo INTO x_ekpo INDEX lx_rs_selfield-tabindex.
MESSAGE i003(aq) WITH ’Anda memilih Purchase order ’
x_ekpo-ebeln.
CLEAR x_ekpo.
ENDIF.

WHEN ’SHOW’.
LOOP AT t_ekpo INTO x_ekpo.
IF x_ekpo-cell EQ ’X’.
MESSAGE i003(aq) WITH ’Anda memilih Purchase order ’
x_ekpo-ebeln1.
ENDIF.
ENDLOOP.
CLEAR x_ekpo.
ENDCASE.
ENDFORM. “F_USER_COMMAND

FORM F_SUBTOTAL_TEXT CHANGING ld_total TYPE any
ld_subtot_text TYPE slis_subtot_text.

*Material level sub total
if ld_subtot_text-criteria = ’EBELN’.
ld_subtot_text-display_text_for_subtotal
= ’Subtotal’.
ENDIF.
ENDFORM.
Kemudianbuat GUI Status dengan status “STANDARD”.

Kemudianpilih Template Status “List Viewer” (Extras>Adjust Template).

Activate semua, lalueksekusi.




Hasilnyaadalah “ALV Grid”, untukmengubahmenjadi“ALV List”, masukke subroutine
“FORM f_display_alv_report“, ubah ” ”
CALL FUNCTION ’REUSE_ALV_GRID_DISPLAYmenjadi ”
CALL FUNCTION ’REUSE_ALV_LIST_DISPLAY “.
CMIIW

More Related Content

What's hot

List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
sapdocs. info
 
Alvedit programs
Alvedit programsAlvedit programs
Alvedit programsmcclintick
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
sapdocs. info
 
Message, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type GroupMessage, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type Group
sapdocs. info
 
To excel or not?
To excel or not?To excel or not?
To excel or not?
Filippo Selden
 
Lecture 4 sql {basics keys and constraints}
Lecture 4 sql {basics  keys and constraints}Lecture 4 sql {basics  keys and constraints}
Lecture 4 sql {basics keys and constraints}
Shubham Shukla
 
Lecture 3 sql {basics ddl commands}
Lecture 3 sql {basics  ddl commands}Lecture 3 sql {basics  ddl commands}
Lecture 3 sql {basics ddl commands}
Shubham Shukla
 
Web Developer make the most out of your Database !
Web Developer make the most out of your Database !Web Developer make the most out of your Database !
Web Developer make the most out of your Database !
Jean-Marc Desvaux
 
Oracle Training in Kochi | Trivandrum |Thrissur
Oracle Training in Kochi | Trivandrum |ThrissurOracle Training in Kochi | Trivandrum |Thrissur
Oracle Training in Kochi | Trivandrum |Thrissur
IndiaOptions Softwares
 
Oracle: Functions
Oracle: FunctionsOracle: Functions
Oracle: Functions
DataminingTools Inc
 
Select To Order By
Select  To  Order BySelect  To  Order By
Select To Order By
Krizia Capacio
 
Common SQL Programming Mistakes
Common SQL Programming MistakesCommon SQL Programming Mistakes
Common SQL Programming Mistakes
Plamen Ratchev
 
Oracle: DML
Oracle: DMLOracle: DML
Oracle: DML
DataminingTools Inc
 
RDBMS Lab02 creating tables (UIU)
RDBMS Lab02 creating tables (UIU)RDBMS Lab02 creating tables (UIU)
RDBMS Lab02 creating tables (UIU)
Muhammad T Q Nafis
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries Lecture
Felipe Costa
 
[APJ] Common Table Expressions (CTEs) in SQL
[APJ] Common Table Expressions (CTEs) in SQL[APJ] Common Table Expressions (CTEs) in SQL
[APJ] Common Table Expressions (CTEs) in SQL
EDB
 

What's hot (19)

List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
 
Alvedit programs
Alvedit programsAlvedit programs
Alvedit programs
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
 
Message, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type GroupMessage, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type Group
 
To excel or not?
To excel or not?To excel or not?
To excel or not?
 
Lecture 4 sql {basics keys and constraints}
Lecture 4 sql {basics  keys and constraints}Lecture 4 sql {basics  keys and constraints}
Lecture 4 sql {basics keys and constraints}
 
Lecture 3 sql {basics ddl commands}
Lecture 3 sql {basics  ddl commands}Lecture 3 sql {basics  ddl commands}
Lecture 3 sql {basics ddl commands}
 
Web Developer make the most out of your Database !
Web Developer make the most out of your Database !Web Developer make the most out of your Database !
Web Developer make the most out of your Database !
 
Oracle Training in Kochi | Trivandrum |Thrissur
Oracle Training in Kochi | Trivandrum |ThrissurOracle Training in Kochi | Trivandrum |Thrissur
Oracle Training in Kochi | Trivandrum |Thrissur
 
Oracle: Functions
Oracle: FunctionsOracle: Functions
Oracle: Functions
 
Select To Order By
Select  To  Order BySelect  To  Order By
Select To Order By
 
Common SQL Programming Mistakes
Common SQL Programming MistakesCommon SQL Programming Mistakes
Common SQL Programming Mistakes
 
Les18
Les18Les18
Les18
 
Les17
Les17Les17
Les17
 
Oracle: DML
Oracle: DMLOracle: DML
Oracle: DML
 
Les10
Les10Les10
Les10
 
RDBMS Lab02 creating tables (UIU)
RDBMS Lab02 creating tables (UIU)RDBMS Lab02 creating tables (UIU)
RDBMS Lab02 creating tables (UIU)
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries Lecture
 
[APJ] Common Table Expressions (CTEs) in SQL
[APJ] Common Table Expressions (CTEs) in SQL[APJ] Common Table Expressions (CTEs) in SQL
[APJ] Common Table Expressions (CTEs) in SQL
 

Similar to Example syntax alv grid list

Alv barra her
Alv barra herAlv barra her
Alv a otro alv
Alv a otro alvAlv a otro alv
Alv a otro alv
Universidad de Trujillo
 
Sap scripts
Sap scriptsSap scripts
Sap scripts
Jugul Crasta
 
Zmalv output type_v1.1
Zmalv output type_v1.1Zmalv output type_v1.1
Zmalv output type_v1.1
chandrashekarbh
 
Program For Parsing2
Program For Parsing2Program For Parsing2
Program For Parsing2
Michelle Crapo
 
ABAP EVENTS EXAMPLE
ABAP EVENTS EXAMPLEABAP EVENTS EXAMPLE
ABAP EVENTS EXAMPLE
vr1sap
 
SAP Batch data communication
SAP Batch data communicationSAP Batch data communication
SAP Batch data communication
Jugul Crasta
 
Extbase and Beyond
Extbase and BeyondExtbase and Beyond
Extbase and Beyond
Jochen Rau
 
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docxproject4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
wkyra78
 
Internal tables operations_chalapathi[1]
Internal tables operations_chalapathi[1]Internal tables operations_chalapathi[1]
Internal tables operations_chalapathi[1]
Chalapathi Rao kornu
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 Usage
William Lee
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with Extbase
Jochen Rau
 
07.advanced abap
07.advanced abap07.advanced abap
07.advanced abapPhong Ho
 
Db2 For I Parallel Data Load
Db2 For I Parallel Data LoadDb2 For I Parallel Data Load
Db2 For I Parallel Data Load
Thomas Wolfe
 
Zmd Constant
Zmd ConstantZmd Constant
Zmd Constant
Michelle Crapo
 

Similar to Example syntax alv grid list (20)

Alv barra her
Alv barra herAlv barra her
Alv barra her
 
Alv a otro alv
Alv a otro alvAlv a otro alv
Alv a otro alv
 
Sap scripts
Sap scriptsSap scripts
Sap scripts
 
Zmalv output type_v1.1
Zmalv output type_v1.1Zmalv output type_v1.1
Zmalv output type_v1.1
 
Program For Parsing2
Program For Parsing2Program For Parsing2
Program For Parsing2
 
ABAP EVENTS EXAMPLE
ABAP EVENTS EXAMPLEABAP EVENTS EXAMPLE
ABAP EVENTS EXAMPLE
 
SAP Batch data communication
SAP Batch data communicationSAP Batch data communication
SAP Batch data communication
 
Extbase and Beyond
Extbase and BeyondExtbase and Beyond
Extbase and Beyond
 
Module Prog
Module ProgModule Prog
Module Prog
 
Alv Block
Alv BlockAlv Block
Alv Block
 
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docxproject4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
 
Report zalv
Report  zalvReport  zalv
Report zalv
 
Deber base
Deber baseDeber base
Deber base
 
Internal tables operations_chalapathi[1]
Internal tables operations_chalapathi[1]Internal tables operations_chalapathi[1]
Internal tables operations_chalapathi[1]
 
ZFINDALLZPROGAM
ZFINDALLZPROGAMZFINDALLZPROGAM
ZFINDALLZPROGAM
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 Usage
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with Extbase
 
07.advanced abap
07.advanced abap07.advanced abap
07.advanced abap
 
Db2 For I Parallel Data Load
Db2 For I Parallel Data LoadDb2 For I Parallel Data Load
Db2 For I Parallel Data Load
 
Zmd Constant
Zmd ConstantZmd Constant
Zmd Constant
 

Recently uploaded

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 

Recently uploaded (20)

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 

Example syntax alv grid list

  • 1. Contoh/Example Syntax ALV Grid / List (ALV Programming) 27/07/2010 — eryanta Untukkeperluan reporting, SAP menyediakan Function Module ALV (ABAP List Viewer/Apllication List Viewer).Berikutinicontoh syntax untukmembuat ALV Grid atau List. Syntax di Include TOP type-POOLs: slis, icon. TYPES : BEGIN OF ty_ekpo, cell, icon(5), ebeln TYPE ekpo-ebeln, ebeln1 TYPE ekpo-ebeln, ebelp TYPE ekpo-ebelp, statu TYPE ekpo-statu, aedat TYPE ekpo-aedat, matnr TYPE ekpo-matnr, menge TYPE ekpo-menge, meins TYPE ekpo-meins, netpr TYPE ekpo-netpr, peinh TYPE ekpo-peinh, line_color(4), END OF ty_ekpo. data: t_ekpo TYPE TABLE OF ty_ekpo, x_ekpo TYPE ty_ekpo. *ALV Data declaration data: t_fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE, d_tab_group TYPE slis_t_sp_group_alv, x_layout TYPE slis_layout_alv, d_repid like sy-repid, t_events TYPE slis_t_event, x_prntparams TYPE slis_print_alv, t_sort TYPE slis_t_sortinfo_alv, t_alv_isort TYPE slis_t_sortinfo_alv WITH HEADER LINE, t_alv_extab TYPE slis_t_extab WITH HEADER LINE. Syntax di Include F01 PERFORM f_get_data. PERFORM f_build_fieldcatalog.
  • 2. PERFORM f_build_layout. PERFORM f_build_events. PERFORM f_build_print_params. PERFORM f_display_alv_report. *&———————————————————————* *& Form F_GET_DATA *&———————————————————————* FORM f_get_data . DATA ld_color. SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh UP TO 10 ROWS FROM ekpo INTO CORRESPONDING FIELDS OF TABLE t_ekpo. *Populate field with color attributes LOOP AT t_ekpo INTO x_ekpo. x_ekpo-ebeln1 = x_ekpo-ebeln. * Populate color variable with colour properties * Char 1 = C (This is a color property) * Char 2 = 3 (Color codes: 1 - 7) * Char 3 = Intensified on/off ( 1 or 0 ) * Char 4 = Inverse display on/off ( 1 or 0 ) * i.e. wa_ekpo-line_color = ’C410′ ld_color = ld_color + 1. * Only 7 colours so need to reset color value IF ld_color = 8. ld_color = 1. ENDIF. CONCATENATE ’C' ld_color ’10′ INTO x_ekpo-line_color. * Show Icon IF ld_color = 1. x_ekpo-icon = ’@08@’. ELSEif ld_color = 2. x_ekpo-icon = ’@09@’. else. x_ekpo-icon = ’@0A@’. ENDIF. * wa_ekpo-line_color = ’C410′. MODIFY t_ekpo FROM x_ekpo. ENDLOOP. ENDFORM.“ F_GET_DATA *&———————————————————————* *& Form F_BUILD_FIELDCATALOG
  • 3. *&———————————————————————* FORM f_build_fieldcatalog . PERFORM f_sub_fill_alv_field_catalog USING: ’01′ ’01′ ’ICON’ ’T_EKPO’ ’R' ’Light Status’ ” ” ” ”, ’01′ ’02′ ’EBELN1′ ’T_EKPO’ ’L' ’Purchase Order’ ” ” ” ”, ’01′ ’02′ ’EBELN’ ’T_EKPO’ ’L' ’Purchase Order’ ’X' ’X' ” ”, ’01′ ’03′ ’EBELP’ ’T_EKPO’ ’L' ’PO Item’ ” ” ” ”, ’01′ ’04′ ’STATU’ ’T_EKPO’ ’L' ’Statu’ ” ” ” ”, ’01′ ’05′ ’AEDAT’ ’T_EKPO’ ’L' ’Item change date’ ” ” ” ”, ’01′ ’06′ ’MATNR’ ’T_EKPO’ ’L' ’Material Number’ ” ” ” ”, ’01′ ’07′ ’MENGE’ ’T_EKPO’ ’L' ’PO Quantity’ ” ” ” ”, ’01′ ’08′ ’MEINS’ ’T_EKPO’ ’L' ’Order Unit’ ” ” ” ”, ’01′ ’09′ ’NETPR’ ’T_EKPO’ ’R' ’Net Price’ ” ” ” ”, ’01′ ’10′ ’PEINH’ ’T_EKPO’ ’L' ’Price Unit’ ” ” ” ”. * DATA SORTING AND SUBTOTAL DATA: lx_sort TYPE slis_sortinfo_alv. CLEAR lx_sort. lx_sort-fieldname = ’EBELN’. lx_sort-spos = 1. lx_sort-up = ’X’. lx_sort-subtot = ’X’. APPEND lx_sort to t_sort. ENDFORM.“ F_BUILD_FIELDCATALOG *&———————————————————————* *& Form F_BUILD_LAYOUT *&———————————————————————* FORM f_build_layout . x_layout-colwidth_optimize = ’X’. x_layout-box_tabname = ’T_EKPO’. x_layout-zebra = ’X’. *x_layout-edit = ’X’. x_layout-info_fieldname = ’LINE_COLOR’. x_layout-box_fieldname = ’CELL’. ENDFORM.“ F_BUILD_LAYOUT *&———————————————————————* *& Form F_BUILD_EVENTS *&———————————————————————* FORM f_build_events . DATA: lx_events TYPE slis_alv_event. CONSTANTS: c_formname_subtotal_text TYPE slis_formname VALUE ’F_SUBTOTAL_TEXT’. CALL FUNCTION ’REUSE_ALV_EVENTS_GET’ EXPORTING
  • 4. i_list_type = 0 IMPORTING et_events = t_events[] EXCEPTIONS list_type_wrong = 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. LOOP AT t_events INTO lx_events. CASE lx_events-name. WHEN slis_ev_top_of_page. MOVE ’F_TOP_OF_PAGE’ TO lx_events-form. ENDCASE. MODIFY t_events FROM lx_events. ENDLOOP. *Subtotal CLEAR lx_events. READ TABLE t_events INTO lx_events WITH KEY name = slis_ev_subtotal_text. if sy-subrc eq 0. MOVE c_formname_subtotal_text to lx_events-form. MODIFY t_events FROM lx_events INDEX sy-tabix. ENDIF. ENDFORM.“ F_BUILD_EVENTS *&———————————————————————* *& Form F_BUILD_PRINT_PARAMS *&———————————————————————* FORM f_build_print_params . ENDFORM.“ F_BUILD_PRINT_PARAMS *&———————————————————————* *& Form F_DISPLAY_ALV_REPORT *&———————————————————————* FORM f_display_alv_report . d_repid = sy-repid. CALL FUNCTION ’REUSE_ALV_GRID_DISPLAY’ EXPORTING * I_INTERFACE_CHECK =’’
  • 5. * I_BYPASSING_BUFFER =’’ * I_BUFFER_ACTIVE =’’ i_callback_program = d_repid i_callback_pf_status_set = ’F_ALV_STATUS’ i_callback_user_command = ’F_USER_COMMAND’ * I_CALLBACK_TOP_OF_PAGE =’’ * I_CALLBACK_HTML_TOP_OF_PAGE =’’ * I_CALLBACK_HTML_END_OF_LIST =’’ * I_STRUCTURE_NAME = * I_BACKGROUND_ID =’’ * I_GRID_TITLE = * I_GRID_SETTINGS = is_layout = x_layout it_fieldcat = t_fieldcatalog[] * IT_EXCLUDING = * IT_SPECIAL_GROUPS = IT_SORT = t_sort * IT_FILTER = * IS_SEL_HIDE = i_default = ’X’ i_save = ’A’ * IS_VARIANT = it_events = t_events * IT_EVENT_EXIT = is_print = x_prntparams * IS_REPREP_ID = * I_SCREEN_START_COLUMN =0 * I_SCREEN_START_LINE =0 * I_SCREEN_END_COLUMN =0 * I_SCREEN_END_LINE =0 * I_HTML_HEIGHT_TOP =0 * I_HTML_HEIGHT_END =0 * IT_ALV_GRAPHICS = * IT_HYPERLINK = * IT_ADD_FIELDCAT = * IT_EXCEPT_QINFO = * IR_SALV_FULLSCREEN_ADAPTER = * IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_USER = TABLES t_outtab = t_ekpo EXCEPTIONS PROGRAM_ERROR =1 OTHERS =2 .
  • 6. 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. ” F_DISPLAY_ALV_REPORT *&———————————————————————* *& Form F_SUB_FILL_ALV_FIELD_CATALOG *&———————————————————————* FORM f_sub_fill_alv_field_catalog USING p_rowpos TYPE sycurow p_colpos TYPE sycucol p_fldnam TYPE fieldname p_tabnam TYPE tabname p_justif TYPE char1 p_seltext TYPE dd03p-scrtext_l p_out TYPE char1 p_tech TYPE char1 p_qfield TYPE slis_fieldname p_qtab TYPE slis_tabname. DATA: lx_fcat TYPE slis_fieldcat_alv. lx_fcat-row_pos = p_rowpos. lx_fcat-col_pos = p_colpos. lx_fcat-fieldname = p_fldnam. lx_fcat-tabname = p_tabnam. lx_fcat-just = p_justif. lx_fcat-seltext_l = p_seltext. lx_fcat-no_out = p_out. lx_fcat-tech = p_tech. lx_fcat-qfieldname = p_qfield. lx_fcat-qtabname = p_qtab. IF p_fldnam = ’NETPR’. lx_fcat-do_sum = ’X’. ENDIF. APPEND lx_fcat TO t_fieldcatalog. CLEAR lx_fcat. ENDFORM.“ F_SUB_FILL_ALV_FIELD_CATALOG
  • 7. *&———————————————————————* *& Form F_TOP_OF_PAGE *&———————————————————————* FORM f_top_of_page. *ALV Header Declarations DATA: lt_header TYPE slis_t_listheader, lx_header TYPE slis_listheader, lt_line LIKE lx_header-info, ld_lines TYPE i, ld_linesc(10) TYPE c. *Title lx_header-typ = ’H’. lx_header-info = ’EKPO Table Report’. APPEND lx_header TO lt_header. CLEAR lx_header. *Date lx_header-typ = ’S’. lx_header-key = ’Date: ’. CONCATENATE sy-datum+6(2) ’.’ sy-datum+4(2) ’.’ sy-datum(4) INTO lx_header-info. APPEND lx_header TO lt_header. CLEAR lx_header. *Total No. of records Selected DESCRIBE TABLE t_ekpo LINES ld_lines. ld_linesc = ld_lines. CONCATENATE ’Total No. of records Selected: ’ ld_linesc INTO lt_line SEPARATED BY space. lx_header-typ = ’A’. lx_header-info = lt_line. APPEND lx_header TO lt_header. CLEAR: lx_header, lt_line. CALL FUNCTION ’REUSE_ALV_COMMENTARY_WRITE’ EXPORTING it_list_commentary = lt_header * I_LOGO = ’PHOTOTRI’ * I_END_OF_LIST_GRID = * I_ALV_FORM = . ENDFORM. “F_TOP_OF_PAGE
  • 8. *&———————————————————————* *& Form F_ALV_STATUS *&———————————————————————* FORM f_alv_status USING fu_extab TYPE slis_t_extab. REFRESH fu_extab. SET PF-STATUS ’STANDARD’ EXCLUDING fu_extab. ENDFORM. “F_ALV_STATUS *&———————————————————————* *& Form F_USER_COMMAND *&———————————————————————* FORM f_user_command USING ld_r_ucomm LIKE sy-ucomm lx_rs_selfield TYPE slis_selfield. CASE ld_r_ucomm. WHEN ’&IC1′. IF lx_rs_selfield-fieldname = ’EBELN1′. READ TABLE t_ekpo INTO x_ekpo INDEX lx_rs_selfield-tabindex. MESSAGE i003(aq) WITH ’Anda memilih Purchase order ’ x_ekpo-ebeln. CLEAR x_ekpo. ENDIF. WHEN ’SHOW’. LOOP AT t_ekpo INTO x_ekpo. IF x_ekpo-cell EQ ’X’. MESSAGE i003(aq) WITH ’Anda memilih Purchase order ’ x_ekpo-ebeln1. ENDIF. ENDLOOP. CLEAR x_ekpo. ENDCASE. ENDFORM. “F_USER_COMMAND FORM F_SUBTOTAL_TEXT CHANGING ld_total TYPE any ld_subtot_text TYPE slis_subtot_text. *Material level sub total if ld_subtot_text-criteria = ’EBELN’. ld_subtot_text-display_text_for_subtotal = ’Subtotal’. ENDIF. ENDFORM.
  • 9. Kemudianbuat GUI Status dengan status “STANDARD”. Kemudianpilih Template Status “List Viewer” (Extras>Adjust Template). Activate semua, lalueksekusi. Hasilnyaadalah “ALV Grid”, untukmengubahmenjadi“ALV List”, masukke subroutine “FORM f_display_alv_report“, ubah ” ” CALL FUNCTION ’REUSE_ALV_GRID_DISPLAYmenjadi ” CALL FUNCTION ’REUSE_ALV_LIST_DISPLAY “.
  • 10. CMIIW