2008 Dec 04 11:35 AM
Dear experts.
we have the SAP release 4,6c
I should save a XML file to the Application server
he problem is when i make the validation of the file an error occured.
If foud many samles which work on a higher relaese.
What can i do
Thanks
Frank
My Code
OPEN DATASET lv_file FOR OUTPUT in binary mode.
IF sy-subrc NE 0.
exit.
ENDIF.
*" IN BINARY MODE.
LOOP AT gt_gaeb_xml INTO gs_xml.
TRANSFER gs_xml TO lv_file.
IF sy-subrc NE 0.
exit.
ENDIF.
ENDLOOP.
CLOSE DATASET lv_file.
Dear experts.
we have the SAP release 4,6c
I should save a XML file to the Application server
he problem is when i make the validation of the file an error occured.
If foud many samles which work on a higher relaese.
What can i do
Thanks
Frank
My Code
OPEN DATASET lv_file FOR OUTPUT in binary mode.
IF sy-subrc NE 0.
exit.
ENDIF.
*" IN BINARY MODE.
LOOP AT gt_gaeb_xml INTO gs_xml.
TRANSFER gs_xml TO lv_file.
IF sy-subrc NE 0.
exit.
ENDIF.
ENDLOOP.
CLOSE DATASET lv_file.
2009 Jul 31 11:50 AM
Frank
You need do create a XSTRING as a result of a Simple xml transformation. Then you can make :
OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
TRANSFER XML_content TO FNAME.
CLOSE DATASET FNAME.
The 'XML_content' is a xtring. Example :
CALL TRANSFORMATION 'tranformation name'
SOURCE ficheiroexecucao = gt_source[]
RESULT XML xml_result.
OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
TRANSFER xml_result TO FNAME.
CLOSE DATASET FNAME.
This works Fine!!
Best regards,
MR.
2009 Jul 31 1:17 PM
Hello,
Transformation doesn't work on 4.6 system.
You need to carry some string manipulation by converting XSTRING to STRING.
Thanks,
Augustin.
2009 Jul 31 2:34 PM
Hi,
Please transfer Data into XML format.
Please look into following link,
/people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
Then use following code to transfer it to Application server,
DATA rec(80). "Adjust as per requirement/OS limits
OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT l_xml_table into rec.
TRANSFER rec TO filepath.
ENDLOOP.
CLOSE DATASET filepath.
For operation on application server please look following link,
https://wiki.sdn.sap.com/wiki/display/Snippets/WorkingWithFiles?showChildren=true#children
Thanks & regards,
ShreeMohan
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |