Craete a function module and use it as a web service.
In this example we have created a web service for a (RFC)FM .
Step 1.Go -->se 37 -->create a (RFC) function module
Import parameter
Export parameter
Code for the function module
DATA : L_T_0105 TYPE STANDARD TABLE OF P0105,
WA_0105 TYPE P0105.
CALL FUNCTION 'HR_READ_SUBTYPE'
EXPORTING
* TCLAS = 'A'
PERNR = PERNR
INFTY = '0105'
SUBTY = '0001'
* SPRPS = '*'
BEGDA = SY-DATUM
ENDDA = SY-DATUM
TABLES
INFTY_TAB = L_T_0105[]
EXCEPTIONS
INFTY_NOT_FOUND = 1
INVALID_INPUT = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
ENDIF.
SORT L_T_0105 BY ENDDA DESCENDING.
READ TABLE L_T_0105 INTO WA_0105 INDEX 1.
IF SY-SUBRC = 0 .
WRITE WA_0105-USRID TO E_NAME.
CLEAR WA_0105.
ENDIF.
Save it to locall
Now go to the tcode soamanager the below screen will appear in web browser
Go to the single service administration
We will get the list of web services now choose zTest_webservice (motioned while creating the web services)
This will open WSDL save as XML
Now go to the click display binding WSDL URL
Example: http://:8000/sap/bc/srt/wsdl/bndg_E13C4BD379AE8AF1BF850026554B371E/wsdl11/ allinone/ws_policy/document?sap-client=011
Go the EP portal and run the web services using above link
In this example we have created a web service for a (RFC)FM .
Step 1.Go -->se 37 -->create a (RFC) function module
Import parameter
Export parameter
Code for the function module
DATA : L_T_0105 TYPE STANDARD TABLE OF P0105,
WA_0105 TYPE P0105.
CALL FUNCTION 'HR_READ_SUBTYPE'
EXPORTING
* TCLAS = 'A'
PERNR = PERNR
INFTY = '0105'
SUBTY = '0001'
* SPRPS = '*'
BEGDA = SY-DATUM
ENDDA = SY-DATUM
TABLES
INFTY_TAB = L_T_0105[]
EXCEPTIONS
INFTY_NOT_FOUND = 1
INVALID_INPUT = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
ENDIF.
SORT L_T_0105 BY ENDDA DESCENDING.
READ TABLE L_T_0105 INTO WA_0105 INDEX 1.
IF SY-SUBRC = 0 .
WRITE WA_0105-USRID TO E_NAME.
CLEAR WA_0105.
ENDIF.
Save it to locall
Now go to the tcode soamanager the below screen will appear in web browser
Go to the single service administration
We will get the list of web services now choose zTest_webservice (motioned while creating the web services)
This will open WSDL save as XML
Now go to the click display binding WSDL URL
Example: http://
Go the EP portal and run the web services using above link
No comments:
Post a Comment