konto usunięte

Temat: Analiza rozszerzeń i Z* programów

Witajcie,
Jak kompleksowo uzyskać listę wszystkich Z* utworzonych w systemie ?
Zakładam, że ich nazwy leżą w jakiś tabelach, pytanie dnia jakich ?
Może jest jakiś program, który mogę wrzucić do systemu i wyrzuci mi wszystkie Zety ?
pozdrawiam, Artur

konto usunięte

Temat: Analiza rozszerzeń i Z* programów

SE38, 'Z*' i F4 ?

konto usunięte

Temat: Analiza rozszerzeń i Z* programów

I dodatkowo transakcje z SE93 - tak samo F4 i z*

Pozdrawiam

EDIT. Nie zapomnij o Y-grekach ;)Łukasz T. edytował(a) ten post dnia 07.11.08 o godzinie 11:19

konto usunięte

Temat: Analiza rozszerzeń i Z* programów

Artur Jaworski:
Witajcie,
Jak kompleksowo uzyskać listę wszystkich Z* utworzonych w systemie ?
Zakładam, że ich nazwy leżą w jakiś tabelach, pytanie dnia jakich ?

jesli mnie pamiec nie zawodzi to TRDIR
Paweł B.

Paweł B. Director, SAP
Business
Development, EY

Temat: Analiza rozszerzeń i Z* programów

Łukasz T.:
I dodatkowo transakcje z SE93 - tak samo F4 i z*


A nie prościej sprawdzić tabelę TSTC dla kodów transkacji?
Oraz TRDIR i TADIR dla programów i obiektów słownikowych.

pozdrawiam
pb

konto usunięte

Temat: Analiza rozszerzeń i Z* programów

Paweł Biel:
Łukasz T.:
I dodatkowo transakcje z SE93 - tak samo F4 i z*


A nie prościej sprawdzić tabelę TSTC dla kodów transkacji?
Oraz TRDIR i TADIR dla programów i obiektów słownikowych.

pozdrawiam
pb
O właśnie o coś takiego mi chodziło, jednakże dziękuję za wszystkie sugestie i będę wdzięczny za kolejne.
pozdrawiam, Artur
Maciej Zdziarstek

Maciej Zdziarstek Multi certified, SAP
HCM, Success
Factors, Architect,
Pro...

Temat: Analiza rozszerzeń i Z* programów

Pewnie, ze jest... trzeba bylo sie zglosic do mnie:)
Rozwijac mysl Tomka Kozerskiego nazwy tabel Z-owych sa w tabeli DD02L.

Pozdr.
Maciek
Lech D.

