Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Abap Api Translation

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 38

Former Member

March 1, 2006 14 minute read

RKCTRTX1
________________________________

Just a quick call for Guest Contributors to post SAP or ERP related articles to
ERPWorkbench.com. Not only will you be able to use this as a way to share
your knowledge and advertise your skills but you will also receive a free
online Video training course of your choice for every 6 articles you get
published.

So what are you waiting for?? Start getting rewarded now and share your
knowledge, tips and tricks with the SAP community.

...See here for how to get started contributing to ERPWorkbench SAP


development

H
суббота, 27 марта 2010 г.

Y Google Translate in ABAP


Using

P
*&---------------------------------------------------------------------*
*& Report ZSIT_GOOGLE_TRANSLATE
*&

E
*&---------------------------------------------------------------------*

R
L
*&
*&
*&---------------------------------------------------------------------*

REPORT zsit_google_translate.

*&---------------------------------------------------------------------*
*& Selection Screen
*&---------------------------------------------------------------------*
PARAMETERS p_text TYPE text100 DEFAULT 'Hello World! Using Webservice in SAP AB
AP!'.
PARAMETERS p_src TYPE zesit_net310_google_lang AS LISTBOX VISIBLE LENGTH 15 DEFAULT
'EN' .
PARAMETERS p_trg TYPE zesit_net310_google_lang AS LISTBOX VISIBLE LENGTH 15 DEFAULT
'RU' .
* I create ED and Domain zesit_net310_google_lang like char2
* with values EN and RU
*&---------------------------------------------------------------------*
*& Types and Data
*&---------------------------------------------------------------------*
DATA: http_client TYPE REF TO if_http_client ,
http_url TYPE string ,
p_content TYPE string ,
p_result TYPE string .

*&---------------------------------------------------------------------*
*& Start of Selection
*&---------------------------------------------------------------------*
START-OF-SELECTION .

CONCATENATE 'http://ajax.googleapis.com/ajax/services/language/translate?v
=1.0&q='
p_text '&'
'langpair=' p_src '|' p_trg
INTO http_url.

* Creation of new IF_HTTP_Client object


CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = http_url
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.

http_client->request->set_header_field( name = '~request_method'


value = 'GET' ).
* Send the request
http_client->send( ).

* Reterive the result


CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state =2
http_processing_failed = 3
OTHERS = 4.
* Get character feed
p_content = http_client->response->get_cdata( ).

p_result = p_content.
* Processing string for result
SHIFT p_content LEFT UP TO '{"translatedText":"'.
SHIFT p_content LEFT BY 19 PLACES.
SPLIT p_content AT '"}' INTO p_result p_content.

write:/ 'Источник = ', p_text,


/ 'Перевод = ', p_result.

Автор: wlgserg на 11:03

Ярлыки: ABAP, Google, SAP

ABAP Utility: SAP to Google : View translated ABAP


documentation online
FollowRSS feedLike
0 Likes 221 Views 6 Comments

This is about a simple ABAP Utility . It will post ABAP object’s documentation to Google, for the
purpose of displaying translated text in your logon language or in English.

You can also use this weblog for extending workbench functionality.
The Problem :

Not sure if you’ve faced this problem but I found that quite a few of the function modules are not
provided with English documentation – however documentation in German does exist for most of
these.

Actually I made the problem afterwards. Frankly speaking, I didn’t write this utility because I wanted
to solve any problem. It was just for the fun !!

[ Now where is the fun part? – keep on reading, it’s in The End 🙂 ]
Benefits :

You can write a weblog on SDN about it.

1. It will extend the functionality of the ABAP workbench function[-code] “documentation”

, to get the documentation translated online using Google.

1.
2.

It translates into (other) logon language – if documentation exist in English.

1. Translates into English – if documentation exists only in German.


2.

When no documentation exist at all then you can be sure about that immediately.
Processing :

You can run the report program directly from SE38 as well . But it will be good if you can embed the
functionality in ABAP Workbench itself .
Implementation for BADI WB_PROCESS_FCODE -Method DISPATCH

: It calls the main utility program Z_RMTIWARI_ABAP_DOC_TRANSLATOR, whenever someone clicks


on the ‘Documentation’ of ABAP Workbench Menu..

method IF_EX_WB_PROCESS_FCODE~DISPATCH .
Data : lv_OBJECT type DOKHL-OBJECT.
Data : lv_obj_id type DOKHL-ID.
data : lv_langp type char5.
data : lv_typ type c.
data : lt_dokil type standard table of dokil.
data : wa_dokil type dokil.

