Text-Pool Kopyalama
Query programlarının kopyalandıktan sonra metinlerinin de kopyalanmasını sağlayan programdır.
ZTR_PROGRAM_TEXT_COPY programı hedef sistemde çalıştırılır.
ZTR_GET_PROGRAM_TEXT fonksiyonu ile (RFC) kaynak sistemden text-pool çekilir
ZTR_SET_PROGRAM_TEXT fonksiyonu ile hedef sisteme text-pool kaydedilir.
function ztr_get_program_text.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_PROGRAM) TYPE PROGRAMM OPTIONAL
*" VALUE(I_LANG) TYPE LANGU DEFAULT SY-LANGU
*" EXPORTING
*" VALUE(ET_TEXTPOOL) TYPE TEXTPOOL_TABLE
*"----------------------------------------------------------------------
*
data: ls_reposrc type reposrc.
refresh et_textpool.
select single * into ls_reposrc from reposrc where progname eq i_program.
CHECK SY-SUBRC EQ 0.
read textpool ls_reposrc-progname into et_textpool language i_lang.
endfunction.
FUNCTION ZTR_SET_PROGRAM_TEXT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_PROGRAM) TYPE PROGRAMM OPTIONAL
*" VALUE(I_LANG) TYPE LANGU DEFAULT SY-LANGU
*" VALUE(IT_TEXTPOOL) TYPE TEXTPOOL_TABLE OPTIONAL
*"----------------------------------------------------------------------
*
DATA: LS_reposrc TYPE reposrc.
*
select SINGLE * into LS_reposrc from reposrc where progname eq i_program.
CHECK SY-SUBRC EQ 0.
INSERT TEXTPOOL LS_reposrc-progname FROM IT_TEXTPOOL LANGUAGE I_LANG.
ENDFUNCTION.
*&---------------------------------------------------------------------*
*& Report ZTR_PROGRAM_TEXT_COPY
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
report ztr_program_text_copy.
tables: rs38m.
selection-screen : begin of block blang with frame title text-001.
parameters : p_lang type sy-langu default `T` obligatory.
selection-screen : end of block blang.
selection-screen : begin of block bsource with frame title text-002.
parameters : p_srcprg type programm obligatory.
parameters : p_srcrfc type rfcdest obligatory.
selection-screen : end of block bsource.
selection-screen : begin of block btarget with frame title text-002.
parameters : p_trgprg type programm obligatory.
selection-screen : end of block btarget.
start-of-selection.
perform f_change_text .
end-of-selection.
*&---------------------------------------------------------------------*
*& Form f_change_text
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
form f_change_text .
data: lt_pool type textpool_table.
call function `ZTR_GET_PROGRAM_TEXT`
destination p_srcrfc
exporting
i_program = p_srcprg
i_lang = sy-langu
importing
et_textpool = lt_pool.
if lt_pool[] is not initial.
call function `ZTR_SET_PROGRAM_TEXT`
EXPORTING
I_PROGRAM = p_trgprg
I_LANG = SY-LANGU
IT_TEXTPOOL = lt_pool
.
endif.
endform. "f_change_text
*P_LANG Dil
*P_SRCPRG Kaynak Program
*P_SRCRFC RFC hedefi
*P_TRGPRG Hedef Program