Lech D. Doradca
Biznesowo-informatyc
zny, Kierownik
Projektów IT (...

Temat: Analiza rozszerzeń i Z* programów

Artur,
tu masz program z linkiem do strony z jego najnowsza wersja:
*&---------------------------------------------------------------------*
*& Report ZBCAC_DOWN
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZBCAC_DOWN.
*======================================================================================================================
* Direct Download Enterprise version 1.3.1.
*
* THIS SOFTWARE IS FOR PERSONAL USE ONLY.
* THIS PROGRAM IS FREEWARE AND IS PROVIDED ON AN AS-IS BASIS WITHOUT WARRANTY OF ANY KIND.
* THE PROVIDER SPECIFICALLY DISCLAIMS ANY OTHER WARRANTY, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY
* OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL THE PROVIDER BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, SPECIAL OR INCIDENTAL DAMAGES, EVEN IF PROVIDER
* HAS BEEN ADVISED BY CLIENT OF THE POSSIBILITY OF SUCH POTENTIAL LOSS OR DAMAGE.
* CLIENT AGREES TO HOLD PROVIDER HARMLESS FROM AND AGAINST ANY AND ALL CLAIMS, LOSSES, LIABILITIES AND EXPENSES. BY
* INSTALLING OR RUNNING THIS PROGRAM YOU ARE AGREEING TO THE TERMS AND CONDITONS STATED ABOVE.
*
*----------------------------------------------------------------------------------------------------------------------
* 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 only, 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 ZMKDIR. 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 : E.G.Mellodew
*
*
* program contact : direct@dalestech.com
* http://dalestech.com
*
*----------------------------------------------------------------------------------------------------------------------

*----------------------------------------------------------------------------------------------------------------------
* SAP Tables
*----------------------------------------------------------------------------------------------------------------------
tables: trdir, seoclass, tfdir, enlfdir, dd02l.

*----------------------------------------------------------------------------------------------------------------------
* 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 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,
ddtext like dd04t-ddtext,
end of tdictTableStructure.

* 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.

* 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 like vseomethod-cmpname,
descript like vseomethod-descript,
exposure like vseomethod-exposure,
methodKey type string,
end of tMethod.

* 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,
iConcepts type tConcept occurs 0,
textElementKey type string,
publicClassKey type string,
privateClassKey type string,
protectedClassKey type string,
typesClassKey type string,
exceptionClass type i,
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,
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,
end of tProgram.

*----------------------------------------------------------------------------------------------------------------------
* Internal tables
*----------------------------------------------------------------------------------------------------------------------
* Dictionary object
data: iDictionary type standard table of tDictTable with header line.
* Function modules.
data: iFunctions 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 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.

*----------------------------------------------------------------------------------------------------------------------
* 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.3.1'.
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: LOWINCLUDE type string value 'include'.
constants: DESTINATION type string value 'DESTINATION'.
constants: IS_TABLE type string value 'T'.
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 i value 1.
constants: FALSE type i value 0.
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: BACKGROUND_COLOUR type string value '#FFFFE0'.
constants: COLOUR_WHITE type string value '#FFFFFF'.
constants: COLOUR_BLACK type string value '#000000'.
constants: COLOUR_YELLOW type string value '#FFFF00'.
constants: COMMENT_COLOUR type string value '#0000FF'.
constants: HTMLEXTENSION type string value 'html'.
constants: TEXTEXTENSION type string value 'txt'.

*----------------------------------------------------------------------------------------------------------------------
* Global variables
*----------------------------------------------------------------------------------------------------------------------
data: statusBarMessage(100).
data: forcedExit type i value 0.
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: soFunctionName for tfdir-funcName.
ranges: soClassName for vseoclass-clsname.
ranges: soFunctionGroup for enlfdir-area.
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.

* Local objects
selection-screen begin of line.
selection-screen comment 5(36) t$tmp.
parameters: p$tmp as checkbox default ''.
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 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.

* Message classes
selection-screen begin of line.
parameters: rMess 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 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.

* Classes
selection-screen begin of line.
parameters: rClass 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 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(18) tMLang.
parameters: pMLang like t100-sprsl default 'EN'.
selection-screen end of line.

* Package
selection-screen begin of line.
selection-screen comment 1(18) tPack.
parameters: pPack like tadiv-devclass memory id MPACK.
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 comment 32(25) tNRange.
parameters: pCName type namespace memory id MNAMESPACE.
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) tPinc.
parameters: pInc as checkbox default 'X' memory id MINC.
selection-screen comment 40(20) tRecc.
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) tDoc.
parameters: pDoc as checkbox default 'X' memory id MDOC.
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 default 'X'.
selection-screen end of line.

selection-screen begin of line.
selection-screen comment 5(29) tComm.
parameters: pComm as checkbox default 'X'.
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.
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 'X'.
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.

*----------------------------------------------------------------------------------------------------------------------
* 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 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)'.
t$tmp = 'Programs only: include local objects'.
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'.
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'.
tComm = 'Highlight comments'.
tBack = 'Include background colour'.
tPtext = 'Text elements'.
tPinc = 'Include programs'.
tRecc = 'Recursive search'.
tPpath = 'File path'.
tSPath = 'Logical file name'.
tPmes = 'Message classes'.
tPfunc = 'Function modules'.
tDoc = 'Function module documentation'.
tRecf = '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'.

* 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.

*----------------------------------------------------------------------------------------------------------------------
* start-of-selection.
*----------------------------------------------------------------------------------------------------------------------
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.

* Determine which operating slash and download directory to use
case 'X'.
when pPc.
slashSeparatorToUse = frontendSlashSeparator.
downloadFolder = pFolder.
when pServ.
slashSeparatorToUse = serverSlashSeparator.
downloadFolder = serverFolder.
endcase.

