2009 Mar 10 4:07 PM
Hi,
I write in .dat file with my dataset.
The problem is : I can't make a new line for each transfer.
Have someone an idea ?
My code :
OPEN DATASET filename_ventes FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
select *
from CE13910
where PERIO = '2008002'
and ALTPERIO = '2008006'.
MOVE CE13910-VV800 TO c_converted2.
MOVE CE13910-VV000 TO c_converted3.
CONCATENATE CE13910-PERIO CE13910-ALTPERIO CE13910-ARTNR
CE13910-PAPH2 CE13910-PAPH3 c_converted2 c_converted3
INTO resultString SEPARATED BY separatedString .
transfer resultString to filename_ventes.
ENDSELECT.
CLOSE DATASET filename_ventes.
Thanks for your help.
Nico
2009 Mar 10 4:56 PM
try this way:
data: co_line_feed TYPE c VALUE cl_abap_char_utilities=>cr_lf.
concatenate resultString co_line_feed into resultString. " and then transfer
transfer resultString to filename_ventes.
Hi,
I write in .dat file with my dataset.
The problem is : I can't make a new line for each transfer.
Have someone an idea ?
My code :
OPEN DATASET filename_ventes FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
select *
from CE13910
where PERIO = '2008002'
and ALTPERIO = '2008006'.
MOVE CE13910-VV800 TO c_converted2.
MOVE CE13910-VV000 TO c_converted3.
CONCATENATE CE13910-PERIO CE13910-ALTPERIO CE13910-ARTNR
CE13910-PAPH2 CE13910-PAPH3 c_converted2 c_converted3
INTO resultString SEPARATED BY separatedString .
transfer resultString to filename_ventes.
ENDSELECT.
CLOSE DATASET filename_ventes.
Thanks for your help.
Nico
2009 Mar 10 4:16 PM
Why don't you first finish your selection, then loop into table and download the data into application server line by line. Refer to below code:
LOOP AT itab_header INTO wa_header.
*---Make all the header data into line data
CONCATENATE wa_header-combi
wa_header-descr
wa_header-werks
wa_header-blank1
wa_header-blank2
wa_header-blank3
wa_header-blank4
INTO wa_string1 " Header String Data
SEPARATED BY c_tab.
"---Transfer the data to Application Server
TRANSFER wa_string1 TO v_fpath1.
IF sy-subrc EQ 0.
v_counter1 = v_counter1 + 1.
ENDIF.
CLEAR: wa_string1.
ENDLOOP.
2009 Mar 10 4:56 PM
try this way:
data: co_line_feed TYPE c VALUE cl_abap_char_utilities=>cr_lf.
concatenate resultString co_line_feed into resultString. " and then transfer
transfer resultString to filename_ventes.
2009 Mar 10 5:05 PM
HI,
The better way is to put your code as per the Kuntal Nandi specifed. Fetch the data first and later loop the table and uploaad to application server.
data: cr_lf TYPE c VALUE cl_abap_char_utilities=>CR_LF.
OPEN DATASET filename_ventes FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
select *
from CE13910
where PERIO = '2008002'
and ALTPERIO = '2008006'.
MOVE CE13910-VV800 TO c_converted2.
MOVE CE13910-VV000 TO c_converted3.
CONCATENATE CE13910-PERIO CE13910-ALTPERIO CE13910-ARTNR
CE13910-PAPH2 CE13910-PAPH3 c_converted2
c_converted3 cr_lf --------------> Add Cr_lf for new line
INTO resultString
SEPARATED BY separatedString .
transfer resultString to filename_ventes.
ENDSELECT.
CLOSE DATASET filename_ventes.Edited by: Avinash Kodarapu on Mar 10, 2009 10:35 PM