Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[HR] Abrechnungsergebnisse lesen

Reports:

RPCLSTRD – Anzeige des Clusters RD (Abrechnungsergebnisse Deutschland), Tcode: PC_PAYRESULT
H99_DISPLAY_PAYRESULT – Anzeigen von Abrechnungsergebnissen

Abrechnungsergebnistabelle:

Eine sehr schöne Übersicht über die Tabellen: https://l3consulting.de/die-tabellen-im-abrechnungscluster-des-sap-hcm-verstehen/
Die Tabelle RT enthält die Ergebnislohnarten der ausgewählten Abrechnungsperiode. (RT_ = komprimierte Darstellung)

Funktionsbausteine:

HR_GET_PAYROLL_RESULTS – Lesen von Abrechnungsergebnissen für Monats- und Jahresreports
PYXX_READ_PAYROLL_RESULT – Generischer Import von Abrechnungsergebnissen
HRCM_PAYROLL_RESULTS_GET – Abrechnungsdaten einer Person ermitteln

Hinweise zu Bausteinen: https://blog.hr-manager.de/2011/09/abap-abrechnungsergebnisse-lesen-per.html

Logische Datenbank:

Eine weitere Möglichkeit ist die Nutzung der logischen Datenbank PNP. Die Verwendung logischer Datenbanken ist jedoch obsolet (zumindest in anderen Modulen) und sollten daher eigentlich nicht mehr verwendet werden.

*&---------------------------------------------------------------------*
*& Report  ZGETPAYROLL
*& Eigenschaften: Selektionsbildvariante 900, HR-Reportklasse PY_DEF.
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZGETPAYROLL.

TABLES: PERNR, PYORGSCREEN, PYTIMESCREEN.

INFOTYPES: 0002.

NODES: PAYROLL TYPE PAYDE_RESULT.

DATA: WA_RT TYPE PC207.

START-OF-SELECTION.

GET PERNR.

RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.

WRITE:/ PERNR-PERNR, P0002-VORNA, P0002-NACHN.

GET PAYROLL.

  LOOP AT PAYROLL-INTER-RT INTO WA_RT.
    WRITE:/ WA_RT-LGART, WA_RT-BETRG.
  ENDLOOP.

END-OF-SELECTION.

Oder in Kombination mit einem Fuba:

*&---------------------------------------------------------------------*
*& Report  ZGETPAYROLL
*& Eigenschaften: HR-Reportklasse __M00001.
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZGETPAYROLL.

TABLES: pernr.               "Necessary for get pernr

INFOTYPES: 0001,             "Organisatorische Zuord
           0002,             "Daten zur Person
           0006,             "Anschrift
           0057.             "Mitgliedschaften

DATA: l_payroll_result TYPE payat_result OCCURS 0 WITH HEADER LINE.


START-OF-SELECTION.

GET pernr.

rp_provide_from_last p0001 '' pn-begda pn-endda.

CALL FUNCTION 'HR_GET_PAYROLL_RESULTS'
    EXPORTING
      pernr                         = pernr-pernr
      permo                         = pn-permo
      pabrj                         = pn-pabrj
      pabrp                         = pn-pabrp
      actual                        = space         "X actual, ' ' retro-differences
      waers                         = 'EUR'
    TABLES
      result_tab                    = l_payroll_result
    EXCEPTIONS
      no_results                    = 0
      wrong_structure_of_result_tab = 2
      OTHERS                        = 4.
  IF sy-subrc NE 0.
    RETURN. "nächste Pernr
  ENDIF.

[ABAP] Download internal table as TXT or CSV

" ty_output and tt_output are just dummy types

DATA: l_output_line    TYPE ty_output,
      l_output_lines   TYPE tt_output,  
      l_csv_output     TYPE truxs_t_text_data,
      l_txt_output     TYPE TABLE OF string,

PARAMETERS: p_alv   RADIOBUTTON GROUP rb1 DEFAULT 'X' USER-COMMAND radio,
            p_csv   RADIOBUTTON GROUP rb1,
            p_flcsv TYPE rlgrap-filename DEFAULT 'c:\temp\file.csv',
            p_txt   RADIOBUTTON GROUP rb1,
            p_fltxt TYPE rlgrap-filename DEFAULT 'c:\temp\file.txt'.