* Main program flow.
case 'X'.
* Select tables
when rTable.
perform retrieveTables using iDictionary[]
soTableNames[]
soAuthor[].

* Select message classes tables
when rMess.
perform retrieveMessageClass using iMessages[]
soAuthor[] "Author
pMname "Message class name
pMLang "Message class language
pMod. "Modified by author

* Select function modules
when rFunc.
perform retrieveFunctions using soFunctionName[] "Function name
soFunctionGroup[] "Function group
iFunctions[] "Found functions
soAuthor[] "Author
pText "Get text elements
pScr "Get screens
pCust "Customer data only
customerNameSpace. "Customer name range

loop at iFunctions.
* Find Dict structures, messages, functions, includes etc.
perform scanForAdditionalFuncStuff using iFunctions[]
pRecI "Search for includes recursively
pRecF "Search for functions recursively
pInc "Search for includes
pFunc "Search for functions
pDict "search for dictionary objects
pMess "Search for messages
pCust "Customer data only
customerNameSpace. "Customer name range
endloop.

* Select Classes
when rClass.
perform retrieveClasses using iClasses[]
iFunctions[]
soClassName[] "Class name
soAuthor[] "Author
customerNameSpace "Customer name range
pMod "Also modified by author
pCust "Customer object only
pMess "Find messages
pText "Text Elements
pDict "Dictionary structures
pFunc "Get functions
pInc "Get includes
pRecF "Search recursively for functions
pRecI "Search recursively for includes
'X' "Search recursively for classes
pMLang. "Language

loop at iFunctions.
* Find Dict structures, messages, functions, includes etc.
perform scanForAdditionalFuncStuff using iFunctions[]
pRecI "Search for includes recursively
pRecF "Search for functions recursively
pInc "Search for includes
pFunc "Search for functions
pDict "search for dictionary objects
pMess "Search for messages
pCust "Customer data only
customerNameSpace. "Customer name range
endloop.

* Select programs
when rProg.
perform retrievePrograms using iPrograms[]
iFunctions[]
soProgramName[] "Program name
soAuthor[] "Author
customerNamespace "Customer name range
pMod "Also modified by author
pCust "Customer object only
pMess "Find messages
pText "Text Elements
pDict "Dictionay structures
pFunc "Get functions
pInc "Get includes
pScr "Get screens
pRecF "Search recursively for functions
pRecI "Search recursively for includes
p$Tmp "local objects
pPack. "Package
endcase.

*----------------------------------------------------------------------------------------------------------------------
* end-of-selection
*----------------------------------------------------------------------------------------------------------------------
end-of-selection.

if forcedExit = 0.
* Set the file extension and output type of the file
if pTxt is initial.
downloadFileExtension = HTMLEXTENSION.
else.
downloadFileExtension = TEXTEXTENSION.
endif.

* Decide what to download
case 'X'.
* Download tables
when rTable.
if not ( iDictionary[] is initial ).
perform downloadDDStructures using iDictionary[]
downloadFolder
HTMLEXtension
space
pSortT
slashSeparatorToUse
pServ
pProMess.

* Free up any memory used for caching HTML versions of tables
loop at iDictionary.
free memory id iDictionary-tablename.
endloop.

* Display donwload report
if not pRep is initial.
get time.
runTime = sy-uzeit - startTime.
perform fillTreeNodeTables using iDictionary[]
iTreeDisplay[]
runTime.
endif.

clear iDictionary[].
endif.

* Download message class
when rMess.
if not ( iMessages[] is initial ).
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
pComm
customerNameSpace
pInc
pDict
pMess
slashSeparatorToUse
pServ
pProMess.
clear iSingleMessageClass[].
endat.
endloop.

* Display download report
if not pRep is initial.
get time.
runTime = sy-uzeit - startTime.
perform fillTreeNodeMessages using iMessages[]
iTreeDisplay[]
runTime.
endif.

clear iMessages[].
endif.

