2014 Feb 07 2:06 PM
Hi All
I'm struggling fetching the attacments from ME42 which are stored as store business object .
I used below links :
http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=57409564
They have used the bds_conn00 table but it remains empty with no data .
In below link
http://scn.sap.com/thread/3493960
the cl_binary_relation=>read_links_of_objects returns it_link but this too i got empty.
for
p_botype like borident-objtype default 'BUS2010',
p_bo_id like borident-objkey default '6000000082'," Key e.g. PO No.
p_reltyp like breltyp-reltype default 'ATTA'.
Also table SRGBTBREL is empty for attachments i used in ME42 as store business object.
Kindly help how can i get the attchments from store business data for ME42 (RFQ) .
Regards
Ujjwal
2014 Feb 07 5:01 PM
2014 Feb 07 5:34 PM
Hello,
Could you check below code. It's working for me.
DATA: i_connections TYPE bdn_con OCCURS 0,
i_connections_rec TYPE bdn_con .
DATA fol_id LIKE soodk.
DATA doc_id LIKE soodk.
DATA: objcont TYPE soli OCCURS 0 .
DATA: path TYPE char255,
comp_id TYPE char255 .
DATA: lv_bds_docid TYPE bds_docid.
* Get your own logical system by calling
OWN_LOGICAL_SYSTEM_GET.
CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'
EXPORTING
logical_system = 'DV1CLNT600'
classname = 'BUS2010'
objkey = '6000000082'
client = sy-mandt
TABLES
gos_connections = i_connections.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT i_connections INTO i_connections_rec .
MOVE i_connections_rec-loio_id TO fol_id .
MOVE i_connections_rec-loio_id+17(25) TO doc_id .
MOVE i_connections_rec-loio_id TO lv_bds_docid .
CALL FUNCTION 'SO_OBJECT_READ'
EXPORTING
folder_id = fol_id
object_id = doc_id
TABLES
objcont = objcont.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
break ma59307.
CONCATENATE 'D:\GOS\' i_connections_rec-descript '.' i_connections_rec-docuclass INTO path .
CONCATENATE i_connections_rec-descript '.' i_connections_rec-docuclass INTO comp_id .
CALL FUNCTION 'SO_OBJECT_DOWNLOAD'
EXPORTING
default_filename = comp_id
filetype = 'BIN'
path_and_file = path
extct = 'K'
no_dialog = 'X'
TABLES
objcont = objcont.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Endloop.
Thanks & Regards,
Abhijit