Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playground: add ABAP sample #1737

Merged
merged 1 commit into from Jan 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions website/index/samples/sample.abap.txt
@@ -0,0 +1,29 @@
REPORT zrosetta_base64_encode_data.

DATA: li_client TYPE REF TO if_http_client,
lv_encoded TYPE string,
lv_data TYPE xstring.


cl_http_client=>create_by_url(
EXPORTING
url = 'http://rosettacode.org/favicon.ico'
IMPORTING
client = li_client ).

li_client->send( ).
li_client->receive( ).

lv_data = li_client->response->get_data( ).

CALL FUNCTION 'SSFC_BASE64_ENCODE'
EXPORTING
bindata = lv_data
IMPORTING
b64data = lv_encoded.

WHILE strlen( lv_encoded ) > 100.
WRITE: / lv_encoded(100).
lv_encoded = lv_encoded+100.
ENDWHILE.
WRITE: / lv_encoded.