*P_OK_CODE
Check P_OK_CODE eq ‘WB_DOCUMENTATION’.
break-point.
IF sy-tcode eq ‘SE37’.
get parameter id ‘LIB’ field lv_OBJECT.
lv_obj_id = ‘FU’.
lv_typ = ‘T’.

ELSEIF sy-tcode eq ‘SE38’.


get parameter id ‘RID’ field lv_OBJECT.
lv_obj_id = ‘RE’.
lv_typ = ‘E’.

ELSE.

 Not implemented as yet

ENDIF.

select *
into table lt_dokil
from DOKIL
where ID eq lv_obj_id
and OBJECT eq lv_OBJECT
and TYP eq lv_typ.

check sy-subrc eq 0.

READ TABLE lt_dokil into wa_dokil with key langu = sy-langu.

check sy-subrc ne 0.

READ TABLE lt_dokil into wa_dokil with key langu = ‘E’.

if sy-subrc eq 0 .

 Translate from english to logon language

concatenate ‘en|’ sy-langu into lv_langp.


else.

 Get German and translate to English.

lv_langp = ‘de|en’.

endif.

SUBMIT Z_RMTIWARI_ABAP_DOC_TRANSLATOR AND RETURN


WITH P_ID = lv_obj_id
WITH P_OBJECT = lv_object
WITH P_LANGP = lv_langp.

endmethod.

Program Z_RMTIWARI_ABAP_DOC_TRANSLATOR :

The program accepts inputs for the function module name & the language pair in. It simply gets the
available documentation of the object and then generates the HTML code for Google translation
FORM. The HTML Page gets downloaded to ‘C:\Temp’ folder on your PC and subsequently called by
the program in your default browser.

REPORT Z_RMTIWARI_ABAP_DOC_TRANSLATOR .
—-

 ABAP Document Translator – using Google – Date – 18.02.2006

—-

 Written By: Ram Manohar Tiwari

—-

 Presented By: http://www.rmtiwari.com


—-

 This utility will accept ABAP documentation objects and will submit
 the text to google in order to translate it from one language to
 other.

 This utility is useful for translating the function module and other
 ABAP Object’s documenations from German to English, in case it is
 only available in German.

 You can also translate the documentation from english to any other
 (available) language,in case, for you, English is as good as German.

*—-

 This utility is developed on MiniSAP .

*—-

 SELECTION SCREEN

*—-

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.


PARAMETERS : P_ID LIKE DOKHL-ID DEFAULT ‘FU’ OBLIGATORY,
P_LANGU LIKE SY-LANGU DEFAULT ‘D’ NO-DISPLAY,
P_OBJECT LIKE DOKHL-OBJECT OBLIGATORY,
P_LANGP TYPE CHAR5 default ‘de|en’ OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1 .

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE text-002.

SELECTION-SCREEN BEGIN OF LINE.


PARAMETERS: P_OUTDIR LIKE rlgrap-filename obligatory default ‘C:\temp’.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.
—-

 Data declaration

—-

data : gv_directory LIKE rlgrap-filename,


gv_file_name TYPE STRING,
gv_html_file_name(100) TYPE C.

data : lt_doc_text type standard table of TLINE with header line.

DATA : BEGIN OF gt_html OCCURS 0,


rec(200) TYPE c,
END OF gt_html.

DATA : gv_html_wa like line of gt_html.

—-

DATA: begin of lt_VALUETAB occurs 0,


P_LANGP type char5,
DESC type char100,
end of lt_VALUETAB .

data : lt_return_tab type standard table of DDSHRETVAL with header line.


data : lv_prog type sy-repid,
lv_dynnr type sy-dynnr.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LANGP.

CLEAR lt_valuetab. REFRESH lt_valuetab.


lv_prog = sy-repid.
lv_dynnr = sy-dynnr.

lt_valuetab-P_LANGP = ‘de|en’.
lt_valuetab-DESC = ‘German to English’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘de|fr’.
lt_valuetab-DESC = ‘German to French’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|de’.
lt_valuetab-DESC = ‘English to German’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|es’.
lt_valuetab-DESC = ‘English to Spanish’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|fr’.
lt_valuetab-DESC = ‘English to French’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|it’.
lt_valuetab-DESC = ‘English to Italian’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|pt’.
lt_valuetab-DESC = ‘English to Portuguese’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|ja’.
lt_valuetab-DESC = ‘English to Japanese BETA’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|ko’.
lt_valuetab-DESC = ‘English to Korean BETA’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|cn’.
lt_valuetab-DESC = ‘English to Chinese(Simplified) BETA’.
APPEND lt_valuetab.

 Call the help value screen

CALL FUNCTION ‘F4IF_INT_TABLE_VALUE_REQUEST’


EXPORTING
retfield = ‘P_LANGP’
dynpprog = lv_prog
dynpnr = lv_dynnr
dynprofield = ‘P_LANGP’
value_org = ‘S’
TABLES
value_tab = lt_VALUETAB
RETURN_TAB = lt_return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.

 …

ENDIF.

START-OF-SELECTION.

P_LANGU = P_LANGP(1).

 Get the document text

CALL FUNCTION ‘DOCU_GET’


EXPORTING

 EXTEND_EXCEPT =‘‘

ID = P_ID
LANGU = P_LANGU
OBJECT = P_OBJECT

 TYP = ‘E’
 VERSION =0
 VERSION_ACTIVE_OR_LAST = ‘L’
 PRINT_PARAM_GET = ‘X’
 IMPORTING
 DOKSTATE =
 DOKTITLE =
 HEAD =
 DOKTYP =

TABLES
LINE = lt_doc_text
EXCEPTIONS
NO_DOCU_ON_SCREEN =1
NO_DOCU_SELF_DEF =2
NO_DOCU_TEMP =3
RET_CODE =4
OTHERS =5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

 Create the google html form for the document text.

PERFORM convert_doc_to_html TABLES lt_doc_text


gt_html.

Concatenate ‘Trans_’ P_OBJECT ‘.html’ into gv_html_file_name.

PERFORM prepare_file_name USING p_outdir


gv_html_file_name
CHANGING gv_file_name.

PERFORM download_html_file_on_pc tables gt_html


using gv_file_name.

PERFORM show_html_file using gv_file_name.

END-OF-SELECTION.

&—-

*& Form prepare_file_name


&—-
 text

—-

 –>x_directory text
 –>x_program_name text
 –>y_file_name text

—-

FORM prepare_file_name USING x_directory


x_file
CHANGING y_file_name.

CONCATENATE x_directory ‘\’ x_file into y_file_name.

ENDFORM. ” prepare_file_name
&—-

*& Form download_html_file_on_pc


&—-

 text

—-

 –> p1 text
 <– p2 text

—-
FORM download_html_file_on_pc tables yt_download
using x_outfile type string.

 Use gui_download if file is located on the local PC.


 WS_download only works in foreground

IF sy-batch EQ ‘X’.
MESSAGE e001(AQ) WITH
‘This program cannot be executed in background’.

 ERROR: Unable to download locally stored files when running in


 background

ELSE.

CALL FUNCTION ‘GUI_DOWNLOAD’


EXPORTING
FILENAME = x_outfile
FILETYPE = ‘ASC’
TABLES
DATA_TAB = yt_download
EXCEPTIONS
FILE_WRITE_ERROR =1
NO_BATCH =2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE =4
NO_AUTHORITY =5
UNKNOWN_ERROR =6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.

 Status of download
CASE sy-subrc.
WHEN 0.
MESSAGE I002(AQ) WITH
‘HTML page downloaded as ‘ x_outfile.

WHEN OTHERS.

 Upload unsuccessful – error message

MESSAGE ID SY-MSGID TYPE ‘E’ NUMBER SY-MSGNO


WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDCASE.
ENDIF.

ENDFORM. ” download_html_file_on_pc
&—-

*& Form convert_code_to_html


&—-

 text

—-

 –>P_GT_REP_TABLE text
 –>P_GT_HTML text

—-

FORM convert_doc_to_html TABLES xt_REP_TABLE structure TLINE


yt_HTML.

DEFINE add_html.
yt_html = &1.
APPEND yt_html.
END-OF-DEFINITION.

 Add Header to HTML

add_html ‘‘
into lv_langp_html.
endif.

 Remove the space in < /textarea> – this is for SDN weblog

add_html ‘< /textarea>’.


add_html lv_langp_html.
add_html ‘

‘.
add_html ‘‘.
add_html ‘‘.
add_html ‘‘.
add_html ‘
‘.

 Close HTML Tags

add_html ‘</BODY>’.
add_html ‘</HTML>’.

ENDFORM. ” convert_code_to_html
&—-

*& Form show_html_file


&—-

 text

—-
 –>X_FILE_NAME text

—-

FORM show_html_file USING X_FILE_NAME.

data : lv_url(200) type c.

lv_url = x_file_name.
CALL FUNCTION ‘CALL_BROWSER’
EXPORTING
URL = lv_url.

ENDFORM. ” show_html_file

The Result:

For example : You can open a function module say ABAP_DOCU_SHOW using transaction SE37 .
Further click on Menu Function .

Since the BADI is implemented for function code ‘documentation’, the utility will be called and
Google translated text from German to English will be shown in your default browser.

Also there seems to be some problem with the google translation and it does not respect end-of-
sentence or line-breaks http://www.worldlingo.com/ could have done better . That makes the
translated text look like some kind of garbage. Also, there seems to be some encoding related issue.
But that should not be very difficult to resolve.
</P>


 Alert Moderator

Assigned tags
 Retagging required
 rammanohar tiwari

Related Blog Posts


 We are sorry but we are currently unable to retrieve related content.

Related Questions
 We are sorry but we are currently unable to retrieve related content.

6 Comments
You must be Logged on to comment or reply to a post.

Eddy De Clercq

March 2, 2006 at 2:31 am

Hi,

I wondered why you don’t use simplier methods like the one described in
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/web
as/abap/just%20browsi
ng%20Around.article
I’m not saying that my code is better (in the contrary), but using the local machine as in
between stage could result in unwanted problems with the browser (see the multitude of
forum threads on the call_browser) or the file system (e.g. Tivoli managed PCs).
If the SAP server act as client you don’t need to worry about that anymore.

Eddy

o Like(0)

Former Member Post author

March 2, 2006 at 7:24 am

Hi Eddy,

Thanks for your comments.


I do have that class cl_http_client in my miniSAP version and I also understand your
concern for Browsers 🙂

But
1. cl_http_client is only available from 4.7 onwards at least I could not find it on the
4.6C version to which I’ve the access.
2. In order to make that work, we might well have to first configure the proxies or
firewalls, which does not actually belong to the expertise domain of ABAP
developers.
3. Ultimately, Google result has to be shown in a browser [ as whatever that was
called was not an API / web-service ]..unless you want to go for
pattern match and then get the text

 Like(0)

Former Member

March 2, 2006 at 9:15 am

Ram,

I think it’s high time you download the NW04s preview edition which is here
on SDN and move on from your 610 you are missing out on
SOOOOOOOOOOOOOOOO much.

Besides configuring the proxy is nothing and most times it’s already done by
your Basis guys for many reasons.

SDN Meets Labs: Integrated Web Content


Craig

 Like(0)

Former Member

March 2, 2006 at 7:43 am

hi there,

I hope you’re not serious about using such a translation service for other reasons then for
making yourself a joke about it.

It’s not only those technical problems of line breaking or UTF characters, it just makes
almost no sense with respect to the very content.

I just say ‘User attitudes’.


Or my runner-up favourite ‘postage G parameters’.
But the best of all ist the translation of the coding …IF EMERGENCY of docu_container IS
INITIAL.

please don’t you ever trust in this. but I am sure you were just doing this for the fun of it :-))

regards,
anton

o Like(0)

Former Member Post author

March 2, 2006 at 8:48 am

In terms of getting comments, this weblog has crossed my previous best.


Earlier, in one of my very few weblogs, I was rewarded with 2 comments (including mine)

Thank You for your kind attention !!

 Like(0)

Former Member

August 15, 2013 at 12:36 pm

Wow – I was looking around for some post to consume a webservice from ABAP while
avoiding PI. AND WebAS AND Java. Plus I have no experience with this. PI Proxy bring it
on. That’s easy.

Anyway – I came across your post. I’m glad you got a record number of responses! I’m glad
they are pointing people like me in the right direction. I am disappointed you didn’t get any
positive comments.

So years later, and a dollar short. Thank you for the post! The responses and the blog have
helped me out. I’m glad you were exploring different parts of SAP, and figuring out how
they work.

I’m looking forward to reading your newer posts!

Michelle

sing ABAP with the SAP API Business Hub

1
2
3

Join the conversation on Facebook

o Share this page


o Follow SAP Developers

Join the conversation on Twitter

o Share this page


o Follow SAP Developers

Subscribe to the YouTube Channel

o Subscribe to SAP Developers

Join the conversation on LinkedIn

o Share this page


o Follow SAP Developers

View our projects on GitHub


o View our projects

Share via email

o Share this page

Details

Code Snippets
// Explore More Tutorials

Using ABAP with the SAP API Business


Hub

Meredith Hassett

12/02/2018

Beginner

15 min.

ABAP Development, Tutorial, Beginner

Add a code snippet from the API Hub into your ABAP report.

You will learn

In this tutorial, you will learn how to use the pre-generated code from the SAP API Business
Hub in an ABAP report. You will need to have configured your ABAP system to make an
HTTP request.

Configure your ABAP Proxy

Get your SSL Certificate


Add your certificate to ABAP

Create the ABAP program report

Get the ABAP code from API Business Hub

Add API call and run from ABAP

 Back to Top

Provide Feedback

Prerequisites

 ABAP system should be configured to call http APIs


 Testing API Business Hub APIs with Curl

Configuring the proxy settings is not a required step for all systems. Verify that your system
needs to have the proxy configured before completing steps 1 through 3.

Step 1: Configure your ABAP Proxy

From the SAP Logon pad, launch the SAP Logon screen.
Enter the login credentials in R/3 ABAP System.
Configure your proxy settings by going to transaction SICF and clicking on Execute.

Open Proxy settings page by pressing Ctrl + F2 and set the proxy.
Done

Log on to answer question

Step 2: Get your SSL Certificate

In Google Chrome, export SSL certification.


To get to the SSL certificate, enter F12, go to Security tab, click on View Certificate, click on
Details, and select Copy to File. From here, you can export the certificate by path.
Done

Log on to answer question

Step 3: Add your certificate to ABAP

Once you export the certificate by path, you will need to import it into your ABAP system.
To import the certificate in your ABAP system, go to the transaction STRUST, open SSL
client SSL Client (Standard), and switch to Edit mode.

Click on Import Certificate. Select the certificate you exported from Google Chrome in the
previous step. Click Add to Certificate List and save.
In order to reflect your new SSL settings, you will need to restart your ICM. To restart the
ICM, go to the transaction SMICM. Navigate to Administration > ICM > Exit Hard > Global.
The ICM restart message will appear. Select Yes.

Restart the ICM processes. Make sure no client is communicating during restart.

Done

Log on to answer question

Step 4: Create the ABAP program report

In your ABAP system, go to the transaction se38.


Create a new report. Enter the program name, such as ZAPI_HUB_TEST, select Source Code,
and click Create.

Provide the following details on the Program Attributes screen.


Field Name Value

Title testing API

Type Executable program

OPTIONAL: Status Test Program

Save, Activate, and Execute the report.

Done

Log on to answer question

Step 5: Get the ABAP code from API Business Hub

To get the ABAP code snippets that are available in the SAP API Business Hub, go to the SAP
API Business Hub, which can be found at api.sap.com, from your browser. Navigate to the
API packages page and find the SAP Translation Hub API.
Click the Expand Operations link on the Domains API. Click Generate Code on the GET
/domains method.
Click on the tab for ABAP from available languages and click Copy to Clipboard.

Paste in the copied ABAP code from the API Hub in the text box below.

Submit Answer

Log on to answer question

Step 6: Add API call and run from ABAP

Back in your ABAP system, paste the code snippet into the report.
Replace the <API_KEY> with your API key value. This is also available in the SAP API Business
Hub and is specific to your user and app. Save, Activate, and Execute the report.

If you see a message returned with data, and not an error, you have successfully tested a
call to an API from the SAP API Business Hub

Log On


o Edit My Profile
o Account Settings
o Notifications
o Followed Activities

 Logout

 Home
 Community
 Archives
 Discussions Archive
 ABAP Development

 Ask a Question
 Write a Blog Post
 Login / Sign-up

o Send a Message
o Manage My Blog Posts
o Quick Start Guide

Archived discussions are read-only. Learn more about SAP Q&A

How to call google.com from ABAP


with out using Web dynpro
Dear Gurus,
Pease advise me how to call google.com or any web site from regualr ABAP with out using web dynpro?
Appreciate all your help.
Sincerely,
GSM

Former Member
October 13, 2013 at 17:28 PM
0 Likes

Not what you were looking for? View more on this topic or Ask a question
9 replies

Kesavadas Thekkillath replied


