Skip to content

Commit

Permalink
New template: SALV mini
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerem Kayacan committed Aug 11, 2018
1 parent e288039 commit 2bebe82
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# sap-lib
Template programs, utility procedures and code samples for ABAP and other SAP development tools. Contributions are welcome.

Templates, programs and classes (abap/lib-package folder) are activated in an ABAP 7.50 SP 4 system and exported via [abapGit](https://github.com/larshp/abapGit). Latest release can be imported into an ABAP 7.31 SP 2 system.
Templates, programs and classes (abap/lib-package folder) are activated in an ABAP 7.50 SP 4 system and exported via [abapGit](https://github.com/larshp/abapGit). Latest [release](https://github.com/kkayacan/sap-lib/releases) can be imported into an ABAP 7.31 SP 2 system.

#### Disclaimer
Code in snippets folder are samples and are not guaranteed to work by just copying and pasting. Adjust it according to your requirement.

#### Folder structure
- [abap](abap/)
- [lib-package](abap/lib-package/) Templates and programs exported via abapGit
- [prog](abap/lib-package/prog/) Programs
- [tmplt](abap/lib-package/tmplt/) Templates
- [program](abap/lib-package/program/) Programs
- [template](abap/lib-package/template/) Templates
- [snippets](abap/snippets/)

#### Index

##### Programs
- [Extract ABAP development objects to html/text files](abap/lib-package/prog/massdownload/)
- [Extract ABAP development objects to html/text files](abap/lib-package/program/ydtp_mass_download.prog.abap)

##### Templates
- [SLIS ALV report with user interaction functionality](abap/lib-package/tmplt/slisalv/)
- [SLIS ALV report with user interaction functionality](abap/lib-package/template/yp_alv_template.prog.abap)
- [SALV mini template](abap/lib-package/template/yp_salv_mini.prog.abap)

##### Snippets
- ALV
Expand Down
29 changes: 29 additions & 0 deletions abap/lib-package/template/yp_salv_mini.prog.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
REPORT yp_salv_mini.

TABLES: bkpf.

DATA o_salv TYPE REF TO cl_salv_table.
DATA t_bkpf TYPE TABLE OF bkpf.

SELECT-OPTIONS: s_budat FOR bkpf-budat.

START-OF-SELECTION.

SELECT * FROM bkpf INTO TABLE t_bkpf
WHERE budat IN s_budat.

END-OF-SELECTION.

CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = o_salv
CHANGING
t_table = t_bkpf.

o_salv->get_functions( )->set_all( abap_true ).
o_salv->get_columns( )->set_optimize( abap_true ).
o_salv->get_columns( )->set_key_fixation( value = abap_true ).
o_salv->get_columns( )->set_column_position( columnname = 'BUDAT'
position = 1 ).

o_salv->display( ).
24 changes: 24 additions & 0 deletions abap/lib-package/template/yp_salv_mini.prog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<PROGDIR>
<NAME>YP_SALV_MINI</NAME>
<STATE>A</STATE>
<VARCL>X</VARCL>
<SUBC>1</SUBC>
<RLOAD>T</RLOAD>
<FIXPT>X</FIXPT>
<UCCHECK>X</UCCHECK>
</PROGDIR>
<DYNPROS/>
<TPOOL>
<item>
<ID>R</ID>
<ENTRY>SALV mini template</ENTRY>
<LENGTH>18</LENGTH>
</item>
</TPOOL>
</asx:values>
</asx:abap>
</abapGit>

0 comments on commit 2bebe82

Please sign in to comment.