06-26-2008 12:46 PM
Hi all
I am transferring the XML data in to application server but it is not transferring complete data .
why it is not transferring complete data please tell me.
Points will be rewarded .
Thanks.
Prasad.
06-26-2008 12:52 PM
I think UR not transfering carriage return and line feed characters ...
write the coding as ..
Data : c_cr type x value '0D'.
c_lf type x value '0A'.
Loop at itab ..
.
.
.
transfer itab to g_file ..
transfer c_cr to g_file.
transfer c_lf to g_file.
endloop.
06-26-2008 12:51 PM
tables: t005s,
a911 ,
konp .
data: begin of it_t005u occurs 0,
bland like t005u-bland,
bezei like t005u-bezei,
end of it_t005u .
data: begin of it_a911 occurs 0,
regio like a911-regio,
knumh like a911-knumh,
end of it_a911 .
data: begin of it_konp occurs 0,
knumh like konp-knumh,
kbetr like konp-kbetr,
end of it_konp .
data: begin of it_download occurs 0,
string(54),
end of it_download.
data: it_textno like zdms_textno occurs 0,
wa_textno like line of it_textno .
data : gv_filenum like zdms_textno-filenumber ,
gv_filenumc(10) type c .
data: gv_file1 type string.
data: f1(2),
f2(2),
f3(2),
gv_vat_app(1),
gv_kbetr(12) .
*********Start of Inserted by Durai.V 26-May-2008 *****
data : w_app_ser_nme type msxxlist-name value 'r3prod_EEP_05'.
data : lv_flag_con type c.
data : it_download_app_ser like dxrawdata occurs 0.
*********End of Insert by Durai.V 26-May-2008 *********
start-of-selection.
select bland
bezei
into table it_t005u
from t005u
where spras eq 'EN'
and land1 eq 'IN'.
if not it_t005u[] is initial.
select regio
knumh
into table it_a911
from a911
for all entries in it_t005u
where kschl eq 'JIVP'
and regio eq it_t005u-bland
and taxk1 eq '1'
and taxm1 eq 'A'
and datbi ge sy-datum
and datab le sy-datum .
endif.
if not it_a911[] is initial.
select knumh
kbetr
into table it_konp
from konp
for all entries in it_a911
where knumh eq it_a911-knumh.
endif.
it_download-string = 'STATE' .
append it_download .
clear it_download .
it_download-string = '{' .
append it_download .
clear it_download .
loop at it_t005u.
clear: it_a911,
it_konp,
gv_vat_app,
gv_kbetr.
read table it_a911 with key regio = it_t005u-bland.
if sy-subrc = 0.
read table it_konp with key knumh = it_a911-knumh.
if sy-subrc = 0.
gv_vat_app = 'Y' .
else.
gv_vat_app = 'N' .
endif.
endif.
if ( it_t005u-bland ne '' ).
gv_kbetr = it_konp-kbetr / 10 .
if it_t005u-bezei eq ''.
f1 = ' ~'.
else.
f1 = '~'.
endif.
if gv_vat_app eq ''.
f2 = ' ~'.
else.
f2 = '~'.
endif.
if gv_kbetr eq ''.
f3 = ' ~'.
else.
f3 = '~'.
endif.
concatenate 'STATE'
'~'
'001'
'~'
it_t005u-bland
'~'
it_t005u-bezei
f1
gv_vat_app
f2
gv_kbetr
f3
';'
into it_download-string.
append it_download .
clear it_download .
endif.
endloop.
if sy-subrc = 0.
lv_flag_con = 'X'.
endif.
it_download-string = '}' .
append it_download .
clear it_download .
clear: gv_filenum ,
gv_filenumc,
gv_file1 ,
wa_textno .
select single filenumber
from zdms_textno
into gv_filenum
where filename eq 'DMS_' .
move gv_filenum to gv_filenumc .
shift gv_filenumc left deleting leading '0'.
if gv_filenum < 10 .
concatenate '0' gv_filenumc into gv_filenumc .
endif.
concatenate 'DMS_'
gv_filenumc
'.txt'
into gv_file1 .
*Downloading the file to Application Server**
Start of Commented by Durai.V 26-May-2008 **********
*open dataset gv_file1 for output in text mode ENCODING DEFAULT .
*
loop at it_download.
transfer it_download-string to gv_file1.
endloop.
*
*close dataset gv_file1.
End of Commented by Durai.V 26-May-2008 ************
*********Start of Inserted by Durai.V 26-May-2008 *********
data : lv_serv_file_pth type dxfile-filename.
lv_serv_file_pth = gv_file1.
it_download_app_ser[] = it_download[].
if it_download_app_ser[] is not initial and lv_flag_con = 'X'.
call function 'DX_FILE_WRITE'
exporting
filename = lv_serv_file_pth
server = w_app_ser_nme
pc = ''
tables
data_tab = it_download_app_ser[]
exceptions
no_file_on_server = 1
no_data_on_server = 2
gui_download_failed = 3
no_authority = 4
others = 5.
*********End of Inserted by Durai.V 26-May-2008 ***********
if sy-subrc = 0.
wa_textno-filename = 'DMS_' .
wa_textno-filenumber = gv_filenum + 1 .
modify zdms_textno from wa_textno .
endif.
else.
write / 'No Data Selected, So file not created in Appllcation Server'.
endif.
check this report ........it is doing the same
reward IF...................
Regards
Anbu
06-26-2008 12:52 PM
I think UR not transfering carriage return and line feed characters ...
write the coding as ..
Data : c_cr type x value '0D'.
c_lf type x value '0A'.
Loop at itab ..
.
.
.
transfer itab to g_file ..
transfer c_cr to g_file.
transfer c_lf to g_file.
endloop.
06-26-2008 1:31 PM
hi check this....
do like this..
declare the types with X
data : v_test type x value '0D',
v_test1 type x value '0A'.
loop the internal table .
and pass it to the file as well..