cancel
Showing results for 
Search instead for 
Did you mean: 

Webrfc with Integrated ITS

Former Member
0 Kudos

Hi,

I migrated Webrfc application from 4.6C to ECC6.0 and after reading sap notes webrfc is not works with Integrated ITS, so now i am planning to move BSP applications. Please can any one tell me that what are the steps i need take to create BSP application to call existing webrfc application. Webrfc application RFC taking some input parameters.

here i am sending webrfc URL

/scripts/wgate/RFC_FUNCTION/!?_function=WWW_GET_EMPLOYEE_INFORMATION&_param1=`param1`

Now i need to create BSP application by calling WWW_GET_EMPLOYEE_INFORMATION by passing param1 parameter.

Please any one give me the solution

Accepted Solutions (0)

Answers (1)

Answers (1)

athavanraja
Active Contributor
0 Kudos

create a bsp application and add a page. in the page add the following code.

page attributes: (set auto check box for all the attributes)

function	TYPE	STRING	                                                            
html	TYPE	W3HTMLTAB	Table for ABAP Keyword Documentation
mime	TYPE	W3MIMETABTYPE	ITS: Table Type for MIME Source
query_string	TYPE	RRX_T_W3QUERY	Query Strings for WWW Server

remove all the defaulted code from the layout section.

code for oninitialization event:

* event handler for data retrieval
DATA: result_html TYPE string ,
i_tabline_length TYPE i .

CALL FUNCTION function
  TABLES
    query_string = query_string
    html         = html
    mime         = mime.

i_tabline_length = 255 .

CALL FUNCTION 'CONVERT_TABLE_TO_STRING'
  EXPORTING
    i_tabline_length = i_tabline_length
  IMPORTING
    e_string         = result_html
  TABLES
    it_table         = html.

CALL METHOD response->if_http_entity~set_cdata
  EXPORTING
    data = result_html.

save and activate your bsp application and page.

the url is slightly different. to call your webrfc

the url would be

http://<washost>.<domain>.com:<port>/sap/bc/bsp/sap/ywebrfc/default.htm?sap-client=023&function=WWW_...

in the above url

ywebrfc = your bsp application name

default.htm = bsp page name

query_string[1]-name = _param1

query_string[1]-value = param1 (value for the parameter)

query_string[2]-name = second param name

check this and let me know how it goes.

please note that 2004s comes with webrfc service . for more details check oss notes 979467

Regards

Raja

Message was edited by:

Durairaj Athavan Raja

Former Member
0 Kudos

Hi Raja,

Thanks for reply,

I followed what you are told and i executed my bsap page with the URL by giving Functional module with the parameter but i don't know why the parameter is not passing to the RFC.

Here i given the URL

http://sap182.xxxxxxxxxxxxx.com:8056/sap/bc/bsp/sap/rfc/default.htm?sap-client=018&function=WWW_GET_...

_param1 is the employee number

The following error i got

The following error text was processed in the system SAN : Employee details not found 00000000 02/24/2007

The error occurred on the application server sap182_SAN_45 and in the work process 0 .

The termination type was: ERROR_MESSAGE_STATE

The ABAP call stack was:

Module: %_HTTP_START of program SAPMHTTP

Please can suggest me what i have to do.

athavanraja
Active Contributor
0 Kudos

the url should be like below

http://sap182.xxxxxxxxxxxxx.com:8056/sap/bc/bsp/sap/rfc/default.htm?sap-client=018&function=WWW_GET_...

also to identify the error go to the bsp application oninitialization event and place an http break point just before the statement call function function. and make sure query_string table is filled with details you passed via url.

also make the following small change to the code in oninitialization event.

there replace all the lines just above

i_tableline_lenght = 255 .

with the following code

DATA: result_html TYPE string ,
i_tabline_length TYPE i ,
content_type TYPE w3param-cont_type,
content_length TYPE w3param-cont_len ,
 return_code TYPE w3param-ret_code .
TRANSLATE function TO UPPER CASE.

CALL FUNCTION function
  TABLES
    query_string                  = query_string
    html                          = html
    mime                          = mime
  CHANGING
    content_type                  = content_type
    content_length                = content_length
    return_code                   = return_code
  EXCEPTIONS
    report_not_found              = 1
    no_authority_for_report_start = 2
    report_does_not_exist         = 3
    OTHERS                        = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Regards

Raja

PS: this logic wont work for www_get_selscreen. it will bring up the selscreen, but you wont be able to execute it.

Former Member
0 Kudos

Hi Raja,

I changed URL what you are mentioned and i put the break point at call function.

When i am executing URL from browser i am getting ABAP debug screen when i click on the query_string the _param1 and value storing in the Table.

Further i don't know what to debug because i am new to ABAP and BSP.

so please can you tell me what are the steps i need to do.

Thanks

athavanraja
Active Contributor
0 Kudos

first lets make sure your FM works.

go to se37 enter your FM name there (WWW_GET_EMPLOYEE_INFORMATION ) and hit execute.

pass TEXT/HTML to content_type

and in the query_string table parameter pass the param values (which you used to pass via url)

like

name = _template

value = <name of the template>

execute this funciton , what do you see in the HTML table?

Raja

Former Member
0 Kudos

Hi Raja,

I executed the FM with the values in query_straing parameter's

name=_param1

value=55678

when i am execting the FM it is working fine i mean i am getting HTML out put.

Thanks

athavanraja
Active Contributor
0 Kudos

can you post the url you are using and the complete oninitialization bsp code . i will see whats going wrong

Former Member
0 Kudos

Hi Raja,

URL which i am using is:

http://sap182.xxxxxxxxxxxxx.com:8056/sap/bc/bsp/sap/rfc/default.htm?sap-client=018&function=WWW_GET_...

In the oninitialization code:

  • event handler for data retrieval

DATA: result_html TYPE string ,

i_tabline_length TYPE i ,

content_type TYPE w3param-cont_type,

content_length TYPE w3param-cont_len ,

return_code TYPE w3param-ret_code .

TRANSLATE function TO UPPER CASE.

CALL FUNCTION function

TABLES

query_string = query_string

html = html

mime = mime

CHANGING

content_type = content_type

content_length = content_length

return_code = return_code

EXCEPTIONS

report_not_found = 1

no_authority_for_report_start = 2

report_does_not_exist = 3

OTHERS = 4.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'CONVERT_TABLE_TO_STRING'

EXPORTING

i_tabline_length = i_tabline_length

IMPORTING

e_string = result_html

TABLES

it_table = html.

CALL METHOD response->if_http_entity~set_cdata

EXPORTING

data = result_html.

Former Member
0 Kudos

Hi Raja,

I executed different RFC with different parameters and i got below error.

SAP Note

The following error text was processed in the system:

An exception with the type CX_SY_RANGE_OUT_OF_BOUNDS occurred, but was neither handled locally, nor declared in a RAISING clause

Exception Class CX_SY_RANGE_OUT_OF_BOUNDS

Error Name DATA_OFFSET_NEGATIVE

Program SAPLHR_GB_EF_OUTG

Include LHR_GB_EF_OUTGU03

Line 25

Long text The sub area access (Offset = 1-, Länge = &LEN GTH&) on a data object of size 255, lies outwith the valid boundaries.

athavanraja
Active Contributor
0 Kudos

whatever the line length of html table you use that should be passed to i_tabline_length.

moreover in the url i see rfc as the name of your bsp application. is it a right name? you cold have created only on y or z name

athavanraja
Active Contributor
0 Kudos

what happend?