* Download functions
when rFunc.
if not ( iFunctions[] is initial ).
perform downloadFunctions using iFunctions[]
downloadFolder
downloadFileExtension
space
pDoc
pHtml
pComm
customerNameSpace
pInc
pDict
TEXTEXTENSION
HTMLEXTENSION
pSortT
slashSeparatorToUse
pServ
pProMess.

* Free up any memory used for caching HTML versions of tables
loop at iFunctions.
loop at iFunctions-iDictStruct assigning <waDictStruct>.
free memory id <waDictStruct>-tablename.
endloop.
endloop.

* Display donwload report
if not pRep is initial.
get time.
runTime = sy-uzeit - startTime.
perform fillTreeNodeFunctions using iFunctions[]
iTreeDisplay[]
runTime.
endif.

clear iFunctions[].
endif.

* Download Classes
when rClass.
if not ( iClasses[] is initial ).
perform downloadClasses using iClasses[]
iFunctions[]
downloadFolder
downloadFileExtension
HTMLEXTENSION
TEXTEXTENSION
pHtml
pComm
customerNameSpace
pInc
pDict
pDoc
pSortT
slashSeparatorToUse
pServ
pProMess.

* Free up any memory used for caching HTML versions of tables
loop at iFunctions.
loop at iFunctions-iDictStruct assigning <waDictStruct>.
free memory id <waDictStruct>-tablename.
endloop.
endloop.

* Free up any memory used for caching HTML versions of tables
loop at iPrograms.
loop at iPrograms-iDictStruct assigning <waDictStruct>.
free memory id <waDictStruct>-tablename.
endloop.
endloop.

* Display donwload report
if not pRep is initial.
get time.
runTime = sy-uzeit - startTime.
perform fillTreeNodeClasses using iClasses[]
iFunctions[]
iTreeDisplay[]
runTime.
endif.

clear iClasses[].
clear iFunctions[].
endif.

* Download programs
when rProg.
if not ( iPrograms[] is initial ).
perform downloadPrograms using iPrograms[]
iFunctions[]
downloadFolder
downloadFileExtension
HTMLEXTENSION
TEXTEXTENSION
pHtml
pComm
customerNameSpace
pInc
pDict
pDoc
pSortT
slashSeparatorToUse
pServ
pProMess.

* Free up any memory used for caching HTML versions of tables
loop at iFunctions.
loop at iFunctions-iDictStruct assigning <waDictStruct>.
free memory id <waDictStruct>-tablename.
endloop.
endloop.

* Free up any memory used for caching HTML versions of tables
loop at iPrograms.
loop at iPrograms-iDictStruct assigning <waDictStruct>.
free memory id <waDictStruct>-tablename.
endloop.
endloop.

* Display donwload report
if not pRep is initial.
get time.
runTime = sy-uzeit - startTime.
perform fillTreeNodePrograms using iPrograms[]
iFunctions[]
iTreeDisplay[]
runTime.
endif.

clear iPrograms[].
clear iFunctions[].
endif.
endcase.

if not pRep is initial.
if not ( iTreeDisplay[] is initial ).
perform displayTree using iTreeDisplay[].
else.
statusBarMessage = 'No items found matching selection criteria'.
perform displayStatus using statusBarMessage 2.
endif.
endif.
endif.

*--- Memory IDs
* User name
set parameter id 'MAUTH' field pAuth.
* Message class
set parameter id 'MMNAME' field pMname.
* Customer namespace
set parameter id 'MNAMESPACE' field pCName.
* Folder
set parameter id 'MFOLDER' field pFolder.
* Logical filepath
set parameter id 'MLOGICAL' field pLogical.
* Package
set parameter id 'MPACK' field pPack.
* Text element checkbox
set parameter id 'MTEXT' field pText.
* Messages checkbox
set parameter id 'MMESS' field pMess.
* Includes checkbox
set parameter id 'MINC' field pInc.
* Recursive includes checkbox.
set parameter id 'MRECI' field pReci.
* Functions checkbox
set parameter id 'MFUNC' field pFunc.
* Recursive functions checkbox
set parameter id 'MRECF' field pRecf.
* Function module documntation checkbox
set parameter id 'MDOC' field pDoc.
* Screens checkbox
set parameter id 'MSCR' field pScr.
* Dictionary checkbox
set parameter id 'MDICT' field pDict.
* Sort table ascending checkBox
set parameter id 'MSORTT' field pSortT.

