Skip to Content

In a recent support case with SAP, I was asked to replace the ACF up/down applet in the MIME Repository. Normally one would apply a SAP note containing the MIME object. In this case I had to locate the JAR file in the MIME Repository and replace it with “Upload and Replace”, which I did. After finding out that the new version didn’t fix the reported problem, I tried to restore the previous version which I had downloaded and stored on my local drive. After not getting any confirmation in the MIME Repository Explorer and the fact that the previous version was not restored (more on that later), I tried to delete the JAR file from the MIME Repository. THAT IS A BIG NO, NEVER. All MIME objects are identified by a unique ID called LOIO or the complete path. Since I deleted the JAR file from MIME Repository the LOIO was gone and I wasn’t able to import the SAP note containing the latest (the previous) version of the JAR file, attempting to do so returned an internal error in INT_SMIM_ADD.

Before I go into the details on how to restore the LOIO, an explanation is required why I thought the previous JAR file didn’t get restored. It turns out it is not sufficient to empty the ICM cache and the browser cache; one has to also empty the Java cache with the Control Panel applet. You can also play with the Expiration Time settings for the MIME object but at least my tests indicate that playing with them won’t cause the Java cache to be invalidated.

I used the program WDG_MAINTAIN_UR_MIMES as reference and implemented only the parts required to recreate the MIME object with the correct LOIO. The form UPLOAD_FILE can be just about anything, as long as it provides the JAR file content. I used the one in report WDG_MAINTAIN_UR_MIMES.

report  zrecreate_mime_object.
constants c_zip_file_filter type string value '*.jar'. "#EC NOTEXT
data mr                       type ref to if_mr_api.
data zip                       type xstring.
data zip_file_name     type string.
data zip_path              type string.
data c_mime_zip_loio type skwf_io.
data zip_local_path     type string.
mr = cl_mime_repository_api=>get_api( ).
c_mime_zip_loio-objtype = 'L'.
c_mime_zip_loio-class   = 'M_APP_L'.
c_mime_zip_loio-objid   = '80000E2515CB1DDCA8C7953F5D7A0BC0'.
zip_file_name = 'com_sap_acf_updown.jar'.
zip_path = '/SAP/BC/WebDynpro/SAP/PUBLIC/BC/SSR/uuielibs/active_component/com_sap_acf_updown.jar'.
clear zip.
perform upload_file using zip_file_name changing zip.
check zip is not initial.
mr->put(
  exporting
    i_url                     = zip_path
    i_content                 = zip
    i_language                = 'D'
    i_new_loio                = c_mime_zip_loio
    i_dev_package             = 'SWDP_UIEL_ACTIVE_COMPONENT'
  exceptions
    others                    = 1 ).
if sy-subrc <> 0.
  message id sy-msgid type sy-msgty number sy-msgno
             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

The most important parts in the program are the LOIO, filename, path and development package. By changing those parts of the program and uploading a different file, you could recreate any MIME object in the MIME Repository.

A useful program for troubleshooting MIME objects is MR_CHECK_MIMES.

To report this post you need to login first.

Be the first to leave a comment

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

Leave a Reply