Application Development 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: 

output file

Former Member
0 Kudos

Hi,

The problem I'm having is to write the values in a file at an exactly defined postion. In the output file the values are at different positions. Some values are sometimes initial. Some of them to long. E.g.there is a currency field and its content's length is different.

Therefore they are placed very varaiously. I would like have them just one below the other.


  lt_output_pos-ebeln = 'BelegNr'.
  lt_output_pos-ebelp = 'Pos'.
  lt_output_pos-matnr = 'Material'.
  lt_output_pos-matkl = 'Warengruppe'.
  lt_output_pos-wert  = 'Wert'.
  APPEND lt_output_pos.


  LOOP AT gt_sc_pos INTO lf_sc_pos.
    CLEAR lt_output_pos.
    MOVE-CORRESPONDING lf_sc_pos TO lt_output_pos.
    APPEND lt_output_pos.
  ENDLOOP. 

CALL FUNCTION 'WS_DOWNLOAD'
      EXPORTING
        filename                      = pd_fname
        filetype                      = gp_ftype
        mode                          = 'U'
      TABLES
        data_tab                      = lt_output_pos.


      LOOP AT lt_output_pos.
        TRANSFER lt_output_pos TO pd_fname.
        IF sy-subrc NE 0.
          MESSAGE e398(00) WITH text-e02 pd_fname.
          EXIT. "From LOOP
        ENDIF.
      ENDLOOP. "lt_output_head


CLOSE DATASET pd_fname.

Please give me any idea how to achieve this requirement.

Kind Regards

Marco

Moderator message: please use more descriptive subject lines from now on.

Edited by: Thomas Zloch on Oct 29, 2010 3:53 PM

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

For this purpose use fm GUI_DOWNLOAD passing parameter write_field_separator = '#'

While transfering it ot file in app server concatenate each fields separated by tab.

4 REPLIES 4

kesavadas_thekkillath
Active Contributor
0 Kudos

For this purpose use fm GUI_DOWNLOAD passing parameter write_field_separator = '#'

While transfering it ot file in app server concatenate each fields separated by tab.

0 Kudos

'WS_DOWNLOAD' hasn't parameter write_field_separator

0 Kudos

WS_DOWNLOAD is obsolete. Use GUI_DOWNLOAD instead and set WRITE_FIELD_SEPARATOR = 'X' (not # or tab).

Rob

0 Kudos

Yes X .. I was confused .

Keshav