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: 

Attachment List

Former Member
0 Kudos

Hi everyone,

I have to add a pushbutton on a QM notification screen, to hilight wether or not attachments are available for notification header / tasks. The pushbutton and the attachment list are no problem but I need to check first if any attachments are available for the notification. I tried to use the method Check_Available of cl_gos_attachment_list but this always seems to return 'X' as result. Does anyone have another solution or tell me where I can find the sap table in which the attachments are stored ?

You'd make a desperate man very happy !

Thanks in advance for you answers...

Cheers

Christof Desmet.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Christof,

It's just like Raja said. I will just complete the code a bit more with an example of mine:

  CALL METHOD cl_gos_attachment_query=>count_for_object
    EXPORTING
      is_object = object
      ip_arl    = space
    RECEIVING
      rt_stat   = lt_stat.

  READ TABLE lt_stat INDEX 1 into ls_stat.
  count = ls_stat-counter.

The object has to be a concatenation of your document, like this:

    CONCATENATE object-instid tab-gjahr INTO object-instid.
  ELSE.
    CONCATENATE tab-bukrs tab-belnr tab-gjahr INTO
    object-instid.
  ENDIF.

  MOVE 'BKPF' TO object-typeid.
  MOVE 'BO' TO object-catid.

I hope this helped.

Regards,

Nuno

6 REPLIES 6

Former Member
0 Kudos

Hi Desmet,

The class you had used is marked obsolete.

Did you try the class CL_ATTACHMENT_LIST ?

You can even try method READ_ATTACHMENT of class CL_HRRCF_ATTACHMENTS.

Regards,

Raj

Message was edited by: Rajasekhar Dinavahi

athavanraja
Active Contributor
0 Kudos

welcome to SDN.

you can use

CL_GOS_ATTACHMENT_QUERY=>COUNT_FOR_OBJECT

and pass

is_object-instid = "key of the object"

is_object-typeid = "class"

is_object-catid = "BO"

Regards

Raja

0 Kudos

Hello Raja, thanks for your help. The method works perfectly !!

0 Kudos

Friends,

We have a custom Transaction for which we have activated the GOS icon on the screen. We have that icon and we care able to save the document to the Content repository fine.

The issue is immediately after attaching the documents, if you use the

" Attachment list" option from the GOS menu, it brings the attached documents.

But if you leave the transaction and get in for the same document, the same function is not working.

Kindly pl throw in your ideas on this issue.

Thanks

Vinodh Balakrishnan

Former Member
0 Kudos

Hello Christof,

It's just like Raja said. I will just complete the code a bit more with an example of mine:

  CALL METHOD cl_gos_attachment_query=>count_for_object
    EXPORTING
      is_object = object
      ip_arl    = space
    RECEIVING
      rt_stat   = lt_stat.

  READ TABLE lt_stat INDEX 1 into ls_stat.
  count = ls_stat-counter.

The object has to be a concatenation of your document, like this:

    CONCATENATE object-instid tab-gjahr INTO object-instid.
  ELSE.
    CONCATENATE tab-bukrs tab-belnr tab-gjahr INTO
    object-instid.
  ENDIF.

  MOVE 'BKPF' TO object-typeid.
  MOVE 'BO' TO object-catid.

I hope this helped.

Regards,

Nuno

0 Kudos

Nuno, thanks for your help. It works great !!!!