on 04-29-2009 9:21 AM
Hi all,
I need to upload a file via the UI element: FILEUPLOAD from local PC to a cluster table: ZLIB.
Since I have get the XSTRING data from WD now, how could I convert its format and save it to ZLIB?
remark: ZLIB is a custom-created Cluster Table, with standard fields: RELID/SRTFD/SRTF2/.../CLUSTR/CLUSTD.
Thanks.
XiaoHong
You could also just write the XSTRING into the Cluster table. Why convert to a string? True binary files shouldn't be converted to STRING or you risk corruption of the data they contain.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jung,
Thanks for your reply, but I still need your further help to solve the problem.
In R/3, I can use FM 'GUI_UPLOAD' to upload a file source to an internal table, and then EXPORT to the cluster table. Now in Web Dynpro, that FM cannot be used. I need to write an XSTRING to the Cluster Table directly, but I wonder how I could do so. Since a standard cluster table has the structure as followed:
field data element data type length
RELID INDX_RELID CHAR 2
SRTFD INDX_SRTFD CHAR 22
SRTF2 INDX_SRTF2 INT4 10
... ...
CLUSTR INDX_CLSTR INT2 5
CLUSTD INDX_CLUST LRAW 2886
Thank you.
XiaoHong
Hi,
You can convert xstring data to string data in the following way.
Convert XString to String
data: loc_conv type ref to CL_ABAP_CONV_IN_CE,
loc_xstring type xstring,
loc_string type string.
CALL METHOD CL_ABAP_CONV_IN_CE=>CREATE
EXPORTING
INPUT = loc_xstring
ENCODING = 'UTF-8'
REPLACEMENT = '?'
IGNORE_CERR = ABAP_TRUE
RECEIVING
CONV = loc_CONV.
CALL METHOD loc_CONV->READ
IMPORTING
DATA = loc_string.
Regards,
Mallika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.