Code: Alles auswählen.
FIND REGEX '\\([^\\]*$)' IN lv_filename SUBMATCHES lv_filename.
FIND REGEX '\.([^/.]*$)' IN lv_filename SUBMATCHES DATA(lv_tech_type).
IF lv_tech_type IS INITIAL.
lv_tech_type = 'TXT'.
ENDIF.
TRANSLATE lv_tech_type TO UPPER CASE.
ls_att_content = VALUE #( atta_cat = cl_gos_api=>c_msg
filename = lv_filename
descr = lv_filename
filesize = lv_filelength
tech_type = lv_tech_type
content_x = cl_bcs_convert=>solix_to_xstring( lt_solix ) ).
TRY.
lo_api->insert_al_item( is_attcont = ls_att_content
iv_roltype = cl_gos_api=>c_attachment ).
IF iv_commit = abap_true.
COMMIT WORK.
ENDIF.
CATCH cx_gos_api INTO DATA(lo_cx).
DATA(lv_message) = lo_cx->get_longtext( ).
IF lv_message IS INITIAL.
lv_message = lo_cx->get_text( ).
ENDIF.
MESSAGE lv_message TYPE 'I' DISPLAY LIKE 'E'.
RETURN.
ENDTRY.