UI5 und der Cache

UI5/Fiori und der Cache!

Viele kennen die Situation. Man hat im Entwicklungssystem eine super coole UI5/Fiori App für ein S/4HANA System gebastelt, aber nach dem Import in das Produktivsystem (oder Q-System) geht erstmal gar nix. Target was not found, Type Error, Unknown Setting, Cannot read properties, …

Sehr oft liegen die Gründe der Probleme am Cache! Nicht nur am Browser Cache, auch im SAP Backend gibt es mehrere zu berücksichtigende Caches. Nachfolgend eine Auflistung der Cache Themen, die mir im Zuge meiner Arbeit untergekommen sind.

Eigentlich unglaublich, wie viele Caches man ggf. löschen / invalidieren muss.

Wichtiger Hinweis: Das sind meine persönlichen Erfahrungen, bitte verwendet die Reports oder Transaktionen nur nach vorheriger Prüfung. Es kann durchaus sein, dass der eine oder andere Report obsolet wird oder in gewissen System nicht verwendet werden darf! Ich übernehme keine Garantie, dass die Reports oder Transaktionen in euren Systemen einwandfrei und korrekt funktionieren.

NameTypErläuterungBereich
/UI5/APP_INDEX_CALCULATEReportAb UI Add-On 2.0+ Sollte periodisch eingeplant seinUI / App
/UI2/DELETE_CACHEReportLöscht UI2 Services & Target Mapping CachesUI / App / Lpd
/IWFND/CACHE_CLEANUPTransaktionClean Frontend OData CacheGW
/IWBEP/CACHE_CLEANUPTransaktionClean Backend OData CacheGW
ICM Server CacheGlobal InvalidierenUI / App / GW
/UI2/INVALIDATE_CLIENT_CACHESReportClient Cache Invalidation Fiori Launchpad / Cache BusterUI / App
/UI2/INVALIDATE_GLOBAL_CACHESReportInvalidiert alle UI2 Caches (Alle Services mit /UI2/*, SHMM, … )UI / App
/UI5/UPD_ODATA_METADATA_CACHEReportOData Cache – Cache Buster TokensUI / App
/UI5/UPDATE_CACHEBUSTERReportNur für UI Add-On 1.0UI / APP
CL_SADL_LOAD_AREAShared MemoryShared Memory invalidierenUI / APP
/UI2/FLP_DEL_PERSONALIZATIONReportSAP Fiori Launchpad PersonalisierungenUI / APP
Browser CacheIE, Chrome, … Cache UI / APP

/UI5/APP_INDEX_CALCULATE

Das ist mein Lieblingsreport in dem Zusammenhang, da er mir in den meisten Fällen immer die Probleme löst. Es gibt einen Applikationsindex und Caching für Apps, Komponenten und Libraries. Dieser Report löscht bzw. invalidiert diese Caches / Indextabellen und ist im Normalfall automatisch eingeplant.

Ich habe jedoch die Erfahrung gemacht, dass nach einem Transport von Änderungen einer UI5 Anwendung, ein explizites Ausführen des Reports für die jeweilige Anwendung notwendig ist.

Weiter Informationen zu dem Report können hier entnommen werden:

/UI2/DELETE_CACHE

Hier geht es um das Löschen des UI2 Cache. Dieser kann für einen User oder generell gelöscht werden.

/IWFND/CACHE_CLEANUP und /IWBEP/CACHE_CLEANUP

Invalidiert / Löscht das oData Model (SEGW oder RAP) am Frontend- und Backend-Server.

/UI2/INVALIDATE_CLIENT_CACHES

Dieser Report sollte überhaupt nur in Ausnahmefällen notwendig sein – wenn der UI5 Cache Buster im Einsatz ist. Eine Erklärung zum Report gibt es unter help.sap.com.

/UI2/INVALIDATE_GLOBAL_CACHES

Invalidiert alle globalen UI2 Caches. Bitte die Dokumentation des Reports im System beachten.

/UI5/UPD_ODATA_METADATA_CACHE

Der Report löscht die OData Caches Tokens. Bitte auch hier die Dokumentation des Reports beachten.

/UI5/UPDATE_CACHEBUSTER

Der sorgt dafür, dass der Cache Buster mit dem aktuellsten UI5 Metadaten arbeitet. Der Report ist jedoch nur bei Systemen mit UI Add-On 1.0 einzusetzen. Bei Systemen mit einem höheren UI Add-On Release ist hingegen /UI5/APP_INDEX_CALCULATE zu verwenden.

/UI2/FLP_DEL_PERSONALIZATION

Fiori Launchpad Homepages können normalerweise durch den Anwender personalisiert werden. Es können neue Gruppen angelegt werden, Apps entfernt oder hinzugefügt werden. Manchmal ist es notwendig, solche Personalisierungen zurückzusetzen. Beispielsweise nach Änderungen im Fiori Katalog oder einer Fiori Gruppe. Ein Erklärung zu der Funktion ist hier beschrieben.

Sonstiges

Änderungen an Service-Definitionen müssen manchmal manuell in Transportaufträgen aufgenommen und transportiert werden.

Fazit

Es vergeht fast kein Transport wo nicht irgendein Cache ein Problem bereitet. Aber mit dem /UI5/APP_INDEX_CALCULATE bekommt man das meist in den Griff.

Ich werden diesen Blogpost nach und nach um weitere Erkenntnisse in dem Zusammenhang ergänzen.

How to send emails from ABAP® with CL_BCS

Usage of the class CL_BCS in order to send eMails from ABAP™ applications via the Business Communication Service.

With our development tips we address special, related to praxis topics around the exciting and inexhaustible topic software development.

Valid for: SAP NetWeaver ABAP Web AS from 6.10

Index

  • General
  • e-mail dispatch from SAP
  • Class CL_BCS
  • Method CREATE_PERSISTENT – compile of a sending task
  • Method SET_DOCUMENT – attach text, data files and other objects
  • Method ADD_ATTACHMENT of the class CL_DOCUMENT_BCS
  • Method ADD_RECIPIENT – transfer of receiver
  • Method SEND – Sending of e-mail
  • Cases of application
  • Copyright & disclaimer

General

Often it is important to have necessary information at disposal in order to react quickly and in the right way. Especially, when the information procurement, like a report, takes a long time and cannot be constantly watched, it is useful to release an action upon completion. That can for example be an eMail with the status of a batch job or even the ABAP list.

eMail dispatch from SAP

SAP provided with the web AS 6.10 (6.20) the Business Communication Services (BCS) to send objects from ABAP applications. This object orientated interface is the successor of the Business Communication Interface (BCI), which is implemented as objects of the Business Object Repository (BOR).

In this Cadaxo development tip I will give an overview of the e-mail dispatch via BCS.

Class CL_BCS

Via BCS different objects with attachments and notes for several receivers can be sent also in different communication ways. Consequently the interface – the class CL_BCS – is constructed complex. In this development tip we therefore concentrate on sending an e-mail with attachment only.

A sending process breaks down into the following steps:

  • Generation of a sending task
  • Attaching an object
  • Choice of receivers
  • Sending of the mail

For all those tasks the class CL_BCA provides the following methods:

  • CREATE_PERSISTENT Compilation of a sending task
  • SET_DOCUMENT Attaching a text, data or other objects
  • ADD_RECIPIENT Add the receiver
  • SEND Sending of e-mail

Method CREATE_PERSISTENT – Compilation of a sending order

This method generates a sending task and returns an object of the class CL_BCS. All further steps are used upon that object.

Method SET_DOCUMENT – Attachment oft ext, data and other objects

With this method the content, meaning the actual text and data attachments of the e-mail is committed. The method expects an object with the interface IF_DOCUMENTS_BCS. Attachments are committed via this object too.

Via the statistic method CREATE_DOCUMENT of the class CL_DOCUMENT_BCS a respective object can be created.

The method expects the following parameters:

I_TYPE: Type of committed data, e.g. HTM für eine HTML Datei, TXT for text data, BIN for binary data like PDFs

I_TEXT/I_HEX: A chart with the actual text resp. the binary data according to the choosen type

I_SUBJECT: subject of the e-mail

Method ADD_ATTACHMENT of class CL_DOCUMENT_BCS

This method is similarly used to the CREATE_DOCUMENT:

I_ATTACHMENT_TYPE: Type of committed data, e.g. HTM for HTML data, TXT for text data, BIN for binary data like PDFs

I_ATTACHMENT_TEXT/

I_ATTACHMENT_HEX: An internal table with the actuall text resp. the binary data according to the choosen type

I_ATTACHMENT_SUBJECT: Name of the attachment file

Method ADD_RECIPIENT – Transfer of receiver

Depending on the way of communication and type of the sent object different receivers can be transferred to the mail. E.g. no business object relation can be per e-mail.

The method expect at least one object which implements the interface IF_RECIPIENT_BCS:

I_RECIPIENT: receiver address (Interface IF_RECIPIENT_BCS)

I_EXPRESS: Express message; if the receiver is a SAP user, a pop-up appears at the next processing of the PBO event with the notice of a new message

I_COPY: The receiver receives the message as a copy

I_BLIND_COPY: The receiver receives the message as a blind copy

I_NO_FORWARD: no forwarding; if the receiver is a SAP user, he cannot forward the message

The two most important receiver types are probably e-mail addresses and SAP users. The respective objects are generated by the following statistic methods:

CL_SAPUSER_BCS=>CREATE For SAP users

CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS For e-mail addresses

Method SEND – Sending of an e-mail

The message is passed on to SAPconnect and sent via the respective interface. The actual sending process is usually scheduled by a batch job with the report RSCONN01, which periodically sends all upcoming messages. In order to avoid the waiting perioduntil the next job performance, the message can be tagged as “to be sent immediately”: Method SET_SEND_IMMEDIATELY( abap_true ) of the sending task.

Method SHORT_MESSAGE

With this method the SAPOffice dialogue opens itself for new messages, on which the user can maintain receivers, texts, attachments and their settings himself. Via parameters suggestion values for the respective fields and objects, e.g. receiver addresses, can be taken with at the time of selection, which later will be displayed in the message.