***********************************************************************************************************************
***************************************************SUBROUTINES*********************************************************
***********************************************************************************************************************

*----------------------------------------------------------------------------------------------------------------------
* checkComboBoxes... Check input parameters
*----------------------------------------------------------------------------------------------------------------------
form checkComboBoxes.

if pAuth is initial.
case 'X'.
when rTable.
if soTable[] is initial.
statusBarMessage = 'You must enter either a table name or author.'.
endif.
when rFunc.
if ( soFName[] is initial ) and ( soFGroup[] is initial ).
if soFName[] is initial.
statusBarMessage = 'You must enter either a function name or author.'.
else.
if soFGroup[] is initial.
statusBarMessage = 'You must enter either a function group, or an author name.'.
endif.
endif.
endif.
when rProg.
if soProg[] is initial.
statusBarMessage = 'You must enter either a program name or author name.'.
endif.
endcase.
else.
* Check the user name of the person objects are to be downloaded for
if pAuth = 'SAP*' or pauth = 'SAP'.
statusBarMessage = 'Sorry cannot download all objects for SAP standard user'.
endif.
endif.

if not statusBarMessage is initial.
perform displayStatus using statusBarMessage 3.
forcedExit = 1.
stop.
endif.
endform. "checkComboBoxes

*----------------------------------------------------------------------------------------------------------------------
* fillSelectionRanges... for selection routines
*----------------------------------------------------------------------------------------------------------------------
form fillSelectionRanges.

data: strLength type i.

strLength = strlen( pcName ).

if not pAuth is initial.
soAuthor-sign = 'I'.
soAuthor-option = 'EQ'.
soAuthor-low = pAuth.
append soAuthor.
endif.

* Tables
if not soTable is initial.
soTableNames[] = soTable[].
* Add in the customer namespace if we need to
if not pcName is initial.
loop at soTableNames.
if soTableNames-low+0(strLength) <> pcName.
concatenate pcName soTableNames-low into soTableNames-low.
endif.

if soTableNames-high+0(strLength) <> pcName.
concatenate pcName soTableNames-high into soTableNames-high.
endif.

modify soTableNames.
endloop.
endif.
endif.

* Function names
if not soFName is initial.
soFunctionName[] = soFname[].
* Add in the customer namespace if we need to
if not pcName is initial.
loop at soFunctionName.
if soFunctionName-low+0(strLength) <> pcName.
concatenate pcName soFunctionName-low into soFunctionName-low.
endif.

if soFunctionName-high+0(strLength) <> pcName.
concatenate pcName soFunctionName-high into soFunctionName-high.
endif.

modify soFunctionName.
endloop.
endif.
endif.

* Function group
if not soFGroup is initial.
soFunctionGroup[] = soFGroup[].
* Add in the customer namespace if we need to
if not pcName is initial.
loop at soFunctionName.
if soFunctionGroup-low+0(strLength) <> pcName.
concatenate pcName soFunctionGroup-low into soFunctionGroup-low.
endif.

if soFunctionGroup-high+0(strLength) <> pcName.
concatenate pcName soFunctionGroup-high into soFunctionGroup-high.
endif.

modify soFunctionGroup.
endloop.
endif.
endif.

* Class names
if not soClass is initial.
soClassName[] = soClass[].
* Add in the customer namespace if we need to
if not pcName is initial.
loop at soClassName.
if soClassName-low+0(strLength) <> pcName.
concatenate pcName soClassName-low into soClassName-low.
endif.

if soClassName-high+0(strLength) <> pcName.
concatenate pcName soClassName-high into soClassName-high.
endif.

modify soClassName.
endloop.
endif.
endif.

* Program names
if not soProg is initial.
soProgramName[] = soProg[].
* Add in the customer namespace if we need to
if not pcName is initial.
loop at soProgramName.
if soProgramName-low+0(strLength) <> pcName.
concatenate pcName soProgramName-low into soProgramName-low.
endif.

