Recently I
noticed that FM WWW_GET_MIME_OBJECT was marked as obsolete. 
Thus, Code Inspector
reports it in case it is used in custom ABAP coding.
Function
module WWW_GET_MIME_OBJECT is flagged as obsolete. Send any queries to the
developer of the ==> Function module WWW_GET_MIME_OBJECT.
I was looking
for a replacement function. I found FM WWWDATA_IMPORT. This FM has even
interface similar to the WWW_GET_MIME_OBJECT. Below I introduce a call of both
the FMs.
WWW_GET_MIME_OBJECT
call:
DATA:  picture TYPE TABLE OF w3mime,
       w3_queries TYPE
TABLE OF w3query,
       w3_htmls TYPE TABLE OF w3html,
      return_code TYPE w3param-ret_code,
      content_type TYPE w3param-cont_type,
      content_length TYPE w3param-cont_len.
   
INSERT VALUE #( name  = `_OBJECT_ID`
                    value = `Z_SMW0_ENTRY`) INTO TABLE w3_queries.
    CALL
FUNCTION 'WWW_GET_MIME_OBJECT'
     
TABLES
        query_string        = w3_queries
        html                = w3_htmls
        mime                = picture
     
CHANGING
        return_code         = return_code
        content_type        = content_type
        content_length      = content_length
     
EXCEPTIONS
        object_not_found    = 1
        parameter_not_found = 2
       
OTHERS              = 3.
WWWDATA_IMPORT
call:
  DATA mime TYPE w3mimetabtype.
  DATA(key) = VALUE wwwdatatab( relid = `MI`
                                objid = `Z_SMW0_ENTRY` ).
  CALL
FUNCTION 'WWWDATA_IMPORT'
   
EXPORTING
      key                    = key
  
TABLES
     mime                    = mime
  
EXCEPTIONS
     wrong_object_type       = 1
     import_error            = 2


No comments:
Post a Comment