Application Development 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: 

RFC

Former Member
0 Kudos

hi,

pls look at the code: i have written this in SORUCE CODE of the RFC, pls exclude the "submit" part. and look into the FM's which i have called.

submit zrpt_mm_045 EXPORTING LIST TO MEMORY

with s_werks IN WERK

with s_mtart IN MTARTS

with s_matnr IN MATNRS

with s_budat IN DATES

with s_lgort IN LGORTS

with rb1 = RB1

with rb2 = RB2

with rb3 = RB3

with variant EQ p_varis sign 'E'

AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = ITHEADER.

CALL FUNCTION 'WRITE_LIST'

  • EXPORTING

  • WRITE_ONLY = 'X'

TABLES

listobject = ITHEADER.

CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'

  • EXPORTING

  • REPORT_NAME =

  • TEMPLATE_NAME = 'WEBREPORTING_REPORT'

TABLES

html = it2

listobject = ITHEADER.

in my TABLES option of FM i have it2 like w3html,

now when i call this RFC in EP the result is comming but it in very haphazard way. That is they are not in proper order.

Could any pls provide me the solution to get away with it.

Deepak

1 ACCEPTED SOLUTION

athavanraja
Active Contributor
0 Kudos

the generated html string will produce a result exactly as it looks in ABAP list screen. you cannot have control over its look and feel.

you dont need the write_list FM

just follow the following steps

1. submit (report_name) and return exporting list to memory. 
2.  call function 'LIST_FROM_MEMORY'
      tables           
 listobject = listobject. 

3. call function 'WWW_HTML_FROM_LISTOBJECT'    
   exporting            report_name = report_name 
      tables            html        = html  
          listobject  = listobject.

Regards

Raja

2 REPLIES 2

athavanraja
Active Contributor
0 Kudos

the generated html string will produce a result exactly as it looks in ABAP list screen. you cannot have control over its look and feel.

you dont need the write_list FM

just follow the following steps

1. submit (report_name) and return exporting list to memory. 
2.  call function 'LIST_FROM_MEMORY'
      tables           
 listobject = listobject. 

3. call function 'WWW_HTML_FROM_LISTOBJECT'    
   exporting            report_name = report_name 
      tables            html        = html  
          listobject  = listobject.

Regards

Raja

0 Kudos

Hi,

It is alright that we get the direct output from the ABAP. But the problem is in the web browser along with contents with the abaplist some junk characters are getting added up.

why is it so can you please give me a solution,

or some other solution wherein i can complete my output in EP.

secondly i have a report wherein i have more than 10 select options. Now making them to be used in RFC i coded "TYPE RANGES". sample code down below:

DATA: MATNRS TYPE RANGE OF zmara_marc-matnr.

DATA: MATNRS_WA LIKE LINE OF MATNRS.

IF S_MATNR_LOW IS NOT INITIAL.

MOVE: 'I' TO MATNRS_WA-SIGN,

'GE' TO MATNRS_WA-OPTION,

S_MATNR_LOW TO MATNRS_WA-LOW,

S_MATNR_HIGH TO MATNRS_WA-HIGH.

**APPEND MATNRS_WA TO MATNRS.

ELSE.

MOVE: 'I' TO MATNRS_WA-SIGN,

'EQ' TO MATNRS_WA-OPTION,

S_MATNR_LOW TO MATNRS_WA-LOW,

S_MATNR_HIGH TO MATNRS_WA-HIGH.

*APPEND MATNRS_WA TO MATNRS.

ENDIF.

APPEND MATNRS_WA TO MATNRS.

DATA: BUKR TYPE RANGE OF t001-bukrs.

DATA: BUKR_WA LIKE LINE OF BUKR.

MOVE: 'I' TO BUKR_WA-SIGN,

'EQ' TO BUKR_WA-OPTION,

S_BUKRS TO BUKR_WA-LOW,

S_BUKRS TO BUKR_WA-HIGH.

APPEND BUKR_WA TO BUKR.

DATA: WERK TYPE RANGE OF zmara_marc-werks.

DATA: WERK_WA LIKE LINE OF WERK.

MOVE: 'I' TO WERK_WA-SIGN,

'EQ' TO WERK_WA-OPTION,

S_WERKS TO WERK_WA-LOW,

S_WERKS TO WERK_WA-HIGH.

APPEND WERK_WA TO WERK.

DATA: LGORTS TYPE RANGE OF mard-lgort.

DATA: LGORTS_WA LIKE LINE OF LGORTS.

MOVE: 'I' TO LGORTS_WA-SIGN,

'EQ' TO LGORTS_WA-OPTION,

S_LGORT TO LGORTS_WA-LOW,

S_LGORT TO LGORTS_WA-HIGH.

APPEND LGORTS_WA TO LGORTS.

DATA: CHARGS TYPE RANGE OF zs_mkpf_mseg-charg.

DATA: CHARGS_WA LIKE LINE OF CHARGS.

IF NOT S_CHARG_LOW IS INITIAL.

MOVE: 'I' TO CHARGS_WA-SIGN,

'GE' TO CHARGS_WA-OPTION,

S_CHARG_LOW TO CHARGS_WA-LOW,

S_CHARG_HIGH TO CHARGS_WA-HIGH.

*APPEND CHARGS_WA TO CHARGS.

ELSE.

MOVE: 'I' TO CHARGS_WA-SIGN,

'EQ' TO CHARGS_WA-OPTION,

S_CHARG_LOW TO CHARGS_WA-LOW,

S_CHARG_HIGH TO CHARGS_WA-HIGH.

*APPEND CHARGS_WA TO CHARGS.

ENDIF.

APPEND CHARGS_WA TO CHARGS.

DATA: SOBK TYPE RANGE OF zs_mkpf_mseg-sobkz.

DATA: SOBK_WA LIKE LINE OF SOBK.

IF NOT S_SOBKZ_LOW IS INITIAL.

MOVE: 'I' TO SOBK_WA-SIGN,

'GE' TO SOBK_WA-OPTION,

S_SOBKZ_LOW TO SOBK_WA-LOW,

S_SOBKZ_HIGH TO SOBK_WA-HIGH.

APPEND SOBK_WA TO SOBK.

ELSE.

MOVE: 'I' TO SOBK_WA-SIGN,

'EQ' TO SOBK_WA-OPTION,

S_SOBKZ_LOW TO SOBK_WA-LOW,

S_SOBKZ_HIGH TO SOBK_WA-HIGH.

*APPEND SOBK_WA TO SOBK.

ENDIF.

APPEND SOBK_WA TO SOBK.

DATA: DATES TYPE RANGE OF zs_mkpf_mseg-budat.

DATA: DATES_WA LIKE LINE OF DATES.

MOVE: 'I' TO DATES_WA-SIGN,

'EQ' TO DATES_WA-OPTION,

S_BUDAT_LOW TO DATES_WA-LOW,

S_BUDAT_HIGH TO DATES_WA-HIGH.

APPEND DATES_WA TO DATES.

DATA: BWTARS TYPE RANGE OF zs_mkpf_mseg-bwtar.

DATA: BWTARS_WA LIKE LINE OF BWTARS.

IF NOT S_BWTAR_LOW IS INITIAL.

MOVE: 'I' TO BWTARS_WA-SIGN,

'GE' TO BWTARS_WA-OPTION,

S_BWTAR_LOW TO BWTARS_WA-LOW,

S_BWTAR_HIGH TO BWTARS_WA-HIGH.

*APPEND BWTARS_WA TO BWTARS.

ELSE.

MOVE: 'I' TO BWTARS_WA-SIGN,

'EQ' TO BWTARS_WA-OPTION,

S_BWTAR_LOW TO BWTARS_WA-LOW,

S_BWTAR_HIGH TO BWTARS_WA-HIGH.

*APPEND BWTARS_WA TO BWTARS.

ENDIF.

APPEND BWTARS_WA TO BWTARS.

submit zrpt_mm_041 EXPORTING LIST TO MEMORY "AND RETURN

with s_matnr IN MATNRS

with s_bukrs IN BUKR

with s_werks IN WERK

with s_lgort IN LGORTS

with s_charg IN CHARGS

with s_sobkz IN SOBK

with s_budat IN DATES

with s_bwtar IN BWTARS

AND RETURN.

but this code is giving me some exceptions in list_from_memory. but one thing is i am getting results when i use the addition selection-set.

pls solve the problem for me.

I also cleared the memory with list_free_memory at the end of the code.

Regards

Deepak