Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OPEN DATASET doubt

Former Member
0 Likes
523

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
486

I tryied it... but it didn´t work...

4 REPLIES 4
Read only

Former Member
0 Likes
486

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.

Read only

Former Member
0 Likes
487

I tryied it... but it didn´t work...

Read only

0 Likes
486

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

Read only

Former Member
0 Likes
486

Tnks, Srinivas....