Sistemler arası alv varyant kopyalama
Sistemler arasında alv grid varyantlarını kopyalamak için kullanabilirsiniz.
Fonksiyon
FUNCTION ZSD_GET_ALV_VARIANT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_REPORT) TYPE REPID OPTIONAL
*" TABLES
*" T_LTDX STRUCTURE LTDX OPTIONAL
*"----------------------------------------------------------------------
REFRESH T_LTDX.
select * into TABLE T_LTDX from LTDX where REPORT = I_REPORT.
ENDFUNCTION.
Program :
*&---------------------------------------------------------------------*
*& Report ZSD_MDT_VARIANT_COPY
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
report zsd_mdt_variant_copy.
data: gt_vari type standard table of ltdx with header line.
selection-screen begin of block b_rep with frame title text-h01.
parameters: p_report type repid obligatory.
selection-screen end of block b_rep.
selection-screen begin of block b_system with frame title text-h03.
parameters: p_source type rfcdest default `NONE` obligatory.
selection-screen end of block b_system.
start-of-selection.
perform f_get_vari tables gt_vari using p_report .
end-of-selection.
perform f_save_vari tables gt_vari .
form f_get_vari tables t_vari structure ltdx
using prm_report type repid .
call function `ZSD_GET_ALV_VARIANT`
DESTINATION p_source
exporting
i_report = prm_report
tables
t_ltdx = t_vari.
endform.
form f_save_vari tables t_vari structure ltdx .
data: lv_xndx type int4.
check t_vari[] is not initial.
loop at t_vari.
lv_xndx = sy-tabix.
t_vari-mandt = sy-mandt.
modify t_vari index lv_xndx.
endloop.
modify ltdx from table t_vari.
commit work and wait .
endform.