forked from kkayacan/abap-reference
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ydtp_mass_download.prog.abap
10072 lines (8954 loc) · 433 KB
/
ydtp_mass_download.prog.abap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
REPORT YDTP_MASS_DOWNLOAD.
* ======================================================================================================================
* Mass download version 1.5.2.
* ----------------------------------------------------------------------------------------------------------------------
* PROGRAM DESCRIPTION & USE
* Allows a user to download programs, Functions, DD definitions, etc to the presentation server. This version searches
* recursively for nested includes and function modules, and allows you to download the resulting code as standard text
* or HTML web pages within a suitable directory structure.
*
* You can either search by object name, using wildcards if you wish, or a combination of Author and object name. If
* you want all objects returned for a particular author then select the author name and choose the most suitable
* radiobutton. All objects will be returned if the fields to the right hand side of the radiobutton are left completely
* blank.
*
* Compatible with R/3 Enterprise and Netweaver, for older versions of SAP you will need Direct Download version 5.xx.
* This version removes the programming limitations imposed by developing across SAP releases 3 to 4.6.
*
* In order to be able to download files to the SAP server you must first set up a logical filepath within transaction
* 'FILE', or use an existing one. You must also create a external operating system command in SM69 called ZDTX_MKDIR. This
* will then be used to create any directories needed on the SAP server
* This program is intended to allow a person to keep a visual representation of a program for backup purposes only as
* has not been designed to allow programs to be uploaded to SAP systems.
* ----------------------------------------------------------------------------------------------------------------------
*
* Author : Copyright (C) 1998 E.G.Mellodew
* program contact : www.dalestech.com
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ----------------------------------------------------------------------------------------------------------------------
* ----------------------------------------------------------------------------------------------------------------------
* SAP Tables
* ----------------------------------------------------------------------------------------------------------------------
tables: trdir, seoclass, tfdir, enlfdir, dd02l, tadiv, dd40l, transfdesc.
type-pools: abap, seor.
* ----------------------------------------------------------------------------------------------------------------------
* Types
* ----------------------------------------------------------------------------------------------------------------------
* text element structure
types: tTextTable like textpool.
* GUI titles
types: tGUITitle like d347t.
* Message classes
types: begin of tMessage,
arbgb like t100-arbgb,
stext like t100a-stext,
msgnr like t100-msgnr,
text like t100-text,
end of tMessage.
* Screen flow.
types: begin of tScreenFlow,
screen like d020s-dnum,
code like d022s-line,
end of tScreenFlow.
* Holds all domain texts
types: begin of tDomainStructure,
domname type domname,
domvalue_l type domvalue_l,
domvalue_h type domvalue_l,
ddtext type val_text,
end of tDomainStructure.
* Holds a table\structure definition
types: begin of tDictTableStructure,
fieldname like dd03l-fieldname,
position like dd03l-position,
keyflag like dd03l-keyflag,
rollname like dd03l-rollname,
domname like dd03l-domname,
datatype like dd03l-datatype,
leng like dd03l-leng,
lowercase type lowercase,
ddtext like dd04t-ddtext,
iDomains type tDomainStructure occurs 0,
end of tdictTableStructure.
* -- Holds a table type
types: begin of tTableType,
typename type ttypename, " Name of table type
rowtype type ttrowtype, " Name of row type for table types
ttypkind type ttypkind, " Category of table type (range or general table type)
range_ctyp type range_ctyp, " Elem. type of LOW and HIGH components of a Ranges type
reftype type ddreftype, " Type of Object Referenced
occurs type ddoccurs, " Initial Line Number for Table Types
ddtext type ddtext, " Description
end of tTableType.
* Holds a tables attributes + its definition
types: begin of tDictTable,
tablename like dd03l-tabname,
tableTitle like dd02t-ddtext,
iStructure type tDictTableStructure occurs 0,
end of tDictTable.
types: begin of tDictFilename,
tablename like dd03l-tabname,
filename type string,
end of tDictFilename.
types: begin of tTransformation,
xsltName like trdir-name,
xsltDesc like tftit-stext,
subc like trdir-subc,
end of tTransformation.
* Include program names
types: begin of tInclude,
includeName like trdir-name,
includeTitle like tftit-stext,
end of tInclude.
* Exception class texts
types: begin of tConcept,
constName type string,
concept type sotr_conc,
end of tConcept.
* Method
types: begin of tMethod,
cmpName(61),
descript like vseomethod-descript,
exposure like vseomethod-exposure,
methodKey type string,
end of tMethod.
* Interfaces
types: begin of tInterface,
interfaceName like vseoclass-clsname,
end of tInterface.
* Class
types: begin of tClass,
scanned(1),
clsname like vseoclass-clsname,
descript like vseoclass-descript,
msg_id like vseoclass-msg_id,
exposure like vseoclass-exposure,
state like vseoclass-state,
clsfinal like vseoclass-clsfinal,
r3release like vseoclass-r3release,
iMethods type tMethod occurs 0,
iDictStruct type tDictTable occurs 0,
iTextElements type tTextTable occurs 0,
iMessages type tMessage occurs 0,
iInterfaces type tInterface occurs 0,
iConcepts type tConcept occurs 0,
iTableTypes type tTableType occurs 0,
iTransformations type tTransformation occurs 0,
textElementKey type string,
publicClassKey type string,
privateClassKey type string,
protectedClassKey type string,
typesClassKey type string,
exceptionClass type abap_bool,
end of tClass.
* function modules
types: begin of tFunction,
functionName like tfdir-funcName,
functionGroup like enlfdir-area,
includeNumber like tfdir-include,
functionMainInclude like tfdir-funcName,
functionTitle like tftit-stext,
topIncludeName like tfdir-funcName,
progname like tfdir-pname,
programLinkName like tfdir-pname,
messageClass like t100-arbgb,
iTextElements type tTextTable occurs 0,
iSelectiontexts type tTextTable occurs 0,
iMessages type tMessage occurs 0,
iIncludes type tInclude occurs 0,
iDictStruct type tDictTable occurs 0,
iGUITitle type tGUITitle occurs 0,
iScreenFlow type tScreenFlow occurs 0,
iTableTypes type tTableType occurs 0,
iTransformations type tTransformation occurs 0,
end of tFunction.
types: begin of tProgram,
progname like trdir-name,
programTitle like tftit-stext,
subc like trdir-subc,
messageClass like t100-arbgb,
iMessages type tMessage occurs 0,
iTextElements type tTextTable occurs 0,
iSelectiontexts type tTextTable occurs 0,
iGUITitle type tGUITitle occurs 0,
iScreenFlow type tScreenFlow occurs 0,
iIncludes type tInclude occurs 0,
iDictStruct type tDictTable occurs 0,
iTableTypes type tTableType occurs 0,
iTransformations type tTransformation occurs 0,
end of tProgram.
* ----------------------------------------------------------------------------------------------------------------------
* Internal tables
* ----------------------------------------------------------------------------------------------------------------------
* Dictionary object
data: iDictionary type standard table of tDictTable with header line.
* Dictionary objects which have previously been downloaded
data: iDictFilename type standard table of tDictFilename with header line.
* Table Types
data: iTableTypes type standard table of tTableType with header line.
* Table Type objects which have previously been downloaded
data: iTableTypeFilename type standard table of tDictFilename with header line.
* Function modules.
data: iFunctions type standard table of tFunction with header line.
* Function modules used within programs.
data: iProgFunctions type standard table of tFunction with header line.
* Tree display structure.
data: iTreeDisplay type standard table of snodetext with header line.
* Message class data
data: iMessages type standard table of tMessage with header line.
* Holds a single message class an all of its messages
data: iSingleMessageClass type standard table of tMessage with header line.
* Holds program related data
data: iPrograms type standard table of tProgram with header line.
* Classes
data: iClasses type standard table of tClass with header line.
* Table of paths created on the SAP server
data: iServerPaths type standard table of string with header line.
* Table of XSL Transformations
data: iTransformations type standard table of tTransformation with header line.
* ----------------------------------------------------------------------------------------------------------------------
* Table prototypes
* ----------------------------------------------------------------------------------------------------------------------
data: dumiDictStructure type standard table of tDictTableStructure.
data: dumiTextTab type standard table of tTextTable.
data: dumiIncludes type standard table of tInclude.
data: dumiHtml type standard table of string.
data: dumiHeader type standard table of string .
data: dumiScreen type standard table of tScreenFlow .
data: dumIGUITitle type standard table of tGUITitle.
data: dumiMethods type standard table of tMethod.
data: dumiConcepts type standard table of tConcept.
data: dumiInterfaces type standard table of tInterface.
* ----------------------------------------------------------------------------------------------------------------------
* Global objects
* ----------------------------------------------------------------------------------------------------------------------
data: objFile type ref to cl_gui_frontend_services.
data: objRuntimeError type ref to cx_root.
* ----------------------------------------------------------------------------------------------------------------------
* Constants
* ----------------------------------------------------------------------------------------------------------------------
constants: VERSIONNO type string value '1.5.2'.
constants: TABLES type string value 'TABLES'.
constants: TABLE type string value 'TABLE'.
constants: LIKE type string value 'LIKE'.
constants: TYPE type string value 'TYPE'.
constants: TYPEREFTO type string value 'TYPE REF TO'.
constants: STRUCTURE type string value 'STRUCTURE'.
constants: LOWSTRUCTURE type string value 'structure'.
constants: OCCURS type string value 'OCCURS'.
constants: FUNCTION type string value 'FUNCTION'.
constants: CALLFUNCTION type string value ' CALL FUNCTION'.
constants: MESSAGE type string value 'MESSAGE'.
constants: INCLUDE type string value 'INCLUDE'.
constants: TRANSFORMATION type string value 'TRANSFORMATION'.
constants: LOWINCLUDE type string value 'include'.
constants: DESTINATION type string value 'DESTINATION'.
constants: IS_TABLE type string value 'T'.
constants: IS_TRANSFORMATION type string value 'X'.
constants: IS_PROGRAM type string value 'P'.
constants: IS_SCREEN type string value 'S'.
constants: IS_GUITITLE type string value 'G'.
constants: IS_DOCUMENTATION type string value 'D'.
constants: IS_MESSAGECLASS type string value 'MC'.
constants: IS_FUNCTION type string value 'F'.
constants: IS_CLASS type string value 'C'.
constants: IS_METHOD type string value 'M'.
constants: ASTERIX type string value '*'.
constants: COMMA type string value ','.
constants: PERIOD type string value '.'.
constants: DASH type string value '-'.
constants: TRUE type abap_bool value 'X'.
constants: FALSE type abap_bool value ''.
constants: LT type string value '<'.
constants: GT type string value '>'.
constants: UNIX type string value 'UNIX'.
constants: NON_UNIX type string value 'not UNIX'.
constants: HTMLEXTENSION type string value 'html'.
constants: TEXTEXTENSION type string value 'txt'.
constants: SS_CODE type c value 'C'.
constants: SS_TABLE type c value 'T'.
* ----------------------------------------------------------------------------------------------------------------------
* Global variables
* ----------------------------------------------------------------------------------------------------------------------
data: statusBarMessage(100).
data: forcedExit type abap_bool value FALSE.
data: startTime like sy-uzeit.
data: runTime like sy-uzeit.
data: downloadFileExtension type string.
data: downloadFolder type string.
data: serverSlashSeparator type string.
data: frontendSlashSeparator type string.
data: slashSeparatorToUse type string.
data: serverFilesystem type filesys_d.
data: serverFolder type string.
data: frontendOpSystem type string.
data: serverOpSystem type string.
data: customerNameSpace type string.
ranges: soProgramName for trdir-name.
ranges: soAuthor for usr02-bname.
ranges: soTableNames for dd02l-tabname.
ranges: soTableTypeNames for dd40l-typename.
ranges: soFunctionName for tfdir-funcName.
ranges: soClassName for vseoclass-clsname.
ranges: soFunctionGroup for enlfdir-area.
ranges: soXsltName for tadir-obj_name.
field-symbols: <waDictStruct> type tDictTable.
* ----------------------------------------------------------------------------------------------------------------------
* Selection screen declaration
* ----------------------------------------------------------------------------------------------------------------------
* Author
selection-screen: begin of block b1 with frame title tBlock1.
selection-screen begin of line.
selection-screen comment 5(23) tAuth.
parameters: pAuth like usr02-bname memory id MAUTH.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 5(36) tPmod.
parameters: pMod as checkbox.
selection-screen end of line.
selection-screen: end of block b1.
selection-screen begin of block b2 with frame title tBlock2.
* Tables
selection-screen begin of line.
parameters: rTable as checkbox default 'X'. "radiobutton group r1.
selection-screen comment 5(15) tRtable.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 10(15) tPtable.
select-options: soTable for dd02l-tabname.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 10(79) tTnote.
selection-screen end of line.
* Table Types
selection-screen begin of line.
parameters: rTabType as checkbox default 'X'. "radiobutton group r1.
selection-screen comment 5(15) trtabtyp.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 10(15) tptabtyp.
select-options: sotabtyp for dd40l-typename.
selection-screen end of line.
* Message classes
selection-screen begin of line.
parameters: rMess as checkbox default 'X'. "radiobutton group r1.
selection-screen comment 5(18) tPMes.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 10(18) tMname.
parameters: pMname like t100-arbgb memory id MMNAME.
selection-screen end of line.
* Function modules
selection-screen begin of line.
parameters: rFunc as checkbox default 'X'. "radiobutton group r1.
selection-screen comment 5(30) tRfunc.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 10(15) tPfname.
select-options: soFname for tfdir-funcName.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 10(15) tFgroup.
select-options: soFgroup for enlfdir-area.
selection-screen end of line.
* XSLT
selection-screen begin of line.
parameters: rxslt as checkbox default 'X'. "radiobutton group r1.
selection-screen comment 5(30) trxslt.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 10(15) tpxslt.
select-options: soxslt for transfdesc-xsltdesc.
selection-screen end of line.
* Classes
selection-screen begin of line.
parameters: rClass as checkbox default 'X'. "radiobutton group r1.
selection-screen comment 5(30) tRClass.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 10(15) tPcName.
select-options: soClass for seoclass-clsname.
selection-screen end of line.
* Programs / includes
selection-screen begin of line.
parameters: rProg as checkbox default 'X'. "radiobutton group r1 default 'X'.
selection-screen comment 5(18) tProg.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 10(15) tRpname.
select-options: soProg for trdir-name.
selection-screen end of line.
selection-screen skip.
* Language
selection-screen begin of line.
selection-screen comment 1(27) tMLang.
parameters: pMLang like t100-sprsl default sy-langu.
selection-screen end of line.
* Package
selection-screen begin of line.
selection-screen comment 1(24) tPack.
select-options: soPack for tadiv-devclass DEFAULT 'Z*'.
selection-screen end of line.
* Customer objects
selection-screen begin of line.
selection-screen comment 1(27) tCust.
parameters: pCust as checkbox default 'X'.
selection-screen end of line.
* Alt customer name range
selection-screen begin of line.
selection-screen comment 1(27) tNRange.
parameters: pCName type namespace memory id MNAMESPACE.
selection-screen end of line.
* Tadir content
selection-screen begin of line.
selection-screen comment 1(27) dlTadir.
parameters: pTadir as checkbox default 'X'.
selection-screen end of line.
* Transaction code list
selection-screen begin of line.
selection-screen comment 1(27) dlTcode.
parameters: pTcode as checkbox default 'X'.
selection-screen end of line.
selection-screen: end of block b2.
* Additional things to download.
selection-screen: begin of block b3 with frame title tBlock3.
selection-screen begin of line.
selection-screen comment 1(33) tPtext.
parameters: pText as checkbox default 'X' memory id MTEXT.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tMess.
parameters: pMess as checkbox default 'X' memory id MMESS.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tTTyp.
parameters: pTTyp as checkbox default 'X' memory id MTTYP.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tXslt.
parameters: pTrans as checkbox default 'X' memory id MXSLT.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tPinc.
parameters: pInc as checkbox default 'X' memory id MINC.
selection-screen comment 40(20) tReci.
parameters: pReci as checkbox default 'X' memory id MRECI.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tPfunc.
parameters: pFunc as checkbox default 'X' memory id MFUNC.
selection-screen comment 40(20) tRecf.
parameters: pRecf as checkbox default 'X' memory id MRECF.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tRecC.
parameters: pRecC as checkbox default 'X' memory id MRECC.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tFDoc.
parameters: pFDoc as checkbox default 'X' memory id MFDOC.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tCDoc.
parameters: pCDoc as checkbox default 'X' memory id MCDOC.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tPscr.
parameters: pScr as checkbox default 'X' memory id MSCR.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tPdict.
parameters: pDict as checkbox default 'X' memory id MDICT.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) tSortT.
parameters: pSortT as checkbox default ' ' memory id MSORTT.
selection-screen end of line.
selection-screen: end of block b3.
* File details
selection-screen: begin of block b4 with frame title tBlock4.
selection-screen begin of line.
selection-screen comment 1(20) tPhtml.
parameters: pHtml radiobutton group g1.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 5(29) tBack.
parameters: pBack as checkbox default 'X'.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) tPtxt.
parameters: pTxt radiobutton group g1 default 'X'.
selection-screen end of line.
selection-screen skip.
* Download to SAP server
selection-screen begin of line.
selection-screen comment 1(25) tServ.
parameters: pServ radiobutton group g2.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 8(20) tSPath.
parameters: pLogical like filename-fileintern memory id MLOGICAL.
selection-screen end of line.
selection-screen comment /28(60) tSDPath.
* Download to PC
selection-screen begin of line.
selection-screen comment 1(25) tPc.
parameters: pPc radiobutton group g2 default 'X'.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 8(20) tPpath.
parameters: pFolder like rlgrap-filename memory id MFOLDER.
selection-screen end of line.
selection-screen: end of block b4.
* Display options
selection-screen: begin of block b5 with frame title tBlock5.
* Display final report
* selection-screen begin of line.
* selection-screen comment 1(33) tRep.
* parameters: pRep as checkbox default ''.
* selection-screen end of line.
* Display progress messages
selection-screen begin of line.
selection-screen comment 1(33) tProMess.
parameters: pProMess as checkbox default 'X'.
selection-screen end of line.
selection-screen: end of block b5.
data pRep type c length 1.
* ----------------------------------------------------------------------------------------------------------------------
* Display a directory picker window
* ----------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for pFolder.
data: objFile type ref to cl_gui_frontend_services.
data: pickedFolder type string.
data: initialFolder type string.
if sy-batch is initial.
create object objFile.
if not pFolder is initial.
initialFolder = pFolder.
else.
objFile->get_temp_directory( changing temp_dir = initialFolder
exceptions cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3 ).
endif.
objFile->directory_browse( exporting initial_folder = initialFolder
changing selected_folder = pickedFolder
exceptions cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3 ).
if sy-subrc = 0.
pFolder = pickedFolder.
else.
write: / 'An error has occured picking a folder'.
endif.
endif.
* ----------------------------------------------------------------------------------------------------------------------
at selection-screen.
* ----------------------------------------------------------------------------------------------------------------------
case 'X'.
when pPc.
if pFolder is initial.
* User must enter a path to save to
message e000(oo) with 'You must enter a file path'.
endif.
when pServ.
if pLogical is initial.
* User must enter a logical path to save to
message e000(oo) with 'You must enter a logical file name'.
endif.
endcase.
* ----------------------------------------------------------------------------------------------------------------------
at selection-screen on pLogical.
* ----------------------------------------------------------------------------------------------------------------------
if not pServ is initial.
call function 'FILE_GET_NAME' exporting logical_filename = pLogical
importing file_name = serverFolder
exceptions file_not_found = 1
others = 2.
if sy-subrc = 0.
if serverFolder is initial.
message e000(oo) with 'No file path returned from logical filename'.
else.
* Path to display on the selection screen
tSDPath = serverFolder.
* Remove the trailing slash off the path as the subroutine buildFilename will add an extra one
shift serverFolder right deleting trailing serverSlashSeparator.
shift serverFolder left deleting leading space.
endif.
else.
message e000(oo) with 'Logical filename does not exist'.
endif.
endif.
* ---------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for soProg-low.
* ---------------------------------------------------------------------------------------------------------------------
call function 'REPOSITORY_INFO_SYSTEM_F4' exporting object_type = 'PROG'
object_name = soProg-low
suppress_selection = 'X'
use_alv_grid = ''
without_personal_list = ''
importing object_name_selected = soProg-low
exceptions cancel = 1.
* ---------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for soProg-high.
* ---------------------------------------------------------------------------------------------------------------------
call function 'REPOSITORY_INFO_SYSTEM_F4' exporting object_type = 'PROG'
object_name = soProg-high
suppress_selection = 'X'
use_alv_grid = ''
without_personal_list = ''
importing object_name_selected = soProg-high
exceptions cancel = 1.
* ---------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for soxslt-low.
* ---------------------------------------------------------------------------------------------------------------------
call function 'REPOSITORY_INFO_SYSTEM_F4'
exporting
object_type = 'XSLT'
object_name = soxslt-low
suppress_selection = 'X'
use_alv_grid = ''
without_personal_list = ''
importing
object_name_selected = soxslt-low
exceptions
cancel = 1.
* ---------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for soxslt-high.
* ---------------------------------------------------------------------------------------------------------------------
call function 'REPOSITORY_INFO_SYSTEM_F4'
exporting
object_type = 'XSLT'
object_name = soxslt-high
suppress_selection = 'X'
use_alv_grid = ''
without_personal_list = ''
importing
object_name_selected = soxslt-high
exceptions
cancel = 1.
* ---------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for soClass-low.
* ---------------------------------------------------------------------------------------------------------------------
call function 'F4_DD_ALLTYPES' exporting object = soClass-low
suppress_selection = 'X'
display_only = ''
only_types_for_clifs = 'X'
importing result = soClass-low.
* ---------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for soClass-high.
* ---------------------------------------------------------------------------------------------------------------------
call function 'F4_DD_ALLTYPES' exporting object = soClass-high
suppress_selection = 'X'
display_only = ''
only_types_for_clifs = 'X'
importing result = soClass-high.
* ---------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for soFName-low.
* ---------------------------------------------------------------------------------------------------------------------
call function 'REPOSITORY_INFO_SYSTEM_F4' exporting object_type = 'FUNC'
object_name = soFname-low
suppress_selection = 'X'
use_alv_grid = ''
without_personal_list = ''
importing object_name_selected = soFName-low
exceptions cancel = 1.
* ---------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for soFName-high.
* ---------------------------------------------------------------------------------------------------------------------
call function 'REPOSITORY_INFO_SYSTEM_F4' exporting object_type = 'FUNC'
object_name = soFname-high
suppress_selection = 'X'
use_alv_grid = ''
without_personal_list = ''
importing object_name_selected = soFName-high
exceptions cancel = 1.
* ---------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for soFGroup-low.
* ---------------------------------------------------------------------------------------------------------------------
call function 'REPOSITORY_INFO_SYSTEM_F4' exporting object_type = 'FUGR'
object_name = soFGroup-low
suppress_selection = 'X'
use_alv_grid = ''
without_personal_list = ''
importing object_name_selected = soFGroup-low
exceptions cancel = 1.
* ---------------------------------------------------------------------------------------------------------------------
at selection-screen on value-request for soFGroup-high.
* ---------------------------------------------------------------------------------------------------------------------
call function 'REPOSITORY_INFO_SYSTEM_F4' exporting object_type = 'FUGR'
object_name = soFGroup-high
suppress_selection = 'X'
use_alv_grid = ''
without_personal_list = ''
importing object_name_selected = soFGroup-high
exceptions cancel = 1.
* ----------------------------------------------------------------------------------------------------------------------
* initialisation
* ----------------------------------------------------------------------------------------------------------------------
initialization.
* Parameter screen texts.
tBlock1 = 'Author (Optional)'.
tBlock2 = 'Objects to download'.
tBlock3 = 'Additional downloads for programs, function modules and classes'.
tBlock4 = 'Download parameters'.
tBlock5 = 'Display options'.
tAuth = 'Author name'.
tPmod = 'Include programs modified by author'.
tCust = 'Only customer objects'.
tNRange = 'Alt customer name range'.
tRtable = 'Tables / Structures'.
trtabtyp = 'Table types'.
tPtable = 'Table name'.
tTnote = 'Note: tables are stored under the username of the last person who modified them'.
tRfunc = 'Function modules'.
tPfname = 'Function name'.
tFgroup = 'Function group'.
tRClass = 'Classes'.
tPcname = 'Class name'.
tMess = 'Message class'.
tMName = 'Class name'.
tMLang = 'Language'.
tProg = 'Programs'.
tRpname = 'Program name'.
tPack = 'Package'.
tPtxt = 'Text document'.
tPhtml = 'HTML document'.
tBack = 'Include background colour'.
tPtext = 'Text elements'.
tPinc = 'Include programs'.
tRecI = 'Recursive search'.
tPpath = 'File path'.
tSPath = 'Logical file name'.
tPmes = 'Message classes'.
tPfunc = 'Function modules'.
tFDoc = 'Function module documentation'.
tCDoc = 'Class documentation'.
tRecf = 'Recursive search'.
tRecC = 'Class recursive search'.
tPscr = 'Screens'.
tPdict = 'Dictionary structures'.
tSortT = 'Sort table fields alphabetically'.
tServ = 'Download to server'.
tPc = 'Download to PC'.
* tRep = 'Display download report'.
tProMess = 'Display progress messages'.
tRxslt = 'Transformations'.
tPxslt = 'XSLT Name'.
tTtyp = 'Table Types'.
tXslt = 'Transformation'.
dlTadir = 'Download TADIR content'.
dlTcode = 'Download t-code list'.
* Determine the frontend operating system type.
if sy-batch is initial.
perform determineFrontendOPSystem using frontendSlashSeparator frontendOpSystem.
endif.
perform determineServerOpsystem using serverSlashSeparator serverFileSystem serverOpsystem.
* Determine if the external command exists. If it doesn't then disable the server input field
perform findExternalCommand using serverFileSystem.
if pFolder is initial.
CONCATENATE 'C:\temp\' sy-sysid '_' sy-datum into pFolder.
endif.
* ----------------------------------------------------------------------------------------------------------------------
start-of-selection.
* ----------------------------------------------------------------------------------------------------------------------
perform checkComboBoxes.
perform fillSelectionRanges.
startTime = sy-uzeit.
* Don't display status messages if we are running in the background
if not sy-batch is initial.
pProMess = ''.
endif.
* Fool the HTML routines to stop them hyperlinking anything with a space in them
if pCName is initial.
customerNameSpace = '^'.
else.
customerNameSpace = pCName.
endif.
* Set the file extension and output type of the file
if pTxt is initial.
downloadFileExtension = HTMLEXTENSION.
else.
downloadFileExtension = TEXTEXTENSION.
endif.
* Determine which operating slash and download directory to use
case 'X'.
when pPc.
slashSeparatorToUse = frontendSlashSeparator.
downloadFolder = pFolder.
when pServ.
slashSeparatorToUse = serverSlashSeparator.
downloadFolder = serverFolder.
endcase.
loop at soPack.
if soPack-low ca '*'.
soPack-option = 'CP'.
modify soPack.
endif.
endloop.
* Main program flow.
if pTadir = 'X'.
perform downloadTadir using downloadFolder
pServ
slashSeparatorToUse
pProMess
serverFileSystem
pCust
soAuthor[]
soPack[]
customerNameSpace.
endif.
if pTcode = 'X'.
perform downloadTstct using downloadFolder
pServ
slashSeparatorToUse
pProMess
serverFileSystem
pCust
soAuthor[]
soPack[]
customerNameSpace.
perform downloadTstcp using downloadFolder
pServ
slashSeparatorToUse
pProMess
serverFileSystem
pCust
soAuthor[]
soPack[]
customerNameSpace.
endif.
* case 'X'.
* Select tables
if rTable = 'X'.
perform retrieveTables using iDictionary[]
soTableNames[]
soAuthor[]
soPack[].
if not ( iDictionary[] is initial ).
if pPc = 'X'.
concatenate pFolder slashSeparatorToUse 'DDStructures' into downloadFolder.
endif.
perform downloadDDStructures using iDictionary[]
iDictFilename[]
downloadFolder
HTMLEXtension
space
pSortT
slashSeparatorToUse
pServ
pProMess
serverFileSystem
pBack.
endif.
endif.
if rTabType = 'X'.
perform retrieveTableTypes using iTableTypes[]
soTableTypeNames[]
soAuthor[]
soPack[].
if not ( iTableTypes[] is initial ).
if pPc = 'X'.
CONCATENATE pFolder slashSeparatorToUse 'DDTableTypes' into downloadFolder.
endif.
perform downloadDDTableTypes using iTabletypes[]
iTableTypeFilename[]
downloadFolder
htmlExtension
space
pSortt
slashSeparatorToUse
pServ
pProMess
serverFileSystem
pBack.
endif.
endif.
* Select message classes tables
if rMess = 'X'.
perform retrieveMessageClass using iMessages[]
soAuthor[] "Author
pMname "Message class name
pMLang "Message class language
pMod "Modified by author
soPack[]. "Package
if not ( iMessages[] is initial ).
if pPc = 'X'.
CONCATENATE pFolder slashSeparatorToUse 'MessageClass' into downloadFolder.
endif.
sort iMessages ascending by arbgb msgnr.
loop at iMessages.
append iMessages to iSingleMessageClass.
at end of arbgb.
perform downloadMessageClass using iSingleMessageClass[]
iMessages-arbgb
downloadFolder
downloadFileExtension
pHtml
space