Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem extracting attachments from object services

former_member242512
Participant
0 Kudos
385

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

2 REPLIES 2

nabheetscn
Active Contributor
0 Kudos
139

Did you check TOA01/TOA02/TOA03 tables for the same

Nabheet

Abhijit74
Active Contributor
0 Kudos
139

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