cancel
Showing results for 
Search instead for 
Did you mean: 

xstring to string for ms_excel

Former Member
0 Kudos

Hi ALL,

I am using OFFICE CONTROL UI ELEMENT for displaying iternal table data into EXCEL OFFICE CONTROL UI .

i am displaying data into OFFICE CONTROL UI EXCEL, then i will update excel of office control and then i will save,when i save that updated data need to send one internal table .

DATA :OUT_STRING1 TYPE STRING,

CONTENTXMLSOURCE TYPE XSTRING.

WD_CONTEXT->GET_ATTRIBUTE( EXPORTING NAME = 'DATAS' IMPORTING VALUE = CONTENTXMLSOURCE ).

CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'

EXPORTING

  • FROM_CODEPAGE = '8500'

IN_XSTRING = CONTENTXMLSOURCE

  • OUT_LEN =

IMPORTING

OUT_STRING = OUT_STRING1.

data lr_conv type ref to cl_abap_conv_in_ce.

lr_conv = cl_abap_conv_in_ce=>create( ).

lr_conv->convert( exporting input = xstring importing data = string ).

NOT FOR LIKE Excel file (like Tab Delimited, CVS, XML, etc). Only for ms_excel.

the above mention two concepts are not working to convert from xstring to string ,is there any concept ms_excel format xstring to string?

THANKS,

RAMA

Edited by: Ramakullay Challa on Sep 25, 2009 2:03 PM

Edited by: Ramakullay Challa on Sep 25, 2009 2:06 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Refer this link -

Please try to test these -

CL_SWF_UTL_CONVERT_XSTRING

CL_WDR_CONVERSION_UTILS=>IF_WD_CONVERSION_UTILS~TO_STRING

'SCMS_XSTRING_TO_BINARY'

IF the above still doesnot work, then how about convert the data to XML then to the string.

Former Member
0 Kudos

Hi Lekha,

from itab to xml convertion.

data:

gr_table type ref to cl_salv_table,

lr_data type ref to data,

l_xml type xstring.

get reference of gt_outtab[] into lr_data.

try.

cl_salv_table=>factory(

importing

r_salv_table = gr_table

changing

t_table = gt_outtab ).

catch cx_salv_msg. "#EC NO_HANDLER

endtry.

l_xml = gr_table->to_xml( xml_type = g_xml_type

xml_flavour = IF_SALV_BS_C_TT=>C_TT_XML_FLAVOUR_EXPORT ).

thanks,

rama

Edited by: Ramakullay Challa on Sep 25, 2009 3:08 PM

Former Member
0 Kudos

Hi Lekha,

When i am activating one method , insede this method i am calling one c lass.

data: DATASOURCE type ref to CL_WD_OFFICE_CONTROL,

content type xstring.

TRY.

DATASOURCE = cl_wd_office_control=>GET_DATA_SOURCE( VALUE = CONTENT ).

CATCH CX_WD_ACF_EXCEPTION.

ENDTRY.

error .any idea lekha.

*you can use only use "class=>method" with static methos.*

data: DATASOURCE type ref to CL_WD_OFFICE_CONTROL,

content type xstring.

CONTENT = DATASOURCE->GET_DATA_SOURCE( ).

no error.

thanks.

thanks,

rama

Edited by: Ramakullay Challa on Sep 28, 2009 7:08 AM

Edited by: Ramakullay Challa on Sep 28, 2009 7:09 AM

Edited by: Ramakullay Challa on Sep 28, 2009 11:26 AM

kmoore007
Active Contributor
0 Kudos

Ramakullay,

What is the definition of parameter G_XML_TYPE?

Former Member
0 Kudos

Hello ,

data: g_xml_type type salv_bs_constant.

Thanks,

Rama.