You are on page 1of 5

6/20/2016 HowtoDownloadArchivedandNonArchivedGOSattachmentsintoyourPC(attachmentsfromGenericObjectServices(GOS)Documentum)Sap4

SAP 4 ALL

Home

ABAP

Webdynpro/Workow

SAPUI5/FIORI

HANA

Daily Sap Jobs

SAP

How to Download Archived and Non-Archived GOS


attachments into your PC (attachments from
Generic Object Services (GOS) Documentum)
WEDNESDAY, 15 JUNE 2016

Adsby Google

ERPSap SapNotes SapABAPDownloadPC

AttachingfilestodocumentumusingGOSservicescanhavetwowayseithermanualor
automatic(earlyorlatearchival).RecentlyIcameacrosssomerequirementwheremy
customerwantedtodownloadtheattachmentsofaninvoiceforauditingpurpose.Thisis
somethingveryrareandyouwouldnotfindastraightawaysolutionforit.
Inmyrequirementtheinvoicedocumentcouldhavebotharchivedandnonarchivedfiles
whichwasneededtobedownloaded.HereishowIachievedit.
NonArchived/ManuallyattachedFiles
*LocalDataDeclartions
DATAl_i_relTYPEobl_t_relt.
DATAl_wa_relTYPEobl_s_relt.
DATAl_wa_objectTYPEsibflporb.
DATAl_v_sysTYPElogsys.
DATAl_i_linksTYPEobl_t_link.
DATAl_v_documntTYPEso_entryid.
DATAl_wa_document_dataTYPEsofolenti1.
DATAl_i_headerTYPESTANDARDTABLEOFsolisti1.
DATAl_wa_textTYPEtext200.
DATAl_v_filenamTYPEcacl_string.
DATAl_v_filetypTYPEsychar10.
DATAl_v_varTYPEcacl_string.
DATAl_v_sortfiTYPEsychar30.
DATAl_wa_documntidTYPEsofmk.
DATAl_i_contentTYPEswftlisti1.
DATAl_v_extctTYPEso_extct.
DATAl_v_doc_sizTYPEso_doc_len.
DATAl_v_flenameTYPEcacl_string.
DATA:l_i_tbl1024TYPESTANDARDTABLEOFtbl1024,
l_i_toa02TYPESTANDARDTABLEOFtoa02,
l_v_lengthTYPEsyindex,

POPULAR POSTS

IDOC Step-by-Step OUTBOUND


process
TO Process IDOCS the following
TCODES will be used. On both sides:
Logical System Names SALE Setup RFC
destinations SM59 Por...

IDOC Step-by-Step INBOUND


process

l_v_archived_filenameTYPEsychar132.

Continue from outbound process... In


Client 812 Steps: Function Module
Creation: Create a Function Module to
update the tabl...

FIELDSYMBOLS:<l_fs_tab>TYPEtoa02."toav0.

Sap WorkFlow Step by Step

l_v_mimeTYPEsychar132,
l_cntTYPEbelnr_d,

https://saplatest.blogspot.com/2016/06/howtodownloadarchivedandnon.html

1/5

6/20/2016 HowtoDownloadArchivedandNonArchivedGOSattachmentsintoyourPC(attachmentsfromGenericObjectServices(GOS)Documentum)Sap4
FIELDSYMBOLS<l_fs_links>TYPEobl_s_link.
FIELDSYMBOLS<l_fs_header>TYPEsolisti1.
FIELDSYMBOLS<l_fs_content>TYPEsolisti1.

This document explains how to build a workow. On


execution of Transaction code SWDD you will enter
into the workow builder scree...

Processing IDOC through LSMW


CONSTANTSl_c_iTYPEddsignVALUE'I'.

The below steps explains on how to


transfer data from legacy system to SAP
via IDOC using LSMW tool. Step 1:
Tcode: LSMW. Click on s...

CONSTANTSl_c_eqTYPEddoptionVALUE'EQ'.
CONSTANTSl_c_attaTYPEoblreltypeVALUE'ATTA'.
CONSTANTSl_c_noteTYPEoblreltypeVALUE'NOTE'.
CONSTANTSl_c_dotTYPEsychar01VALUE'.'.

Batch Job (Background Job)


Debugging in SAP

CONSTANTSl_c_slasTYPEsychar01VALUE'\'.
CONSTANTSl_c_equTYPEsychar01VALUE'='.
CONSTANTSl_c_kTYPEso_extctVALUE'K'.
CONSTANTSl_c_undTYPEsychar01VALUE'_'.

At the very outset let me tell you guys


that as an Abaper (Rookie) the rst
object that you get to work on is to
debug a Batch job, Repo...

l_wa_relsign=l_c_i.

SQL Trace Analysis in SAP

l_wa_reloption=l_c_eq.

From the developers perspective, SQL


(Structured Query Language) trace helps
us to improve the overall performance of
the program by und...

l_wa_rellow=l_c_atta.
APPENDl_wa_relTOl_i_rel.
CLEARl_wa_rellow.
l_wa_rellow=l_c_note.

Workow Log Analysis in SAP

APPENDl_wa_relTOl_i_rel.

Analyzing a workow log place a very


important role especially when you are in
support project. Workow log analysis
helps us to nd t...

CLEARl_wa_rel.
l_wa_objectinstid=510000062009(YourObjectkeye.g.DocNo+DocYear).
l_wa_objecttypeid='BUS2081'(ForInvoiceDocument)

IDOC Status Codes and


Reprocess Reports

l_wa_objectcatid='BO'(Keepitasitis)
*DownloadNONARCHIVEDFiles.
TRY.
CALLMETHODcl_binary_relation=>read_links
EXPORTING

After the process of inbound function


module and outbound function module
the state of status will be recorded in the
status record of ID...

is_object=l_wa_object

Email Sending Functionality for


Different Business Process in
SAP

ip_logsys=l_v_sys
it_relation_options=l_i_rel
IMPORTING
et_links=l_i_links.
CATCHcx_obl_parameter_error
cx_obl_internal_error
cx_obl_model_error.
RAISEno_link_found.
ENDTRY.

TRY.

Introduction Every Business Process in


SAP Follow different communication
types to communicate with its Business partners like
Print an...

ABAP OOPS : Introduction and Concepts of


Object Oriented ABAP
What is Object Oriented ABAP and Concepts ? The main
feature of Object Oriented programming is representing
real-time objects in the ...

LOOPATl_i_linksASSIGNING<l_fs_links>.
MOVE<l_fs_links>instid_bTOl_v_documnt.
IFl_v_documntISNOTINITIAL.
CALLFUNCTION'SO_DOCUMENT_READ_API1'
EXPORTING

CATEGORIES
Abap

document_id=l_v_documnt

ABAP OOPS

IMPORTING

Abap Tips

document_data=l_wa_document_data

BADI

TABLES
object_header=l_i_header

BTE

EXCEPTIONS

Complete_ABAP

document_id_not_exist=1

GOS

operation_no_authorization=2

HANA

x_error=3
OTHERS=4.
IFsysubrc<>0.

IDOC
Jobs

RAISEno_link_found.

LSMW

ELSE.

Sap

SAPUI5/FIORI

CONCATENATEl_wa_document_dataobj_descrl_c_dot

https://saplatest.blogspot.com/2016/06/howtodownloadarchivedandnon.html

Smartforms

2/5

6/20/2016 HowtoDownloadArchivedandNonArchivedGOSattachmentsintoyourPC(attachmentsfromGenericObjectServices(GOS)Documentum)Sap4
l_wa_document_dataobj_type

Webdynpro/Workow

INTOl_v_filenam.

ENDIF.
MOVEl_wa_document_dataobj_typeTOl_v_filetyp.
READTABLEl_i_headerASSIGNING<l_fs_header>INDEX2.
IFsysubrcISINITIAL.

BLOG ARCHIVES
2016 (80)
June (20)
Parallel Cursor technique

ENDIF.

How to Download Archived and NonArchived GOS atta...

CONDENSEl_v_filetyp.

Index Tables to avoid BSEG fetching

l_wa_documntid=<l_fs_links>instid_b.

Debugging Skills

CONCATENATEl_wa_documntiddoctp

Print Functionality in HCM FPM Forms

SPLIT<l_fs_header>lineATl_c_equINTOl_v_varl_v_filetyp.

l_wa_documntiddocyr
l_wa_documntiddocnoINTOl_v_sortfi.

Fresher Dot Net Programmer


Workow Log Analysis in SAP

IMPORTobjcont_tabTOl_i_content
FROMDATABASEsoc3(dt)IDl_v_sortfi.
IFsysubrcISINITIAL.
READTABLEl_i_contentASSIGNING<l_fs_content>INDEX1.
IFsysubrcISINITIAL.
IF<l_fs_content>lineCP'KPro'
l_v_extct=l_c_k.
ELSE.
CLEARl_v_extct.

Difference between logical and physical


deletion o...
Payment Advice conguration and
activation for di...
Email Sending Functionality for Different
Business...
SQL Trace Analysis in SAP

ENDIF.

Pop-up Window Debugging in SAP

ENDIF.

Fresher Sap Abap Opening

ENDIF.
MOVEl_wa_document_datadoc_sizeTOl_v_doc_siz.
CALLFUNCTION'SO_OBJECT_DOWNLOAD'
EXPORTING
bin_filesize=l_v_doc_siz
filetype=l_v_filetyp
path_and_file=l_v_filenam
extct=l_v_extct

Freshers SAP ABAP Hiring


Batch Job (Background Job) Debugging in
SAP
SAP LSMW Events and Debugging
Sap WorkFlow Step by Step
Improve performance program sap abap

IMPORTING

Troubleshooting Tips & Tricks for


workow issues

act_filename=l_v_flename

Processing IDOC through LSMW

no_dialog=abap_true

TABLES
objcont=l_i_content
EXCEPTIONS
file_write_error=1

May (37)
April (23)

invalid_type=2
x_error=3
kpro_error=4
OTHERS=5.
IFsysubrc<>0.
RAISEno_link_found.
ENDIF.
ENDIF.
CLEAR:l_i_content,l_v_extct.
ENDLOOP.
CATCHcx_sy_conversion_no_number
cx_sy_conversion_overflow
cx_sy_move_cast_error
cx_sy_conversion_codepage
cx_sy_import_format_error
cx_sy_import_mismatch_error.
RAISEno_link_found.

https://saplatest.blogspot.com/2016/06/howtodownloadarchivedandnon.html

3/5

6/20/2016 HowtoDownloadArchivedandNonArchivedGOSattachmentsintoyourPC(attachmentsfromGenericObjectServices(GOS)Documentum)Sap4
ENDTRY.

*DownloadArchivedFiles
WeneedtheSAPtoDocumentumlink,thisisavailableinTOA*tables,andit
dependsinwhichtableyoufindtherelation.FormeitsTOA02,itmaynotbe
sameforyou.
IncaseyoudontfinduseFunctionmodule
ARCHIV_CONNECTINFO_GET_METAandusetheparameterssap_object
andobject_idasinbelowselect.

IamusingtableTOA02togetallArchiveids.

Adsby Google

SapABAPTraining
SapWorkflow
DownloadPC

SELECT*FROMtoa02INTOTABLEl_i_toa02WHERE

sap_object='BUS2081'AND
object_id=5100000062009.(formeitsInvoicedocument)
IFsysubrcNE0.
RETURN.
ELSE.
LOOPATl_i_toa02ASSIGNING<l_fs_tab>.
l_cnt=l_cnt+1.
CLEAR:l_v_archived_filename,l_v_length,l_i_tbl1024.
CONCATENATE'C:\DATA\DOCUMENTUM''\''_Arc_'l_cnt'.'<l_fs_tab>reserve
INTOl_v_archived_filename.
CONDENSEl_v_archived_filename.
CALLFUNCTION'SCMS_AO_TABLE_GET'
EXPORTING
arc_id=<l_fs_tab>archiv_id
doc_id=<l_fs_tab>arc_doc_id
IMPORTING
length=l_v_length
TABLES
data=l_i_tbl1024
EXCEPTIONS
error_http=1
error_archiv=2
error_kernel=3
error_config=4
OTHERS=5.
IFsysubrc<>0.
CONTINUE.
ENDIF.
CALLFUNCTION'SCMS_DOWNLOAD'
EXPORTING
filename=l_v_archived_filename"'C:\DATA\DOCUMENTUM\....
filesize=l_v_length
mimetype=l_v_mime
TABLES
data=l_i_tbl1024
EXCEPTIONS
error=1
OTHERS=2.
IFsysubrc<>0.
CONTINUE.
ENDIF.
ENDLOOP.

https://saplatest.blogspot.com/2016/06/howtodownloadarchivedandnon.html

4/5

6/20/2016 HowtoDownloadArchivedandNonArchivedGOSattachmentsintoyourPC(attachmentsfromGenericObjectServices(GOS)Documentum)Sap4
ENDIF.

Free Shipping!

ThiscompletecodewillcreateafolderC:\Data\DocumentuminyourPCandyouwillfind
alldownloadedattachmentsthere.HappyDownloading
AT 06:54:00
LABELS: ABAP, ABAP TIPS, GOS, SAP

Share

NO COMMENTS:
POST A COMMENT

Enteryourcomment...

Commentas:

Publish

Newer Post

Unknown(Google)

Signout

Notifyme

Preview

Home

Older Post

2016BigDataTrends
Top8TrendsinBigDatafor2016.GettheWhitepaper!

Powered by Blogger.

Copyright 2015 Sap 4 All


Distributed By SAP 4 ALL |

https://saplatest.blogspot.com/2016/06/howtodownloadarchivedandnon.html

5/5

You might also like