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

[CAP] CQL Expand two levels deep

I’ve already made a post about expanding compositions or associations (see here), but this time I had to extend two levels deep.

My entity structure looked something to this:

entity Header: cuid, managed {
    Items           : Composition of many Header.Items
                          on Items.purgeRun = $self;
}

entity Header.Items : cuid, managed {
    file            : Association to Files @mandatory @assert.target;
    header: Association to Header;
}

entity Files : cuid, managed {          
    content         : LargeBinary @Core.MediaType: mediaType  @Core.ContentDisposition.Filename: fileName  @Core.ContentDisposition.Type: 'inline';
    mediaType       : String      @Core.IsMediaType: true;
    fileName        : String      @mandatory;
    size            : Integer;
}   

It is possible to query all data in a single HTTP call using $expand twice.

### Header + Items + File
GET {{server}}/odata/v4/service/MainEntity/{{ID}}
?$expand=Items($expand=file)
Authorization: Basic {{username}} {{password}}

However, if you want to fetch the same data using CQL, the following query is required:

        const data = await SELECT(Header, ID)
            .columns(h => {
                h('*')
                h.Items(i => {
                    i('*')
                    i.file(f => f('*'))
                })
            })

This syntax is really hard to remember…

[Android] Taschenlampe einschalten durch seitliches Schütteln

Durch Zufall habe ich letztens herausgefunden, dass man die Taschenlampe des Smartphones durch seitliches Schütteln einschalten kann, sofern man es in den Einstellungen aktiviert hat. Ich muss sagen, ich nutze es quasi täglich und es hat mein Leben verändert 😀

Einstellungen → System → Touch-Gesten & Bewegungen → Moto-Gesten → Hacken (Taschenlampe mit der Hack-Geste ein-/ausschalten)

[ABAP] Ermittle Sachkonto zu symbolischen Konto aus FI System

DATA(service_manager) = NEW cl_hrpp_ws_service_manager( ).

SELECT * INTO TABLE @DATA(lt_t52el) FROM t52el  WHERE molga = '01' AND symko <> @space AND endda >= @pn-begps. " Verknüpfung Lohnart zu symbolischen Konto
SELECT * INTO TABLE @DATA(lt_t52ek) FROM t52ek.                                                                " Symbolische Konten
SELECT * INTO TABLE @DATA(lt_t52ep) FROM t52ep.                                                                " Kontierungsarten

 LOOP AT lt_t52el INTO DATA(ls_t52el). " Ermittle je Lohnart die symbolischen Konten (1:n)

      TRY.
          DATA(ls_t52ek) = lt_t52ek[ symko = ls_t52el-symko ].   " Ermittele Kontierungsart
          DATA(ls_t52ep) = lt_t52ep[ koart = ls_t52ek-koart ].   " Ermittele Typ des symbolischen Kontos
          DATA(process)  = CONV ktosl( 'HR' && ls_t52ep-kttyp ).
        CATCH cx_sy_itab_line_not_found.
          CONTINUE.
      ENDTRY.

      service_manager->hrpp_fi_acct_det_hr( EXPORTING companycode        = pernr-bukrs
                                                      process            = process              " Vorgangsschlüssel
                                                      symb_acct          = ls_t52el-symko
                                                      eg_acct_det        = CONV #( '1' )        " Überleitung FI/CO: Mitarbeitergruppierung Kontenfindung: alle Mitarbeiter
                                            IMPORTING gl_account_debit   = DATA(account_debit)
                                                      gl_account_credit  = DATA(account_credit)
                                                      return_tab         = DATA(return_tab) ).
      IF line_exists( return_tab[ type = 'E' ] ).
        CONTINUE.
      ENDIF.

      " Lese Sachkonto Text
      service_manager->hrpp_gl_acc_getdetail( EXPORTING companycode    = pernr-bukrs
                                                        glacct         = account_debit
                                                        language       = sy-langu
                                                        text_only      = abap_true
                                              IMPORTING account_detail = DATA(account_detail) ).

 ENDLOOP.

[SAP] System upgrade – Find related notes

Brief overview of how to find all notes contained in the installed SPs during a system patch.