" fill table l_output_lines with your data you want to export as txt or csv

  IF p_csv = abap_true.

    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
      TABLES
        i_tab_sap_data       = l_output_lines
      CHANGING
        i_tab_converted_data = l_csv_output.

    TRY.
        cl_gui_frontend_services=>gui_download( EXPORTING filename = CONV #( p_flcsv )
                                                          filetype = 'ASC'
                                                CHANGING  data_tab = l_csv_output ).  
      CATCH cx_root INTO DATA(e_text).
        MESSAGE e_text->get_text( ) TYPE 'I'.
    ENDTRY.


  ELSEIF p_txt = abap_true.

    LOOP AT l_output_lines INTO l_output_line.
      CALL FUNCTION 'SO_STRUCT_TO_CHAR'
        EXPORTING
          ip_struct = l_output_line
        IMPORTING
          ep_string = l_string.
      APPEND l_string TO l_txt_output.
    ENDLOOP.

    TRY.
        cl_gui_frontend_services=>gui_download( EXPORTING filename = CONV #( p_fltxt )
                                                          filetype = 'ASC'
                                                CHANGING  data_tab = l_txt_output ). 
      CATCH cx_root INTO e_text.
        MESSAGE e_text->get_text( ) TYPE 'I'.
    ENDTRY.

  ENDIF.

[SAP] Install SAP Gui for Java 7.50 on Linux Mint 20

Download

First have a look at the Requirements and FAQ.
Find the download link in the SAP Support Portal here. You will need a valid S-User and download permissions.

If you are not able to download the installer via Support Portal, there is a little workaround. Both, the installer for SAP Gui for Windows and SAP Gui for Java are also delivered with the AS ABAP 752 SP04, developer edition:

“The actual download (in the form of several .rar files), along with more information is available from the SAP Community Trials and Downloads page. Search for “7.52 SP04″ for convenience.”

You will have to download all 11 .rar files (about 14,6GB). When unziping, you’ll find a folder called client (about 1,2GB) containing both installers.

Installation

Since SAP Gui 7.50 Rev 5, Oracles JDKs is not necessary to run SAP Gui for Java, instead you are able to use OpenJDK. Read more about it here. And since version 7.50 Rev 8 the installer includes SapMachine and OpenJFX. Read more about it here. In this case, you don’t even have to install OpenJKD and OpenJFX by yourself and don’t have specify the module path, because it comes containerized within the SAP Gui.
So better first check the version of your downloaded gui. I’ve got SAP Gui 750 rev 5 within the AS ABAP 752 SP04. So let’s install openJDK & openJFX.

sudo apt-get install openjdk-11-jre openjfx
java --version

Finally lets install the SAP Gui:

cd JavaGUI/
java -jar PlatinGUI750_5-80002496.JAR install

The important step during the installation of SAP Gui for Java Rev 5 is to define the option for the module path. The module path hast to point to the OpenJFX lib-path:

/usr/share/openjfx/lib

Now you should be able to run the SAP Gui on Linux Mint 20

Eclipse ADT

When using Eclipse with ADT in combination with SAP Gui for Java and receiving the following error:

"The system reqirements are not met.Could not find: javafx.propertiesin: /usr/lib/jvm/java-11-openjdk-amd64/libYour Java Virtual Machine seems not to support JavaFX, required to run the SAPGUI for Java 7.50 rev 5.Please make sure you provide a valid path to the Java FX modules during guiinstallation."

You also have to add the OpenJFX path to the eclipse.ini file. Read more about it here.

--module-path=/usr/share/openjfx/lib
--add-modules=ALL-MODULE-PATH

[ABAP Env] gCTS

https://blogs.sap.com/2020/05/30/sap-cloud-platform-abap-environment-lifecycle-management-introduction/
https://blogs.sap.com/2020/05/30/sap-cloud-platform-abap-environment-lifecycle-management-sample-scenarios/

GitGit is a distributed version-control system
CTSChange and Transport Management System
gCTSGit-based CTS (the evolution of the classical CTS)
abapGitAn open-source Git client that allows you to import existing code into your ABAP system
RepositoryA Repository is a collection of objects, their directory structure, and metadata
Transport requestsA transport request records all the changes in your ABAP development system.
With gCTS: Once a transport request is released, the changes are pushed into your central Git repository in the cloud as a commit represented by a commit ID.

[ABAP] SE80 Shortcuts

Meine meist verwendeten Workbench Shortcuts:

Strg DZeile verdoppeln
Strg JIn Kommentaren -> 1 Buchstaben groß
Strg ISuchen abwärts (startet beim tippen)
Strg Shift ISuchen aufwärts (startet beim tippen)
Strg KText groß/klein switchen. Alternativ (Strg U für groß, Strg L für klein)
Strg Shift SCoding in Datei speichern
Strg Shift LGanze Zeile löschen
Strg Shift XGanze Zeile löschen und einrücken
Ctrl /Jump to the “command field” where we enter t-codes
Alt Shift PfeiltastenCoding Block markieren (alternativ Alt + Maus)

[SAPUI5] Formatting numbers

https://experience.sap.com/fiori-design-web/formatting-numbers/#usage
https://sapui5.netweaver.ondemand.com/sdk/#/topic/91f3145e6f4d1014b6dd926db0e91070
a few examples: https://github.com/brooklynb7/HTML5/blob/master/sapui5-dist-static/test-resources/sap/ca/ui/demokit/explored/views/type/number.view.xml

<ObjectListItem 
title="{income>Month}" 
number="{ model : 'income', path : 'Cost', type: 'sap.ui.model.type.Integer', formatOptions: {groupingEnabled: true} }"
numberUnit="EUR" />

[SAPUI5] Deploying the ui5 sample app on debian

I’m deploying the openui5-sample-app to a Linux Container running Debian Buster. First update the packages and install Node.js.

apt update && apt upgrade -y
apt install curl -y
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt install nodejs -y
nodejs --version

Install PM2 (process manager to manage Node.js applications) and the UI5 Tooling

npm install pm2 -g
npm install --global @ui5/cli

Now clone the openui5-sample-app and build it

apt install git
git clone https://github.com/SAP/openui5-sample-app.git
cd openui5-sample-app/
ui5 build -a
cd ..

Run your project on port 8000. With “startup” it will automatically create a systemd script.

pm2 serve openui5-sample-app/dist/ 8000
pm2 startup
pm2 save
systemctl start pm2-root
systemctl status pm2-root

[SAPUI5] local ui5 development

1. Install node.js

2. Install UI5 Tooling

npm install --global @ui5/cli

3. Install Easy UI5 Generator, create a project and run it on your localhost

npm install -g yo generator-easy-ui5
yo easy-ui5
cd <your project name> 
npm start

4. Set up a Github project and do your initial push

git add .
git commit -m "Initial commit"
git remote add origin https://github.com/user/myUI5App.git 
git push origin master

5. Install your favorite Editor, e.g. Visual Studio Code or Atom, and open your project to edit it

[SAPUI5] Versioning

SAPUI5 follows Semantic Versioning.

MAJOR.MINOR.PATCH (e.g. 1.71.9)

  • Patches are mostly bug fixes.
  • Minor releases bring new features.
  • Major contains incompatible API changes.

Version overviews:
https://sapui5.hana.ondemand.com/versionoverview.html
https://openui5.hana.ondemand.com/versionoverview.html

Find detailed patchinfos here:
https://sapui5.hana.ondemand.com/X.XX.X/patchinfo.html (where X.XX.X is the SAPUI5 version number)
https://openui5.hana.ondemand.com/X.XX.X/patchinfo.html (where X.XX.X is the OpenUI5 version number)

Note: “sap.ui.core and sap.m are special, because they are OpenUI5 libraries. Currently, OpenUI5 libraries are always released as a whole. This means that whenever there is a change to be released for any of the OpenUI5 libraries, the new patch includes them all.”

[ABAP] Calculation

* ab ABAP 7.54
DATA field TYPE p decimals 2.

field += 4.
field -= 2.
field *= 3.
field /= 2.

*obsolet: ADD, SUBSTRACT, MULTIPLY, DIVIDE