From d849b2ac4f1a6a4098fd658a09d747746c48f0af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Erd=C3=B6si?= Date: Tue, 10 Oct 2017 12:47:44 +0200 Subject: [PATCH] Translations are deleted upon activation Translations should be inserted as active text pools, only the text pool of the master language can be inactive. Otherwise translations will be deleted upon activation. --- src/zabapgit_objects.prog.abap | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/zabapgit_objects.prog.abap b/src/zabapgit_objects.prog.abap index 6d0752527..60d64c919 100644 --- a/src/zabapgit_objects.prog.abap +++ b/src/zabapgit_objects.prog.abap @@ -1461,23 +1461,30 @@ CLASS lcl_objects_program IMPLEMENTATION. ENDIF. READ TABLE it_tpool WITH KEY id = 'R' TRANSPORTING NO FIELDS. - IF ( sy-subrc = 0 AND lines( it_tpool ) = 1 ) OR lines( it_tpool ) = 0. - RETURN. " no action for includes + IF ( sy-subrc = 0 AND lines( it_tpool ) = 1 AND lv_language = mv_language ) OR lines( it_tpool ) = 0. + RETURN. " no action for includes unless there is a translation of the program description ENDIF. - INSERT TEXTPOOL iv_program - FROM it_tpool - LANGUAGE lv_language - STATE 'I'. - IF sy-subrc <> 0. - zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ). - ENDIF. + IF lv_language = mv_language. "Textpool in master language needs to be activated + INSERT TEXTPOOL iv_program + FROM it_tpool + LANGUAGE lv_language + STATE 'I'. + IF sy-subrc <> 0. + zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ). + ENDIF. - IF lv_language = mv_language. " Add just once lcl_objects_activation=>add( iv_type = 'REPT' iv_name = iv_program ). + ELSE. "Translations are always active + INSERT TEXTPOOL iv_program + FROM it_tpool + LANGUAGE lv_language + STATE 'A'. + IF sy-subrc <> 0. + zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ). + ENDIF. ENDIF. - ENDMETHOD. "deserialize_textpool METHOD deserialize_cua.