Category Archive Blog

Convert timestamps to date time

Code to quickly convert timestamps (type TZNTSTMPL for instance) to date & time :


DATA : lv_tmstp         TYPE TZNTSTMPL, " 20260326181521000000
       lv_datetime_text TYPE CHAR22.

CONVERT TIME STAMP lv_tmstp TIME ZONE 'UTC' INTO DATE DATA(lv_date) TIME DATA(lv_time). 
" UTC for local time
" lv_date type DATUM = 20260326, WRITE in FR format => 26.03.2026,
" lv_time type tims = 181521, WRITE => 18:15:21.

" Code example to get date time :
" -------------------------------
lv_datetime_text = |{ lv_date DATE = USER } { lv_time(2) }:{ lv_time+2(2) }:{ lv_time+4(2) }|.
" lv_datetime_text : 26.03.2026 - 18:15:21
" (date format can change according to user parameters)

Search tag : convertir, heure

Display SAP popup Installed software

On the lastest SAP versions, it is no longer possible to reach the popup with the component version in the SAP Logon menu. To get this popup, launch module function (SE37) OCS_UI_DISPLAY_PATCH_LEVEL.

Activate scripting (VBS scripts)

On server side: to activate the scripting, go to transaction RZ11, and set parameter name sapgui/user_scripting.
And update the value to TRUE.
Cf details : https://help.sap.com/docs/intelligent-robotic-process-automation/desktop-studio-developer-guide/enabling-scripting-on-server-side?locale=en-US

Table type for VTWEG field

This post just to save time, instead of doing where-used on VTWEG field…

Type table of VTWEG : TDT_VTWEG => line type VTWEG

Type table of VTWEG : TMS_T_VTWEG_RANGE => line type TABLE_LINE

Type range of VTWEG : RANGE_VTWEG_TAB
Warning, this uses structure in package not maintained, it generates ATC check errors, see note 2469385 ❗.

Search tag : type de table

SAP Technical object types

Check list below (CTRL +F to find value) :

Read More

Link check boxes and label in selection screen

You add a check box in your selection screen, want to display long text close to your check box (text longer than the standard selection text), use the synthax below, with FOR FIELD to link the added text to your check box :


SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS p_chkbx  TYPE abap_bool AS CHECKBOX DEFAULT abap_true.
SELECTION-SCREEN COMMENT 02(77) text-001 FOR FIELD p_chkbx.
SELECTION-SCREEN END OF LINE.

Read More

Delete file on AL11 directory

Use the function module (SE37) EPS_DELETE_FILE :

Search tag : Supprimer, fichier, remove

Popup to select a range of date

Use FM RSPC_POPUP_DATE_SELECTION :