Skip to Content
Technical Articles
Author's profile photo Gregor Wolf

Performance improvement for the SAP Menu in SAP Fiori Launchpad in multiple languages

If you’re using the SAP Menu in the SAP Fiori Launchpad you might be aware of the SAP Notes:

That ask you to run the report /UI2/EAM_BUILD_CACHE. If you have multiple languages installed that can be quite cumbersome as you have to execute the report in each of the installed languages. To get arround this issue I’ve created the following helper report that schedules a job in all installed languages:

*&---------------------------------------------------------------------*
*& Report ZBC_FLP_EAM_BUILD_CACHE
*&---------------------------------------------------------------------*
*& Wrap /UI2/EAM_BUILD_CACHE to execute for multiple languages
*&---------------------------------------------------------------------*
*& Created by Gregor Wolf
*&---------------------------------------------------------------------*
REPORT zbc_flp_eam_build_cache.

CONSTANTS prefix TYPE tbtcjob-jobname VALUE 'ZBC_FLP_EAM_BUILD_CACHE'.

DATA tt002 TYPE t002.
DATA languages TYPE TABLE OF t002.
DATA own_language TYPE spras.
DATA message TYPE string.

DATA: number           TYPE tbtcjob-jobcount,
      name             TYPE tbtcjob-jobname,
      print_parameters TYPE pri_params.

SELECT-OPTIONS s_langu FOR tt002-spras.

START-OF-SELECTION.

  own_language = sy-langu.

  SELECT * FROM t002
    LEFT JOIN t002c ON t002~spras = t002c~spras
    INTO CORRESPONDING FIELDS OF TABLE @languages
    WHERE t002~spras IN @s_langu AND t002c~lainst = 'X'
    ORDER BY t002~spras.

  IF sy-subrc <> 0.
    WRITE / 'No active languages installed'.
  ENDIF.

  LOOP AT languages ASSIGNING FIELD-SYMBOL(<language>).
    WRITE: / 'Building EAM Cache for language: ', <language>-spras.
    name = prefix && |_| && <language>-laiso.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = name
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc = 0.
      SUBMIT /ui2/eam_build_cache TO SAP-SPOOL
                      SPOOL PARAMETERS print_parameters
                      WITHOUT SPOOL DYNPRO
                      VIA JOB name NUMBER number LANGUAGE <language>-spras
                      AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = number
            jobname              = name
            strtimmed            = 'X'
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5
            job_notex            = 6
            lock_failed          = 7
            OTHERS               = 8.
        IF sy-subrc <> 0.
          WRITE / 'There was a error scheduling the Job'.
        ENDIF.
      ELSE.
        DATA(msg) = cl_abap_submit_handling=>get_error_message( ).
        MESSAGE ID msg-msgid
                TYPE 'I'
                NUMBER msg-msgno
                WITH msg-msgv1 msg-msgv2 msg-msgv3 msg-msgv4
                INTO message.
        WRITE / message.
        WRITE / <language>-laiso.
      ENDIF.
    ELSE.
      WRITE / 'Issue creating a job number'.
    ENDIF.
  ENDLOOP.

When you’ve executed this report you should see the following result in SM37:

 

 

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.