Skip to Content
0
Former Member
Jul 22, 2005 at 06:08 AM

How to suppress special(JUNK ) char while getting data from R3 to EP

45 Views

Hi ,

I have an RFC where I am outputting the data

in html format But while retrieving the data

in Enterpise Portal side. I am getting lot of junk char inserted in the html data coming from the R3..

I am using this code in my RFC..

ITHEADER LIKE TABLE OF abaplist with header line .

submit ZRPT_MM56 EXPORTING LIST TO MEMORY

with p_werks = P_WERKS "IN WERK

WITH s_lgort IN LGORT

with s_budat IN BUDAT

with s_charg IN CHARG

with s_matnr IN MATNR

with rb1 = RB1

with rb2 = RB2

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = ITHEADER.

CALL FUNCTION 'WRITE_LIST'

TABLES

listobject = ITHEADER.

CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'

TABLES

html = it2

listobject = ITHEADER.

CALL FUNCTION 'WWW_LIST_TO_HTML'

TABLES

html = IT2.

CALL FUNCTION 'LIST_FREE_MEMORY'

TABLES

LISTOBJECT = ITHEADER.

In my EP PART I have the following code

JCO.addClientPool(SID, Max. number of connections , SAP Client, userid , pwd, lang, hostname ..)

then create a repository

repository = JCO.createRepository(....)

IFunctionTemplate ftemplate = repository.getFunctionTemplate(rfc);

JCO.Function function = ftemplate.getFunction();

client = JCO.getClient(SID);

JCO.ParameterList input = function.getImportParameterList

input.setValue("Some Value" , "P_WERKS" );

....

client.execute(function)

then getting the data from r3

JCO.Table tab = function.getTableParameterList().getTable("IT2");

tab.toString()

in the above line I am getting the the data in html format but has some special chars(Junk) with in the html code . because of this It is not rendering properly on the browser..

Is there any alternative way to achieve this ...

how to suppress these junk chars so that I can render the page properly

thanks

pkiran