|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Creating ITS application and handling ITS URL with Custom values passed as Parameters
Click on the tab ‘Handler List’ and
enter the class CL_HTTP_EXT_ITS. In the case of ztest_its, I have copied the
existing class and added some functionality.
The copied class is ZCL_HTTP_EXT_ITS. It has
the standard method “IF_HTTP_EXTENSION~HANDLE_REQUEST” which identifies the
application name from the URL and executes the appropriate transaction.
I added the following code to capture my
desired parameters from the URL. The l_query_string field will return the query
string parameters passed by the ITS URL.
l_query_string type string.
l_query_string = server->request->get_header_field( '~QUERY_STRING' ).
When this method calls the transaction, the
PBO module of the transaction fetches the wa_para2 from memory ID ‘ZBC’ and
a select command uses the parameter value to get populate the screen fields.
Once the fields are populated, the PBO module passes control to the HTML page
which displays the screen on the web page with the values fetched from the
database on the basis of the parameters received from the URL.
Save and activate the service.
The ITS URL looks like:
Hyperlink reference not valid.
If we pass our parameter, the URL becomes:
Note that in the above URL everything after
‘?’ is considered as parameter by the HTTP server. The parameters are
separated by ‘&’.
In our scenario we required the second
parameter i.e. ZSAPTS-TRANS_NO= CXD9000123, so we captured this parameter in the
variable para2 (see handler code above).
ITS application is ready to run from the browser.
Now, we can send URLs such as given below in mails to respective
the user clicks the URL, the ITS page will open with all the data on the screen
as the handler would fetch data from SAP on the basis of the parameters passed
by the URL.
See the resulting page below:
Fig 9 – Resulting screen with pre populated values (Notice the URL parameter also)
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards