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

Question on Webdynpro ABAP File Upload

Former Member
0 Likes
483

Hi,

I want to upload a file from client to server in webdynpro ABAP..

I am using the file upload UI element & I have the data uploaded..

But the data is in the XSTRING format.. How can I covert this data to CHAR or STRING format..

& how can be data be transferred to SERVER... Will the OPEN DATASET & TRANSFER statements work... ?

Thanks

Geetha

Hi,

I want to upload a file from client to server in webdynpro ABAP..

I am using the file upload UI element & I have the data uploaded..

But the data is in the XSTRING format.. How can I covert this data to CHAR or STRING format..

& how can be data be transferred to SERVER... Will the OPEN DATASET & TRANSFER statements work... ?

Thanks

Geetha

2 REPLIES 2
Read only

matt
Active Contributor
0 Likes
461

Assuming your xstring is in i_data, and t_data is your output table:

  data: l_data  type string,
        lr_conv type ref to cl_abap_conv_in_ce.

* Convert to string
  lr_conv = cl_abap_conv_in_ce=>create( input = i_data ).
  lr_conv->read( importing data = l_data ).

* Convert string to table
  split l_data at cl_abap_char_utilities=>cr_lf into table t_data.

Now you can process t_data using the normal OPEN DATASET and TRANSFER commands.

matt

Read only

Former Member
0 Likes
461

For converting xstring to string format you need to use some function module.

like below CRM_IC_XML_XSTRING2STRING

CALL FUNCTION 'CRM_IC_XML_XSTRING2STRING'
    EXPORTING
      INXSTRING = l_xstring
    IMPORTING
      OUTSTRING = l_string.

Once it is converted to string format , you need to split at Tabs using cl_abap_char_utilities=>horizontal_tab (if the file is tab delimited file)

Check it once.