Saving GOS attachment
hi,
Our client is using 4.6c system.
I want to download PO attachment with GOS functionality. I tried using FM BDS_GOS_CONNECTIONS_GET in 4.6c system. But this FM is not present in 4.6c System. Is there any other way of downloading PO attachment without using above Fm.
Thanks
Hi,
Please use the below code to get attachment from GOS for Pur Order .
w_bo_id = w_ebeln.
lo_is_object_a-instid = w_bo_id.
lo_is_object_a-typeid = ' '. "Please find the BOR for Por Order Using Trace
lo_is_object_a-catid = 'BO'.
wa_rel-sign = 'I'.
wa_rel-option = 'EQ'.
wa_rel-low = 'ATTA'.
APPEND wa_rel TO t_rel.
CALL METHOD cl_binary_relation=>read_links
EXPORTING
is_object = lo_is_object_a
it_relation_options = t_rel
IMPORTING
et_links = t_links.
LOOP AT t_links INTO wa_links WHERE typeid_b = 'MESSAGE'.
CLEAR : w_doc_name,w_doc_type,t_content.
MOVE wa_links-instid_b TO wa_document_id.
CALL FUNCTION 'SO_DOCUMENT_READ_API1'
EXPORTING
document_id = wa_document_id
TABLES
object_header = t_header
contents_hex = t_content
EXCEPTIONS
document_id_not_exist = 1
operation_no_authorization = 2
x_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Similar Messages
-
Services for Object (GOS) Attachement List not showing after attachment
Hi All,
I have created a new entry for the Generic Object Service List and this links to a copy of the CL_GOS_SRV_ATTACHMENT_CREATE class (Create attachment) with some additional logic. However, after attaching a file, the "Attachment List" does not become available until after I re-enter the transaction. The attachment list is showing the correct attachments.
After some (understatement...) investigation, I found that even if I try and link the new service to a unchanged copy of the CL_GOS_SRV_ATTACHMENT_CREATE service in SGOSATTR, it is not working. It is attaching fine, but the "Attachment List" entry in the Services for Object Menu is still greyed out. If I attach the original class CL_GOS_SRV_ATTACHMENT_CREATE to the newly created entry it works fine. e.g. straight after I attach a file to the transaction, the menu entry becomes available.
I can't find where the re-draw of the GOS menu happens and hence can not determine what is going wrong. Does anybody know if this is part of the Kernel or is this actually done in ABAP ?
Am I missing something ? Debugging including system debugging for two days now and can't find it... very frustrating.
Any help would be appreciated.
Thanks,
Wouter.Hi Wouter,
I had originally posted to ask if you had resolved this since I was facing the same issue, but then deleted my post when I was able to get it working. Sorry, I didn't mean to initiate a flurry of activity in such an old thread.
My scenario is I created a new GOS service entry in table SGOSATTR using transaction SGOSM. My new service uploads attachments to an external document management system via a call to a RESTful web service. The class I use in the SGOSM entry is a custom subclass of CL_GOS_SRV_URL_CREATE.
I resolved this issue by taking a look at what CL_GOS_SRV_URL_CREATE does in its EXECUTE method. The key bits to refresh the GOS Attachment List with the new attachment are...
raise event commit_required. " if SGOSM has the commit flag checked
raise event service_succeeded
exporting eo_service = me.
These events tell any subscribers to go do their thing-- which in this case includes a refresh of the GOS Attachment List. So in the EXECUTE method of my custom subclass, after I call function BINARY_RELATION_CREATE, I raise these events...
CALL FUNCTION 'BINARY_RELATION_CREATE'
EXPORTING
obj_rolea = gs_object
obj_roleb = rel_doc
relationtype = 'URL'
EXCEPTIONS
OTHERS = 1.
CASE sy-subrc.
WHEN 0.
MESSAGE s043(sgos_msg). " The attachment was successfully created
RAISE EVENT commit_required.
RAISE EVENT service_succeeded
EXPORTING eo_service = me.
WHEN OTHERS.
MESSAGE s042(sgos_msg). " The attachment has not been created
ENDCASE.
I hope this is helpful to you even though your initial implementation was a while back. Thanks for replying to my question though!!
Cheers,
Amy -
How to transfer GOS attachment to my work item
Hi Friends,
I have the following requirement. The user while creating a Appropriation request in tcode IMA1N will create an attachment using Generic Object Services(GOS). once he saves my workflow will trigger and it will go to approval. I need to show the attachment created using GOS in my Work item. How to achieve this. Please advice.I have some annotations:
The object type ARCHIVE is for archived Data Files from the DataArchiving. The object type for ArchiveLink documents is IMAGE
The default method is .Display to display the document.
The GOS-Attachment is not a SAP ArchiveLink document. This attachment is stored in SOOD and linked via the GOS-relationship table SRGBTBREL
The business object, that can be used here is: SOFM
The object instance needs to be found with a custom self-made background method, to find the correct link and create an object instance.
After that, this instance can be used as a secondary method in the work item's execution or attached to the ADHOCOBJECTS as already mentioned here.
Good luck,
Florin
P.S.: Similar reply cross-posted to SAP-WUG -
Transfer GOS Attachment (Single/Multiple) from custom program to XK01
Hi,
GOS - Generic Object Service is a way one can attach single / multiple attachment. I have a custom program where there is a GOS with some attachment (used CL_GOS_MANAGER class).
Next I need to send / transfer this GOS attachment from my custom program to say a standard transaction , eg XK01.
Whether we can achieve this functionality, ie. we are able to create/save attachment but is there a way to send attachment (not via email) such that the same attach itself to the GOS of the standard transaction. I don't see any method in the CL_GOS_MANAGER class by which we can achieve this!
Any suggestion/solution will be highly appreciated!
Thanks,
DebHi,
I am trying to send attachment linked to a custom BO to standard BO eg, LFA1 using 'GOS_SERV_TOOLS_TEST' (copy_linked_objects).
Surprisingly, I am able to copy/send attachment list within same BO (LFA1) from one LIFNR to another LIFNR. But the same method does not work when I try to copy attachment between diff BO example from VENDOR BO to MATERIAL BO. Why is it so?
Also it does not work between a custom BO & standard BO. Please suggest in case I am missing on anything!
Thank,
Deb -
Hi
I understood GOS attachment(Contents of PC attachment ) file is stored in SAP table SOFFCONT1 and SOC3.
But i could not understand how GOS attachment can be stored using Kpro to external server.
SAP note explains documents are stored using Kpro. how the Kpro setting is done to save the attachment in external server.
I referred sdn forums and SAP help. but no body explains about how kpro is linked with GOS attachment.
Pls shed light on this.
Regards
ckumarthanks..found its linked with Bussiness workplace..thanks
-
Hi All,
I am developing a program to retrieve the GOS attachment from PO attachment and send to the vendor through email. Kindly advise me to resolve this problem because I have no idea how to retrieve the attachment from the GOS table.
Many thanks and best regards,
Ting Wei HongHi,
There is a class CL_GOS_MANAGER. Use that.
See here for an example:
data: o_gos type ref to cl_gos_manager.
data: o_att type ref to cl_gos_attachments.
data: ls_borident type borident.
ls_borident-objkey = gs_data-vgbel.
ls_borident-objtype = zcl_word=>co_busobject_worddocument.
free o_gos.
create object o_gos
exporting
ip_no_commit = space.
call method o_gos->start_service_direct
exporting
ip_service = 'VIEW_ATTA'
is_object = ls_borident
exceptions
no_object = 1
object_invalid = 2
execution_failed = 3
others = 4.
if sy-subrc <> 0.
message 'Geen bijlagen aanwezig. Toolbox wordt getoond' type 'S'.
o_gos->display_toolbox( is_object = ls_borident ).
else.
message 'Bijlagen aangepast' type 'S'.
endif. -
Hallo Gurus,
I need Your help!
Is it possible to use a Gos attachment in a Module Pool?
I have an image on material master data, and I would like to show it on a dynpro (for example with cl_gui_picture).
I have read the attachment with function SO_DOCUMENT_READ_API1 but then I don't know how to use the result.
Can anybody help me?
Thank you very much indeed!try
CALL FUNCTION 'SO_DOCUMENT_READ_API1
EXPORTING
DOCUMENT_ID = <doc>
FILTER = FILTER
IMPORTING
DOCUMENT_DATA = <DOCUMENT_DATA>
TABLES
OBJECT_HEADER = OBJECT_HEADER
OBJECT_CONTENT = OBJECT_CONTENT
* OBJECT_PARA =
* OBJECT_PARB =
* ATTACHMENT_LIST =
* RECEIVER_LIST =
CONTENTS_HEX = CONTENTS_HEX
EXCEPTIONS
DOCUMENT_ID_NOT_EXIST = 1
OPERATION_NO_AUTHORIZATION = 2
X_ERROR = 3
OTHERS = 4 -
Hi Experts,
I'm not ABAPer at all. Here are only my suppositions and please do not judge me strictly.
I need to upload PDF file as a GOS attachment to the QM notification from external system (SAP MII) using RFC. As I found out there is no remote-enabled FM for this. There is only SGOS_NOTE_CREATE for notes. I investigated it and found out that all FM's that are used inside it are remote-enabled.
Question: is it possible to call from my external system same 3 FMs as in SGOS_NOTE_CREATE (SO_FOLDER_ROOT_ID_GET, SO_OBJECT_INSERT, BINARY_RELATION_CREATE_COMMIT) to create attachment instead of note? I guess that in general i need to provide SO_OBJECT_INSERT with some other parameters than it is done in SGOS_NOTE_CREATE, so it will create attachment-object instead of note-object in SAPoffice. Is this way possible, or there should be more steps to create attachment?
thanks in advace,
PetrHi,
In the above code what is is_object and attachment parameters corresponds to. What are the values needs to used in this parameters.
data: l_object_id_loio type SDOKOBJECT,
l_object_id_phio type SDOKOBJECT.
call function 'SO_LOIO_PHIO_CREATE'
importing
loio_object = l_object_id_loio
phio_object = l_object_id_phio
exceptions
kpro_model_error = 103
x_error = 1000
others = 1000
call function 'SO_KPRO_DATA_INTO_OBJCONT_PUT'
exporting
loio_object = l_object_id_loio
tables
* CONTEXT =
objcont = i_objcont.
x_obj_data-file_ext = 'HTM'.
x_obj_data-OBJPRI = '5'.
x_obj_data-extct = 'K'.
x_obj_data-objla = sy-langu.
x_obj_data-objdes = '000004280212022400687486'. "wa_attach-filename.
x_obj_data-objlen = LINES( i_bin_data ) * 255. "i_soli_size. 000000007319
CONDENSE x_obj_data-objlen.
CONCATENATE '&SO_FILENAME=' '000004280212022400687486.htm' INTO x_objhead. "wa_attach-filename INTO wa_content.
APPEND x_objhead TO i_objhead.
x_objhead = '&SO_FORMAT=BIN' .
APPEND x_objhead TO i_objhead.
CALL FUNCTION 'SO_OBJECT_INSERT'
EXPORTING
folder_id = l_fol_id
object_hd_change = x_obj_data
object_type = 'EXT'
owner = sy-uname
IMPORTING
object_id = x_object_id
TABLES
objcont = i_objcont "&SO_KProObjectID=SOFFLOIO E2870D61F569E7F186CB0013216A31DB
objhead = i_objhead "&SO_FILENAME=000227964812102400687486.htm &SO_FORMAT=BIN
EXCEPTIONS
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
dl_name_exist = 4
folder_not_exist = 5
folder_no_authorization = 6
object_type_not_exist = 7
operation_no_authorization = 8
owner_not_exist = 9
parameter_error = 10
substitute_not_active = 11
substitute_not_defined = 12
system_failure = 13
x_error = 14
OTHERS = 15.
IF sy-subrc = 0 AND x_object-objkey IS NOT INITIAL.
x_folmem_k-foltp = l_fol_id-objtp.
x_folmem_k-folyr = l_fol_id-objyr.
x_folmem_k-folno = l_fol_id-objno.
x_folmem_k-doctp = x_object_id-objtp.
x_folmem_k-docyr = x_object_id-objyr.
x_folmem_k-docno = x_object_id-objno.
l_ep_note = x_folmem_k.
x_note-objtype = 'BKPF'. "c_message.
x_note-objkey = l_ep_note.
CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
EXPORTING
obj_rolea = x_object
obj_roleb = x_note
relationtype = 'ATTA'
EXCEPTIONS
OTHERS = 1.
I am using this code for attaching a .HTM external file automatically to a invoice document. But unable to attach it.
Can you please help.
Regards,
Rafi -
Hi
is there any standard bapis or RFcs are available to export GOS attachment from R/3 to external systemsv. the attachement will be exist in qm02 transaction . if in case of n attachment i have to upload latest one .hi reddy,
Welcome to SDN forum.
use function module
<b>BDS_GOS_CONNECTIONS_GET</b>
to get the GOS attachment list
Refer this link
/people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background
Reward with points for helpful answers.
Cheers
Alfred -
Every time my lg g pad 8.3 lte tablet is turned off it reverts the saving email attachment back to internal storage. Every time I turn on, I change it back to save to SD card. It stays that way until it is turned off for more than a minute. If I do a restart, it holds the setting, but loses it when it is shut down for any period of time. Does anyone else have this issue? The setting holds for photos taken with camera storing to SD card. Only the email attachment setting does not hold.
I believe that system has a hall sensor on it to detect when the lid is closed so it can put the system to sleep and/or disable the monitor so it can be used with an external monitor only. If the sensor is marginal or has a bad cable, it may intermittently cut the monitor on and off, and may likewise put the system to sleep. One way to check would be to plug in an external monitor and if the laptop's screen cuts off or doesn't show up, start using the trackpad and press on a non-typing key like the shift key. If the external display suddenly pops and becomes active while the laptop display remains black, it's probably a problem with the sensor or the cable/connection. You might be able to fool the sensor into kicking on and off by moving a magnet over it. It's located on the left had side of the base with the unit opened up, and right over the audio output plug.
I know of some people that put a small magnet right over the hall sensor's location so the laptop display turns off and they use the system with an external monitor, keyboard, and mouse. If fooling with magnets, make sure they're small and don't get them close to the hard drive because a strong magnet can wipe them out.
I don't know if this will help you much, but it might. -
How to enhance the GOS attachment list
Hi,
I'd like to enhance the standard GOS attachment list as follows:
- when archiving a new document (archive link) to write additional text into a z-table --> this I managed already
- in the display of the attachment list, besides the standard fields display also additional fields (from the z-table) --> this is a new requested feature
- add a new button with functionality (besides the already known change, delete, filter, etc. buttons) --> this is also a new requested feature
I tried already some BADIs, but it seems that they are not really working.
So, if someone could support in this case, it would be highly appreciated:
a) read additional info and display it in the GOS ALV
b) put additional functions / icons on the ALV
The SAP release I'm working on is ECC 6.0
kr,
AndreasHi Anderas,
There is a class for GOS attachment list. CL_GOS_ATTACHMENTS
go to se24 and checkout this class. There are various methods. As per my knowledge you can make enhancement implementations in method SET_TOOLBAR rto fullfill your requirement.
By debugging check out for other methods which can suite your requirement.
Regards
Sachin. -
GOS attachment list could not open office 2007 docs
HI All,
My client environment is still uses office 2003.
but documents attached to the financial accounting documents may have office 2007 files attached.
when we try to open these docs we get an error.
Is there any OSS note available for the same?
it is in GOS services.Office 2007 changed their file structure. Files are now saved as .docx for word files. Old style was just .doc. Open the document on your PC, choose FILE-> SAVE AS-> 97-2003 document. This will save it with the .doc extension. Then transfer to your BlackBerry. Same for Excel and Powerpoint as well.
-
Guys, looking for your help.
My issue is, we have a Custom Transaction for PR. We have implemented the GOS functionality for the screen.
We are able to attach documents and save the same to KPRO ( SAP Office).
Documents are fine and sitting pretty there.
Problem is when i leave the transaction and comeback again to the same document, the 'Attachment list' link in the GOS menu is grayed out. where in the attachments are saved in the Content repository.
Any solution to this issue would be highly appreciated.
Thanks
Vinodh BalakrishnanHi,
I think you are using OO for this functionality. then
select * from sgosattr where name ne 'VIEW_ATTA'
and name ne 'PCATTA_CREA'.
i_service-sign = 'E'.
i_service-option = c_eq.
i_service-low = sgosattr-name.
append i_service to i_services.
endselect.
* then call gos manager
if v_tmode eq 'C'. " Create or Change Mode
i_borident-objtype = 'Y_ATTA'.
i_borident-objkey = yhdr-docno.
create object gos_manager
exporting
is_object = i_borident
it_service_selection = i_services
ip_no_commit = ' '
exceptions
object_invalid = 1.
else. " Display Mode
i_borident-objtype = 'Y_ATTA'.
i_borident-objkey = yhdr-docno.
create object gos_manager
exporting
is_object = i_borident
it_service_selection = i_services
ip_mode = 'D'
exceptions
object_invalid = 1.
endif.
aRs -
Disable 'Delete' button for posted invoices in GOS Attachment List
Hi,
when i open the attachement list of a generic object i see the attached files. In this dialog i want to disable the "Delete" ( attachment) button for Posted invoices ( In MIR4 tcode -> If the invoice is already posted it should not allow to delete the attachment )
I read oss notes and some ides of copying diverse classes but nothing really helps.
I found two badis
GOS_SRV_REQUEST
GOS_SRV_SELECT
but i dont know where we have to write our code .
I read so many posts related to attachments but all the places described about authoriztion object .
Can you please give some ideas to disable the delete button for posted invoices.Hello,
For GOS there is no SAP Standard authorization concept. The only way to
manage GOS authorizations is implementing it via custom code as
described in SAP Note: 491271.
Please have a look at the SAP notes:
491271 Authorizations for generic object services
701609 Authorizations for services: Final classes
For the use of S_OC_ROLE: this object states if a user is an office
administrator he can create, modify or delete every document, even
those created by other users. If the user is not an office admin, the
user is still able to create his own attachments.
Regarding to the issue, there is an role object S_GUI for upload.
To match your inquiry, pleaes find the user's role and active the
object S_GUI.
Regards,
David -
Issue with retrieving GOS attachment
Hi,
My requirement is to create a Web service to retrieve the contents of an attachment which was uploaded via GOS.toolbar in Purchase Requisition. I am able to retrieve the list of attachments and get the content of the particular attachment, but after I save the file to my PC I am unable to open the file. It seems to be corrupt.
Following is the logic I have used:
1. Call BDS_GOS_CONNECTIONS_GET with CLASSNAME = 'BUS2105' and objkey = <PR Number>. I am able to retrieve the list of attachments in gos_connections.
2. Then call SO_DOCUMENT_READ_API1 to read the contents_hex into LT_HEX_CONT.
3. Convert the table contents into Binary string LV_BINFILE using the folowing code
CLEAR lv_binfile.
LOOP AT lt_hex_cont INTO ls_hex_cont.
ASSIGN ls_hex_cont TO <p> CASTING.
CONCATENATE lv_binfile <p> INTO lv_binfile IN BYTE MODE.
ENDLOOP.
4.return the contents of the lv_binfile as the export parameter for the FM
The Java program that consumes the web service downloads the contents to a file on the PC, but we are unable to open the file.
I tried the following also:
1. Call BDS_GOS_CONNECTIONS_GET with CLASSNAME = 'BUS2105' and objkey = <PR Number>. I am able to retrieve the list of attachments in gos_connections.
2. Then call SO_DOCUMENT_READ_API1 to read the OBJECT_CONTENT and download to PC using GUI_DOWNLOAD in ASC mode. Still the same issue.
One thing I noticed is that the size of the actual file is 103kb, whereas the downloaded file is about 208kb.
Not sure where I went wrong. Pls help
Regds
ThiruHi Thiru,
from
http://wiki.scn.sap.com/wiki/display/ABAP/Reading+PDF+attachment+from+sap+inbox+through+ABAP?original_fqdn=wiki.sdn.sap.com
I've got one idea to use fm SCMS_BINARY_TO_XSTRING for xstring creation. But the parameter input_length is needed.
Maybe you can get it from fm SO_DOCUMENT_READ_API1 in table ATTACHMENT_LIST.
Please try that.
Regards,
Klaus
Maybe you are looking for
-
How do I add or delete photos from a SMART collection?
In LR3 I recently created a Smart Collection from color flagged photos. Now I want to add a few, and delete a few. How?? The obvious method are not allowed with SMART Collections..... Thanks for any input -
-
Getting WorkManager scheduleWork() to throw WorkRejected ?
I'm writing a socket server to service persistent inbound TCP sockets. I would like scheduleWork() to throw an exception if no threads are available to service the work object parameter. There is an application scoped work manager with a ma
-
ThinkVanta​ge Active Protection System will not install
Hi, Every time I try to install ThinkVantage Active Protection System, I get this error on the setup "This installation package is not supported by this processor type." My processor is an Intel T3400. Thanks, Daniel
-
RecordSelectionFormula is not working
<p>Hello,</p><p>I have developed an application in VS 2005. I have developed some reports with CR XI R2 and I am calling these reports from within my application. I am using Report Document Object Model of CR. </p><p>My problem is that when I try to
-
How can I use my gift card to purchase? It says i already redeemed it but I haven't used the money in it.