January 17, 2010 at 18:08 PM
Use function module PRGN_GENER_EXECUTE_URL or CALL_BROWSER in your progarm and call it.
Copy Code

1. call method cl_gui_frontend_services=>execute


2. exporting
3. document = 'http://www.sdn.sap.com'
4. exceptions
5. others = 1.

Copy Code

1. CALL FUNCTION 'CALL_BROWSER'


2. EXPORTING
3. URL = 'http://www.sdn.sap.com'
4. WINDOW_NAME = 'New'
5. NEW_WINDOW = 'X'
6. * BROWSER_TYPE =
7. * CONTEXTSTRING =
8. * EXCEPTIONS
9. * FRONTEND_NOT_SUPPORTED = 1
10. * FRONTEND_ERROR = 2
11. * PROG_NOT_FOUND = 3
12. * NO_BATCH = 4
13. * UNSPECIFIED_ERROR = 5
14. * OTHERS = 6.
15. IF sy-subrc <> 0.
16. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
17. * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
18. ENDIF.

1 likes
Former Member replied
January 17, 2010 at 20:48 PM
Thanks Keshav. Appreciate if you could let me know how to pass parameters to this websites from ABAP?
The example would be I have a link(which is equal to web site) and when I call this link from ABAP i have
to pass a document number as a parameter to directly open a document. Any help would be appreciated.
Thanks,
GSM
0 likes

Former Member replied


January 18, 2010 at 04:52 AM
Hi,
You need to concatenate the related URL with the Document Number using '&'. The example will be
something like this:
http://<website>.com/lang?=en&VBELN=<document number>&
The document number will be a dynamic part.
This is one of the methods of directly opening the desired document number.
Regards,
-Syed.
0 likes

Former Member replied


January 18, 2010 at 05:36 AM
Dear GSM,
You can execute the tCode: DWDM and check the source code of the first demo program.
Hope you will find the tcode very helpful.
Regards
s@k
0 likes

Former Member replied


January 18, 2010 at 05:45 AM
Hi GSM,
Please go through this example program,
SAPHTML_DEMO1
Hope it helps you,
Regards,
Abhijit G. Borkar
0 likes
Former Member replied
January 18, 2010 at 08:08 AM
You can use the above mentioned Function Module (CALL_BROWSER).
You can pass parameters like this in the URL parameter for the funciton module:
'http://www.mywebsite.com?param1=val1&param2=val2'
Have a look at : /people/poonam.assudani/blog/2007/10/08/call-a-specific-component-and-object-from-
outside-crm-using-url
Kind Regards,
C
0 likes

Former Member replied


January 18, 2010 at 09:04 AM
Hi,
Below is the ABAP program that call google.com
REPORT ZURL NO STANDARD PAGE HEADING.
DATA: BEGIN OF URL_TABLE OCCURS 10,
L(25),
END OF URL_TABLE.
URL_TABLE-L = 'http://www.google.com'.APPEND URL_TABLE.
URL_TABLE-L = 'http://www.hotbot.com'.APPEND URL_TABLE.
URL_TABLE-L = 'http://www.sap.com'.APPEND URL_TABLE.
LOOP AT URL_TABLE.
SKIP. FORMAT INTENSIFIED OFF.
WRITE: / 'Single click on '.
FORMAT HOTSPOT ON.FORMAT INTENSIFIED ON.
WRITE: URL_TABLE. HIDE URL_TABLE.
FORMAT HOTSPOT OFF.FORMAT INTENSIFIED OFF.
WRITE: 'to go to', URL_TABLE.
ENDLOOP.
CLEAR URL_TABLE.
AT LINE-SELECTION.
IF NOT URL_TABLE IS INITIAL.
CALL FUNCTION 'WS_EXECUTE'
EXPORTING
program = 'C:\Program Files\Internet Explorer\IEXPLORE.EXE'
commandline = URL_TABLE
INFORM = ''
EXCEPTIONS
PROG_NOT_FOUND = 1.
IF SY-SUBRC <> 0.
WRITE:/ 'Cannot find program to open Internet'.
ENDIF.
ENDIF.
0 likes

Former Member replied


October 13, 2013 at 17:19 PM
We recently figured out how to interface to the Google API's from ABAP via OAuth2. Our short video is
here:
http://youtu.be/uDgTxiR00cY
hope you find this helpful
Forrest
0 likes

abilash n replied
October 13, 2013 at 17:28 PM
Excellent share Forest,Kesavadas,Rahul....

You might also like