Con la función SAVE_TEXT vamos a poder crear y completar campos de textos en SAP. Podremos llenar, por ejemplo, textos de cabecera y posición en forma masiva.
Vamos a necesitar algo de información previa. Para eso hay que ir al lugar donde ponemos el texto y clickeamos en el menú Pasar a —> Cabecera…
El código que tenemos que agregar es:
*Declaraciones para los textos.
DATA: it_header TYPE thead,
it_lines TYPE TABLE OF tline.
REFRESH it_lines.
CLEAR it_header.
*—–>Texto para agregar
it_lines-tdline = ‘Este es un texto de cabecera’.
APPEND wa_lines TO it_lines.
*—–>Completamos con los datos que obtuvimos arriba
it_header-tdobject = ‘VBBK’. «VG_OBJ
it_header-tdname = ‘0000000057’. «VG_NAME
it_header-tdid = ‘ZCER’. «VG_ID
it_header-tdspras = ‘E’. «VG_LANG
it_header-tdlinesize = ‘072’.
*—->Llamamos a la función que nos completa el texto
CALL FUNCTION ‘SAVE_TEXT’
EXPORTING
header = it_header
insert = ‘X’
savemode_direct = ‘X’
TABLES
lines = it_lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Como resultado obtenemos:
Comentarios Recientes: