2007 Feb 26 8:07 PM
Hi,
I am deleting a GOS attachment using following code.
data: i_borident type borident,
i_attsrv type ref to cl_gos_document_service.
i_objectd-objtype = 'YATTA'.
i_objectd-logsys = 'BO'.
i_objectd-objkey = inumber.
select * from srgbtbrel " Get GOS Link
into table i_srgbtbrel
where instid_a eq i_objectd-objkey
and typeid_a eq i_objectd-objtype
and catid_a eq i_objectd-logsys
and reltype eq 'ATTA'.
if sy-subrc eq 0.
create object i_attsrv.
loop at i_srgbtbrel.
i_borident-objkey = i_srgbtbrel-instid_b.
call method i_attsrv->delete_attachment
exporting
* is_object = i_objectd
ip_attachment = i_borident-objkey.
commit work.
endloop.
endif.
I am getting proper binary key from table SRGBTBREL and passing to method DELETE_ATTACHMENT , and getting sy-subrc eq 0, then also attachment are showing in the document. But if you are going thru service object delete it has been deleting the attachment perfectly. What is the error in the code?
Thanks
aRs
Message was edited by:
aRs
Hi,
I am deleting a GOS attachment using following code.
data: i_borident type borident,
i_attsrv type ref to cl_gos_document_service.
i_objectd-objtype = 'YATTA'.
i_objectd-logsys = 'BO'.
i_objectd-objkey = inumber.
select * from srgbtbrel " Get GOS Link
into table i_srgbtbrel
where instid_a eq i_objectd-objkey
and typeid_a eq i_objectd-objtype
and catid_a eq i_objectd-logsys
and reltype eq 'ATTA'.
if sy-subrc eq 0.
create object i_attsrv.
loop at i_srgbtbrel.
i_borident-objkey = i_srgbtbrel-instid_b.
call method i_attsrv->delete_attachment
exporting
* is_object = i_objectd
ip_attachment = i_borident-objkey.
commit work.
endloop.
endif.
I am getting proper binary key from table SRGBTBREL and passing to method DELETE_ATTACHMENT , and getting sy-subrc eq 0, then also attachment are showing in the document. But if you are going thru service object delete it has been deleting the attachment perfectly. What is the error in the code?
Thanks
aRs
Message was edited by:
aRs
2007 Feb 26 8:10 PM
2007 Feb 26 8:20 PM
Rich,
Here is_object is optional , we have to pass only the folder key(binary key) (ie ip_attachment)
call method i_attsrv->delete_attachment
exporting
* is_object = i_objectd
ip_attachment = i_borident-objkey.
Thanks
aRs
2010 Jan 13 9:18 AM
Hi
If you want to delete attached file....
This Program is needed to add Class Method input parameter value
Example) Refer to Following Souce Code...
................
LOOP AT i_srgbtbrel.
CALL METHOD i_attsrv->delete_attachment
EXPORTING
is_object = i_borident
ip_attachment = i_srgbtbrel-instid_b.
................
ENDLOOP.
Good Luck.
2015 Jan 22 8:37 AM
Hi.
You are missing SO_OBJECT_DELETE_IN_VB:
...
data ls_folder_id type soodk.
data ls_object_id type soodk.
loop at i_srgbtbrel.
i_borident-objkey = i_srgbtbrel-instid_b.
call method i_attsrv->delete_attachment
exporting
* is_object = i_objectd
ip_attachment = i_borident-objkey.
ls_folder_id = i_borident-objkey(17).
ls_object_id = i_borident-objkey+17(17).
call function 'SO_OBJECT_DELETE_IN_VB'
in update task
exporting
folder_id = ls_folder_id
object_id = ls_object_id.
endloop.
commit work and wait.
At the end of cl_gos_document_service->delete_attachment, there is the line:
call function 'GOS_ADD_KEY' exporting ip_objkey = ip_attachment.
This function adds the deleted item to table gt_obj_to_delete.
Later, the standard makes the call to SO_OBJECT_DELETE_IN_VB at include LSGOSITSF01, form DELETE_OBJECTS using gt_obj_to_delete.
Thanks.
2019 Sep 19 5:31 AM
Hi, how were you able to solve this issue, since we have the same requirement.
2019 Sep 19 6:16 AM
You can find the sample code to delete GOS files here: https://github.com/keremkoseoglu/ABAP-Library/blob/master/zcl_bc_gos_toolkit.abap . This class also includes many further utilities regarding GOS.
2020 Oct 27 9:56 AM
Resource has moved to: https://github.com/keremkoseoglu/ABAP-Library/blob/master/document/zcl_bc_gos_toolkit.abap
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |