

- #Rest client download attachment how to
- #Rest client download attachment software
- #Rest client download attachment code
- #Rest client download attachment password
Under selected Software Component click on imported objects, put your credentials, select RFC node and download previously created FM. There’re standard steps and objects to be created here, nothing new and fancy: MESSAGE 'Select file' TYPE 'S' DISPLAY LIKE 'E'.

MESSAGE 'Enter credentials' TYPE 'S' DISPLAY LIKE 'E'. Is_attachment = VALUE zjira_attachment_s( filename = gv_filenameĭATA(gv_msg) = sy-subrc & ` - sy-subrc. SPLIT p_file AT `\` INTO TABLE DATA(gt_file).ĭATA(gv_filename) = gt_file.ĬALL FUNCTION 'ZFM_JIRA_ADD_ATTACHMENT_RFC' DESTINATION 'PI_RFC' IF p_unam IS NOT INITIAL AND p_pass IS NOT INITIAL.ĬALL FUNCTION 'SKWF_MIMETYPE_OF_FILE_GET'ĭATA(gv_auth_string) = p_unam & `:` & p_pass.
#Rest client download attachment password
"have a little decency and hide password fieldĪT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.Ĭl_gui_frontend_services=>file_open_dialog(

SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME TITLE TEXT-T02. PARAMETERS: p_unam TYPE string LOWER CASE, SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-T01. SELECTION-SCREEN BEGIN OF BLOCK BL0 WITH FRAME TITLE TEXT-T00. data – encoded, in base64, data stream įor testing purposes simple test program would be useful, here you can find one I wrote (but you can try directly from se37 using some simple and short base64 string): *&-*.mimetype – mimetype, also passed to request data (between boundaries).filename – name of the file, which will be passed to Content-Disposition for data stream in included in this structure.is_attachment – attachments structure with following fields:.This is something adapter can create itself, but we want to pass data entered by the user on ERP side instead of hardcoding it on adapter level iv_authstring – concatenated user name and password, separated by “:” and encoded in base64.iv_issue_key – issue number/key we want to add attachment to.

This can be also used later to replace structure with table type and send multiple attachments at once. Of course you can modify it to have all fields as strings (I have a strange habit to put existing text-based component types instead of using string everywhere), or predefined custom/standard types.
#Rest client download attachment code
Module is just an empty interface for RFC call so no ABAP code is needed: I created simple, RFC enabled, function module. So the goal is to have synchronous RFC->REST interface, from ERP to JIRA system.įirst thing first – need an entry point for SAP request.
#Rest client download attachment how to
Now – how to do it? Because, in my case, issue should be created in a dialog SAP GUI session, i decided to use synchronous RFC functions. Ok, so we know now what we want to send out from PO system. We can attach more than one file, but each one of them must be included into separated boundaries like that. Method is available at path api/2/issue/–. For my little project I had to implement also methods creating issue and retrieving dictionary data (projects, issue types, custom fields), but these are simple GET/POST methods and won’t be described here. Basically I’d like to focus on adding attachment method. JIRA’s API is really well described and if you get stuck there’s a lot of useful information on their community side. And this part appeared to be more difficult than I had expected… So in this blog, I’ll explain my solution to multipart/form-data requests created on SAP PO. However, creating new issue is not enough, because user reporting some kind of an issue would like to attach at least some screenshots and maybe other files documenting what actually happened/what should be fixed. Because this software provides its own REST API it seemed to be an easy task. Recently I’ve received interesting requirement: integrate SAP system with Atlassian’s JIRA software to enable creating new issues directly from SAP GUI.
