I need help with uploading attachments in SAP MIRO transaction
I’m working on a functionality to attach documents (specifically TIF format images and files) directly to the MIRO transaction screen. The issue I’m facing is that my code successfully updates the database tables, but the attachments don’t appear in the MIRO interface itself.
I need to properly configure the business object and business key parameters. Here’s my current approach:
SELECTION-SCREEN BEGIN OF BLOCK upload_block WITH FRAME TITLE text-upload.
PARAMETERS: file_path TYPE localfile,
object_id TYPE swo_typeid,
bus_object TYPE swo_objtyp.
SELECTION-SCREEN END OF BLOCK upload_block.
DATA:
file_content TYPE STANDARD TABLE OF soli,
content_line TYPE soli,
header_info TYPE STANDARD TABLE OF soli,
folder_member TYPE sofmk,
note_ref TYPE borident,
business_obj TYPE borident,
object_key TYPE soodk,
content_data TYPE soli,
folder_key TYPE soodk,
document_info TYPE sood1,
note_key TYPE borident-objkey,
vendor_num TYPE lifnr,
upload_file TYPE string,
file_name TYPE c LENGTH 100,
file_ext TYPE c LENGTH 4.
CLEAR: file_content[], header_info[].
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\Temp\document.TIF'
filetype = 'BIN'
TABLES
data_tab = upload_table.
CALL FUNCTION 'SO_CONVERT_CONTENTS_BIN'
EXPORTING
it_contents_bin = file_content[]
IMPORTING
et_contents_bin = file_content[].
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
region = 'B'
IMPORTING
folder_id = folder_key
EXCEPTIONS
communication_failure = 1
owner_not_exist = 2
system_failure = 3
x_error = 4
OTHERS = 5.
Can someone point out what might be wrong with my implementation? The attachment process completes without errors but doesn’t show up in MIRO.