07-17-2008 3:25 PM
We have a request from users to shorten the number of clicks needed to get to a Note or Attachment attached to an Invoice (and to know whether or not these files exist).
We use ArchiveLink/HTTP Content Server to store all attachments in an external repository.
We capture and store an image of the original invoice.
We allow the user to create a Note.
We also allow additional files to be attached.
Users access Attachments today via the GOS menu that is available from a button on SAP screens like:
SBWP
ZWFL
FB03
FBL1N
From the GOS menu, they can select "List Attachments" and then from the GOS attachment list, they can launch and view the attachments. The Invoice, Note and other attachments all show up in this list. The main invoice file and Note are always named in a way that they can be easily identified.
There will always be a scanned invoice image in the list. But there may or may not be a Note or an additional attachment.
Users have requested that two buttons be added to the toolbar on those screens, one related to Notes, and the second button related to attachments other than main Invoice and Note.
The Note button would only appear when a Note existed. Similarly, the second general attachment button would appear when an attachment other than the Invoice or Note had already been added.
Clicking on the Note button would launch the Note.
Clicking on the Attachment button would launch the standard GOS attachment List dialog (or if that can't be done, a dialog with the list of other attachments -- clicking on items in the list would launch those files).
The main shortcut for the user is that if there is no Note or extra attachment file, the user need not bring up the GOS attachment list -- they'll see immediately that there is no need to.
1. Any suggestions of possible code samples of something similar?
2. Is it possible to interact with GOS to programatically get the attachment list to check which attachments are in the list?
3. Can the Note be launched programatically?
4. Can the GOS attachment list dialog be launched programatically?
5. Where is the best source of information for how to interact with the toolbar (adding buttons) for the screens listed above?
Thanks for your full or partial assistance with this!
(Credit will be given for help...)
07-17-2008 4:24 PM
Please find some sample code i have done for your queries
For Point No 2.
i_object-typeid = 'KNA1'. " Find corresponding object name
i_object-catid = 'BO'. " Find corresponding object type
i_object-instid = docno.
refresh : i_brel, i_link.
* Get Attachment List
append 'ATTA' to i_brel. " For Note if think its NOTE
if not i_brel is initial.
select *
from srgbtbrel
appending corresponding fields of table i_link
for all entries in i_brel
where
instid_a eq i_object-instid and
typeid_a eq i_object-typeid and
catid_a eq i_object-catid and
reltype eq i_brel-reltype.
endif.
wa_filter-send_info = 'X'.
wa_filter-no_content = 'X'.
loop at i_link into ls_link.
clear : wa_doc_data.
wa_fol_cont-doc_id = ls_link-instid_b.
call function 'SO_DOCUMENT_READ_API1'
exporting
document_id = wa_fol_cont-doc_id
filter = wa_filter
importing
document_data = wa_doc_data
exceptions
document_id_not_exist = 1
operation_no_authorization = 2
others = 3.
if sy-subrc eq 0 and not wa_doc_data is initial.
v_attno = v_attno + 1.
endif.
endloop.
For point No 3 & 4
if v_attno ge 1.
* Object creation of GOS View
create object gos_view
exporting
ip_mode = 'D'. " Display Mode
* Start GOS Service for attachement view
i_viewobj-objtype = 'KNA1'.
i_viewobj-objkey = docno.
call method gos_view->start_service_direct
exporting
ip_service = 'VIEW_ATTA' " Find service type NOTE
is_object = i_viewobj.
endif.
For point no 5.
Find some PBO userexit or enhancements points/spot in your transaction and add your code.
a®
07-17-2008 9:18 PM