Skip to Content
2
Former Member
Jul 20, 2007 at 11:19 PM

Moving a BOR ".bmp" attachment (objtyp message) to a Picture Control ????

94 Views

Using BAPI_REL_GETRELATIONS and the usual SWC macros, I am able to:

1) find the objectid of a BOR object of type "MESSAGE" that contains a ".bmp" attachment to a PM notification;

2) create an instance of this object in background.

But now that I have an instance of the object which holds the actual ".bmp", what do I have to do to provide this ".bmp" to a picture control on a screen ?????

I know I can display the ".bmp" in a variety of ways, e.g using the display_attachment method of CL_GOS_DOCUMENT_SERVICE.

But how do I give a picture control addressibility to a ".bmp" held in the BOR as an object ???

Thanks for any advice - I'm srue it's simple - I just don't see how to do it.

Code starts here (only for one attachment to a BUS2038 object - just for testing)

DATA:

  wa_objectid       TYPE bapiborid,
  i_listrel         TYPE STANDARD TABLE OF bapirellk,
  wa_listrel        TYPE bapirellk,
  v_rtrn            TYPE bapiret2.

DATA:

  v_obj1            TYPE swc_object,
  v_objtype         TYPE swo_objtyp,
  v_objkey          TYPE swo_typeid.

DATA:
  v_objdes          TYPE so_obj_des,
  v_fileext         TYPE so_fileext.

DATA:
  v_cntr            TYPE i.

  wa_objectid-objkey  = viqmel-qmnum.
  wa_objectid-objtype = 'BUS2038'.


CALL FUNCTION 'BAPI_REL_GETRELATIONS'
  EXPORTING
    OBJECTID              = wa_objectid
    RECURSIONLEVEL        = 1
  IMPORTING
    RETURN                = v_rtrn
  TABLES
    LISTOFRELATIONS       = i_listrel.

v_cntr = 0.
v_nmbr = 0.
LOOP AT i_listrel into wa_listrel.

  IF wa_listrel-reltype <> 'ATTA'.
    CONTINUE.
  ENDIF.

  v_cntr = v_cntr + 1.


  IF v_cntr > 1.
    EXIT.
  ENDIF.

  v_objtype = wa_listrel-objtype_b.
  v_objkey  = wa_listrel-objkey_b.

  ENDCASE.

ENDLOOP.

swc_create_object v_obj1 v_objtype v_objkey.
swc_get_property v_obj1 'Description' v_objdes.
swc_get_property v_obj1 'FileExtension' v_fileext.