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

[CAP] Fiori Elements – Add i18n label for bound action

It took me some time to figure out, how I can provide a label for an action parameter.

I try to separate all my translations in label.cds file. This means, the annotations are not placed where the entities or actions are defined. If you have the action definition and the label annotations in one file, you could simply do the following for an action:

trip-service.cds

    entity Trip as projection on db.Trip
        actions {
            action approval();
            action rejection(reason: String @title: '{i18n>reason});
        };

But if you separate both, you need to access somehow the defined action to add the annotation. Following a short snippet, how it works. The important part is, that you have to write a complete new annotation block for your actions.

trip-service.cds without label

service tripService @(requires: 'authenticated-user') {

    entity Trip as projection on db.Trip
        actions {
            action approval();
            action rejection(reason: String);
        };

}

label.cds

using my.namespace as db from '../db/index';
using tripService from '../srv/trip-service';

annotate db.Trip with @title: '{i18n>trips}' {
    description   @title      : '{i18n>description}';
    status        @title      : '{i18n>status}';
    // etc.
}

// solution
annotate tripService .Trip actions {
    rejection(reason @titlel: '{i18n>reason}' )
}

[ABAP] Radiobutton with label (comment) and input field

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-b01.

* Schnittstelle
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_server RADIOBUTTON GROUP rad1.
SELECTION-SCREEN COMMENT 6(26) text-t01 FOR FIELD p_server.
PARAMETERS: p_sname(8) TYPE c DEFAULT ''. 
SELECTION-SCREEN END OF LINE.

* Filename (optional)
PARAMETERS: p_fname TYPE j_3sdsn.

* Lokale Datei
PARAMETERS: p_local  RADIOBUTTON GROUP rad1 DEFAULT 'X'.
* Dateiauswahl
PARAMETERS: p_up     TYPE dxfile-filename DEFAULT ''.

SELECTION-SCREEN END OF BLOCK b1.