on 06-11-2009 10:30 AM
I am developing an simple application to upload an excel file and display its contents in a table in Solution manager using Web dynpro.
But 'HR_KR_XSTRING_TO_STRING' is not avaiable in DS1.
Can you help me find a replacement for this function module.
TYPES :
BEGIN OF str_itab,
name(10) TYPE c,
age(10) TYPE c,
END OF str_itab.
DATA : t_table1 TYPE STANDARD TABLE OF str_itab,
i_data TYPE STANDARD TABLE OF string,
lo_nd_sflight TYPE REF TO if_wd_context_node,
lo_el_sflight TYPE REF TO if_wd_context_element,
l_string TYPE char200,
fs_table TYPE str_itab,
l_xstring TYPE char200,
fields TYPE string_table,
lv_field TYPE string.
DATA : t_table TYPE if_main=>elements_data_tab,
data_table TYPE if_main=>elements_data_tab.
get single attribute
wd_context->get_attribute(
EXPORTING name = `DATASOURCE`
IMPORTING value = l_xstring ).
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
Bind With table Element.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields. READ TABLE fields INTO lv_field INDEX 1.
fs_table-name = lv_field. READ TABLE fields INTO lv_field INDEX 2.
fs_table-age = lv_field. APPEND fs_table TO t_table1.
ENDLOOP.
lo_nd_sflight = wd_context->get_child_node( 'DATA_TAB' ).
lo_nd_sflight->bind_table( t_table1 ).
Thanks in advance
Akshatha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When i use this i get the following error:
A character set conversion is not possible.
Pls help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is not appropriate to ask general ABAP questions such as this in the Web Dynpro ABAP Forum. As your punishment I will help with your question.
In this sample buffer is the XSTRING, text_buffer is the string. You have to supply an encoding to tell the system what codepage/unicode type the XSTRING is.
data: convin type ref to cl_abap_conv_in_ce,
call method cl_abap_conv_in_ce=>create
exporting
encoding = encoding
input = buffer
receiving
conv = convin.
call method convin->read
importing
data = text_buffer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Try using CRM_IC_XML_XSTRING2STRING this FM.
Regards,
Runal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.