mime-upload Macro

Use

You use the mime-upload macro to transfer MIME data from the ITS to the SAP system during PAI.

To use this macro, there must be at least one MIME object in the ITS context. You can create this object using the tag <input type=file name"...">. You can then call mime-info to retrieve a list of MIME objects held in the current ITS context.

mime-upload
mimeinfo_index    (in,NUM)
mimeinfo          (out,ITAB)
mimeinfo_length   (out,NUM)
         

Parameter

Description

mimeinfo_index

Index to mime-info index.

mimetab

Internal table into which the data is copied.

The macro accepts any internal table and copies the value of the context field to the internal table components. If one record is not sufficient, it adds additional records.

mimeinfo_length

Length of the retrieved data.

If the mime-upload call is successful, mimetab contains the contents of the MIME data and mimeinfo_length contains the length of the data in mimetab.

To accommodate the data, the ITS creates as many rows as necessary in mimetab.

Example

The following ABAP code fragment shows how you can upload MIME data smaller than 100 KB from the ITS to SAP system:

data: mime_info like savwmpmime occurs 0 with header line.
data: datalen type i.
data: data_tab(500) occurs 0 with header line.
mime-info mimetab.
loop at mimetab.
   if mime_info-mimeinfo_length < 10000.
      mime-upload sy-tabix data_tab datalen.
   endif.
endloop.