2009 Jul 13 9:04 PM
Hi experts,
I´m trying to create a file in a server using OPEN DATASET.
TYPES:
BEGIN OF l_ty_string,
l_string TYPE c LENGTH 71,
END OF l_ty_string.
DATA: l_t_string TYPE TABLE OF l_ty_string,
l_s_string TYPE l_ty_string,
DATA: v_arquivo TYPE c LENGTH 255.
.
.
.
.
LOOP AT l_t_string INTO l_s_string.
OPEN DATASET v_arquivo FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.
TRANSFER l_s_string TO v_arquivo.
ENDIF.
CLOSE DATASET v_arquivo.
ENDLOOP.
Using the prevideous code I can generate it so far great. But I CAN´T define a number caracters standard. I would like to insert a line with 71 caracters.
Eg.
'TEST_____________________________________________________'
'USING OPEN DATASET CORRECTLY____________________________'
My file is like this:
'TEST '
'USING OPEN DATASET CORRECTLY '
someone can help me?
Edited by: Douglas Yuri Silveira on Jul 13, 2009 5:34 PM
2009 Jul 13 9:52 PM
2009 Jul 13 9:45 PM
Are you defining the texts as text + spaces or only the text? Because if you only assign the text, it won't work. Try calculating and adding the exact number of extra spaces to the text strings.
2009 Jul 13 9:52 PM
2009 Jul 13 9:54 PM
Use LENGTH option with your TRANSFER statement.
TRANSFER l_s_string TO v_arquivo LENGTH 71
Edited by: Srinivas Adavi on Jul 13, 2009 4:55 PM
2009 Jul 13 10:00 PM