By using line_exists you can check if a line exists or not exists, but it is not possible to use other comparison operators. A workaround can be REDUCE in that case.
In the following snippet, we want to check if there is a flight that costs more than $1000,
SELECT * FROM sflight INTO TABLE @DATA(flights).
* Check if flight with price > 1000 exist
IF REDUCE abap_bool( INIT price_gt_1000 = abap_false
FOR line IN flights WHERE ( price > 1000 )
NEXT price_gt_1000 = abap_true ) EQ abap_true.
" flight with price > 1000 exists
ENDIF.
Mein letzter Blog-Umzug war im Juli 2020 von DigitalOcean zu Strato (siehe hier). Nun war es mal wieder Zeit.
Der Blog und alle meine weiteren Docker Container sind nun endlich nach über 4 Jahren von einem Strato VPS zu einem Netcup VPS auf ARM Basis umgezogen. Obwohl ich schon viele schlechte Erfahrungen mit Strato gemacht hatte, habe ich trotzdem damals den VPS bei Strato abgeschlossen, da dieser mit 1TB SSD Speichern zu der Zeit konkurrenzlos viel Speicher für 15 € im Monat bot. Das war für den Betrieb einer Nextcloud für mich entscheidend. Aber meine schlechten Erfahrungen setzten sich fort. Ich kann gar nicht aufzählen, wie viele Performanceprobleme und Ausfälle es gab. Manchmal nur ein paar Minuten oder Stunden. Manchmal auch einfach mehrere Tage. Anfangs habe ich noch Tickets aufgemacht, aber irgendwann hatte ich darauf auch keine Lust mehr. Warum ich trotzdem so lange bei Strato war? Wohl einfach aus faulheit… Aber als Strato diesem Sommer auch noch den Preis für den V40-16 von 15€ auf 17,70€ angehoben hat, vermutlich primär um die Altkunden loszuwerden bzw. diese zu drängen von der Virtuozzo auf die neue KVM Virtualisierungsplattform zu wechseln, war es endgültig genug. Hab mich einige Wochen nach VPS Anbietern umgeschaut, die einen VPS mit viel Speicher anbieten und wurde Ende Oktober bei Netcup fündig, als es eine Angebotsaktion gab, bei der für bestimmte VPS der Speicher verdoppelt wurde. Die Aktionsproduktseite gibt es nicht mehr, aber es handelt sich quasi um dieses Produkt mit doppeltem Speicher: https://www.netcup.com/de/server/arm-server/vps-3000-arm-g11-mnz#vps-3000-arm-g11-vie In meinem Fall also: VPS 3000 ARM G11 SE VIE SPS24 mit 1536 GB NVMe Speicher für 16,95 €
Das ganze auch noch monatlich kündbar und nicht mehr wie bei Strato jährlich. Für quasi das gleiche Geld gab es hier also erheblich mehr Leistung. Einziger “Knackpunkt”, der neue Server bedeutete auch ein Wechsel der CPU Architektur von x86 auf ARM. Ich habe daher sicherheitshalber erstmal für meine aktuell genutzten Anwendungen
WordPress
Nginx Proxy Manager
Nextcloud
OnlyOffice
Collabora
Vaultwarden
SMTP
Portainer
TeamSpeak3
geprüft, ob auch Docker Images für ARM bereitgestellt werden. Lediglich bei zwei Anwendungen war das nicht der Fall. Der Teamspeak3 Server, sowie der SMTP Container. Nach kurze Recherche habe ich aber direkt Ersatz gefunden (TS3 & SMTP). Wirklich neu aufsetzen musste ich daher lediglich den TeamSpeak3 Server, aber der Aufwand hielt sich in Grenzen.
Die ganze Migration verlief erheblich einfacher als erwartet. Mit dem folgenden Befehl habe ich jeden Ordner meiner Docker Anwendungen (praktischerweise hab ich damals alles ohne Docker Volumes aufgesetzt, alle Daten liegen also direkt in dem gleichen Ordner wie die docker-compose.yml) nacheinander auf den neuen Server übertragen. Bis auf die Nextcloud, eine Sache von wenigen Minuten.
Danach noch die DNS Einträge angepasst und gewartet, bis diese sich aktualisieren. Bei der Nextcloud und Vaultwarden gingen komischerweise die User:Group Zuordnungen zum Teil nicht sauber rüber. Da musste ich daher noch kurz etwas nacharbeiten. Im Nginx Proxy Manager habe ich noch alle Zertifikate einmal aktualisiert und nach wenigen Stunden waren dann alle Container wieder über alte URL erreichbar.
Hätte ich geahnt, dass der Serverumzug so reibungslos verläuft, hätte ich das auf jeden Fall schon vor Jahren gemacht. Mit Netcup bin ich vollkommen zufrieden und mein Uptime Kuma konnte bisher kein einziges Erreichbarkeitsproblem des VPS feststellen, im Gegensatz zum Strato VPS, der immer mal wieder für einige Minuten nicht auf den Ping Test reagiert. Ich kann daher nur nochmals von den Strato VPS Produkten abraten.
Since my workflow was already in this state, I had to find another way, and found it with transaction code SWWL. Simply find the unique Identification of the top level workitem via t-code SWIA and then use it in SWWL. When running the report, you will first get a list, then simply select the result items you want to delete and hit the trash icon, or restart the selection and check the flag for Delete immediately.
The fact that some applications do not start minimized (in tray) at system startup has been annoying me for quite some time. I find it even more annoying that you can’t simply set this directly via a checkbox in the Startup Applications for each application. The problem seems to be that each application has a different parameter for this, and therefore it cannot be done generally by the operating system (at least that’s my guess). I have therefore researched the necessary parameters for the applications I use. Simply add the parameter at the end of the Startup Applications command. For some applications, you can also activate it directly in the specific settings.
I had to calculate the difference between two times, even if the end time goes beyond the 0 o’clock day limit, e.g. 20:00 to 02:00 should be 6h. I found the following two function modules doing the job:
* Option 1
CALL FUNCTION 'CATS_COMPUTE_HOURS'
EXPORTING
pernr = pernr
date = date
* NO_BREAK_DEDUCTION = ' '
row = row
TABLES
return = return
CHANGING
catshours = catshours
beguz = beguz
enduz = enduz
vtken = vtken.
* Option 2 (I think it's only available on S/4 HANA)
CALL FUNCTION 'CATS_DETERMINE_HOURS'
CHANGING
catshours = catshours
beguz = beguz
enduz = enduz.
Customizing SPRO → Personnel Management → Employee Self-Service (Web Dynpro ABAP) → Service-Specific Settings → Working Time → My Overtime Requests.
Adjusting the Fiori UI
If you want to hide fields in the Fiori frontend, or you want to adjust some labels, you can simply do this via Customizing: My Overtime Requests → Layout of the Web Application → Define Field Selection
Multi-Level Approval for Time Data Requests (HRPT_B_TMD_MULTI_APPROVERS)
The BAdI is called when opening the My Overtime Request App and a second time when clicking on the New Button to create a new OVT request. It’s not triggered when sending the request, what I initially expected. To reuse the code from the sample class,
* "Determine approver level
* DATA(cust_key_request_fields) = VALUE cl_hrpt_ovt_const=>ovt_cust_key_request_fields( pernr = iv_pernr
* ktart = iv_subtype
* date = is_request_period-start_date ).
* TRY.
* DATA(approval_settings) = cl_hrpt_ovt_cust_factory=>get_customizing_reader( )->get_approval_settings( REF #( cust_key_request_fields ) ).
* CATCH cx_hrpt_tmd.
* RETURN.
* ENDTRY.
* IF approval_settings-use_multiple_approver = abap_false.
* RETURN.
* ENDIF.
....
* "If no last approvers exist, use line manager, HR BP and HR Admin by default
* CALL FUNCTION 'BAPI_GET_LINE_MANAGER'
* EXPORTING
* im_objid = iv_pernr
* IMPORTING
* es_approver = line_manager
* ev_has_manager = approver_exists.
* IF approver_exists = abap_true.
* last_seqnr = last_seqnr + 1.
* line_manager-seqnr = last_seqnr.
* APPEND line_manager TO rt_approver_tab.
* IF lines( rt_approver_tab ) >= approval_settings-approver_level.
* RETURN.
* ENDIF.
* ENDIF.
you have to set the amount of approval steps in the customizing.
Custom Workflow
If you want to replace the default Workflow WS02400057 (PT_OVTREQ) with a custom one, you must adjust the customizing (as described here for the standard WF), and you’ll need to create a new BAdI Implementation for HCMFAB_MYOTQ_APPROVAL_INBOX analog HCMFAB_MYOTQ_APPROVAL_INBOX to get the Approve and Rejects Buttons working by providing the Workflow-ID and decision Step-ID.
Extensibility
Although it should be possible to extend both Fiori Apps via Adaptation Projects, I was unable to do so. Either it’s a problem with the new adaption editor, which got new released while writing the blog, or it is a problem with the apps itself. Whatever I tried, I was always running in issues.
Therefore, I did it the “classic” way and created an Extension Project and used the provided Extension Points. For the Approval App, I was unable to preview the application directly in BAS, perhaps because it is only an Inbox integration and does not run standalone. I therefore always had to deploy, to test my changes.