if soProgramName-high+0(strLength) <> pcName.
concatenate pcName soProgramName-high into soProgramName-high.
endif.

modify soProgramName.
endloop.
endif.
endif.
endform. " fillSelectionRanges

*----------------------------------------------------------------------------------------------------------------------
* retrieveTables... Search for tables in dictionary
*----------------------------------------------------------------------------------------------------------------------
form retrieveTables using iLocDictStructure like iDictionary[]
soTable like soTable[]
soAuthor like soAuthor[].

data: waDictStructure type tDictTable.

select tabname
from dd02l
into waDictStructure-tablename
where tabname in soTable
and tabclass <> 'CLUSTER'
and tabclass <> 'POOL'
and tabclass <> 'VIEW'
and as4user in soAuthor
and as4local = 'A'.

perform findTableDescription using waDictStructure-tablename
waDictStructure-tableTitle.

perform findTableDefinition using waDictStructure-tableName
waDictStructure-iStructure[].

append waDictStructure to iLocDictStructure.
clear waDictStructure.
endselect.
endform. "retrieveTables

*----------------------------------------------------------------------------------------------------------------------
* findTableDescription... Search for table description in dictionary
*----------------------------------------------------------------------------------------------------------------------
form findTableDescription using value(tableName)
tableDescription.

select single ddtext
from dd02t
into tableDescription
where tabname = tableName
and ddlanguage = sy-langu.
endform. "findTableDescription

*----------------------------------------------------------------------------------------------------------------------
* findTableDefinition... Find the structure of a table from the SAP database.
*----------------------------------------------------------------------------------------------------------------------
form findTableDefinition using value(tablename)
iDictStruct like dumIDictStructure[].

data gotstate like dcobjif-gotstate.
data: definition type standard table of DD03P with header line.
data: waDictStruct type tDictTableStructure.

call function 'DDIF_TABL_GET'
exporting
name = tablename
state = 'A'
langu = sy-langu
importing
gotstate = gotstate
tables
dd03p_tab = definition
exceptions
illegal_input = 1
others = 2.

if sy-subrc = 0 and gotstate = 'A'.
loop at definition.
move-corresponding definition to waDictStruct.
perform removeLeadingZeros changing waDictStruct-position.
perform removeLeadingZeros changing waDictStruct-leng.
append waDictStruct to iDictStruct.
endloop.
endif.
endform. "findTableDefinition

*----------------------------------------------------------------------------------------------------------------------
* retrieveMessageClass... Retrieve a message class from the SAP database
*----------------------------------------------------------------------------------------------------------------------
form retrieveMessageClass using iLocMessages like iMessages[]
rangeAuthor like soAuthor[]
value(messageClassName)
value(messageClassLang)
value(modifiedBy).

data: waMessage type tMessage.

if not messageClassName is initial.
select * from t100
appending corresponding fields of table iLocMessages
where sprsl = messageClassLang
and arbgb = messageClassName.

loop at iLocMessages into waMessage.
select single stext
from t100a "#EC CI_BUFFJOIN
into waMessage-stext
where arbgb = waMessage-arbgb.
modify iLocMessages from waMessage index sy-tabix.
endloop.
else.
if modifiedBy is initial.
* Select by author
select t100~arbgb "#EC CI_BUFFJOIN
t100~msgnr
t100~text
t100a~stext
appending corresponding fields of table iLocMessages
from t100
inner join t100a on t100a~arbgb = t100~arbgb
where t100a~masterLang = messageClassLang
and t100a~respUser in rangeAuthor[].
else.
* Select also by the last person who modified the message class
select t100~arbgb "#EC CI_BUFFJOIN
t100~msgnr
t100~text
t100a~stext
appending corresponding fields of table iLocMessages
from t100
inner join t100a on t100a~arbgb = t100~arbgb
where t100a~masterLang = messageClassLang
and t100a~respUser in rangeAuthor[]
and t100a~lastUser in rangeAuthor[].
endif.
endif.
endform. "retrieveMessageClass

*----------------------------------------------------------------------------------------------------------------------
* retrieveFunctions... Retrieve function modules from SAP DB. May be called in one of two ways
*----------------------------------------------------------------------------------------------------------------------
form retrieveFunctions using soFName like soFunctionName[]
soFGroup like soFunctionGroup[]
iLocFunctionNames like iFunctions[]
value(solocAuthor) like soAuthor[]
value(getTextElements)
value(getScreens)
value(customerOnly)
value(customerNameRange).

ranges: rangeFuncName for tfdir-funcName.
ranges: rangefuncGroup for enlfdir-area.
data: waFunctionName type tFunction.
data: noGroupsFound type i value TRUE.
data: previousFG type v_fdir-area.

rangeFuncName[] = soFName[].
rangeFuncGroup[] = soFGroup[].

if not soLocAuthor[] is initial.
*-- Need to select all function groups by author
select area
from tlibv
into rangeFuncGroup-low
where uname in soLocAuthor
and area in soFGroup[].

rangeFuncGroup-sign = 'I'.
rangeFuncGroup-option = 'EQ'.
append rangeFuncGroup.
noGroupsFound = FALSE.
endselect.
else.
noGroupsFound = FALSE.
endif.

if noGroupsFound = FALSE.
* select by function name and/or function group.
select funcName area
from v_fdir
into (waFunctionName-functionName,
waFunctionName-functionGroup)
where funcName in rangeFuncName
and area in rangeFuncGroup
and generated = ''
order by area.

append waFunctionName to iLocFunctionNames.
endselect.
endif.

loop at iLocFunctionNames into waFunctionName.
perform retrieveFunctionDetail using waFunctionName-functionName
waFunctionName-progname
waFunctionName-includeNumber
waFunctionName-functionTitle.

perform findMainFunctionInclude using waFunctionName-progname
waFunctionName-includeNumber
waFunctionName-functionMainInclude.

perform findFunctionTopInclude using waFunctionName-progname
waFunctionName-topIncludeName.

* Find all user defined includes within the function group
perform scanForFunctionIncludes using waFunctionName-progname
customerOnly
customerNameRange
waFunctionName-iIncludes[].
* Find main message class
perform findMainMessageClass using waFunctionName-progname
waFunctionName-messageClass.

* Find any screens declared within the main include
if not getScreens is initial.
if previousFG is initial or previousFG <> waFunctionName-functionGroup.
perform findFunctionScreenFlow using waFunctionName.

* Search for any GUI texts
perform retrieveGUITitles using waFunctionName-iGUITitle[]
waFunctionName-progname.
endif.
endif.

if not getTextElements is initial.
* Find the program texts from out of the database.
perform retrieveProgramTexts using waFunctionName-iSelectionTexts[]
waFunctionName-iTextElements[]
waFunctionName-progname.
endif.

previousFG = waFunctionName-functionGroup.
modify iLocFunctionNames from waFunctionName.
endloop.
endform. "retrieveFunctions

*----------------------------------------------------------------------------------------------------------------------
* retrieveFunctionDetail... Retrieve function module details from SAP DB.
*----------------------------------------------------------------------------------------------------------------------
form retrieveFunctionDetail using value(functionName)
progname
includeName
titleText.

select single pname
include
from tfdir
into (progname, includeName)
where funcName = functionName.

if sy-subrc = 0.
select single stext
from tftit
into titleText
where spras = sy-langu
and funcName = functionName.
endif.
endform. "retrieveFunctionDetail

*----------------------------------------------------------------------------------------------------------------------
* findMainFunctionInclude... Find the main include that contains the source code
*----------------------------------------------------------------------------------------------------------------------
form findMainFunctionInclude using value(programName)
value(includeNo)
internalIncludeName.
data: newIncludeNumber type string.

concatenate '%U' includeNo into newIncludeNumber.
select single include
from d010inc
into internalIncludeName
where master = programName
and include like newIncludeNumber.
endform. "findMainFunctionInclude

*----------------------------------------------------------------------------------------------------------------------
* findFunctionTopInclude... Find the top include for the function group
*----------------------------------------------------------------------------------------------------------------------
form findFunctionTopInclude using value(programName)
topIncludeName.

select single include
from d010inc

Podobne tematy


Następna dyskusja:

Analiza ABC




Wyślij zaproszenie do