*&---------------------------------------------------------------------*
*& Form F_GET_TEXT
*&---------------------------------------------------------------------*
FORM f_get_text USING p_v_obj TYPE tdobject
p_v_id TYPE tdid
p_v_langu TYPE spras
p_v_name TYPE tdobname
CHANGING p_v_string TYPE string.
DATA: lt_lines_tab TYPE efg_tab_tline,
ls_line_es TYPE tline,
lv_texto_line TYPE string.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = p_v_id
language = p_v_langu
name = p_v_name
object = p_v_obj
TABLES
lines = lt_lines_tab
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
* Implement suitable error handling here
ELSE.
LOOP AT lt_lines_tab INTO ls_line_es.
IF sy-tabix EQ 1.
p_v_string = ls_line_es-tdline.
ELSE.
CONDENSE ls_line_es-tdline.
CONCATENATE p_v_string ls_line_es-tdline INTO p_v_string SEPARATED BY space.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " F_GET_TEXT
LLAMADA A LA FORM: en este caso es un texto de posición.
DATA: lv_string TYPE string,
lv_name TYPE tdobname,
CLEAR: lv_string, lv_name.
CONCATENATE <fs_item>-vbeln <fs_item>-vbpos INTO lv_name.
PERFORM f_get_text USING 'VBBP'
'0001'
syst-langu
lv_name
CHANGING lv_string.
No hay comentarios:
Publicar un comentario