mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 20:32:26 +08:00
Finu-tuning of serializing
Optimized serializing of program texts by removing unnecessary structure lt_langs_i18n.
This commit is contained in:
parent
b4f2912a04
commit
8c0678843c
|
@ -15,7 +15,7 @@ CLASS lcl_object_prog DEFINITION INHERITING FROM lcl_objects_program FINAL.
|
||||||
|
|
||||||
PRIVATE SECTION.
|
PRIVATE SECTION.
|
||||||
TYPES: BEGIN OF ty_tpool_i18n,
|
TYPES: BEGIN OF ty_tpool_i18n,
|
||||||
langu TYPE langu,
|
language TYPE langu,
|
||||||
textpool TYPE textpool_table,
|
textpool TYPE textpool_table,
|
||||||
END OF ty_tpool_i18n,
|
END OF ty_tpool_i18n,
|
||||||
tt_tpool_i18n TYPE STANDARD TABLE OF ty_tpool_i18n.
|
tt_tpool_i18n TYPE STANDARD TABLE OF ty_tpool_i18n.
|
||||||
|
@ -163,39 +163,28 @@ CLASS lcl_object_prog IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD serialize_texts.
|
METHOD serialize_texts.
|
||||||
|
|
||||||
DATA:
|
DATA lt_tpool_i18n TYPE tt_tpool_i18n.
|
||||||
lt_tpool_i18n TYPE tt_tpool_i18n,
|
|
||||||
ls_tpool_i18n LIKE LINE OF lt_tpool_i18n,
|
|
||||||
lt_langs_i18n TYPE TABLE OF langu.
|
|
||||||
|
|
||||||
FIELD-SYMBOLS:
|
FIELD-SYMBOLS <tpool> LIKE LINE OF lt_tpool_i18n.
|
||||||
<lang> LIKE LINE OF lt_langs_i18n,
|
|
||||||
<text> LIKE LINE OF lt_tpool_i18n.
|
|
||||||
|
|
||||||
" Table d010tinf stores info. on languages in which program is maintained
|
" Table d010tinf stores info. on languages in which program is maintained
|
||||||
" Select all active translations of program texts
|
" Select all active translations of program texts
|
||||||
" Skip master language - it was already serialized
|
" Skip master language - it was already serialized
|
||||||
SELECT DISTINCT language
|
SELECT DISTINCT language
|
||||||
INTO TABLE lt_langs_i18n
|
INTO CORRESPONDING FIELDS OF TABLE lt_tpool_i18n
|
||||||
FROM d010tinf
|
FROM d010tinf
|
||||||
WHERE r3state = 'A'
|
WHERE r3state = 'A'
|
||||||
AND prog = ms_item-obj_name
|
AND prog = ms_item-obj_name
|
||||||
AND language <> mv_language.
|
AND language <> mv_language.
|
||||||
|
|
||||||
SORT lt_langs_i18n ASCENDING.
|
SORT lt_tpool_i18n BY language ASCENDING.
|
||||||
LOOP AT lt_langs_i18n ASSIGNING <lang>.
|
LOOP AT lt_tpool_i18n ASSIGNING <tpool>.
|
||||||
READ TEXTPOOL ms_item-obj_name LANGUAGE <lang> INTO ls_tpool_i18n-textpool.
|
READ TEXTPOOL ms_item-obj_name
|
||||||
|
LANGUAGE <tpool>-language
|
||||||
IF sy-subrc IS INITIAL.
|
INTO <tpool>-textpool.
|
||||||
ls_tpool_i18n-langu = <lang>.
|
|
||||||
APPEND ls_tpool_i18n TO lt_tpool_i18n.
|
|
||||||
ENDIF.
|
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
|
|
||||||
IF lines( lt_langs_i18n ) > 0.
|
IF lines( lt_tpool_i18n ) > 0.
|
||||||
io_xml->add( iv_name = 'I18N_LANGS'
|
|
||||||
ig_data = lt_langs_i18n ).
|
|
||||||
|
|
||||||
io_xml->add( iv_name = 'I18N_TPOOL'
|
io_xml->add( iv_name = 'I18N_TPOOL'
|
||||||
ig_data = lt_tpool_i18n ).
|
ig_data = lt_tpool_i18n ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
@ -212,7 +201,7 @@ CLASS lcl_object_prog IMPLEMENTATION.
|
||||||
|
|
||||||
LOOP AT lt_tpool_i18n ASSIGNING <tpool>.
|
LOOP AT lt_tpool_i18n ASSIGNING <tpool>.
|
||||||
deserialize_textpool( iv_program = ms_item-obj_name
|
deserialize_textpool( iv_program = ms_item-obj_name
|
||||||
iv_language = <tpool>-langu
|
iv_language = <tpool>-language
|
||||||
it_tpool = <tpool>-textpool ).
|
it_tpool = <tpool>-textpool ).
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
|
|
||||||
|
|
|
@ -874,8 +874,8 @@ CLASS lcl_objects_program DEFINITION INHERITING FROM lcl_objects_super.
|
||||||
|
|
||||||
METHODS deserialize_textpool
|
METHODS deserialize_textpool
|
||||||
IMPORTING iv_program TYPE programm
|
IMPORTING iv_program TYPE programm
|
||||||
iv_language TYPE langu OPTIONAL
|
|
||||||
it_tpool TYPE textpool_table
|
it_tpool TYPE textpool_table
|
||||||
|
iv_language TYPE langu OPTIONAL
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
METHODS deserialize_cua
|
METHODS deserialize_cua
|
||||||
|
|
Loading…
Reference in New Issue
Block a user