Alv Demo Program Sap
SAP List Viewer (ALV) adalah elemen terintegrasi dari lingkungan pemrograman Objek ABAP. Ini memungkinkan pengembang aplikasi untuk dengan cepat mengimplementasikan tampilan dataset terstruktur dengan menyediakan tiga alat ALV yang berbeda, masing-masing untuk tampilan:. Simple list:. Hierarchical sequential list:. Tree:Pada kesempatan kali ini kita akan belajar membuat sebuah ALV Simple List berbasis Object Oriented Programming / OOP. Sebagai contoh kita akan menampilkan Kode Material dari table MARA dan Nama Material dari Table MAKT.Script Code Program Abap (Full). REPORT ywhytest.
TYPES: BEGIN OF tymara,matnr TYPE mara -matnr,maktx TYPE makt -maktx, END OF tymara. DATA alv TYPE REF TO clsalvtable. DATA lttable TYPE STANDARD TABLE OF tymara. PERFORM selectdata. PERFORM buatalv.
PERFORM tampilalv. FORM selectdata.
Alv Demo Program Sap Login
SELECT amatnr, bmaktx FROM mara AS aLEFT JOIN makt AS bON amatnr = bmatnrINTO TABLE @lttable UP TO 5 ROWS WHERE bspras = 'E'. FORM buatalv. DATA message TYPE REF TO cxsalvmsg.
TRY.clsalvtable = & gt;factory ( IMPORTINGrsalvtable = alvCHANGINGttable = lttable ). CATCH cxsalvmsg INTO message. ' error handling ENDTRY. FORM tampilalv.alv -& gt;display ( ). ENDFORM.REPORT ywhytest.TYPES: BEGIN OF tymara,matnr TYPE mara-matnr,maktx TYPE makt-maktx,END OF tymara.DATA alv TYPE REF TO clsalvtable.DATA lttable TYPE STANDARD TABLE OF tymara.START-OF-SELECTION.PERFORM selectdata.PERFORM buatalv.PERFORM tampilalv.FORM selectdata.SELECT amatnr, bmaktx FROM mara AS aLEFT JOIN makt AS bON amatnr = bmatnrINTO TABLE @lttable UP TO 5 ROWSWHERE bspras = 'E'.ENDFORM.FORM buatalv.DATA message TYPE REF TO cxsalvmsg.TRY.clsalvtable=factory(IMPORTINGrsalvtable = alvCHANGINGttable = lttable ).CATCH cxsalvmsg INTO message.' Error handlingENDTRY.ENDFORM.FORM tampilalv.alv-display( ).ENDFORM.Keterangan Script:. Buat Type Terlebih Dahulu.
FORM selectdata. SELECT amatnr, bmaktx FROM mara AS aLEFT JOIN makt AS bON amatnr = bmatnrINTO TABLE @lttable UP TO 5 ROWS WHERE bspras = 'E'. FORM buatalv.
DATA message TYPE REF TO cxsalvmsg. TRY.clsalvtable = & gt;factory ( IMPORTINGrsalvtable = alvCHANGINGttable = lttable ). CATCH cxsalvmsg INTO message. ' error handling ENDTRY. FORM tampilalv.alv -& gt;display ( ).
ENDFORM.FORM selectdata.SELECT amatnr, bmaktx FROM mara AS aLEFT JOIN makt AS bON amatnr = bmatnrINTO TABLE @lttable UP TO 5 ROWSWHERE bspras = 'E'.ENDFORM.FORM buatalv.DATA message TYPE REF TO cxsalvmsg.TRY.clsalvtable=factory(IMPORTINGrsalvtable = alvCHANGINGttable = lttable ).CATCH cxsalvmsg INTO message.' Error handlingENDTRY.ENDFORM.FORM tampilalv.alv-display( ).ENDFORM. Buat event ketika kita akan memproses data, untuk memproses 3 subrutin tsb.
List of demo programs in SAP which explains SAP ALV Drag Drop functionality.BCALVDND01 – Drag ALV Row to Tree FolderThis example shows how to define a drag and drop behaviour using a drag and drop control. Direction: drag from tree and drop in ALV control. BCALVDND02 – Drag Icons from Tree to Rows of the GridThis example shows how to define a drag and drop behaviour using a drag and drop control. This is the direction: drag from ALV Control, drop in tree. BCALVDND03 – Drag & Drop on Cells of the GridThis example shows how to define a drag and drop behaviour on cells of an ALV Control. BCALVDND04 – Drag & Drop Within an ALV Grid ControlThis example shows how to define a drag and drop behaviour using a drag and drop control.
The behaviour is defined within one ALV Control.