Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- report zz_test_get_delta line-size 320.
- * Diff tool for texts,
- * using the function module of the ABAP version management
- * SVRS_COMPUTE_DELTA_REPS
- * Mode 2 ignores indentations
- types:
- ty_text type c length 300,
- begin of ty_delta,
- vrsflag type c length 4,
- vrsnr type i,
- line type ty_text,
- end of ty_delta,
- ty_delta_tab type standard table of ty_delta,
- begin of ty_wrapped_text,
- line type ty_text,
- end of ty_wrapped_text,
- ty_wrapped_text_tab type standard table of ty_wrapped_text.
- start-of-selection.
- perform start.
- * ---
- form start.
- data: lt_new type stringtab,
- lt_old type stringtab,
- lt_delta type ty_delta_tab.
- append :
- 'Abc' to lt_new,
- 'Def' to lt_new,
- ' abc' to lt_old,
- 'Ghi' to lt_old,
- 'Jkl' to lt_old.
- perform edit_text using :
- 'New Version' changing lt_new,
- 'Old Version' changing lt_old.
- perform compare using lt_new lt_old
- changing lt_delta.
- perform output using lt_new lt_delta.
- endform. "start
- *
- form output using it_new type stringtab
- it_delta type ty_delta_tab.
- data: ls_delta type ty_delta,
- lv_new type ty_text.
- loop at it_delta into ls_delta.
- write: / ls_delta-vrsflag, 6 ls_delta-vrsnr, 20 ls_delta-line.
- read table it_new into lv_new index ls_delta-vrsnr.
- if sy-subrc eq 0.
- write: /20 lv_new.
- endif.
- endloop.
- endform. "output
- * ---
- form compare using it_new type stringtab
- it_old type stringtab
- changing et_delta type ty_delta_tab.
- data: lt_dummy1 type table of trdir,
- lt_dummy2 type table of trdir,
- lt_dummy3 type table of xtrdir,
- lt_new type ty_wrapped_text_tab,
- lt_old type ty_wrapped_text_tab.
- perform wrap_text :
- using it_new changing lt_new,
- using it_old changing lt_old.
- clear et_delta.
- call function 'SVRS_COMPUTE_DELTA_REPS'
- exporting
- compare_mode = 2
- ignore_case_differences = 'X'
- tables
- texttab_old = lt_old
- texttab_new = lt_new
- trdirtab_old = lt_dummy1 " Oblig. in interface
- trdirtab_new = lt_dummy2 " Oblig. in interface
- trdir_delta = lt_dummy3 " Oblig. in interface
- text_delta = et_delta.
- endform. "compare
- * ---
- form wrap_text using it_text type stringtab
- changing et_text type ty_wrapped_text_tab.
- data: lv_line type string,
- ls_line type ty_wrapped_text.
- clear et_text.
- loop at it_text into lv_line.
- ls_line-line = lv_line.
- append ls_line to et_text.
- endloop.
- endform. "wrap_text
- * ---
- form edit_text using iv_title
- changing ct_text type stringtab.
- call function 'TERM_CONTROL_EDIT'
- exporting
- titel = iv_title
- tables
- textlines = ct_text
- exceptions
- user_cancelled = 1
- others = 2.
- if sy-subrc eq 1.
- leave to screen 0.
- elseif sy-subrc ne 0.
- message id sy-msgid type 'A' number sy-msgno
- with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- endif.
- endform. "edit_text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement