Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * -----------------------------------------------------------------
- * GLOBAL DEFINITIONS
- * -----------------------------------------------------------------
- GS_TXT_L1 TYPE TY_TXT
- GS_TXT_L2 TYPE TY_TXT
- * -----------------------------------------------------------------
- * TYPES DEFINITIONS
- * -----------------------------------------------------------------
- TYPES:
- BEGIN OF ty_txt,
- lang TYPE sy-langu,
- txt_1 TYPE tdline,
- txt_2 TYPE tdline,
- txt_3 TYPE tdline,
- txt_4 TYPE tdline,
- txt_5 TYPE tdline,
- txt_6 TYPE tdline,
- txt_7 TYPE tdline,
- txt_8 TYPE tdline,
- txt_9 TYPE tdline,
- txt_10 TYPE tdline,
- txt_11 TYPE tdline,
- txt_12 TYPE tdline,
- txt_13 TYPE tdline,
- txt_14 TYPE tdline,
- txt_15 TYPE tdline,
- txt_16 TYPE tdline,
- txt_17 TYPE tdline,
- txt_18 TYPE tdline,
- txt_19 TYPE tdline,
- txt_20 TYPE tdline,
- txt_21 TYPE tdline,
- txt_22 TYPE tdline,
- txt_23 TYPE tdline,
- txt_24 TYPE tdline,
- txt_25 TYPE tdline,
- txt_26 TYPE tdline,
- txt_27 TYPE tdline,
- txt_28 TYPE tdline,
- txt_29 TYPE tdline,
- txt_30 TYPE tdline,
- txt_31 TYPE tdline,
- txt_32 TYPE tdline,
- txt_33 TYPE tdline,
- txt_34 TYPE tdline,
- txt_35 TYPE tdline,
- txt_36 TYPE tdline,
- txt_37 TYPE tdline,
- txt_38 TYPE tdline,
- txt_39 TYPE tdline,
- txt_40 TYPE tdline,
- txt_41 TYPE tdline,
- txt_42 TYPE tdline,
- txt_43 TYPE tdline,
- txt_44 TYPE tdline,
- txt_45 TYPE tdline,
- txt_46 TYPE tdline,
- txt_47 TYPE tdline,
- txt_48 TYPE tdline,
- txt_49 TYPE tdline,
- txt_50 TYPE tdline,
- txt_51 TYPE tdline,
- txt_52 TYPE tdline,
- txt_53 TYPE tdline,
- txt_54 TYPE tdline,
- txt_55 TYPE tdline,
- txt_56 TYPE tdline,
- txt_57 TYPE tdline,
- txt_58 TYPE tdline,
- txt_59 TYPE tdline,
- txt_60 TYPE tdline,
- txt_61 TYPE tdline,
- txt_62 TYPE tdline,
- txt_63 TYPE tdline,
- txt_64 TYPE tdline,
- txt_65 TYPE tdline,
- txt_66 TYPE tdline,
- txt_67 TYPE tdline,
- txt_68 TYPE tdline,
- txt_69 TYPE tdline,
- txt_70 TYPE tdline,
- txt_71 TYPE tdline,
- txt_72 TYPE tdline,
- txt_73 TYPE tdline,
- txt_74 TYPE tdline,
- txt_75 TYPE tdline,
- txt_76 TYPE tdline,
- txt_77 TYPE tdline,
- txt_78 TYPE tdline,
- txt_79 TYPE tdline,
- txt_80 TYPE tdline,
- txt_81 TYPE tdline,
- txt_82 TYPE tdline,
- txt_83 TYPE tdline,
- txt_84 TYPE tdline,
- txt_85 TYPE tdline,
- txt_86 TYPE tdline,
- txt_87 TYPE tdline,
- txt_88 TYPE tdline,
- txt_89 TYPE tdline,
- txt_90 TYPE tdline,
- txt_91 TYPE tdline,
- txt_92 TYPE tdline,
- txt_93 TYPE tdline,
- txt_94 TYPE tdline,
- txt_95 TYPE tdline,
- txt_96 TYPE tdline,
- txt_97 TYPE tdline,
- txt_98 TYPE tdline,
- txt_99 TYPE tdline,
- END OF ty_txt.
- * -----------------------------------------------------------------
- * INITIALIZATION
- * -----------------------------------------------------------------
- PERFORM load_static_txt
- USING
- 'TEXTMODULE_NAME'
- iv_lang_1
- iv_lang_2
- CHANGING
- gs_txt_l1
- gs_txt_l2.
- * -----------------------------------------------------------------
- * FORM ROUTINES
- * -----------------------------------------------------------------
- FORM load_static_txt
- USING
- iv_name TYPE tdsfname
- iv_l1 TYPE spras
- iv_l2 TYPE spras
- CHANGING
- es_txt_l1 TYPE ty_txt
- es_txt_l2 TYPE ty_txt.
- DATA:
- ls_l1 TYPE ssfrlang,
- ls_l2 TYPE ssfrlang,
- lv_l1 TYPE spras,
- lv_l2 TYPE spras.
- DATA:
- lt_line_l1 TYPE tsftext,
- lt_line_l2 TYPE tsftext,
- ls_line TYPE tline.
- DATA:
- lv_line_l1_size TYPE i,
- lv_line_l2_size TYPE i,
- lv_index TYPE i.
- FIELD-SYMBOLS :
- <fs_field> TYPE any.
- ls_l1-langu1 = iv_l1.
- ls_l1-langu2 = 'E'.
- IF iv_l2 EQ iv_l1.
- ls_l2-langu1 = 'E'.
- ELSE.
- ls_l2-langu1 = iv_l2.
- ls_l2-langu2 = 'E'.
- ENDIF.
- CALL FUNCTION 'SSFRT_READ_TEXTMODULE'
- EXPORTING
- i_textmodule = iv_name
- i_languages = ls_l1
- IMPORTING
- o_langu = lv_l1
- o_text = lt_line_l1
- EXCEPTIONS
- error = 1
- language_not_found = 2
- OTHERS = 3.
- IF sy-subrc <> 0.
- * Implement suitable error handling here
- ENDIF.
- CALL FUNCTION 'SSFRT_READ_TEXTMODULE'
- EXPORTING
- i_textmodule = iv_name
- i_languages = ls_l2
- IMPORTING
- o_langu = lv_l2
- o_text = lt_line_l2
- EXCEPTIONS
- error = 1
- language_not_found = 2
- OTHERS = 3.
- IF sy-subrc <> 0.
- * Implement suitable error handling here
- ENDIF.
- es_txt_l1-lang = lv_l1.
- es_txt_l2-lang = lv_l2.
- DESCRIBE TABLE:
- lt_line_l1 LINES lv_line_l1_size,
- lt_line_l2 LINES lv_line_l2_size.
- IF lv_line_l1_size <> lv_line_l2_size.
- " TODO
- ENDIF.
- WHILE lv_index LE lv_line_l1_size.
- ADD 1 TO lv_index.
- UNASSIGN:
- <fs_field>.
- CLEAR:
- ls_line.
- READ TABLE lt_line_l1 INTO ls_line INDEX lv_index.
- CHECK sy-subrc EQ 0.
- ASSIGN COMPONENT |txt_{ lv_index }| OF STRUCTURE es_txt_l1 TO <fs_field>.
- <fs_field> = ls_line-tdline.
- "---------------------------------------------------
- UNASSIGN:
- <fs_field>.
- CLEAR:
- ls_line.
- IF lv_l1 <> lv_l2.
- READ TABLE lt_line_l2 INTO ls_line INDEX lv_index.
- CHECK sy-subrc EQ 0.
- ASSIGN COMPONENT |txt_{ lv_index }| OF STRUCTURE es_txt_l2 TO <fs_field>.
- <fs_field> = ls_line-tdline.
- ENDIF.
- ENDWHILE.
- ENDFORM.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement