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: 

GOS : How to check if there any attachment exists

Former Member
0 Kudos

i'am reading the question :

i have the same problem : "How to check if there any attachment exists "

I use the class cl_gos_attachment_list to display

all attachments file to an object; it's ok, _but i want only to know if exist any attachments file for an object whithout display

sombody speak about te class GOS_ATTACHMENT_QUERY

but we are in SAP 46C2.

somebody knows another way to check if exist any attachment without display ?

could you help me ?

Fred.

1 ACCEPTED SOLUTION

Jelena
Active Contributor
0 Kudos

Try BIN_REL_OF_ROLES_GET - it is used inside BINARY_RELATION_CREATE to check if binary relation exists already, it seems. You might want to read more on [attachment creation using GOS|http://friendlyabaper.blogspot.com/2008/07/oh-my-gos.html] and then work from there in kind of a reverse order.

3 REPLIES 3

Jelena
Active Contributor
0 Kudos

Try BIN_REL_OF_ROLES_GET - it is used inside BINARY_RELATION_CREATE to check if binary relation exists already, it seems. You might want to read more on [attachment creation using GOS|http://friendlyabaper.blogspot.com/2008/07/oh-my-gos.html] and then work from there in kind of a reverse order.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

At my previous company, we were doing this to check to see if there are any attachments.

data: xborident TYPE  BORIDENT
  data: documents type standard table of neighbor.

  xborident.

* check if there are any attachments
  refresh documents.
  call function 'SREL_GET_NEXT_NEIGHBORS'
       exporting
            object       = xborident
            roletype     = 'APPLOBJ'
            relationtype = 'ATTA'
       tables
            neighbors    = documents.

  if documents[] is initial.
* then there are no attachments!!!
  endif.

Regards,

Rich Heilman

0 Kudos

Thanks a lot ; i try with the MF 'SREL_GET_NEXT_NEIGHBORS'

it's ok.

do you know where is the link between the object ( WORKORDER or MATERIAL for example) and the object id FOLxxxx and where are store the attachments files ; in wich table ?

Thank you very much for your answer

Fred