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.
This commit is contained in:
Thomas Erdösi 2017-10-10 12:47:44 +02:00
parent 9ec2bd4895
commit d849b2ac4f

View File

@ -1461,23 +1461,30 @@ CLASS lcl_objects_program IMPLEMENTATION.
ENDIF. ENDIF.
READ TABLE it_tpool WITH KEY id = 'R' TRANSPORTING NO FIELDS. 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. IF ( sy-subrc = 0 AND lines( it_tpool ) = 1 AND lv_language = mv_language ) OR lines( it_tpool ) = 0.
RETURN. " no action for includes RETURN. " no action for includes unless there is a translation of the program description
ENDIF. ENDIF.
INSERT TEXTPOOL iv_program IF lv_language = mv_language. "Textpool in master language needs to be activated
FROM it_tpool INSERT TEXTPOOL iv_program
LANGUAGE lv_language FROM it_tpool
STATE 'I'. LANGUAGE lv_language
IF sy-subrc <> 0. STATE 'I'.
zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ). IF sy-subrc <> 0.
ENDIF. zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ).
ENDIF.
IF lv_language = mv_language. " Add just once
lcl_objects_activation=>add( iv_type = 'REPT' lcl_objects_activation=>add( iv_type = 'REPT'
iv_name = iv_program ). 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. ENDIF.
ENDMETHOD. "deserialize_textpool ENDMETHOD. "deserialize_textpool
METHOD deserialize_cua. METHOD deserialize_cua.