2010 Oct 29 1:10 PM
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
2010 Oct 29 1:50 PM
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.
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
2010 Oct 29 1:50 PM
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.
2010 Oct 29 3:20 PM
2010 Oct 29 3:33 PM
WS_DOWNLOAD is obsolete. Use GUI_DOWNLOAD instead and set WRITE_FIELD_SEPARATOR = 'X' (not # or tab).
Rob
2010 Oct 29 4:21 PM
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |