Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Why is my transfer statement no working for a string?

Former Member
0 Likes
563

I have a a string field that I create via call transformation.

I now want to download that string to my PC.

I can not use the GUI_DOWNLOAD because it demands a table to download - I have a string field so i can not use a table to download.

So i am tring to use the tranfer statement.

It returns sy-subrc = 0 but nothing is downloaded.

Here is the sample code.

data: lv_result_xml. type string.

  • Call to XSLT Transformation

TRY.

CALL TRANSFORMATION zrcs_xfer_wrty_xslt

SOURCE batchtime = filetime

saletab = saletab

RESULT XML lv_result_xml.

CATCH cx_xslt_exception INTO xslt_error.

xslt_message = xslt_error->get_text( ).

RAISE xslt_error.

ENDTRY.

******************************************************

  • types: begin of ty_xml_line,

  • data(256) type x,

*end of ty_xml_line.

*

*data: wa_xmlrec type ty_xml_line.

*

:.

OPEN DATASET zfile FOR OUTPUT IN BINARY MODE.

TRANSFER lv_result_xml TO zfile. "LENGTH w_size.

*loop at xml_tab into wa_xmlrec.

*v_strlen = strlen( wa_xmlrec ).

*transfer wa_xmlrec to v_serfile length v_strlen1.

*endloop.

CLOSE DATASET zfile.

I have a a string field that I create via call transformation.

I now want to download that string to my PC.

I can not use the GUI_DOWNLOAD because it demands a table to download - I have a string field so i can not use a table to download.

So i am tring to use the tranfer statement.

It returns sy-subrc = 0 but nothing is downloaded.

Here is the sample code.

data: lv_result_xml. type string.

  • Call to XSLT Transformation

TRY.

CALL TRANSFORMATION zrcs_xfer_wrty_xslt

SOURCE batchtime = filetime

saletab = saletab

RESULT XML lv_result_xml.

CATCH cx_xslt_exception INTO xslt_error.

xslt_message = xslt_error->get_text( ).

RAISE xslt_error.

ENDTRY.

******************************************************

  • types: begin of ty_xml_line,

  • data(256) type x,

*end of ty_xml_line.

*

*data: wa_xmlrec type ty_xml_line.

*

:.

OPEN DATASET zfile FOR OUTPUT IN BINARY MODE.

TRANSFER lv_result_xml TO zfile. "LENGTH w_size.

*loop at xml_tab into wa_xmlrec.

*v_strlen = strlen( wa_xmlrec ).

*transfer wa_xmlrec to v_serfile length v_strlen1.

*endloop.

CLOSE DATASET zfile.

2 REPLIES 2
Read only

Former Member
0 Likes
508

Looking at your other posts I don't know whether this is still an open issue. One thing you should note however: OPEN DATASET - TRANSFER - CLOSE DATASET creates files on the application server, not on your workstation.

Rgds,

Mark

Read only

Former Member
0 Likes
508

Yep - we got it working and just let it go to the application server instead of my PC.

Found that out just before checked replies but thanks.