2006 Dec 19 11:04 AM
Hi ,
Can somebody send me the sample code to Download the Data to Application Server as an XML file.
Best Regards
Bhagat.
2006 Dec 19 11:08 AM
2006 Dec 19 11:13 AM
Kishan,
I need the sample code which actually uploads the data to Application sever.
If possible send me.
Best Regards
Bhagat.
2006 Dec 19 11:17 AM
hi bhagat,
parameters: P_DSNI(75) TYPE C DEFAULT
'/usr/local/sapdata/amit.dat' LOWER CASE.
data: begin of itab occurs 0,
pernr(8),
sp1(1) value ',',
werks(4),
sp2(1) value ',',
persg(1),
sp3(1) value ',',
persk(2),
end of itab.
start-of-selection.
OPEN DATASET P_DSNI FOR OUTPUT IN LEGACY TEXT MODE.
PERFORM FETCH_DATA.
&----
*& Form FETCH_DATA
&----
text
----
--> p1 text
<-- p2 text
----
FORM FETCH_DATA .
SELECT * FROM PA0001 WHERE PERNR IN S_PERNR.
MOVE-CORRESPONDING PA0001 TO ITAB.
TRANSFER ITAB TO P_DSNI.
APPEND ITAB.
ENDSELECT.
CLOSE DATASET P_DSNI.
ENDFORM. " FETCH_DATA
This will help u out.
pls change the table names and file to be downloaded to AServer accordingly..
pls reward points..
amit
2006 Dec 19 11:15 AM
Hi,
Convert the XML xstring data to string and transfer the same to appserver file. Some thing like this,
CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
EXPORTING im_xstring = xml_xstring
IMPORTING ex_string = xml_string.
Or you can create XML in XSTRING output stream by:
lo_ostream = o_streamfactory->create_ostream_xstring( string = li_xml_xstring ).
Then:
open dataset dsn for output in binary mode .
if sy-subrc = 0.
transfer li_xml_xstring to dsn.
endif.
close dataset dsn.
Reward points if this Helps.
Manish
2006 Dec 19 11:17 AM
parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.csv'.
data: begin of itab occurs 0,
fld1(20) type c,
fld2(20) type c,
fld3(20) type c,
end of itab.
data: wa(2000) type c.
upload internal table using fm gui_upload.
after that use internal table for upload data into application server.u can upload xml file also using this fm.
start-of-selection.
open dataset d1 for input in text mode.
if sy-subrc = 0.
do.
read dataset d1 into wa.
if sy-subrc <> 0.
exit.
endif.
split wa at ',' into itab-fld1 itab-fld2 itab-fld3.
append itab.
enddo.
endif.
close dataset d1.
2006 Dec 19 11:20 AM
I need to upload the data to Application server. The out put should be XML file.
Can you send sample code for this ?
Reward points are assured.
Best Regards
Bhagat.
2006 Dec 19 11:22 AM
Hello Bhagat,
Try using the function module SCMS_DOWNLOAD.
Manoj
2006 Dec 19 11:23 AM
2006 Dec 19 11:25 AM
2006 Dec 19 11:27 AM