First, look up the new SP level for a specific component. For example, if the old SP level was 0026 and the patch it is 0028, you need to check the notes for SP 0027 and 0028.

Then open the SAP Software center: https://me.sap.com/softwarecenter (or via https://support.sap.com/en/index.html and click on Software Downloads)

Search for component UIHR002

Click on “Maintenance Software Component”

Click on “SUPPORT PACKAGES”

Choose a package you want to view the notes for and click on “Content Info”

Now it will list all notes which are included

[YouTube] Android App Gestures

I don’t remember exactly when and how I found all this out, but I have noticed that many people don’t know many features/gestures.

  • If you double tap with one finger on the left or right of the screen, you can skip 10 seconds (I guess most people know this). If you tap more often, it can skip multiples of 10 seconds.
  • If you double tap with two fingers, you can skip to the next chapter (if the video has chapter marks).
  • If you simply tab and hold with one finger, you can fast forwards with 2x speed.
  • If you are watching a video, you can simply swipe up to view the video in full screen (will turn video into landscape mode) or swipe down to exit full screen mode.
  • In full screen mode, pinch with two fingers to zoom in or out. Then pan = move to that corner you want to look closer.
  • When searching for a specific scene, press and hold on the progress bar and then slightly swipe upwards. You get a larger progress bar, which contains preview images for the respective timestamps, and through which you can easily scroll.

And there are probably others that I don’t know about…

[YouTube] Combine Metube & SponsorBlock

I have been using MeTube for some time to occasionally download YouTube videos. Now I’ve been looking for a way to combine MeTube with SponsorBlock to get rid of the ads when downloading a file. And it turned out to be possible. You can either use SponsorBlock to add a chapter for an ad segment, or you can use it to remove the ad or any other segment using the remove_sponsor_segments parameter. Currently, it is not possible to do both things (create segment chapters + remove segments). Here the solution to remove ads while downloading:

Create the following JSON File:

{
  "postprocessors": [
    {
      "api": "https://sponsor.ajay.app/",
      "categories": [
        "intro",
        "outro",
        "poi_highlight",
        "selfpromo",
        "sponsor",
        "interaction" 
      ],
      "key": "SponsorBlock",
      "when": "after_filter"
    },
    {
      "force_keyframes": false,
      "key": "ModifyChapters",
      "remove_chapters_patterns": [],
      "remove_ranges": [],
      ""remove_sponsor_segments": ["sponsor","interaction","selfpromo"],
      "sponsorblock_chapter_title": "'[SponsorBlock]: ''%(category_names)l'"
    },
    {
      "add_chapters": true,
      "add_infojson": "none",
      "add_metadata": false,
      "key": "FFmpegMetadata"
    }
  ]
}

The relevant parts here are the categories:

  • intro — video intro segments
  • outro — video endings or credits
  • sponsor — sponsored ads/segments to skip
  • selfpromo — creator self-promotion clips
  • interaction — calls to action (like “subscribe” asks)
  • poi_highlight — important highlights or notable moments (Points of Interest)

And the remove_sponsor_segments parameter. Here you can provide all sections you want to have removed during a download.

The last step is to mount the JSON File into the Container:

version: '3'

services:
  metube:
    image: alexta69/metube
    ports:
      - "8081:8081"
    volumes:
      - ./downloads:/downloads
      - ./ytdl_options.json:/config/ytdl_options.json:ro # the first part must be the path/place of your new created json file
    environment:
      - YTDL_OPTIONS_FILE=/config/ytdl_options.json

To add video links to MeTube you can also use this handy Browser Add-on: MeTube Downloader

Update 28.07.2025: Since MeTube version 2025-07-27, changes to the YTDL_OPTIONS_FILE are monitored and do not require a container restart to take effect.

[Software] Firefox

Mittels about:unloads kann man in Firefox eine Übersichtsseite aufrufen, die einem auflistet, welche Tabs wie viel Speicher verbrauchen. Hier können inaktive Tabs mit hohem RAM verbrauch auch entladen werden. Seit Firefox 140 kann man mit einem Rechtsklick auf einen Tab oder eine Tabgruppe und der Funktion Unload Tab dies nun auch manuell für bestimmte Tabs erledigen.