Sie sind auf Seite 1von 282

*&---------------------------------------------------------------------*

*& Report ZZSOLPROD


*&
*&---------------------------------------------------------------------*
*& Beliebig langer Pfadname
*&
*&---------------------------------------------------------------------
*
REPORT ZZSOLPROD LINE-SIZE 255.
************************************************
*Constant for length of field "Existing Path"
CONSTANTS c_path_length TYPE i VALUE 200.
************************************************
******Variablen fuer Selektionsbildschirme
*Transaktionscodes
DATA: tacode TYPE tstc.
*Namen von Funktionsgruppen
DATA: fktgroup TYPE tlibg-area.
*Klassen und Interfaces
DATA: class TYPE vseoclass-clsname.
*Entwicklungsklassen
DATA devcl TYPE tadir-devclass.
*Definition fuer Selektion ueber Transportauftraege
DATA: trkorr TYPE e071-trkorr.
*Definition fuer Badi-Implementierung
DATA: badi_imp TYPE sxc_attr-imp_name.
*Definition fuer Kundenerweiterungsprojekte
DATA: wa_cmod TYPE modact.
*Definition fuer IDOCs
*Definition ueberi Tables-Anweisung wegen Suchhilfe
TABLES: sed5struc.
*IAC-Service
TABLES: iachtml.
*Modifikationselemente
DATA: modiname TYPE smodilog-sub_name.
*Tabellen mit den Includeobjekten
DATA: it_trdir TYPE TABLE OF trdir,
wa_trdir LIKE LINE OF it_trdir.
DATA: report_name TYPE reposrc-progname.
*Sprachenfeld
DATA: language TYPE t002c-spras.
************************************************
*** Selektionsbildschirm.
************************************************
*Startselektionsbildschirm
SELECTION-SCREEN BEGIN OF BLOCK b80 WITH FRAME TITLE text059.
PARAMETERS: p_single RADIOBUTTON GROUP g0.
PARAMETERS: p_trkorr RADIOBUTTON GROUP g0.
PARAMETERS: p_devc RADIOBUTTON GROUP g0.
SELECTION-SCREEN END OF BLOCK b80.
*Sonstige Selektionsparameter
PARAMETERS: p_nspace TYPE namespace.
SELECTION-SCREEN SKIP 1.
*PARAMETERS: pfad(7) TYPE c DEFAULT 'C:\temp'.
PARAMETERS: pfad(c_path_length) TYPE c DEFAULT 'C:\temp'.
SELECT-OPTIONS: o_lan FOR language DEFAULT sy-langu NO INTERVALS.
*Selektionsbildschirm fuer Selektion ueber den Transportauftrag
SELECTION-SCREEN BEGIN OF SCREEN 100.
SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME TITLE text057.
SELECT-OPTIONS: o_trkorr FOR trkorr NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b0.
SELECTION-SCREEN END OF SCREEN 100.

*Selektionsbildschrim fuer die Selektion ueber die Entwicklungsklasse


SELECTION-SCREEN BEGIN OF SCREEN 101.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text052.
SELECT-OPTIONS: o_devcl FOR devcl NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 101.
*Selektionsbildschirm fuer die Selektion von einzelnen Objekten
*und Selektion einer logischen Entwicklung
SELECTION-SCREEN BEGIN OF SCREEN 102.
PARAMETERS: p_logic(10) TYPE c.
SELECTION-SCREEN SKIP 2.

SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text069.


* Rahmenprogramme, Modulpoole
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text040.
SELECT-OPTIONS: o_prog FOR report_name NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b2.
*Transaktion
SELECTION-SCREEN BEGIN OF BLOCK b2a WITH FRAME TITLE text070.
SELECT-OPTIONS: o_tcode FOR tacode-tcode NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b2a.
* Funktionsgruppen
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text041.
SELECT-OPTIONS: o_fkgrp FOR fktgroup NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b3.
* Klassen, Classpools
SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text042.
SELECT-OPTIONS: o_class FOR class NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b4.
* Interfaces
SELECTION-SCREEN BEGIN OF BLOCK b4a WITH FRAME TITLE text067.
SELECT-OPTIONS: o_intf FOR class NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b4a.
* IDOC's
* Funktionsgruppen
SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text048.
SELECT-OPTIONS: o_idoc FOR sed5struc-object NO INTERVALS.
PARAMETERS: p_basis LIKE sed5struc-select_org RADIOBUTTON GROUP g1.
PARAMETERS: p_enh LIKE sed5struc-select_ext RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b5.
* *Kundenerweiterungsprojekte: CMOD
SELECTION-SCREEN BEGIN OF BLOCK b6 WITH FRAME TITLE text049.
SELECT-OPTIONS o_cmod FOR wa_cmod-name NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b6.
* *Badiimplementierungen
SELECTION-SCREEN BEGIN OF BLOCK b7 WITH FRAME TITLE text054.
SELECT-OPTIONS o_badis FOR badi_imp NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b7.
* Modifikationen
SELECTION-SCREEN BEGIN OF BLOCK b8 WITH FRAME TITLE text068.
SELECT-OPTIONS o_inc FOR modiname NO INTERVALS.
SELECT-OPTIONS o_func FOR modiname NO INTERVALS.
SELECT-OPTIONS o_dynp FOR modiname NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b8.
* IAC-Service
SELECTION-SCREEN BEGIN OF BLOCK b9 WITH FRAME TITLE text062.
SELECT-OPTIONS o_iacs FOR iachtml-service NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b9.
SELECTION-SCREEN END OF BLOCK b.
SELECTION-SCREEN END OF SCREEN 102.

************************************************
*******Datendeklarationen
************************************************
*Praefixe fuer Downloaddateinamen
CONSTANTS: ci(4) VALUE 'IN_', "Filename für Includes
cr(3) VALUE 'R_', "Filename für Onlineprogramme
cl(4) VALUE 'OL_', "Objektliste
ct(4) VALUE 'TAB_', "Tables
cv(5) VALUE 'View_', "View
cst(4) VALUE 'STR_', "Strukturen
cap(4) VALUE 'App_', "Appends
ca(4) VALUE 'AL_', "alle Programme/Includes
cs(4) VALUE 'SC_', "Filename für Screens
cte(4) VALUE 'TE_', "Textelemnte
ctg(4) VALUE 'TGR_', "Typgruppen
ccl(5) VALUE 'CLIN_', "Klassenincludes
cint(5) VALUE 'Intf_', "Interfaceincludes
eint(5) VALUE 'Enh_', "Enhancementinclude
cfunc(5) VALUE 'Func_'. "einzelner Funktionsbaustein
*** Namensraum
DATA: g_name(11) TYPE c,
g_savename TYPE string.
DATA: g_nspace TYPE string.
DATA: g_len_nspace TYPE i.
*interne Tabelle und Arbeitsbereich fuer Sprache
DATA: it_lan TYPE STANDARD TABLE OF t002c-spras,
wa_lan LIKE LINE OF it_lan.
*Einbindung des Typepools damit das kopierte Coding fuer die Bearbeitung
*der IDOC's funktioniert.
TYPE-POOLS ledid.
*Type fuer Tabelle mit Includename
TYPES: BEGIN OF include,
name TYPE trdir-name,
END OF include.
TYPES: includetab TYPE STANDARD TABLE OF include.
*Typ fuer Performtabelle
TYPES: performtab TYPE STANDARD TABLE OF string.
*Tabllentype für download-Tabelle
FIELD-SYMBOLS: <ty_downtab> TYPE STANDARD TABLE.
*Verzeichnisname beim Anlegen des Verzeichnisses des Rahmenprogramms
FIELD-SYMBOLS <new_dir> TYPE ANY.
*DATA: new_dir(128) TYPE c.
DATA: new_dir TYPE string.
*Bezugstabelle fuer Textpool-Parametertabelle
DATA: it_textpool TYPE STANDARD TABLE OF textpool.
*** Anzahl gefundener TRDIR-Sätze (Anzahl der Rahmenprogramme)
DATA: anz TYPE i.
*** Antwort aus Popupabfrage, wenn mehr als 50 Rahmenprogramme
DATA: answer.
*Zwischenspeicherugng Pfad fuer Klassen OO
*DATA: lcl_it_path TYPE STANDARD TABLE OF rlgrap-filename,
DATA: lcl_it_path TYPE STANDARD TABLE OF string,
lcl_wa_path LIKE LINE OF lcl_it_path.

*Eindeutiger Identifizierer Installation + System


DATA: instnr(30) TYPE c.
*Sichern des Rootverzeichnisses fuer spaetere Zugriffe
DATA: root TYPE string.
*Fag,ob Verzeichnis bereits angelegt worden ist.
DATA: direxists TYPE c.
*Tabelle mit abhängigen Includes des jeweiligen Rahmenprogramms
DATA: it_d010inc TYPE STANDARD TABLE OF d010inc,
wa_d010inc LIKE LINE OF it_d010inc.
*Tabelle mit abhängigen Includes des jeweiligen Rahmenprogramms
DATA: it_d020s TYPE STANDARD TABLE OF d020s,
wa_d020s LIKE LINE OF it_d020s.
*Tabelle mit abhängigen Tabellen, Strukturen, Appends des jeweiligen
*Rahmenprogramms
DATA: it_d010tab TYPE STANDARD TABLE OF d010tab,
wa_d010tab LIKE LINE OF it_d010tab.
*Generische Tabelle zum Download von Includes
*DATA: downtab TYPE STANDARD TABLE OF ababsource.
DATA: "down_variable(255) type c,
downtab LIKE STANDARD TABLE OF abaptxt255 ."down_variable.
*String zum Schreiben der Ausgabeliste nach Download
DATA: str_output TYPE string.
*Generischer Bezugsdatentyp für includename
DATA: c_includename(40) TYPE c.
*Stückliste für die Speicherung der Struktur des Rahmenprogramms
TYPES: BEGIN OF prog_stueckliste,
type TYPE string, "beliebige Laenge wegen sprechenden Namen
name(75) TYPE c, "Laenge wegen zusammengesetzten Namen
obername TYPE trdir-name,
instnr LIKE instnr,
file_name(75) TYPE c, "filename with replaced special chars
END OF prog_stueckliste.
*allgemeine Stueckliste
DATA: it_prog_stueckliste TYPE STANDARD TABLE OF prog_stueckliste
WITH NON-UNIQUE KEY name obername.
DATA: wa_prog_stueckliste LIKE LINE OF it_prog_stueckliste.
*spezielle Stueckliste fuer logische Entwicklung
DATA: it_log_stueckliste TYPE STANDARD TABLE OF prog_stueckliste,
wa_log_stueckliste LIKE LINE OF it_log_stueckliste.
*Tabelle für Strukturinformationen über Funktionsgruppen.
*Includename und wenn Fktbaustein, auch dessen Namen.
*Die Name der Fktgruppe wird im Dateinamen festgehalten
TYPES: BEGIN OF fkgrp_struktur,
objecttype(20) TYPE c,
objectname(75) TYPE c, "wegen zsammengesetzten Namen
fktbstname TYPE tfdir-funcname,
file_objectname(75) TYPE c,
END OF fkgrp_struktur.
DATA: it_fkgrp_struktur TYPE STANDARD TABLE OF fkgrp_struktur,
wa_fkgrp_struktur LIKE LINE OF it_fkgrp_struktur.

*** Dateiname für den Download


*DATA: filename LIKE rlgrap-filename.
DATA: filename TYPE string.

*** Dateigrösse des Donwloads


DATA: size TYPE i.
*Workarea fuer dd02l -->Bestimmung der Tabellentypen
DATA: wa_ddictypes TYPE dd02l.
*Bereiche fuer die Verarbeitung der Datenelemente
DATA: it_dataelements TYPE STANDARD TABLE OF dd04v,
wa_dataelements LIKE LINE OF it_dataelements.
*Typ, der nur sinnvolle Informationen über Datenelemente
TYPES: BEGIN OF idd04v,
rollname TYPE dd04v-rollname,
ddlanguage TYPE dd04v-ddlanguage,
domname TYPE dd04v-domname,
memoryid TYPE dd04v-memoryid,
logflag TYPE dd04v-logflag,
headlen TYPE dd04v-headlen,
scrlen1 TYPE dd04v-scrlen1,
scrlen2 TYPE dd04v-scrlen2,
scrlen3 TYPE dd04v-scrlen3,
ddtext TYPE dd04v-ddtext,
reptext TYPE dd04v-reptext,
scrtext_s TYPE dd04v-scrtext_s,
scrtext_m TYPE dd04v-scrtext_m,
scrtext_l TYPE dd04v-scrtext_l,
actflag TYPE dd04v-actflag,
shlpname TYPE dd04v-shlpname,
shlpfield TYPE dd04v-shlpfield,
END OF idd04v.
*Bereiche fuer die Verarbeitung der Domaenen
DATA: it_dd01v TYPE STANDARD TABLE OF dd01v,
wa_dd01v LIKE LINE OF it_dd01v,
it_dd07v TYPE STANDARD TABLE OF dd07v,
wa_dd07v LIKE LINE OF it_dd07v.
*Typ fuer Aussagefähigelder Felder fuer Menuexitcodes
TYPES: BEGIN OF icuatexts,
prog TYPE cuatexts-prog,
code TYPE cuatexts-code,
sprsl TYPE cuatexts-sprsl,
l_text TYPE cuatexts-l_text,
s_text TYPE cuatexts-s_text,
info_text TYPE cuatexts-info_text,
icon_name TYPE cuatexts-icon_name,
END OF icuatexts.
*Gesamttabelle fuer Messages
DATA: it_messages TYPE STANDARD TABLE OF t100
WITH NON-UNIQUE KEY sprsl arbgb msgnr,
wa_messages LIKE LINE OF it_messages.
*Feststellen, ob Includedownload erfolgreich war
DATA: ok TYPE c.
*globale Tabelle der Tabellentypen: Sammlung fuer Downlaod
DATA: it_tabletypes TYPE STANDARD TABLE OF dd40vv,
wa_tabletypes LIKE LINE OF it_tabletypes.
*Typ der nur die wichtigen Infos zu Tabellentyp enthält
TYPES: BEGIN OF itabletypes,
typename TYPE dd40vv-typename,
rowtype TYPE dd40vv-rowtype,
rowkind TYPE string,
datatype TYPE dd40vv-datatype,
leng TYPE dd40vv-leng,
decimals TYPE dd40vv-decimals,
accessmode TYPE string,
keydef TYPE string,
keykind TYPE string,
generic TYPE dd40vv-generic,
END OF itabletypes.
*Typ fuer Schluesselfelder von Tabellentypen
TYPES: BEGIN OF idd42s,
keyfdpos TYPE dd42s-keyfdpos,
keyfield TYPE dd42s-keyfield,
END OF idd42s.
*Tabelle fuer alle Tabellentypen
TYPES: BEGIN OF all_tabletypes,
typename TYPE ddtypes-typename,
END OF all_tabletypes.
DATA: it_all_tabletypes TYPE STANDARD TABLE OF all_tabletypes.

*Typ mit Joindedingungen im View


TYPES: BEGIN OF idd28j,
ltab TYPE dd28j-ltab,
lfield TYPE dd28j-lfield,
operator TYPE dd28j-operator,
rtab TYPE dd28j-rtab,
rfield TYPE dd28j-rfield,
END OF idd28j.
*Typ mit wichtigen Selektionsbedingungen fuer Views
*(Basis Tabelle dd28s)
TYPES: BEGIN OF idd28s,
tabname TYPE dd28s-tabname,
fieldname TYPE dd28s-fieldname,
operator TYPE dd28s-operator,
constants TYPE dd28s-constants,
END OF idd28s.

*Typ mit wichtigen Felder der Viewfeler


*(Basis: dd27s)
TYPES: BEGIN OF idd27s,
viewfield TYPE dd27s-viewfield,
tabname TYPE dd27s-tabname,
fieldname TYPE dd27s-fieldname,
END OF idd27s.
*Uebersicht der Berechtigungsobjekte
DATA: it_tobj TYPE STANDARD TABLE OF tobj,
wa_tobj LIKE LINE OF it_tobj.
*Aktivitaeten zu den Berichtigungsobjekten
DATA: it_tactz TYPE STANDARD TABLE OF tactz,
wa_tactz LIKE LINE OF it_tactz.
*Berechtigungsfelder
DATA: it_authx TYPE STANDARD TABLE OF authx,
wa_authx LIKE LINE OF it_authx.
*Globale Bereiche für Titlebars
DATA: it_d347t TYPE STANDARD TABLE OF d347t,
wa_d347t LIKE LINE OF it_d347t.
*Übersichtstabelle über Zuordnung von Transaktionen
*zu Programmen
TYPES: BEGIN OF itstc,
tcode TYPE tstc-tcode,
pgmna TYPE tstc-pgmna ,
dypno TYPE tstc-dypno,
END OF itstc.
DATA: it_tstc TYPE STANDARD TABLE OF itstc,
wa_tstc LIKE LINE OF it_tstc.
*Transaktionscodetabelle fuer Klassen (Parmetertabelle)
DATA: it_tstcp TYPE STANDARD TABLE OF tstcp,
wa_tstcp LIKE LINE OF it_tstcp.
*Globale Tabellen für Menueaufbau Pfstatus
DATA: it_rsmpe_tree TYPE STANDARD TABLE OF rsmpe_tree,
wa_rsmpe_tree LIKE LINE OF it_rsmpe_tree.
*Globale Tabelle für Functionkeys
DATA: it_rsmpe_keys TYPE STANDARD TABLE OF rsmpe_keys,
wa_rsme_keys LIKE LINE OF it_rsmpe_keys.
*Variablen für Klassenbehandlung
*Flag fuer Ueberpruefung, ob Klasse vorliegt
DATA: clintf(1) TYPE c.
*Stückliste für Klassenliste
TYPES: BEGIN OF classlist,
typus(20) TYPE c,
inc TYPE trdir-name,
meth TYPE tmdir-methodname ,
file_inc TYPE trdir-name,
END OF classlist.
DATA: it_classlist TYPE STANDARD TABLE OF classlist,
wa_classlist LIKE LINE OF it_classlist.
*Verarbeitung von verschachtelten Aufrufstrukturen
TYPES: BEGIN OF collectmains,
typus(4) TYPE c,
mainname(40) TYPE c,
END OF collectmains.
DATA: it_collectmains TYPE STANDARD TABLE OF collectmains
WITH NON-UNIQUE KEY mainname,
wa_collectmains LIKE LINE OF it_collectmains.
*Bereiche fuer Interface in einer Klass zu schreiben
DATA: it_vseoimplem TYPE STANDARD TABLE OF vseoimplem,
wa_vseoimplem LIKE LINE OF it_vseoimplem.
*Bereiche fuer Dialogbausteine
*1.) Zuordnung Dialogbaustein -> Modulpool; Gesamttabelle
TYPES: BEGIN OF itdct,
dnam TYPE tdct-dnam,
prog TYPE tdct-prog,
dynr TYPE tdct-dynr,
END OF itdct.
DATA: it_tdct TYPE STANDARD TABLE OF itdct,
wa_tdct LIKE LINE OF it_tdct.
*2.) Zuordnung der Parameter zu einem Funktionsbaustein; Gesamttabelle
DATA: it_diapar TYPE STANDARD TABLE OF diapar,
wa_diapar LIKE LINE OF it_diapar.
*Bereiche fuer SET/GET Parameter; globale fuer jeweiliges Rahmenprogramm
DATA: it_tpara TYPE STANDARD TABLE OF tpara,
wa_tpara LIKE LINE OF it_tpara.
*Bereiche fuer HTML-Tabellendatei (wird global fuer alle HTML-Dateien
*definiert
DATA: it_html TYPE STANDARD TABLE OF line,
wa_html LIKE LINE OF it_html.
*global table for ABAP.xsl
DATA: it_abap_xsl TYPE STANDARD TABLE OF line.
*global table for formate.css
DATA: it_formate_css TYPE STANDARD TABLE OF line.
*global table for nav.xsl
DATA: it_nav_xsl TYPE STANDARD TABLE OF line.
*global table for table.xsl
DATA: it_table_xsl TYPE STANDARD TABLE OF line.
*global table for blank.xsl
DATA: it_blank_xsl TYPE STANDARD TABLE OF line.
*Datenobjekte für XSL-Files
DATA: it_xsl TYPE STANDARD TABLE OF line,
wa_xsl LIKE LINE OF it_xsl.
*Zusammenfassende Tabelle fuer Kunden erweiterungsprogjekt
TYPES: BEGIN OF enhancecomp,
sapenh TYPE modsap-name,
comp TYPE modsap-member,
typus(20) TYPE c,
internal(50) TYPE c,
file_internal(50) TYPE c,
END OF enhancecomp.
DATA: it_enhancecomp TYPE STANDARD TABLE OF enhancecomp,
wa_enhancecomp LIKE LINE OF it_enhancecomp.
*Tabelle fuer Selektion ueber Entwicklungsklasse
DATA: it_tadir TYPE STANDARD TABLE OF tadir,
wa_tadir LIKE LINE OF it_tadir.
*interne Tabelle fuer Wertehilfe bei Modinamen
DATA: BEGIN OF it_f4_modi OCCURS 0,
name LIKE smodilog-sub_name,
END OF it_f4_modi.

*interne Tabelle fuer Wertehilfe bei Klassen


DATA: BEGIN OF it_f4_class OCCURS 0,
name LIKE vseoclass-clsname,
END OF it_f4_class.
*interne Tabelle fuer Wertehilfe bei Interfaces
DATA: BEGIN OF it_f4_intf OCCURS 0,
name LIKE vseointerf-clsname,
END OF it_f4_intf.
*intern Tabelle fuer Wertehilfe bei Badiimplementierung
*interne Tabelle fuer Wertehilfe bei Enhancementprojekt
DATA: BEGIN OF it_f4_cmod OCCURS 0,
name LIKE modact-name,
END OF it_f4_cmod.
*intern Tabelle fuer Wertehilfe bei Badiimplementierung
DATA: BEGIN OF it_f4_badiimp OCCURS 0,
name LIKE sxc_attr-imp_name,
END OF it_f4_badiimp.
*globale tabelle um die heruntergeladenen Typgruppen von Customer-
*enhancements in die spezifische Enhancementstueckliste schreiben
*zu koennen
DATA: it_enh_d010inc TYPE STANDARD TABLE OF d010inc,
wa_enh_d010inc LIKE LINE OF it_enh_d010inc.
*Globale Tabelle um die heruntergeladenen Tabellen von Customer-
*enhancements in die spezifischen Enhancementstrueckliste schreiben
*zu koennen
TYPES: BEGIN OF enh_d010tab,
tabname TYPE d010tab-tabname,
typus(4) TYPE c,
END OF enh_d010tab.
DATA: it_enh_d010tab TYPE STANDARD TABLE OF enh_d010tab,
wa_enh_d010tab LIKE LINE OF it_enh_d010tab.
*Globale Tabelle fuer Informationen von Menueexits
DATA: it_cuatexts TYPE STANDARD TABLE OF cuatexts.
*Tabelle fuer Rueckgabewert der ausprogrammierten F4-Hilfen
DATA: it_rueck TYPE STANDARD TABLE OF ddshretval,
wa_rueck LIKE LINE OF it_rueck.
*Gesamttabelle einer Implementierung zur Uebersicht Badi zu
*Implementierung und Filterparameter
DATA: it_ges_sxc_exit TYPE STANDARD TABLE OF sxc_exit.
*Typ fuer Dialogbausteine
TYPES: BEGIN OF dialogmodule,
header LIKE tdct,
par LIKE diapar,
END OF dialogmodule.
*Bezugstabelle fur vseoclass
DATA: it_vseoclass TYPE STANDARD TABLE OF vseoclass.
*Typ zur Speicherung von Klassenhierarchien
TYPES: BEGIN OF inheritance,
sub TYPE vseoextend-clsname,
super TYPE vseoextend-clsname,
END OF inheritance.
*Tabelle + Workarea fuer Vererbungshierachie
DATA: it_inheritance TYPE STANDARD TABLE OF inheritance,
wa_inheritance LIKE LINE OF it_inheritance.
*Protokolltabelle fuer Ausgabe
TYPES: BEGIN OF protocol,
typus TYPE c,
objtype(20) TYPE c,
objname(50) TYPE c,
* filename(128) TYPE c,
filename TYPE string,
END OF protocol.
DATA: it_protocol TYPE STANDARD TABLE OF protocol,
wa_protocol LIKE LINE OF it_protocol.
*Variable zum Zusammenbauen der Ueberschrift
*DATA: header(128) TYPE c.
DATA: header TYPE string.
*globale Tabelle fuer Haupttransportauftraege(Objekte haengen
*an Unterauftraegen
DATA: it_trkorr_ueber TYPE STANDARD TABLE OF e070-strkorr,
wa_trkorr_ueber LIKE LINE OF it_trkorr_ueber.

*Struktur zum Sichern der globalen Tabellen eines Rahmenprogramms


TYPES: BEGIN OF global_save,
type TYPE c,
name LIKE wa_trdir-name,
END OF global_save.
*Bereiche zur Sicherung der globalen Tabellen eines Rahmenprogramms
DATA: it_global_save TYPE STANDARD TABLE OF global_save,
wa_global_save LIKE LINE OF it_global_save.
*Arbeitsbereich zur temporaeren Speicherung der globalen Tabellen
DATA: it_tmpgs TYPE STANDARD TABLE OF global_save,
wa_tmpgs LIKE LINE OF it_tmpgs.
*Returncode fuer Methodenaufruf Directory_Create
DATA: rc TYPE i.
*Variable fuer globalen Namen des uebergeordneten Objektes
DATA: global_main_name LIKE wa_trdir-name.

*interner Typ fuer Domaenenattribute, der nur die notwendigen


*Werte enthaelt
TYPES: BEGIN OF idd01v,
domname TYPE dd01v-domname,
ddlanguage TYPE dd01v-ddlanguage,
datatype TYPE dd01v-datatype,
leng TYPE dd01v-leng,
outputlen TYPE dd01v-outputlen,
decimals TYPE dd01v-decimals,
lowercase TYPE dd01v-lowercase,
signflag TYPE dd01v-signflag,
valexi TYPE dd01v-valexi,
entitytab TYPE dd01v-entitytab,
convexit TYPE dd01v-convexit,
ddtext TYPE dd01v-ddtext,
END OF idd01v.
*interner Typ fuer Domaenenfestwert, der nur die notwendigen
*Werte enthaelt
TYPES: BEGIN OF directory_list,
dir TYPE string,
END OF directory_list.
DATA: it_directory_list TYPE STANDARD TABLE OF directory_list,
wa_directory_list LIKE LINE OF it_directory_list.
*globaler Verzeichnisname
*DATA: dir TYPE rlgrap-filename.
DATA: dir TYPE string.
*Verzeichnisname für Entwicklungsklassen
*DATA: dc_path TYPE rlgrap-filename.
DATA: dc_path TYPE string.
*Verzeichnisname bei Transportauftraegen
*DATA: tr_path TYPE rlgrap-filename.
DATA: tr_path TYPE string.

*Typ fuer Liste der Oberobjekte bei Einzelselektion


TYPES: BEGIN OF obj_list,
name TYPE string,
END OF obj_list.
*Bereiche fuer Liste der Einzelselektionen
DATA: it_obj_list TYPE STANDARD TABLE OF obj_list,
wa_obj_list LIKE LINE OF it_obj_list.
*Variable für Pfadsuche.
FIELD-SYMBOLS: <g_folder> TYPE ANY.
*Flag, ob Externe Programmaufe abgearbeitet werden
DATA: extern TYPE c.
*Typ fuer Wetehilfe von Domänen
TYPES: BEGIN OF idd07v,
domname TYPE dd07v-domname,
valpos TYPE dd07v-valpos,
ddlanguage TYPE dd07v-ddlanguage,
domvalue_l TYPE dd07v-domvalue_l,
domvalue_h TYPE dd07v-domvalue_h,
ddtext TYPE dd07v-ddtext,
END OF idd07v.

*Versionstabelle fuer Hilfe der Modifikationen


DATA: it_vrsd TYPE STANDARD TABLE OF vrsd,
wa_vrsd LIKE LINE OF it_vrsd.
*Zwischentabelle fuer Selektion aus smodilog
TYPES: BEGIN OF such,
sub_name TYPE smodilog-sub_name,
END OF such.
DATA: it_such TYPE STANDARD TABLE OF such,
wa_such LIKE LINE OF it_such.
*Tabelle zur Aufnahme der Verzeichnis
*Typ fuer Tabelllen/View und Appendstrukturen, der nur die notwendigen
*Informationen enthält
TYPES: BEGIN OF idd03p,
tabname TYPE dd03p-tabname,
fieldname TYPE dd03p-fieldname,
shorttext TYPE dfies-fieldtext,
position TYPE dd03p-position,
keyflag TYPE dd03p-keyflag,
mandatory TYPE dd03p-mandatory,
rollname TYPE dd03p-rollname,
checktable TYPE dd03p-checktable,
adminfield TYPE dd03p-adminfield,
reftable TYPE dd03p-reftable,
precfield TYPE dd03p-precfield,
notnull TYPE dd03p-notnull,
datatype TYPE dd03p-datatype,
leng TYPE dd03p-leng,
decimals TYPE dd03p-decimals,
END OF idd03p.
*Variablen zur Belegung initialer Textelemente
DATA: text001 TYPE string,
text002 TYPE string,
text003 TYPE string,
text004 TYPE string,
text005 TYPE string,
text006 TYPE string,
text007 TYPE string,
text008 TYPE string,
text009 TYPE string,
text010 TYPE string,
text011 TYPE string,
text012 TYPE string,
text013 TYPE string,
text014 TYPE string,
text015 TYPE string,
text016 TYPE string,
text017 TYPE string,
text018 TYPE string,
text019 TYPE string,
text020 TYPE string,
text021 TYPE string,
text022 TYPE string,
text023 TYPE string,
text024 TYPE string,
text025 TYPE string,
text026 TYPE string,
text027 TYPE string,
text028 TYPE string,
text029 TYPE string,
text030 TYPE string,
text031 TYPE string,
text032 TYPE string,
text033 TYPE string,
text034 TYPE string,
text035 TYPE string,
text036 TYPE string,
text037 TYPE string,
text038 TYPE string,
text039 TYPE string,
text043 TYPE string,
text044 TYPE string,
text045 TYPE string,
text046 TYPE string,
text047 TYPE string,
text050 TYPE string,
text051 TYPE string,
text055 TYPE string,
text056 TYPE string,
text058 TYPE string,
text060 TYPE string,
text061 TYPE string,
text066 TYPE string,
text071 TYPE string,
text072 TYPE string.
*Variablen zur Steuerung der Belegung der Selektionstexte
DATA: program TYPE sy-cprog,
it_tp TYPE STANDARD TABLE OF textpool,
wa_tp LIKE LINE OF it_tp.
DATA tp_flag(1) TYPE c.
************************************************
*
*Initialisierungen
*************************************************
INITIALIZATION.
*Belegung der Selektionstexte nach erstem Start
program = sy-cprog.
READ TEXTPOOL program INTO it_tp LANGUAGE sy-langu.
DELETE it_tp WHERE entry = '' AND id = 'S'.
READ TABLE it_tp INTO wa_tp WITH KEY key = 'O_LAN'.
IF NOT wa_tp-entry = ' Documentation Language'.
wa_tp-id = 'S'. wa_tp-key = 'O_IACS'.
wa_tp-entry = ' IAC-Service(ITS)'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_LAN'.
wa_tp-entry = ' Documentation Language'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_BADIS'.
wa_tp-entry = ' Badi-Implementation'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_CLASS'.
wa_tp-entry = ' Classes'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_CMOD'.
wa_tp-entry = ' Enhancement Project'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_DEVCL'.
wa_tp-entry = ' Developmentclass'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_DYNP'.
wa_tp-entry = ' Dynpro'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_FKGRP'.
wa_tp-entry = ' Functiongroups'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_FUNC'.
wa_tp-entry = ' Functionmodule'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_IDOC'.
wa_tp-entry = ' IDoc/Enhancement'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_INC'.
wa_tp-entry = ' Include'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_INTF'.
wa_tp-entry = ' Interface'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_PROG'.
wa_tp-entry = ' Online-Program'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_TCODE'.
wa_tp-entry = ' Transactioncode'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'O_TRKORR'.
wa_tp-entry = ' Transport-Request'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'PFAD'.
wa_tp-entry = ' Existing path'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_APP1'.
wa_tp-entry = ' Data-File auf App-Server'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_APP2'.
wa_tp-entry = ' CO-File auf App-Server'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_ASC'.
wa_tp-entry = ' Asci Mode'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_BASIS'.
wa_tp-entry = ' Basistype'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_BIN'.
wa_tp-entry = ' Binary Mode'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_DEVC'.
wa_tp-entry = ' Selection via Developmentclass'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_DOWN'.
wa_tp-entry = ' Download vom R/3-Server'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_ENH'.
wa_tp-entry = ' Enhancement'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_FRONT'.
wa_tp-entry = ' Verzeichnis WS'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_LOGIC'.
wa_tp-entry = ' Logical Development'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_OVER'.
wa_tp-entry = ' Bestehende Dat. übeschr.'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_SINGLE'.
wa_tp-entry = ' Selction via single Objects'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_TRFIL'.
wa_tp-entry = ' Handling of Transport Files'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_TRKOR1'.
wa_tp-entry = ' Transportauftrag'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_TRKORR'.
wa_tp-entry = ' Selection via Transportrequest'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_NSPACE'.
wa_tp-entry = ' Namespace'.
APPEND wa_tp TO it_tp.
wa_tp-id = 'S'. wa_tp-key = 'P_UP'.
wa_tp-entry = ' Upload zum R/3-Server'.
APPEND wa_tp TO it_tp.
INSERT TEXTPOOL program FROM it_tp LANGUAGE sy-langu.
tp_flag = 'X'.
*Stautusmeldung als Hinweis fuer Neustart
MESSAGE i888(sabapdocu) WITH
'This is the first time you start this report.'
'After the next start the '
'selectiontexts are initialized!'.
ENDIF.
***************************************************************
*Initialisierung der Bezeichnungsfelder;
*Zum besseren Upload werden die Textelemente mit den Inhalten der
*Variablen gefuellt, wenn die Textelemente nicht belegt sind.
text001 ='SUBRC'(001).
text002 = 'by reading object list for'(002).
text003 = 'by write file'(003).
text004 = 'saved as'(004).
text005 = 'Continue ?'(005).
text006 = 'More then 50 programs found.'(006).
text007 = 'Information'(007).
text008 = 'Object list'(008).
text009 = 'Table/View'(009).
text010 = 'Maininclude'(010).
text011 = 'Include'(011).
text012 = 'Objectlist'(012).
text013 = 'not saved as'(013).
text014 = 'Download error...'(013).
text015 = 'Directory exists ?'(015).
text016 = 'Summary'(016).
text017 = 'Screen'(017).
text018 = 'Textelements'(018).
text019 = 'Parts List'(019).
text020 = 'Messagetable'(020).
text021 = 'Fktgroupstructure'(021).
text022 = 'Dataelements'(022).
text023 = 'DomainHeader'(023).
text024 = 'DomainValues'(024).
text025 = 'Typegroup'(025).
text026 = 'Structure'(026).
text027 = 'Append'(027).
text028 = 'Directory exists Already'(028).
text029 = 'Yes for next Main-program!'(029).
text030 = 'No for stop !'(030).
text031 = 'Autthorityobjects'(031).
text032 = 'Author. Acti'(032).
text033 = 'Titlebar'(033).
text034 = 'Tacodelist'(034).
text035 = 'Menulist'(035).
text036 = 'Functionkeylist'(036).
text037 = 'Classinclude'(037).
text038 = 'Interfaceinclude'(038).
text039 = 'Classlist'(039).
text040 = 'Reports / Modulepools'(040).
text041 = 'Functiongroups'(041).
text042 = 'Classes'(042).
text043 = 'Dlgmd_to_Modpool_'(043).
text044 = 'Dlgmoduleparams'(044).
text045 = 'Patchlist'(045).
text046 = 'Lockobject'(046).
text047 = 'Set/Get-Parameter'(047).
text048 = 'IDOC'(048).
text049 = 'Customer Enhancements'(049).
text050 = 'Enhancementinclude'(050).
text051 = 'EnhOverview'(051).
text052 = 'via Developmentclass'(052).
text054 = 'Badi-Implementation'(054).
text055 = 'BadiImpFilter'(055).
text056 = 'Menuexitlist'(056).
text057 = 'via Transport-Request'.
text058 = 'Functionmodule'(058).
text059 = 'Selection Method'(059).
text060 = 'View'(060).
text061 = 'Authorityfields'(061).
text062 = 'IAC-Service(ITS)'(062).
text066 = 'Transport request does not exist in the source system'(066).
text067 = 'Interfaces'(067).
text068 = 'Modification'(068).
text069 = 'Mainobjects of Workbench'(069).
text070 = 'Transactioncode'(070).
text071 = 'Messageclass'(071).
text072 = 'Tabletype'(072).

************************************************
*F4-Hilfe fuer Wahl des Basisverzeichnis
*************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PFAD.
*Dummyvariablen zur Zuweisung je nach Release
DATA: lcl_char LIKE rlgrap-filename,
lcl_string TYPE string.
*Längenbestimmung
DATA: lcl_len TYPE i.
*Bereich fuer Lesen der Parameter
DATA: lcl_wa_vseoparam TYPE vseoparam.
*Verarbeitung unterscheiden je nach Release:
*Typisierung nach string oder char.
*Pruefen wie der Parameter Directory der Methode typisiert ist
SELECT SINGLE * FROM vseoparam INTO lcl_wa_vseoparam
WHERE clsname = 'CL_GUI_FRONTEND_SERVICES'
AND cmpname = 'DIRECTORY_BROWSE'
AND sconame = 'SELECTED_FOLDER'.
IF lcl_wa_vseoparam-type = 'C'.
ASSIGN lcl_char TO <g_folder>.
ELSEIF lcl_wa_vseoparam-type = 'STRING'.
ASSIGN lcl_string TO <g_folder>.
ENDIF.

CALL METHOD cl_gui_frontend_services=>directory_browse


EXPORTING
window_title = 'Selection of Basis Folder'
initial_folder = 'C:\'
CHANGING
selected_folder = <g_folder>
EXCEPTIONS
cntl_error = 1
* ERROR_NO_GUI = 2
* others = 3
.
IF sy-subrc = 0.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2
OTHERS = 3.
IF sy-subrc = 0.
lcl_len = STRLEN( <g_folder> ).
IF lcl_len <= c_path_length.
pfad = <g_folder>.
ELSE.
MESSAGE i888(sabapdocu) WITH
'Only' c_path_length 'characters allowed!'
'Reselect a path!'.
ENDIF.
ENDIF.
ENDIF.

************************************************
*F4-Hilfe fuer Modifizierte Includes
*************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR o_inc-low.
*Bereiche fuer Kundenenhancementtabelle
DATA: lcl_it_smodilog TYPE STANDARD TABLE OF smodilog-sub_name,
lcl_wa_smodilog LIKE LINE OF lcl_it_smodilog.
* Create search string for partner namespace
* Take customer name space if initial
IF p_nspace IS INITIAL.
p_nspace = 'Z'.
ENDIF.
CONCATENATE p_nspace '%' INTO g_name.
CONDENSE g_name NO-GAPS.
*Initialisieren der Tabellen
REFRESH lcl_it_smodilog. CLEAR lcl_wa_smodilog.
REFRESH it_such. REFRESH it_vrsd.
*Relevante Daten aus der Versionverwaltung lesen.
SELECT * FROM vrsd INTO TABLE it_vrsd
WHERE objtype = 'REPS'
AND versno = '00000'
AND objname NOT LIKE 'Z%'
AND objname NOT LIKE 'Y%'
AND objname NOT LIKE g_name
AND korrnum NOT LIKE 'SAP%'
AND korrnum NOT LIKE 'UPGRADE%'.
LOOP AT it_vrsd INTO wa_vrsd.
APPEND wa_vrsd-objname TO it_such.
ENDLOOP.
*Modi-Tabelle
SELECT DISTINCT sub_name FROM smodilog INTO TABLE lcl_it_smodilog
FOR ALL ENTRIES IN it_such
WHERE sub_name = it_such-sub_name.
LOOP AT lcl_it_smodilog INTO lcl_wa_smodilog.
APPEND lcl_wa_smodilog TO it_f4_modi.
ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'


EXPORTING
retfield = 'o_inc-low'
value_org = 'S'
TABLES
value_tab = it_f4_modi
return_tab = it_rueck
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE it_rueck INDEX 1 INTO wa_rueck.
o_inc-low = wa_rueck-fieldval.
ENDIF.
REFRESH it_f4_modi.

************************************************
*F4-Hilfe fuer Modifizierte Funktionsbaustein
*************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR o_func-low.
*Bereiche fuer Kundenenhancementtabelle
DATA: lcl_it_smodilog TYPE STANDARD TABLE OF smodilog-sub_name,
lcl_wa_smodilog LIKE LINE OF lcl_it_smodilog.
* Create search string for partner namespace
* Take customer name space if initial
IF p_nspace IS INITIAL.
p_nspace = 'Z'.
ENDIF.
CONCATENATE p_nspace '%' INTO g_name.
CONDENSE g_name NO-GAPS.
*Initialisieren der Tabellen
REFRESH lcl_it_smodilog. CLEAR lcl_wa_smodilog.
REFRESH it_such. REFRESH it_vrsd.
*Relevante Daten aus der Versionverwaltung lesen.
SELECT * FROM vrsd INTO TABLE it_vrsd
WHERE objtype = 'FUNC'
AND versno = '00000'
AND objname NOT LIKE 'Z%'
AND objname NOT LIKE 'Y%'
AND objname NOT LIKE g_name
AND korrnum NOT LIKE 'SAP%'
AND korrnum NOT LIKE 'UPGRADE%'.
LOOP AT it_vrsd INTO wa_vrsd.
APPEND wa_vrsd-objname TO it_such.
ENDLOOP.
*Modi-Tabelle
SELECT DISTINCT sub_name FROM smodilog INTO TABLE lcl_it_smodilog
FOR ALL ENTRIES IN it_such
WHERE sub_name = it_such-sub_name.

LOOP AT lcl_it_smodilog INTO lcl_wa_smodilog.


APPEND lcl_wa_smodilog TO it_f4_modi.
ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'


EXPORTING
retfield = 'o_func-low'
value_org = 'S'
TABLES
value_tab = it_f4_modi
return_tab = it_rueck
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE it_rueck INDEX 1 INTO wa_rueck.
o_func-low = wa_rueck-fieldval.
ENDIF.
REFRESH it_f4_modi.

************************************************
*F4-Hilfe fuer Modifizierte Dynpros
*************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR o_dynp-low.
*Bereiche fuer Kundenenhancementtabelle
DATA: lcl_it_smodilog TYPE STANDARD TABLE OF smodilog-sub_name,
lcl_wa_smodilog LIKE LINE OF lcl_it_smodilog.
DATA: lcl_saplname(30) TYPE c.
* Create search string for partner namespace
* Take customer name space if initial
IF p_nspace IS INITIAL.
p_nspace = 'Z'.
ENDIF.
CONCATENATE p_nspace '%' INTO g_name.
CONDENSE g_name NO-GAPS.
* Create name with SAPL*
IF p_nspace(1) = '/'.
CONCATENATE p_nspace 'SAPL%' INTO lcl_saplname.
ELSE.
lcl_saplname = 'SAPLZ%'.
ENDIF.

*Initialisieren der Tabellen


REFRESH lcl_it_smodilog. CLEAR lcl_wa_smodilog.
SELECT DISTINCT sub_name FROM smodilog INTO TABLE lcl_it_smodilog
WHERE sub_name NOT LIKE 'Z%'
AND sub_name NOT LIKE 'Y%'
AND sub_name NOT LIKE g_name
AND sub_name NOT LIKE 'SAPLZ%'
AND sub_name NOT LIKE 'SAPLY%'
AND sub_name NOT LIKE lcl_saplname
AND sub_type = 'DYNP'.
LOOP AT lcl_it_smodilog INTO lcl_wa_smodilog.
APPEND lcl_wa_smodilog TO it_f4_modi.
ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'


EXPORTING
retfield = 'o_dynp-low'
value_org = 'S'
TABLES
value_tab = it_f4_modi
return_tab = it_rueck
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE it_rueck INDEX 1 INTO wa_rueck.
o_dynp-low = wa_rueck-fieldval.
ENDIF.
REFRESH it_f4_modi.

************************************************************
* F4-Hilfe fuer Reports und Modulpools
************************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR o_prog-low.
DATA: lcl_dynpfields TYPE STANDARD TABLE OF dynpread WITH HEADER LINE.
* Get entry from screen
lcl_dynpfields-fieldname = 'O_PROG-LOW'.
APPEND lcl_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = lcl_dynpfields
EXCEPTIONS
OTHERS.
IF sy-subrc EQ 0.
READ TABLE lcl_dynpfields INDEX 1.
o_prog-low = lcl_dynpfields-fieldvalue.
ENDIF.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
object_type = 'PROG'
object_name = o_prog-low
suppress_selection = 'X'
without_personal_list = 'X'
IMPORTING
object_name_selected = o_prog-low
EXCEPTIONS
cancel = 01.

************************************************
*F4-Hilfe fuer Interface
*************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR o_class-low.
*Bereiche fuer Kundenenhancementtabelle
DATA: lcl_it_vseoclass TYPE STANDARD TABLE OF vseoclass-clsname,
lcl_wa_vseoclass LIKE LINE OF lcl_it_vseoclass .
*Initialisieren der Tabellen
REFRESH lcl_it_vseoclass. CLEAR lcl_wa_vseoclass .
* Create search string for partner namespace
* Take customer name space if initial
IF p_nspace IS INITIAL.
p_nspace = 'Z'.
ENDIF.
CONCATENATE p_nspace '%' INTO g_name.
CONDENSE g_name NO-GAPS.
SELECT DISTINCT clsname FROM vseoclass INTO TABLE lcl_it_vseoclass
WHERE clsname LIKE 'Z%'
OR clsname LIKE 'Y%'
OR clsname LIKE g_name.
LOOP AT lcl_it_vseoclass INTO lcl_wa_vseoclass.
APPEND lcl_wa_vseoclass TO it_f4_class.
ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'


EXPORTING
retfield = 'o_intf-low'
value_org = 'S'
TABLES
value_tab = it_f4_class
return_tab = it_rueck
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE it_rueck INDEX 1 INTO wa_rueck.
o_class-low = wa_rueck-fieldval.
ENDIF.
REFRESH it_f4_class.

************************************************
*F4-Hilfe fuer Interface
*************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR o_intf-low.
*Bereiche fuer Kundenenhancementtabelle
DATA: lcl_it_vseointerf TYPE STANDARD TABLE OF vseointerf-clsname,
lcl_wa_vseointerf LIKE LINE OF lcl_it_vseointerf.
*Initialisieren der Tabellen
REFRESH lcl_it_vseointerf. CLEAR lcl_wa_vseointerf.
* Create search string for partner namespace
* Take customer name space if initial
IF p_nspace IS INITIAL.
p_nspace = 'Z'.
ENDIF.
CONCATENATE p_nspace '%' INTO g_name.
CONDENSE g_name NO-GAPS.
SELECT DISTINCT clsname FROM vseointerf INTO TABLE lcl_it_vseointerf
WHERE clsname LIKE 'Z%'
OR clsname LIKE 'Y%'
OR clsname LIKE g_name.
LOOP AT lcl_it_vseointerf INTO lcl_wa_vseointerf .
APPEND lcl_wa_vseointerf TO it_f4_intf.
ENDLOOP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'o_intf-low'
value_org = 'S'
TABLES
value_tab = it_f4_intf
return_tab = it_rueck
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE it_rueck INDEX 1 INTO wa_rueck.
o_intf-low = wa_rueck-fieldval.
ENDIF.
REFRESH it_f4_intf.
************************************************
***
*F4-Hilfe fuer Enhancementprojekt (Feld modact-name
*************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR o_cmod-low.
*Bereiche fuer Kundenenhancementtabelle
DATA: lcl_it_modact TYPE STANDARD TABLE OF modact-name,
lcl_wa_modact LIKE LINE OF lcl_it_modact.
*Initialisieren der Tabellen
REFRESH lcl_it_modact. REFRESH it_rueck.
SELECT DISTINCT name FROM modact INTO TABLE lcl_it_modact.
LOOP AT lcl_it_modact INTO lcl_wa_modact.
APPEND lcl_wa_modact TO it_f4_cmod.
ENDLOOP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'o_cmod-low'
value_org = 'S'
TABLES
value_tab = it_f4_cmod
return_tab = it_rueck
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE it_rueck INDEX 1 INTO wa_rueck.
o_cmod-low = wa_rueck-fieldval.
ENDIF.
REFRESH it_f4_cmod.
************************************************************
*Ausprogrammierte F4-Hilfe fuer Badi-Implementierungen
************************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR o_badis-low.
*Bereiche fuer Kundenenhancementtabelle
DATA: lcl_it_badiimp TYPE STANDARD TABLE OF sxc_attr-imp_name,
lcl_wa_badiimp LIKE LINE OF lcl_it_badiimp.
*Initialisieren der Tabellen
REFRESH lcl_it_badiimp. REFRESH it_rueck.
SELECT imp_name FROM sxc_attr INTO TABLE lcl_it_badiimp
WHERE active = 'X'.
LOOP AT lcl_it_badiimp INTO lcl_wa_badiimp.
APPEND lcl_wa_badiimp TO it_f4_badiimp.
ENDLOOP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'o_badis-low'
value_org = 'S'
TABLES
value_tab = it_f4_badiimp
return_tab = it_rueck
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE it_rueck INDEX 1 INTO wa_rueck.
o_badis-low = wa_rueck-fieldval.
ENDIF.
REFRESH it_f4_badiimp.
***************************************************
*
********Beginn der Hauptroutine***********************
*
***************************************************
START-OF-SELECTION.
*Ueberpruefung, ob erster Programmstart
IF tp_flag = 'X'.
* Information message wegen Popup-Verhalten
MESSAGE i888(sabapdocu) WITH
'Restart of Report!'
'Tis happens only at the first start'.
* Zur Aufrufstelle zurückspringen; Neuer Programmstart
SET SCREEN 0.
STOP.
ENDIF.
*Eindeutigen Schlüssel für Installation + System
PERFORM get_unique_identifier.

*Startverzeichnis herststellen
dir = pfad.
*Alle Tabellentypen im Kundennamensraum fuer Abgleich lesen
SELECT typename FROM ddtypes INTO TABLE it_all_tabletypes
WHERE typekind = 'TTYP'.
*Aufruf des gewählten Selektionsbildschirms
PERFORM get_selected_screen.
*Selektionsbirdschirm abfangen
PERFORM selection.

*Protokolltabelle ausgeben
PERFORM output_protocol.

***************************************************
*
********Ende der Hauptroutine***********************
*
***************************************************

****************************************************
****Unterprogramme; Formroutinen
****************************************************
*&---------------------------------------------------------------------*
*& Form reps_mods
*&---------------------------------------------------------------------*
* Aufruf aus dem Selektionsbildschirm für einzelne Objekte
* Abfangen der Eingabe aus diesem Bildschirm
* Aufruf der Verarbeitungsroutine fuer Reports/Modulpools
*----------------------------------------------------------------------*
FORM reps_mods.
*Bereiche fuer trdir
DATA: lcl_it_trdir TYPE STANDARD TABLE OF trdir,
lcl_wa_trdir LIKE LINE OF lcl_it_trdir.
*Selektion der relevanten Reports und Modulpoole
SELECT * FROM trdir INTO TABLE lcl_it_trdir
WHERE name IN o_prog
AND ( ( subc = '1' ) OR ( subc ='M' )
OR ( subc ='S' ) ) "Report o. Modulpool
AND ( ( name LIKE 'Z%' ) OR ( name LIKE 'Y%' ) OR
( name LIKE g_name ) ).

*Verlassen,wenn keine Werte gefunden worden sind


IF lcl_it_trdir IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for Reports or Modulpools! '
'Please check your selection. '
'The program will process your other selections.'.
*Form-Routine verlassen
EXIT.
ENDIF.
**********Ausfuehren des Programmdownloads
*** Ausführung für jedes Rahmenprogramms
LOOP AT lcl_it_trdir INTO lcl_wa_trdir.
*Liste mit Ober-Objekten bei Einzelselektion
MOVE lcl_wa_trdir-name TO wa_obj_list-name.
APPEND wa_obj_list TO it_obj_list.
*Aufruf der Verarbeitungsroutine fuer Reports / Modulpoole
PERFORM handle_reps_mods USING lcl_wa_trdir-name.

*Stueckliste fuer logische Entwicklung schreiben


IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'Report/Modulpool'
lcl_wa_trdir-name
p_logic.
ENDIF.
ENDLOOP. "Schleife ueber selektierte Rahmenprogramme

ENDFORM. "Reps_Mods

*&---------------------------------------------------------------------*
*& Form GET_UNIQUE_IDENTIFIER
*&---------------------------------------------------------------------*
* Liest die Lizenznummer des Systems und den Systemnamen.
* Daraus wird eindeutiger Identifikationsstring für dieses System
* zusammengebaut (globales Feld).
*----------------------------------------------------------------------*
FORM get_unique_identifier.
************************************************
***Lesen der Installationsnummer des Systems
************************************************
*1. Installationsnummer des Kunden herauslesen
CALL FUNCTION 'SLIC_GET_LICENCE_NUMBER'
IMPORTING
license_number = instnr.
**2. Concatenieren der Inst-Nummer, Trennzeichen und Systemnamen
* CONCATENATE instnr '#%%#' sy-sysid INTO instnr.
ENDFORM. " GET_UNIQUE_IDENTIFIER
*&---------------------------------------------------------------------*
*& Form HANDLE_NORMAL_INCLUDES
*&---------------------------------------------------------------------*
* Rekursives Lesen und Sichern aller Includes fuer das
* angegebene Rahmenprogramm
*----------------------------------------------------------------------*
FORM handle_normal_includes USING p_name.
DATA: lcl_it_includes TYPE STANDARD TABLE OF include,
lcl_wa_includes LIKE LINE OF lcl_it_includes.

*FB liefert nur die normalen Inlcudes des Programmes/Includes


CALL FUNCTION 'GET_INCLUDETAB'
EXPORTING
progname = p_name
TABLES
incltab = lcl_it_includes.
LOOP AT lcl_it_includes INTO lcl_wa_includes.
*Kundennamensraum???, Partnernamensraum, Transportauftragssicht?
IF lcl_wa_includes-name(1) = 'Z' OR lcl_wa_includes-name(1) = 'Y'
OR lcl_wa_includes-name(g_len_nspace) = p_nspace
OR ( p_trkorr = 'X' AND lcl_wa_includes-name(1) <> '<' ).
PERFORM download_include USING lcl_wa_includes-name 'I'
CHANGING ok.
IF ok = 'X'. "Download include war erfolgreich
*Stueckliste herunterschreiben
PERFORM write_stueckliste USING 'IN'
lcl_wa_includes-name
p_name.
ENDIF. "Dowhload erfolgreich
ENDIF. "Kundennamensraum?
ENDLOOP.
ENDFORM. " READ_NORMAL_INCLUDES
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_INCLUDE
*&---------------------------------------------------------------------*
* Sichern des angegebenen Includes in das Filesystem.
* Erstellung der Dateinamen je nach Aufrufparameter p_typus.
* Rückgabe des Parameters OK zur Überprüfung, ob Sicherung
* erfolgt ist.
*----------------------------------------------------------------------*
FORM download_include USING p_include LIKE c_includename
p_typus TYPE c
CHANGING ok TYPE c.
*Variable fuer Laenge des Typgruppennamens (aussagefähiger Name)
DATA: lcl_laeng TYPE i.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
* XML-Strukutur
DATA: lcl_it_xml TYPE STANDARD TABLE OF tbl2048.
*Ausgabeparameter initialisieren
REFRESH downtab.
CLEAR str_output. CLEAR size. CLEAR filename.
*Fuer Typgruppen den Namen der Typgruppe aus dem Incldename
*herausnehemen --> Offset von 3 bei p_include
*Nur downloaden wenn noch nicht gedownloaded, da in Stückliste.
IF p_typus = 'T'.
READ TABLE it_prog_stueckliste WITH KEY name = p_include+3
TRANSPORTING NO FIELDS.
ELSE.
READ TABLE it_prog_stueckliste WITH KEY name = p_include
TRANSPORTING NO FIELDS.
ENDIF.
IF sy-subrc <> 0. "nichts gefunden
*Quelltext lesen
READ REPORT p_include INTO downtab.
*Fallunterscheidung der einzelnen Typen von Includes
*fuer Downloadtabelle und Ausgabename
CASE p_typus.
WHEN 'I'. "normale Includes
CONCATENATE ci p_include INTO filename.
str_output = text011.
WHEN 'R'. "Rahmenprogramme
CONCATENATE cr p_include INTO filename.
str_output = text010.
WHEN 'T'. "Typgruppen
lcl_laeng = STRLEN( p_include ).
lcl_laeng = lcl_laeng - 3.
CONCATENATE ctg p_include+3(lcl_laeng) INTO filename.
str_output = text025.
WHEN 'C'. "Klaseeninclude
CONCATENATE ccl p_include INTO filename.
str_output = text037.
WHEN 'J'. "Interface
CONCATENATE cint p_include INTO filename.
str_output = text038.
WHEN 'E'. "Include eines Enhancements
CONCATENATE eint p_include INTO filename.
str_output = text050.
WHEN 'F'. "Einzelner Funktionsbaustein
CONCATENATE cfunc p_include INTO filename.
str_output = text058.
ENDCASE.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
* Convert include to XML
PERFORM convert_include_to_xml TABLES lcl_it_xml
USING p_include.
*Nur downloaden wenn include existiert (subrc von read report =0)
IF sy-subrc = 0.
* create complete filename
CONCATENATE new_dir '\' filename '.XML' INTO filename.
* replace g_nspace with g_savename into p_include.
*Durchführung des eigentlichen Downloads
PERFORM call_ws_download USING filename
lcl_it_xml
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' str_output p_include filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' str_output p_include filename.
*p_OK auf X setzen; Download hat funktioniert
ok = 'X'.
ENDIF. "subrc-Abfrage Fktbstabfrage
ELSE.
* no success in reading the files
* WE have to clear the ok flag
CLEAR ok.
ENDIF. "Include vorhanden?
ENDIF. "schon in Stueckliste drin
* replace g_savename with g_nspace into p_include.
ENDFORM. " DOWNLOAD_INCLUDE
*&---------------------------------------------------------------------*
*& Form HANDLE_TYPGROUPS
*&---------------------------------------------------------------------*
* Lesen und Sichern der Typgruppen des Rahmenprogramms,
* das in Parameter P_NAME enthalten ist.
* Schreiben der Stueckliste.
*----------------------------------------------------------------------*
FORM handle_typgroups USING p_wa_cross_ref TYPE cross.
*Variable fuer Includenamen der Typgruppe
DATA: lcl_inc LIKE c_includename.
CONCATENATE '%_C' p_wa_cross_ref-name INTO lcl_inc.

*Uebergabe des Typ des Includes, um Dateinamen festlegen zu können


CLEAR ok.
PERFORM download_include USING lcl_inc 'T'
CHANGING ok.
IF ok = 'X'. "Download include war erfolgreich
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Typgroup'
p_wa_cross_ref-name
global_main_name.
ENDIF.
ENDFORM. " HANDLE_TYPGROUPS
*&---------------------------------------------------------------------*
*& Form HANDLE_SCREENS
*&---------------------------------------------------------------------*
* Selektion der Dynpros des im Parameter P_NAME mitgegegbenen
* Rahmenprogrammes.
* Aufruf der Downloadroutine fuer Dynpros und Schreiben der
* Uebersichtsliste.
*----------------------------------------------------------------------*
FORM handle_screens USING p_name LIKE wa_trdir-name
p_typus TYPE c.
*Lokale Tabellen und Arbeitsbereiche zur Sicherung der
* Modularisierbareit
DATA: lcl_it_d020s LIKE it_d020s,
lcl_wa_d020s LIKE wa_d020s.

*Nur die Screens selektieren die nicht durch select-option/parameters


*im Coding festgelegt worden sind (d020s-type = S;J;W).
SELECT prog dnum type fnum FROM d020s INTO TABLE lcl_it_d020s
WHERE prog = p_name
AND ( ( type NE 'S' )
AND ( type NE 'J' )
AND ( type NE 'W' ) ).
LOOP AT lcl_it_d020s INTO lcl_wa_d020s.
*Unterscheidung zu welcher Ordnungsebene der Screen gehoert:
*Rahmenprogramm oder Funktionsgruppe oder ... (wegen Stuecklisten)
IF p_typus = 'R'. "Rahmenprogramm
*Ueberpuefen, ob schon Heruntergeladen (nur fuer Rahmenprogramme,
*da Screens von Funktionsgruppen ueber die Funktionsgruppen selbst
*abgesichert sind.
READ TABLE it_prog_stueckliste WITH TABLE KEY
name = lcl_wa_d020s-dnum
obername = p_name
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0. "nichts gefunden
PERFORM download_dynpro USING lcl_wa_d020s.
PERFORM write_stueckliste USING 'SCR'
lcl_wa_d020s-dnum
p_name.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " HANDLE_SCREENS
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_DYNPRO
*&---------------------------------------------------------------------*
* Durchführung der Sicherung eines Dynpros in das lokale
* Dateisystem.
* Der Code ist angepasster Standardcode. Änderungen sind druch
* eckige Klammern gekennzeichnet
*----------------------------------------------------------------------*
FORM download_dynpro USING p_wa_d020s LIKE wa_d020s.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Lokaler Dynproname zum Download
DATA: lcl_screenbez TYPE string.
*Lokale Strukturen zu Einlesen des Dynpros aus dem System
DATA: lcl_wa_dynproheader TYPE d020s, "Header des Dynpros
lcl_it_feldliste TYPE TABLE OF d021s, "Feldlistentabelle
lcl_it_ablauflogik LIKE d022s OCCURS 0 WITH HEADER LINE, "Ablauflogk
lcl_it_matchcode LIKE d023s OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF lcl_dynp,
prog TYPE d020s-prog,
dnum TYPE d020s-dnum,
END OF lcl_dynp.
*filename initialisieren
CLEAR filename.
*[zusätzliche Deklarationen für kopierten code(siehe Include)
DATA: header TYPE d020s,
descript TYPE d020t-dtxt,
* file TYPE rlgrap-filename.
file TYPE string.
DATA: fields TYPE TABLE OF d021s,
flowlogic LIKE d022s OCCURS 0 WITH HEADER LINE,
params LIKE d023s OCCURS 0 WITH HEADER LINE.
DATA header_char LIKE scr_chhead.
DATA dynp_char LIKE scr_chfld OCCURS 0 WITH HEADER LINE.
TABLES: d020t.
DATA prog_len TYPE p.
DATA fields_char LIKE scr_chfld OCCURS 0 WITH HEADER LINE.

CONSTANTS: stars(64) VALUE


'****************************************************************',
"#EC NOTEXT
comment1(64) VALUE
'* THIS FILE IS GENERATED BY THE SCREEN PAINTER. *',
"#EC NOTEXT
comment2(64) VALUE
'* NEVER CHANGE IT MANUALLY, PLEASE ! *',
"#EC NOTEXT
dynpro_text(8) VALUE '%_DYNPRO', "#EC NOTEXT
header_text(8) VALUE '%_HEADER', "#EC NOTEXT
params_text(8) VALUE '%_PARAMS', "#EC NOTEXT
descript_text(13) VALUE '%_DESCRIPTION', "#EC NOTEXT
fields_text(8) VALUE '%_FIELDS', "#EC NOTEXT
kreuz(1) VALUE 'x', "#EC NOTEXT
flowlogic_text(11) VALUE '%_FLOWLOGIC'. "#EC NOTEXT
*]
*Dynpro zuordnen
lcl_dynp-dnum = p_wa_d020s-dnum.
lcl_dynp-prog = p_wa_d020s-prog.

*Dynpro importieren
IMPORT DYNPRO lcl_wa_dynproheader lcl_it_feldliste lcl_it_ablauflogik
lcl_it_matchcode ID lcl_dynp.

*** Dateiname und Pfad bilden


CONCATENATE new_dir '\' cs p_wa_d020s-prog p_wa_d020s-dnum '.TXT'
INTO filename.
*In dieser Routine bis zum Ende des Formulars ist im wesentlichen der
*Code aus dem Funktionsbaustein RS_DYNPRO_DOWNLOAD enthalten. Die
*zusätzlichen
*Datendeklarationen sind am Anfang der Form enthalten. Änderungen des
*Codings sind mit [] gekennzeichnet. Der Funktionsbaustein 'Download'
*wurde durch 'WS_Download' ersetzt, um nicht den Pfad zur Speicherung
*manuell eingeben zu müssen.
*-----------------------------------------------------------------------
*[Erweiterung DNE
*Zuordnung der Parameter wie beim Aufruf des FB-Bausteins
header = lcl_wa_dynproheader.
file = filename.
fields = lcl_it_feldliste.
flowlogic[] = lcl_it_ablauflogik[].
params[] = lcl_it_matchcode[].

*Lesen der Kurztextbeschreibung des Dynpros


SELECT SINGLE dtxt FROM d020t INTO descript
WHERE prog = lcl_dynp-prog
AND dynr = lcl_dynp-dnum .
*]
*kopierter Text aus Funktionsbaustein
CALL FUNCTION 'RS_SCRP_HEADER_RAW_TO_CHAR'
EXPORTING
header_int = header
IMPORTING
header_char = header_char
EXCEPTIONS
OTHERS = 1.
REFRESH dynp_char.
* Comment
dynp_char = stars. APPEND dynp_char.
dynp_char = comment1. APPEND dynp_char.
dynp_char = comment2. APPEND dynp_char.
dynp_char = stars. APPEND dynp_char.
* Identification
dynp_char = dynpro_text. APPEND dynp_char. " '%_DYNPRO'
dynp_char = header_char-prog. APPEND dynp_char.
dynp_char = header_char-dnum. APPEND dynp_char.
dynp_char = sy-saprl. APPEND dynp_char.
DESCRIBE FIELD d020t-prog LENGTH prog_len IN CHARACTER MODE.
dynp_char(16) = prog_len. APPEND dynp_char.
* Header
dynp_char = header_text. APPEND dynp_char. " '%_HEADER'
APPEND header_char TO dynp_char.
* Description
dynp_char = descript_text. APPEND dynp_char. " '%_DESCRIPTION'
APPEND descript TO dynp_char.
* Fieldlist
dynp_char = fields_text. " '%_FIELDS'
APPEND dynp_char.
CALL FUNCTION 'RS_SCRP_FIELDS_RAW_TO_CHAR'
TABLES
fields_int = fields
fields_char = fields_char
EXCEPTIONS
OTHERS = 1.
LOOP AT fields_char.
APPEND fields_char TO dynp_char.
ENDLOOP.
* Flowlogic
dynp_char = flowlogic_text. " '%_FLOWLOGIC'
APPEND dynp_char.
LOOP AT flowlogic.
APPEND flowlogic TO dynp_char.
ENDLOOP.
** refresh flowlogic. "vjb 25.06.98
*[Abänderung des Funktionsbausteins DNE
* Dynpro Parameters "vjb ab 4.6A (01.07.98)
** IF NOT ( PARAMS IS INITIAL ).
dynp_char = params_text.
APPEND dynp_char.
LOOP AT params.
APPEND params TO dynp_char.
ENDLOOP.
* ENDIF.
*]
* begin of changes for partner namespace
TRANSLATE file USING '/_'.
* end of changes for partner namespace
* Download
PERFORM call_ws_download USING file
dynp_char[]
CHANGING lcl_subrc.
*[Eigene Fehlerprüfung/Wegschreiben Listen; Erweiterung DNE
CONCATENATE p_wa_d020s-prog ', ' p_wa_d020s-dnum INTO lcl_screenbez.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text017 lcl_screenbez filename.
ELSE.
PERFORM write_protocol USING 'N' text017 lcl_screenbez filename.
ENDIF.
*]
ENDFORM. " DOWNLOAD_DYNPRO
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_TEXTELEMENTS
*&---------------------------------------------------------------------*
* Lesen und Sichern der Textelemente des im Parameter
* P_NAME uebergebenen Rahmenprogrammes
*----------------------------------------------------------------------*
FORM download_textelements USING p_name LIKE wa_trdir-name
p_typus TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Lokale Datendefinition fuer Textelementtabelle
*Interne Tabellle zum Aufnehmender Textelemente
DATA: lcl_it_textelements LIKE textpool OCCURS 50 WITH HEADER LINE.
*Name des Textelements in der Stückliste (darf nicht heißen wie
*Rahmenprogramm.
DATA: lcl_text_name TYPE snodetext-text1.
*Filename initialisieren
CLEAR filename.
*Schleife ueber die selektierten Sprachen
LOOP AT it_lan INTO wa_lan.
*Name für Prüfung zusammenbauen.
CONCATENATE 'TE_' p_name '(' wa_lan ')' INTO filename.
*Namen fuer Stueckliste
lcl_text_name = filename.
*Nur downloaden wenn noch nicht gedownloaded, da in Stückliste.
READ TABLE it_prog_stueckliste WITH KEY name = filename
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
** Dateiname und Pfad bilden
CONCATENATE new_dir '\' filename '.htm' INTO filename.
*Textelemente in der Anmeldesprache herunterladen
READ TEXTPOOL p_name
INTO lcl_it_textelements LANGUAGE wa_lan.
*Nur Download und Eintrag in Stueckliste durchfuehren, wenn
*Textelement vorhanden sind.
IF sy-subrc = 0.
*HTML-Tabelle fuer Textelemente zusamenbauen
PERFORM create_htmltab_for_textelement USING lcl_it_textelements[]
.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text018 p_name filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text018 p_name filename.
*Je nach Typ oder Hierarchiestufe wird das wegschreiben der
*Strukturinformationen verschieden gehandhabt.
IF p_typus = 'G'. "Funktionsgruppe
CLEAR wa_fkgrp_struktur.
wa_fkgrp_struktur-objecttype = 'TE'.
wa_fkgrp_struktur-objectname = p_name.
APPEND wa_fkgrp_struktur TO it_fkgrp_struktur.
ELSEIF p_typus = 'R'. "Rahmenprogramm: Report/Modulpool
*Statisches wegschreiben der Stückliste für die Textelemente (Angaben
*stehen im vorhinein schon fest
CLEAR wa_prog_stueckliste.
wa_prog_stueckliste-type = 'TE'.
wa_prog_stueckliste-name = lcl_text_name.
wa_prog_stueckliste-obername = p_name.
wa_prog_stueckliste-instnr = instnr.
APPEND wa_prog_stueckliste TO it_prog_stueckliste.
ELSEIF p_typus = 'T'. "Selektion über Transportrequest
*Statisches wegschreiben der Stückliste für die Textelemente (Angaben
*stehen im vorhinein schon fest
CLEAR wa_prog_stueckliste.
wa_prog_stueckliste-type = 'TE'.
wa_prog_stueckliste-name = lcl_text_name.
wa_prog_stueckliste-obername = global_main_name.
wa_prog_stueckliste-instnr = instnr.
APPEND wa_prog_stueckliste TO it_prog_stueckliste.
ELSEIF p_typus = 'C'. "Klasse
CLEAR wa_classlist.
wa_classlist-typus = 'TE'.
wa_classlist-inc = lcl_text_name.
APPEND wa_classlist TO it_classlist.
ENDIF. "Welcher Typ liegt vor vor????
ENDIF. "Waren Textelemente vorhanden
ENDIF.
ENDIF. "Ende der Ueberpruefung, ob ueberhaupt Textelemente vorhanden
ENDLOOP. "Sprachentabelle

ENDFORM. " DOWNLOAD_TEXTELEMENTS


*&---------------------------------------------------------------------*
*& Form DOWNLOAD_STUECKLISTE
*&---------------------------------------------------------------------*
* Sicherung einer erzeugten Stueckliste in das lokale Dateisystem.
* Generierung der Tabelle in HTML-Format
*----------------------------------------------------------------------*
FORM download_stueckliste.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Stücklistenname
DATA: lcl_stueckliste_name TYPE string.
* Name for object name in parts list
DATA: lcl_file_name LIKE wa_prog_stueckliste-file_name.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
* begin of changes for partner namespace
* Auffuellen der Felder fuer den verwendeten file_name
LOOP AT it_prog_stueckliste INTO wa_prog_stueckliste.
lcl_file_name = wa_prog_stueckliste-name.
TRANSLATE lcl_file_name USING '/_'.
CONDENSE lcl_file_name NO-GAPS.
wa_prog_stueckliste-file_name = lcl_file_name.
MODIFY it_prog_stueckliste FROM wa_prog_stueckliste
INDEX sy-tabix.
ENDLOOP.
* end of changes for partner namespace
*Ueberschrift zusammenbauen
CONCATENATE 'List of Object' global_main_name
INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Objecttype' TO lcl_it_headerrow.
APPEND 'Objectname' TO lcl_it_headerrow.
APPEND 'Super Object' TO lcl_it_headerrow.
APPEND 'System Identifier' TO lcl_it_headerrow.
APPEND 'Name in file system' TO lcl_it_headerrow.

*Nur downloaden, wenn nicht leer


IF NOT ( it_prog_stueckliste IS INITIAL ).
CONCATENATE 'Stueckliste_' global_main_name
INTO lcl_stueckliste_name.
*Umwandlung in HTML-Tabelle
********************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_prog_stueckliste INTO wa_prog_stueckliste.
PERFORM create_htmltab_body USING wa_prog_stueckliste.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************
CLEAR filename.
CONCATENATE new_dir '\' lcl_stueckliste_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
* Protokollliste schreiben.
PERFORM write_protocol USING 'E' text019 lcl_stueckliste_name
filename.
ELSE.
* Protokollliste schreiben.
PERFORM write_protocol USING 'N' text019 lcl_stueckliste_name
filename.
ENDIF.
* Navigationsfiles zusammenbauen
CONCATENATE lcl_stueckliste_name '.htm' INTO lcl_stueckliste_name.
PERFORM create_nav_files USING lcl_stueckliste_name.
* Aufbauen und Herunterladen der XSL-Files
PERFORM create_xsl_files.
ENDIF.
ENDFORM. " DOWNLOAD_STUECKLISTE
*&---------------------------------------------------------------------*
*& Form WRITE_STUECKLISTE
*&---------------------------------------------------------------------*
* Schreiben der Stueckliste mit den Aufrufparametern Typ (p_typus),
* Name des Objektes (p_name) und Nam des übergeordneten Objektes
* (p_obername).
*----------------------------------------------------------------------*
FORM write_stueckliste USING p_type TYPE any
p_name TYPE any
p_obername TYPE any.
wa_prog_stueckliste-type = p_type.
wa_prog_stueckliste-name = p_name.
wa_prog_stueckliste-obername = p_obername.
wa_prog_stueckliste-instnr = instnr.
APPEND wa_prog_stueckliste TO it_prog_stueckliste.
ENDFORM. " WRITE_STUECKLISTE
*&---------------------------------------------------------------------*
*& Form HANDLE_DDIC
*&---------------------------------------------------------------------*
* Lesen von Tabellentypen, Strukturen, Tabellen, Views und Appends
* zu einem Rahmenprogramm (Parameter P_NAME).
*----------------------------------------------------------------------*
FORM handle_ddic USING p_name LIKE wa_trdir-name
p_typus TYPE c.
*Breiche fuer Bearbeitung von Rahmenprogramm abhängigen Includes
DATA: lcl_it_d010tab LIKE it_d010tab,
lcl_wa_d010tab LIKE wa_d010tab.
DATA: lcl_it_ddic TYPE STANDARD TABLE OF rddnm.
DATA: lcl_wa_ddic LIKE LINE OF lcl_it_ddic.
*lokaler Puffer fuer dd02l
DATA: lcl_it_puffer TYPE STANDARD TABLE OF dd02l,
lcl_wa_puffer LIKE LINE OF lcl_it_puffer.
*lokale Variable fuer Stuecklisten
DATA: lcl_ddictyp TYPE string.
*Arbeitsrbereiche fuer Bestimmung von Tabellenappends
DATA: lcl_it_dd02l TYPE STANDARD TABLE OF dd02l,
lcl_wa_dd02l LIKE LINE OF lcl_it_dd02l.
*Abgleich und Verarbeitung der Tabellentypen
SELECT * FROM d010tab INTO TABLE lcl_it_d010tab
WHERE master = p_name.
* DELETE lcl_it_d010tab
* WHERE NOT ( ( tabname(1) = 'Y' )
* OR ( tabname(1) = 'Z' )
* OR ( tabname(g_len_nspace) = p_nspace ) ).
LOOP AT lcl_it_d010tab INTO lcl_wa_d010tab.
* Only deal with elements in namespace
IF ( ( lcl_wa_d010tab-tabname(1) NE 'Y' )
AND ( lcl_wa_d010tab-tabname(1) NE 'Z' )
AND ( lcl_wa_d010tab-tabname(g_len_nspace) NE p_nspace ) ).
CONTINUE.
ENDIF.
READ TABLE it_all_tabletypes WITH KEY
typename = lcl_wa_d010tab-tabname TRANSPORTING NO FIELDS.
IF sy-subrc = 0. "Tabellentyp liegt vor
PERFORM handle_tabletype USING lcl_wa_d010tab-tabname.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Tabletype'
lcl_wa_d010tab-tabname
p_name.
ENDIF.
ENDLOOP.
LOAD REPORT p_name PART 'DDNM' INTO lcl_it_ddic.

*Zu den
*Verarbeitung der Informationen
LOOP AT lcl_it_ddic INTO lcl_wa_ddic.
*Initialisieren des Puffers
REFRESH lcl_it_puffer.
CLEAR lcl_wa_puffer.
*Feststellen des Typs des DDicobjektes
SELECT SINGLE * FROM dd02l INTO wa_ddictypes
WHERE tabname = lcl_wa_ddic-tabname.
*Objekte im Kundennamensraum herunterladen + Partnernamensraum
IF ( ( lcl_wa_ddic-tabname(1) = 'Y' )
OR ( lcl_wa_ddic-tabname(1) = 'Z' )
OR ( lcl_wa_ddic-tabname(g_len_nspace) = p_nspace ) ).
*Behandlung der Faelle
CASE wa_ddictypes-tabclass.
WHEN 'TRANSP'. "normale Tabellen
PERFORM download_table USING wa_ddictypes 'T'.
lcl_ddictyp = 'Table'.
WHEN 'VIEW'. "View
* PERFORM download_table USING wa_ddictypes 'V'.
PERFORM download_view USING wa_ddictypes.
lcl_ddictyp = 'View'.
WHEN 'INTTAB'. "Struktur
PERFORM download_table USING wa_ddictypes 'S'.
lcl_ddictyp = 'Structure'.
ENDCASE.
ELSE.
*Objekte im SAP-Namensraum auf eine Appendstruktur ueberpruefen
REFRESH lcl_it_dd02l. CLEAR lcl_wa_dd02l.
SELECT * FROM dd02l INTO TABLE lcl_it_dd02l
WHERE sqltab = lcl_wa_ddic-tabname
AND tabclass = 'APPEND'.
IF sy-subrc = 0. "es existieren appends
lcl_ddictyp = 'APP'.
LOOP AT lcl_it_dd02l INTO lcl_wa_dd02l.
*Eigentlicher Download
PERFORM download_table USING lcl_wa_dd02l 'A'.
*Schreiben der Stuecklisten
*Unterscheidung zu welcher Ordnungsebene diese Ddic-objektes gehoert:
*Rahmenprogramm oder Funktionsgruppe oder ...
IF p_typus = 'R'. "Rahmenprogramm
*Ueberpruefen, ob Eintrag mit diesem Schluessel schon in Stueckliste
*steht
READ TABLE it_prog_stueckliste WITH TABLE KEY
name = lcl_wa_dd02l-tabname
obername = lcl_wa_ddic-tabname
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0. "nichts gefunden
PERFORM write_stueckliste USING 'Append'
lcl_wa_dd02l-tabname
lcl_wa_ddic-tabname.
ENDIF.
ENDIF.

ENDLOOP. "Loop ueber Appends


CONTINUE.
ELSE. "Sap-Tabellen nicht in Stueckliste schreiben
CONTINUE.
ENDIF. "existiert ein Append
ENDIF. "Kundennamensraum

*Unterscheidung zu welcher Ordnungsebene diese Ddic-objektes gehoert:


*Rahmenprogramm oder Funktionsgruppe oder ...
IF p_typus = 'R'. "Rahmenprogramm
*Ueberpruefen, ob Eintrag mit diesem Schluessel schon in Stueckliste
*steht
READ TABLE it_prog_stueckliste WITH TABLE KEY
name = lcl_wa_ddic-tabname
obername = p_name
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0. "nichts gefunden
PERFORM write_stueckliste USING lcl_ddictyp
lcl_wa_ddic-tabname
p_name.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " HANDLE_DDIC
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_DOMAINS
*&---------------------------------------------------------------------*
* Lesen und Sichern der Domaenenheaderinformationen und
* wenn vorhanden der Wertehilfen. Als Grundlage dient dient die
* Liste der Datenelemente.
*----------------------------------------------------------------------*
FORM download_domains.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Variablen fuer Download (Filename) festlegen
DATA: lcl_domainheader_name TYPE string.
DATA: lcl_domainvalues_name TYPE string.
*Lokaler Datenbereich fuer temporaere Verarbeitung von dd07v(enthält
*evtl. Wertebereich der Domaene.
DATA: lcl_it_dd07v TYPE STANDARD TABLE OF dd07v,
lcl_wa_dd07v LIKE LINE OF lcl_it_dd07v.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
*Arbeitsbereich nur fuer die sinnvolen Attrbute der Domaene
DATA: lcl_wa_idd01v TYPE idd01v.
*Arbeitsbereich nur fuer die sinnvolen Festwerte der Domaene
DATA: lcl_wa_idd07v TYPE idd07v.
*Schleife ueber die Kundeneigenen Datenelemente
*Es werden alle Domaenen (auch die SAP-Domaenen)
*betrachtet, da sie wegen der referentiellen Intgrität
*in der Datenbank notwendig sind
LOOP AT it_dataelements INTO wa_dataelements.
LOOP AT it_lan INTO wa_lan.
REFRESH lcl_it_dd07v.
CALL FUNCTION 'DDIF_DOMA_GET'
EXPORTING
name = wa_dataelements-domname
state = 'A'
langu = wa_lan
IMPORTING
* GOTSTATE =
dd01v_wa = wa_dd01v
TABLES
dd07v_tab = lcl_it_dd07v
* EXCEPTIONS
* ILLEGAL_INPUT = 1
* OTHERS = 2
.
IF sy-subrc = 0.
* Domaeneninfos in Gesamttabelle schreiben, wenn im Kundennamensraum.
IF wa_dd01v-domname(1) = 'Z'
OR wa_dd01v-domname(1) = 'Y'
OR wa_dd01v-domname(g_len_nspace) = p_nspace.
APPEND wa_dd01v TO it_dd01v.
* Wertelistetabelle (dd07v) in Gesamtwerteliste schreiben.
* Nur ausführen wenn lcl_it_dd07v nicht leer ist. Nur aus-
* fuehren wenn Domaenen im Kundennamensraum liegen.
IF NOT ( lcl_it_dd07v IS INITIAL ).
LOOP AT lcl_it_dd07v INTO lcl_wa_dd07v.
IF ( lcl_wa_dd07v-domname(1) = 'Z'
OR lcl_wa_dd07v-domname(1) = 'Y'
OR lcl_wa_dd07v-domname(g_len_nspace) = p_nspace ).
APPEND lcl_wa_dd07v TO it_dd07v.
ENDIF. "Kundennamensraum
ENDLOOP.
ENDIF. "initialpruefung
ENDIF. "Kundnennamensraum
ENDIF. "sy-subrc
* Loeschen der zeile, wenn kein Datenelementname vorhanden-->Eintrag
* aus Verarbeitung Tabellentyp
IF wa_dataelements-rollname IS INITIAL.
DELETE it_dataelements INDEX sy-tabix.
ENDIF.
ENDLOOP. "Sprachtabelle
ENDLOOP.
******************************************************************
*Download der allgemeinen Informationen
******************************************************************
*Nur Download wenn it_dd01v nicht leer ist
IF NOT ( it_dd01v IS INITIAL ).
*Duplikate löschen
SORT it_dd01v BY domname ddlanguage.
DELETE ADJACENT DUPLICATES FROM it_dd01v COMPARING ALL FIELDS.
* Ueberschrift zusammenbauen
CONCATENATE 'Domain Attributes of ' global_main_name
INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Domain Name' TO lcl_it_headerrow.
APPEND 'Language Key' TO lcl_it_headerrow.
APPEND 'Data Type' TO lcl_it_headerrow.
APPEND 'Length of Type' TO lcl_it_headerrow.
APPEND 'Output Length' TO lcl_it_headerrow.
APPEND 'Decimal places' TO lcl_it_headerrow.
APPEND 'Lowercase letters (flag)' TO lcl_it_headerrow.
APPEND 'Sign (flag)' TO lcl_it_headerrow.
APPEND 'Flag for fixed Values' TO lcl_it_headerrow.
APPEND 'Value Table' TO lcl_it_headerrow.
APPEND 'Conversion Routine' TO lcl_it_headerrow.
APPEND 'Short Text' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_dd01v INTO wa_dd01v.
*nur sinnvolle Felder nutzen
MOVE-CORRESPONDING wa_dd01v TO lcl_wa_idd01v.
PERFORM create_htmltab_body USING lcl_wa_idd01v.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************
CONCATENATE 'DomHeader_' global_main_name
INTO lcl_domainheader_name.
CLEAR filename.
CONCATENATE new_dir '\' lcl_domainheader_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_dd01v
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text023 lcl_domainheader_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text023 lcl_domainheader_name
filename.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Domainheader'
'Domainheader'
global_main_name.
ENDIF.
ENDIF. "Ist Tabelle it_dd01v gefüllt.
******************************************************
*Herunterladen der Wertehilfen
******************************************************
*Nur Download wenn it_dd07v nicht leer ist
IF NOT ( it_dd07v IS INITIAL ).
*Duplikate löschen
SORT it_dd07v BY domname valpos ddlanguage.
DELETE ADJACENT DUPLICATES FROM it_dd07v COMPARING ALL FIELDS.
SORT it_dd07v BY domname ddlanguage valpos.
CLEAR lcl_header. REFRESH lcl_it_headerrow.
* Ueberschrift zusammenbauen
CONCATENATE 'Value Range and Short Text of Domains used in '
global_main_name INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Domain Name' TO lcl_it_headerrow.
APPEND 'Position in Value List' TO lcl_it_headerrow.
APPEND 'Language' TO lcl_it_headerrow.
APPEND 'Single Value/lower Limit' TO lcl_it_headerrow.
APPEND 'Upper limit' TO lcl_it_headerrow.
APPEND 'Short Text for fixed Values' TO lcl_it_headerrow.
* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_dd07v INTO wa_dd07v.
*nur sinnvolle Felder nutzen
MOVE-CORRESPONDING wa_dd07v TO lcl_wa_idd07v.
PERFORM create_htmltab_body USING lcl_wa_idd07v.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************

CONCATENATE 'DomValues_' global_main_name INTO lcl_domainvalues_name.


CLEAR filename.
CONCATENATE new_dir '\' lcl_domainvalues_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_dd07v
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text024 lcl_domainvalues_name
filename.
ELSE.
PERFORM write_protocol USING 'N' text024 lcl_domainvalues_name
filename.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Domainvalues'
'Domainvalues'
global_main_name.
ENDIF.
ENDIF.
ENDFORM. " DOWNLOAD_DOMAINS

*&---------------------------------------------------------------------*
*& Form WRITE_DATAELEMENTS
*&---------------------------------------------------------------------*
* Lesen der Informationen zu dem im Parameter P_ROLLNAME
* angegebenen Datenelement. Information wird an Gesamtliste
* der Dateneelemente zu späterem Download angehängt.
*----------------------------------------------------------------------*
FORM write_dataelements USING p_rollname LIKE
wa_dataelements-rollname.
*Initialisieren der Datenelemente
CLEAR wa_dataelements.
*Sprachabhaengigkeit
LOOP AT it_lan INTO wa_lan.
*Herauslesen der spezifischen Information fuer Datenelemente
CALL FUNCTION 'DDIF_DTEL_GET'
EXPORTING
name = p_rollname
state = 'A'
langu = wa_lan
IMPORTING
* GOTSTATE =
dd04v_wa = wa_dataelements
* TPARA_WA =
* EXCEPTIONS
* ILLEGAL_INPUT = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
APPEND wa_dataelements TO it_dataelements.
ENDLOOP. "Sprachtabelle
ENDFORM. " WRITE_DATAELEMENTS
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_TABLE
*&---------------------------------------------------------------------*
* Lesen und Sichern der Feldinformationen zu Tabellen, Views,
* Strukturen und Appends.
*----------------------------------------------------------------------*
FORM download_table USING p_dd02l TYPE dd02l
p_typus TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Arbeitsbereich fuer die sinnvolen Felder
DATA: lcl_wa_idd03p TYPE idd03p.
*Variable fuer Kopfzeile der zu generierenden HTML-Tabelle
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
*Variable zur Modularisierung des Ausgabenamens
DATA: str_output TYPE string.
*lokale Datendeklarationen fuer Zugriff auf DDIC-Objekte
DATA: lcl_t_dd03p LIKE dd03p OCCURS 0 WITH HEADER LINE,
lcl_t_dd05m LIKE dd05m OCCURS 0 WITH HEADER LINE,
lcl_ddic_name LIKE dcobjdef-name,
lcl_w_dd02v LIKE dd02v.
** Variable for shorttext of fieldname
DATA: lcl_it_dfies TYPE STANDARD TABLE OF dfies,
lcl_wa_dfies LIKE LINE OF lcl_it_dfies.
CLEAR filename.
lcl_ddic_name = p_dd02l-tabname.
CALL FUNCTION 'DDIF_TABL_GET'
EXPORTING
name = lcl_ddic_name
IMPORTING
dd02v_wa = lcl_w_dd02v
TABLES
dd03p_tab = lcl_t_dd03p
dd05m_tab = lcl_t_dd05m
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc = 0.
* Weiter Verarbeitung wenn etwas gefunden worden ist
IF NOT ( lcl_t_dd03p[] IS INITIAL ).
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

* Verarbeitung der kundeneigenen Datenelemente in der Tabelle


LOOP AT lcl_t_dd03p.
IF ( ( lcl_t_dd03p-rollname(1) = 'Z' )
OR ( lcl_t_dd03p-rollname(1) = 'Y' )
OR ( lcl_t_dd03p-rollname(g_len_nspace) = p_nspace ) ).
PERFORM write_dataelements USING lcl_t_dd03p-rollname.
ENDIF.
ENDLOOP.
*Vorbereitungen für Download
*Fallunterscheidung der einzelnen Typen von DDIC-Strukturen
*fuer Downloadtabelle und Ausgabename; und Ueberschrift HTML-Tabelle
CASE p_typus.
WHEN 'T'. "Tabelle
CONCATENATE new_dir '\' ct lcl_ddic_name '.xml' INTO filename.
str_output = text009.
CONCATENATE 'Fields of Table ' lcl_ddic_name
INTO lcl_header SEPARATED BY space.
WHEN 'V'. "View
CONCATENATE new_dir '\' cv lcl_ddic_name '.xml' INTO filename.
str_output = text060.
CONCATENATE 'Fields of View ' lcl_ddic_name
INTO lcl_header SEPARATED BY space.
WHEN 'S'. "Strukturen
CONCATENATE new_dir '\' cst lcl_ddic_name '.xml' INTO filename.
str_output = text026.
CONCATENATE 'Fields of Structure ' lcl_ddic_name
INTO lcl_header SEPARATED BY space.
WHEN 'A'. "Appends
CONCATENATE new_dir '\' cap lcl_ddic_name '.xml' INTO filename.
str_output = text027.
CONCATENATE 'Fields of Append-Structure ' lcl_ddic_name
'of Table' p_dd02l-sqltab
INTO lcl_header SEPARATED BY space.
ENDCASE.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* Read shorttext for fieldname
* To Do: Check whether this function module can replace the one
* above
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = lcl_ddic_name
langu = sy-langu
TABLES
dfies_tab = lcl_it_dfies
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
REFRESH lcl_it_dfies.
ENDIF.

* Headertabelle zusammenbauen
APPEND 'Table Name' TO lcl_it_headerrow.
APPEND 'Field Name' TO lcl_it_headerrow.
APPEND 'Short Text' TO lcl_it_headerrow.
APPEND 'Position in Table' TO lcl_it_headerrow.
APPEND 'Key Field (Flag)' TO lcl_it_headerrow.
APPEND 'Mandatory Field (Flag)' TO lcl_it_headerrow.
APPEND 'Data Element' TO lcl_it_headerrow.
APPEND 'Checktable' TO lcl_it_headerrow.
APPEND 'Nesting Depth for Includes' TO lcl_it_headerrow.
APPEND 'Table for Reference Field' TO lcl_it_headerrow.
APPEND 'Name of included Table' TO lcl_it_headerrow.
APPEND 'NOTNULL (flag)' TO lcl_it_headerrow.
APPEND 'Data Type' TO lcl_it_headerrow.
APPEND 'Length of Field' TO lcl_it_headerrow.
APPEND 'Number of decimals' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT lcl_t_dd03p.
MOVE-CORRESPONDING lcl_t_dd03p TO lcl_wa_idd03p.
* Get fieldtexts
CLEAR lcl_wa_dfies.
READ TABLE lcl_it_dfies
WITH KEY tabname = lcl_t_dd03p-tabname
fieldname = lcl_t_dd03p-fieldname
INTO lcl_wa_dfies.
lcl_wa_idd03p-shorttext = lcl_wa_dfies-fieldtext.
PERFORM create_htmltab_body USING lcl_wa_idd03p.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************
*** Tables/View downloaden
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "lcl_t_dd03p
CHANGING lcl_subrc.
*lcl_t_DD03P-ROLLNAME.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' str_output lcl_ddic_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' str_output lcl_ddic_name
filename.
ENDIF. "subrc-Abfrage des Download
ENDIF. "subrc des ddifget-Bausteine
* ENDIF. "Subrc der Stuecklistenueberpruefung
ENDIF. "Tabelle gefuellte???
ENDFORM. " DOWNLOAD_TABLE
*&---------------------------------------------------------------------*
*& Form DATAELEMENTS_DOWNLOAD
*&---------------------------------------------------------------------*
* Sicherung der Gesamttabelle der Datenelemente.
* Konvertierung in HTML-Format.
*----------------------------------------------------------------------*
FORM download_dataelements.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Datenelementname
DATA: lcl_dataelements_name TYPE string.
DATA: lcl_wa_idd03p TYPE idd03p.
*Variable fuer Kopfzeile der zu generierenden HTML-Tabelle
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
*Komprimierter Bereich fuer Datenelemete
DATA: lcl_wa_idataelements TYPE idd04v.
*Nur herunterladen, wenn Datenelementliste Inhalt hat.
IF NOT ( it_dataelements IS INITIAL ).
lcl_header = 'Dataelements'.
*Duplikate löschen
SORT it_dataelements BY rollname ddlanguage.
DELETE ADJACENT DUPLICATES FROM it_dataelements COMPARING ALL FIELDS.
* Headertabelle zusammenbauen
APPEND 'Dataelement Name' TO lcl_it_headerrow.
APPEND 'Language' TO lcl_it_headerrow.
APPEND 'Domainname' TO lcl_it_headerrow.
APPEND 'Parameter ID' TO lcl_it_headerrow.
APPEND 'Change Document (flag)' TO lcl_it_headerrow.
APPEND 'Length of Heading' TO lcl_it_headerrow.
APPEND 'Length of Short-Label' TO lcl_it_headerrow.
APPEND 'Length of Medium-Label' TO lcl_it_headerrow.
APPEND 'Length of Long-Label' TO lcl_it_headerrow.
APPEND 'Short Text' TO lcl_it_headerrow.
APPEND 'Heading Text' TO lcl_it_headerrow.
APPEND 'Short Label Text' TO lcl_it_headerrow.
APPEND 'Medium Label Text' TO lcl_it_headerrow.
APPEND 'Long Label Text' TO lcl_it_headerrow.
APPEND 'Active-Flag' TO lcl_it_headerrow.
APPEND 'Search Help Name' TO lcl_it_headerrow.
APPEND 'Search Help Parameter' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_dataelements INTO wa_dataelements.
MOVE-CORRESPONDING wa_dataelements TO lcl_wa_idataelements.
PERFORM create_htmltab_body USING lcl_wa_idataelements.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************

CONCATENATE 'Dataelements_' global_main_name


INTO lcl_dataelements_name.
CLEAR filename.
CONCATENATE new_dir '\' lcl_dataelements_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_dataelements
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text022 lcl_dataelements_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text022 lcl_dataelements_name
filename.

*Stueckliste schreiben
PERFORM write_stueckliste USING 'Dataelements'
'Dataelements'
global_main_name.
ENDIF.
ENDIF. "Tabelle it_dataelements gefuellt?????
ENDFORM. " DATAELEMENTS_DOWNLOAD
*&---------------------------------------------------------------------*
*& Form CREATE_DIRECTORY
*&---------------------------------------------------------------------*
* Anlegen eines Verzeichnis aus dem Uebergabeparameter P_NAME und
* dem Basisverzeichnis (DIR). Je nach Typ des anzulegenden
* Verzeichnisses (Parameter P_TYPUS) wird vor P_NAME ein
* entsprechendes Praefix angehaengt.
* Die Methode zur Verzeichnisanlage wird je nach Implementierung im
* System unterschiedlich aufgerufen.
*----------------------------------------------------------------------*
FORM create_directory USING p_name TYPE any
p_typus TYPE c.
*Sicherung des Verzeichniss bei Entwicklungsklasssenelementen
* DATA: lcl_path TYPE rlgrap-filename.
DATA: lcl_path TYPE string.
*Bereich fuer Lesen der Parameter
DATA: lcl_wa_vseoparam TYPE vseoparam.
*Variablen je nach Typisierung de
DATA: lcl_char(128) TYPE c.
DATA: lcl_string TYPE string.
DATA: l_name(40) TYPE c.
l_name = p_name.
*** alle slashes im Filenamen entfernen
TRANSLATE l_name USING '/_'.

*Initialisieren des Flags zur Ueberpruefung, ob Verzeichnis schon


*existiert.
CLEAR direxists.
*initialsieren des Verzeichnisnamens
CLEAR new_dir.
*Wenn Entwicklungsklassenselektion vorliegt Basisverzeichnis
*setzen (nicht wenn Beasisvereichnis angelegt wird
IF p_devc = 'X' AND p_typus <> 'Devc'.
lcl_path = dir.
dir = dc_path.
ENDIF.
*Wenn Transportauftrag vorliegt Basisverzeichnis
*setzen (nicht wenn Beasisvereichnis angelegt wird)
IF p_trkorr = 'X' AND p_typus <> 'T'.
lcl_path = dir.
dir = tr_path.
ENDIF.

*Pruefen wie der Parameter Directory der Methode typisiert ist


SELECT SINGLE * FROM vseoparam INTO lcl_wa_vseoparam
WHERE clsname = 'CL_GUI_FRONTEND_SERVICES'
AND cmpname = 'DIRECTORY_CREATE'.

IF lcl_wa_vseoparam-type = 'C'. "Typisierung mit Char


*Zusammensetzen des Verzeichnisnamen aus root und Rahmenprogrammname
*je nach Typ des Rahmenprogramms
IF p_typus = 'R'. "Report/Modulpoole
CONCATENATE dir '\RM_' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'F'. "Funktionsgruppen
CONCATENATE dir '\FG_' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'C'. "Klassen OO
CONCATENATE dir '\OC_' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'I'. "Interface OO
CONCATENATE dir '\OI_' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'ORG'. "Basistype IDOC.
CONCATENATE dir '\IB_' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'EXT'. "IDOC-Enhancemenet
CONCATENATE dir '\IE_' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'E'. "CMOD-Erweiterung
CONCATENATE dir '\EP_' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'S'. "IAC_Service
CONCATENATE dir '\IAC_' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'Devc'. "Entwicklungsklasse
CONCATENATE dir '\DC_' l_name INTO new_dir.
*Basisverzeichnis fuer Entwicklungsklasse schreiben
dc_path = new_dir.
ASSIGN new_dir TO <new_dir>.
CLEAR dir.
dir = new_dir.
ELSEIF p_typus = 'B'. "Badiimplementierung
CONCATENATE dir '\BI_' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'T'. "Transportrequest
CONCATENATE dir '\TR_' l_name INTO new_dir.
*Basisverzeichnis fuer Tranportauftraege schreiben
tr_path = new_dir.
ASSIGN new_dir TO <new_dir>.
CLEAR dir.
dir = new_dir.
ELSEIF p_typus = 'M'. "Modifikationen
CONCATENATE dir '\Modifications' INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'L'. "Logische Entwicklung
CONCATENATE dir '\' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'TA'. "Transaktionscode
CONCATENATE dir '\TA_' l_name INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ELSEIF p_typus = 'SUB'. "Unterobjekte in Klassen
CONCATENATE dir '\S' INTO new_dir.
ASSIGN new_dir TO <new_dir>.
ENDIF. "Art des Verzeichnisses

*Ueberpruefen, ob Verzeichnis bereits angelegt worden ist


READ TABLE it_directory_list WITH KEY dir = <new_dir>
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
CALL METHOD cl_gui_frontend_services=>directory_create
EXPORTING
directory = <new_dir>
CHANGING
rc = rc
EXCEPTIONS
directory_create_failed = 1
cntl_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Im Feherfall; Verzeichnis existiert schon; Falscher root
* Information message wegen Popup-Verhalten
MESSAGE i888(sabapdocu) WITH
'Error on creating directory:'
new_dir
'! The chosen root path must exist!'
'Please check your File System!'.
* Zur Aufrufstelle zurückspringen; Neuer Programmstart
SET SCREEN 0.
STOP.
ENDIF. "Ergebnis der Verzeichnisanlage
* Absetzen der Verzeichnisanlage Queue
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Im Feherfall; Verzeichnis existiert schon; Falscher root
* Information message wegen Popup-Verhalten
MESSAGE i888(sabapdocu) WITH
'Error on creating directory:'
new_dir
'! The chosen root path must exist!'
'Please check your File System!'.
* Zur Aufrufstelle zurückspringen; Neuer Programmstart
SET SCREEN 0.
STOP.
ENDIF. "Ergebnis der asynchronen Verarbeitung
* Ueberpruefung des Returncodes der Methode
IF rc <> 0.
* Im Feherfall; Verzeichnis existiert schon; Falscher root
* Information message wegen Popup-Verhalten
MESSAGE i888(sabapdocu) WITH
'Error on creating directory:'
new_dir
'! The chosen root path must exist!'
'Please check your File System!'.
* Zur Aufrufstelle zurückspringen; Neuer Programmstart
SET SCREEN 0.
STOP.
ENDIF. "RC-Abfrage
* Erstelltes Verzeichnis an Verzeichnistabelle anhaengen
MOVE <new_dir> TO wa_directory_list-dir.
APPEND wa_directory_list TO it_directory_list.
ELSE.
direxists = 'X'.
ENDIF. "Verzeichnis bereits erstellt
ELSEIF lcl_wa_vseoparam-type = 'STRING'. "Typisierung mit String
*Zusammensetzen des Verzeichnisnamen aus root und Rahmenprogrammname
*je nach Typ des Rahmenprogramms
IF p_typus = 'R'. "Report/MOdulpoole
CONCATENATE dir '\RM_' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'F'. "Funktionsgruppe
CONCATENATE dir '\FG_' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'C'. "OO Klassen
CONCATENATE dir '\OC_' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'I'. "OO Interface
CONCATENATE dir '\OI_' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'ORG'. "IDOC-Basis.
CONCATENATE dir '\IB_' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'EXT'. "IDOc-Erweiterung
CONCATENATE dir '\IE_' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'E'. "CMOD-Projekt
CONCATENATE dir '\EP_' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'S'. "IAC_Service
CONCATENATE dir '\IAC_' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>..
ELSEIF p_typus = 'Devc'. "Entwicklungsklasse
CONCATENATE dir '\DC_' l_name INTO new_dir.
*Basisverzeichnis fuer Entwicklungsklasse
dc_path = new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
CLEAR dir.
dir = new_dir.
ELSEIF p_typus = 'B'. "Badiimplementierung
CONCATENATE dir '\BI_' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'T'. "Transportauftrag
CONCATENATE dir '\TR_' l_name INTO new_dir.
*Basisverzeichnis fuer Tranportauftraege schreiben
tr_path = new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
CLEAR dir.
dir = new_dir.
ELSEIF p_typus = 'M'. "Modifikationen
CONCATENATE dir '\Modifications' INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'L'. "Logische Entwicklung
CONCATENATE dir '\' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'TA'. "Transaktionscode
CONCATENATE dir '\TA_' l_name INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ELSEIF p_typus = 'SUB'. "Unterobjekte von Klassen
CONCATENATE dir '\S' INTO new_dir.
lcl_string = new_dir.
ASSIGN lcl_string TO <new_dir>.
ENDIF. "Art des Verzeichnisse
*Ueberpruefen, ob Verzeichnis bereits angelegt worden ist
READ TABLE it_directory_list WITH KEY dir = <new_dir>
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
CALL METHOD cl_gui_frontend_services=>directory_create
EXPORTING
directory = <new_dir>
CHANGING
rc = rc
EXCEPTIONS
directory_create_failed = 1
cntl_error = 2
* ERROR_NO_GUI = 3
* PATH_NOT_FOUND = 4
* DIRECTORY_ACCESS_DENIED = 5
* DIRECTORY_ALREADY_EXISTS = 6
* UNKNOWN_ERROR = 7
OTHERS = 8
.
IF sy-subrc <> 0.
* Information message wegen Popup-Verhalten
MESSAGE i888(sabapdocu) WITH
'Error on creating directory:'
new_dir
'! The chosen root path must exist!'
'Please check your File System!'.
* Zur Aufrufstelle zurückspringen; Neuer Programmstart
SET SCREEN 0.
STOP.
ENDIF.
* Erstelltes Verzeichnis an Verzeichnistabelle anhaengen
MOVE <new_dir> TO wa_directory_list-dir.
APPEND wa_directory_list TO it_directory_list.
ELSE.
direxists = 'X'.
ENDIF. "Verzeichnis bereits angelegt
ENDIF. "Art der Parametrisierung: Stirng oder Char
UNASSIGN <new_dir>.

*Ruecksichern des Verzeichnisses bei Entwicklungsklassen


IF p_devc = 'X' AND p_typus <> 'Devc'.
dir = lcl_path.
ENDIF.
*Ruecksichern des Verzeichnisses bei Transportauftraegen
IF p_trkorr = 'X' AND p_typus <> 'T'.
dir = lcl_path.
ENDIF.
ENDFORM. " CREATE_DIRECTORY
*&---------------------------------------------------------------------*
*& Form INITIALIZE
*&---------------------------------------------------------------------*
* Initialisierung von globalen Tabellen.
*----------------------------------------------------------------------*
FORM initialize.
REFRESH it_prog_stueckliste. "Stueckliste
REFRESH it_dataelements. "Datenelemente
REFRESH it_dd01v. "Domaenenheader
REFRESH it_dd07v. "Festwertehilfen
REFRESH it_tobj. "Berechtigungsobjekte
REFRESH it_tactz. "Aktivitaeten von Berechtigungsobjekten
REFRESH it_authx. "Tabelle der Berechtigungsfelder
REFRESH it_tstc. "Tabelle mit zu einem Programm zugeordneten TA-Codes
REFRESH it_collectmains. "externe Aufrufe in externen Aufrufen
REFRESH it_d347t. "Titlebar
REFRESH it_fkgrp_struktur. "Funtionsgruppenstruktur
REFRESH it_tstcp. "TA-Codes einer Klasse.
REFRESH it_tdct. "Dialogbausteinuebersicht
REFRESH it_diapar. "Parameter fuer Dialogbaustein
REFRESH it_tpara. "Tabelle der set/get-Parameter
REFRESH it_classlist. "Klassenliste initialisieren
ENDFORM. " INITIALIZE

*&---------------------------------------------------------------------*
*& Form HANDLE_EXTPROG
*&---------------------------------------------------------------------*
* Lesen von aufgerufenen Objekten des im Parameter P_NAME
* angegebenen Rahmenprogrammes.
* Funktionsbausteine, Sperrobjekte, Meldungen, Programmaufrufen
* Berechtigungsobjekten und Set/Get-Parametern
*----------------------------------------------------------------------*
FORM handle_extprog USING p_name LIKE wa_trdir-name.
*Lokale Bereich zur Aufnahme der Fktbst-Rueckgabewerte
*1.) Name der definierten Variablen (wird nicht verwendet
DATA: lcl_it_compo TYPE STANDARD TABLE OF scompo,
lcl_wa_compo LIKE LINE OF lcl_it_compo.
*2.)aufgerufene Includes: bereits behandelt
DATA: lcl_it_inc TYPE STANDARD TABLE OF d010inc,
lcl_wa_inc LIKE LINE OF lcl_it_inc.
*->Nur se Tabelle wird auch wirklich verwendet
*3.)Referenzen: Funktionsbausteine, Messages, Externe Programme
DATA: lcl_it_cross_ref TYPE STANDARD TABLE OF cross,
lcl_wa_cross_ref LIKE LINE OF lcl_it_cross_ref.
*4.)Sperrobjektname für Patnernamensraum aufbereiten
DATA: lcl_enqueue TYPE string,
lcl_dequeue TYPE string,
lcl_len TYPE i.
*Hilfsarbeitsbereich um Festzustellen ob ein Funktionsbaustein
*zu dieser Funktionsgruppe gehoert (nur bei funtkionsgruppen)
DATA: lcl_wa_tfdir TYPE tfdir.
*Namen für Sperrobjekte zusammenbauen
IF p_nspace(1) = '/'.
CONCATENATE 'ENQUEUE_' p_nspace 'E' INTO lcl_enqueue.
CONCATENATE 'DEQUEUE_' p_nspace 'E' INTO lcl_dequeue.
lcl_len = STRLEN( lcl_enqueue ).
ELSE.
lcl_len = 1.
ENDIF.
*Lesen der vom Include aufgerufenen Objekte
* CALL FUNCTION 'RS_PROGRAM_INDEX'
* EXPORTING
* pg_name = p_name
** WITHOUT_TREE = ' '
** IMPORTING
** MESSAGE_CLASS =
* TABLES
* compo = lcl_it_compo
* cross_ref = lcl_it_cross_ref
* inc = lcl_it_inc
** EXCEPTIONS
** SYNTAX_ERROR = 1
** OTHERS = 2
* .
PERFORM rs_program_index USING p_name
CHANGING lcl_it_cross_ref.
* IF sy-subrc = 0. "Es sind keine Fehler aufgetreten
*Wenn vorhanden Verarbeitung der Objetkliste (Messages, Funktionen).
IF NOT ( lcl_it_cross_ref IS INITIAL ).
*Nur betrachten wo externe Verweise in Programmen
*des Kundennamensraumes gemacht worden sind, bzw. Partnernamensraum.
LOOP AT lcl_it_cross_ref INTO lcl_wa_cross_ref.
IF NOT ( ( lcl_wa_cross_ref-include(1) = 'Z' ) "Includes
OR ( lcl_wa_cross_ref-include(1) = 'Y' )
OR ( lcl_wa_cross_ref-include(2) = 'LZ' )
OR ( lcl_wa_cross_ref-include(2) = 'LY' )
OR ( lcl_wa_cross_ref-include(g_len_nspace) = p_nspace ) ).
CONTINUE.
ENDIF.
*Behandlung je nach Typ
CASE lcl_wa_cross_ref-type.
WHEN 'N'. "Verarbeitung von messages
PERFORM handle_message USING lcl_wa_cross_ref.
WHEN 'F'. "Verarbeitung Funktionsbaustein
*Behandlung von normalen Funktionsbausteinen in Kundennamensraum.
*Ueberpruefen, ob der aufgerufene Funktionsbaustein im aufrufenden
*Programm liegt (nur bei Funktionsgruppen der Fall )-->Zirkelbezug.
SELECT SINGLE * FROM tfdir INTO lcl_wa_tfdir
WHERE funcname = lcl_wa_cross_ref-name
AND pname = p_name.
IF sy-subrc <> 0. "Dies trifft nicht zu
"Kundennamenraum ueberpruefen; auch Funktionsgruppe
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_functionmodule USING lcl_wa_cross_ref.
ENDIF. "Kundennamensraum
ENDIF. "sy-subrc
*Behandlung von Sperrobjekten im Kundennamensraum
IF ( ( lcl_wa_cross_ref-name(10) = 'ENQUEUE_EZ' ) OR
( lcl_wa_cross_ref-name(10) = 'ENQUEUE_EY' ) OR
( lcl_wa_cross_ref-name(lcl_len) = lcl_enqueue ) OR
( lcl_wa_cross_ref-name(10) = 'DEQUEUE_EZ' ) OR
( lcl_wa_cross_ref-name(10) = 'DEQUEUE_EY' ) OR
( lcl_wa_cross_ref-name(lcl_len) = lcl_dequeue ) ).
PERFORM handle_lockobject USING lcl_wa_cross_ref
'F'.
"Name ist ein Funktionsbausteinname
ENDIF.
WHEN 'R'. "Aufruf eines anderen Reports (submit program)
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_submits USING lcl_wa_cross_ref.
ENDIF.
WHEN 'U'. "Aufruf einer Form in einem anderen Programm
IF ( ( lcl_wa_cross_ref-prog(1) = 'Z' )
OR ( lcl_wa_cross_ref-prog(1) = 'Y' )
OR ( lcl_wa_cross_ref-prog(g_len_nspace) = p_nspace ) ).
PERFORM handle_performextern USING lcl_wa_cross_ref.
ENDIF.
WHEN 'T'. "Behandlung von Transaktionen (call transaction)
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_transaction USING lcl_wa_cross_ref.
ENDIF.
WHEN 'A'. "Behandlung von Berechtigungsobjekten
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_authorityobject USING lcl_wa_cross_ref.
ENDIF.
WHEN 'D'. "Dialogbaustein
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_dialogmodule USING lcl_wa_cross_ref.
ENDIF.
WHEN 'P'. "set/get Parameterpaar
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ) .
PERFORM handle_setgetparamss USING lcl_wa_cross_ref.
ENDIF.
WHEN 'G'. "Typgruppe
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_typgroups USING lcl_wa_cross_ref.
ENDIF.
ENDCASE.
ENDLOOP.
ENDIF.
* ENDIF.
ENDFORM. " HANDLE_EXTPROG
*&---------------------------------------------------------------------*
*& Form HANDLE_MESSAGE
*&---------------------------------------------------------------------*
* Lesen der Meldungsinformationen, die in Uebergabestruktur
* angegeben ist. Anhaengen an Gesmttabelle fuer Meldungen.
*----------------------------------------------------------------------*
FORM handle_message USING p_wa_cross_ref TYPE cross.
*Lokale Variablen zum zerlegen der messagevariable in
*Klasse und Nummer.
DATA: lcl_message_class TYPE t100-arbgb,
lcl_message_nr TYPE t100-msgnr.
*Feld um den Namen der Message (Klasse/Name) in Stückliste aufnehmen zu
*können.
DATA: lcl_message_name TYPE trdir-name.
*Db-Feld auseinandernehmen
lcl_message_class = p_wa_cross_ref-name(20).
lcl_message_nr = p_wa_cross_ref-name+20(3).
*Nur Behandeln, wenn Messageclass/arbeitsbereich im Kundennamensraum
*liegt
IF ( ( lcl_message_class(1) = 'Z' ) OR ( lcl_message_class(1) = 'Y' )
OR ( lcl_message_class(g_len_nspace) = p_nspace ) ).
LOOP AT it_lan INTO wa_lan.
*Name für Stückliste zusammensetzen
CONCATENATE lcl_message_class '/' lcl_message_nr '/' wa_lan INTO
lcl_message_name.
CLEAR wa_messages.
*Messagetabelle lesen mit Schlüssel nur bei Fehler nichts tun
SELECT SINGLE * FROM t100 INTO wa_messages
WHERE arbgb = lcl_message_class
AND msgnr = lcl_message_nr
AND sprsl = wa_lan.
IF sy-subrc = 0.
*Überprüfen ob diese Meldung schon in Messagetabelle enthalten ist.
*Wenn enthalten nur noch in Stückliste aufnehmen und nicht mehr in
*Messagetabelle.
READ TABLE it_messages WITH TABLE KEY arbgb = lcl_message_class
msgnr = lcl_message_nr
sprsl = wa_lan
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
*Schreiben der Gesamt-Messagetabellle
APPEND wa_messages TO it_messages.
ENDIF.
*Schreiben der Stückliste, nicht länderspezifisch nur einmal
PERFORM write_stueckliste USING 'MSG'
lcl_message_name
p_wa_cross_ref-include.
ENDIF.
ENDLOOP. "Sprachentabelle.
ENDIF. "Ueberpruefung Kundennamensraum
ENDFORM. " HANDLE_MESSAGE
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_MESSAGES
*&---------------------------------------------------------------------*
* Sicherung der globalen Nachrichtentabelle ins lokale Dateisystem.
* Generierung der Tabelle in HTML-Format.
*----------------------------------------------------------------------*
FORM download_messages.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Name fuer die Gesamtmessagetabelle des Rahmenprogramms
DATA: lcl_messagetab_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
*Nur Download durchführen wenn Messgetabelle nicht leer ist.
IF NOT ( it_messages IS INITIAL ).
CONCATENATE 'Messagetable_' global_main_name INTO lcl_messagetab_name.
*Umwandlung in HTML-Tabelle
********************************************************
*Ueberschrift zusammenbauen
CONCATENATE 'Messages in Customer Name Space of Object'
global_main_name INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Language' TO lcl_it_headerrow.
APPEND 'Working Area' TO lcl_it_headerrow.
APPEND 'Message Number' TO lcl_it_headerrow.
APPEND 'Message Text' TO lcl_it_headerrow.

PERFORM create_htmltab_header USING lcl_it_headerrow


lcl_header.
LOOP AT it_messages INTO wa_messages.
PERFORM create_htmltab_body USING wa_messages.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************

CLEAR filename.
CONCATENATE new_dir '\' lcl_messagetab_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_messages
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text020 lcl_messagetab_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text020 lcl_messagetab_name
filename.
ENDIF.
ENDIF. "Download nur wen Messagetabelle nicht leer ist
ENDFORM. " DOWNLOAD_MESSAGES
*&---------------------------------------------------------------------*
*& Form HANDLE_FUNCTIONMODULE
*&---------------------------------------------------------------------*
* Verarbeitung des in der Uebergabestruktur angegebenen
* Funktionsbausteins. Zugehoerig Funktionsgruppe wird an
* Tabelle zur späteren Verarbeitung von Rahmenprogrammen
* angehaengt.
*----------------------------------------------------------------------*
FORM handle_functionmodule USING p_wa_cross_ref TYPE cross.
*Lokale Defintion des Funktionsgruppennamens
DATA: lcl_fktgroup_name LIKE wa_trdir-name.
DATA: lcl_devc_name LIKE wa_trdir-name.
*Sicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
* Area for devclass.
DATA: lcl_devc TYPE tadir-devclass.
* Variables for dividing in partner namespace
DATA: lcl_include TYPE rs38l-include.
DATA: lcl_namespace TYPE rs38l-namespace.
DATA: lcl_without TYPE rs38l-include.
*Funktionsbaustein verarbeiten; Herunterladen der gesamten
*Funktionsgruppe wegen eventueller Beziehungen
*Suche der Funktionsgruppe über den Fktbausteinname in tfdir
SELECT SINGLE pname FROM tfdir INTO lcl_fktgroup_name
WHERE funcname = p_wa_cross_ref-name.
IF sy-subrc = 0. "Der Funktionsbaustein existiert
* Check whether this object belongs to the selected dev-class
IF NOT p_devc IS INITIAL.
* Get name without namespace
IF lcl_fktgroup_name(1) = '/'.
lcl_include = lcl_fktgroup_name.
CALL FUNCTION 'RS_PROGNAME_SPLIT'
EXPORTING
progname_with_namespace = lcl_include
IMPORTING
namespace = lcl_namespace
progname_without_namespace = lcl_without.
IF sy-subrc <> 0.
EXIT.
ELSE.
CONCATENATE lcl_namespace lcl_without+4 INTO
lcl_devc_name .
ENDIF.
ELSE. "normal name space
lcl_devc_name = lcl_fktgroup_name+4.
ENDIF.
SELECT SINGLE devclass FROM tadir INTO lcl_devc
WHERE pgmid = 'R3TR'
AND object = 'FUGR'
AND obj_name = lcl_devc_name.
CHECK lcl_devc IN o_devcl.
ENDIF.
*Überpruefen, ob Funktionsgruppe runtergeladen worden ist.
READ TABLE it_prog_stueckliste WITH KEY
name = lcl_fktgroup_name
TRANSPORTING NO FIELDS.
*Nur downloaden wenn download noch nicht durchgefuehrt worden ist.
IF sy-subrc <> 0.
*Eintrag fuer Funktionsgruppe zu dem den Fktbaustein aufrufenden
*Include schreiben
PERFORM write_stueckliste USING 'Functiongroup'
lcl_fktgroup_name
p_wa_cross_ref-include.
*Eintrag fuer Funktionsbaustein zu aufrufendem Include
PERFORM write_stueckliste USING 'Functionmodule'
p_wa_cross_ref-name
lcl_fktgroup_name.

*Tabellen zur späteren Weierverarbeitung zwischenspeichern


PERFORM write_global_save USING 'F' lcl_fktgroup_name.
ENDIF. "FKGRP bereits gesichert
ENDIF. "Funktionsbaustein existiert
ENDFORM. " HANDLE_FUNCTIONMODULE
*&---------------------------------------------------------------------*
*& Form Download_Functiongroup
*&---------------------------------------------------------------------*
* Sicherung der Elemente der im Uebergabeparmeter angegebenen
* Funktionsgruppe.
*----------------------------------------------------------------------*
FORM download_functiongroup USING p_fktgroup_name LIKE wa_trdir-name.
*Die Typiesierung mit 'G' ist obsolet, da diese Elemente fast alle
*an die normale Strueckliste angehaengt werden

*Textelemente des Rahmenprogramms herunterladen


PERFORM download_textelements USING p_fktgroup_name
'R'. "'G'.
*Stueckliste wird in 'download_textelements' geschrieben
**Echter Screen des Rahmenprogramms herunterladen
PERFORM handle_screens USING p_fktgroup_name
'R'. "'G'.
*Titlebars suchen
PERFORM handle_titlebar USING p_fktgroup_name
'R'. "'G'.
*pf-Stati verarbeiten
PERFORM handle_pf_status USING p_fktgroup_name
'R'. "'G'.
*Eventuell zughöriger Transaktionscode suchen
PERFORM handle_tacode USING p_fktgroup_name.

*Normale Includes des Rahmenprogramms herunterladen


PERFORM handle_includes_fktgroup USING p_fktgroup_name.

*Klassen und Interface behandeln


PERFORM handle_classinterface USING p_fktgroup_name
'R'. "'G'.
*Tabellen/Strukturen herunterladen
PERFORM handle_ddic USING p_fktgroup_name
'R'. "'G'.
*Gesamtfunktionsgruppenliste herunterladen
PERFORM download_fktgrplist USING p_fktgroup_name.
ENDFORM. " FUNCTIONGROUP_DOWNLOAD
*&---------------------------------------------------------------------*
*& Form HANDLE_INCLUDES_FKTGROUP
*&---------------------------------------------------------------------*
* Rekursives Lesen und Speichern der Inlcudes (normale Includes
* und Funktionsbausteinincludes). Anhaengen an globale Liste der
* Funtkionsgruppenstruktur.
*----------------------------------------------------------------------*
FORM handle_includes_fktgroup USING p_fktgroup_name.
*Lokale Tabellen und Arbeitsbereiche zur Sicherung der
* Modularisierbareit
DATA: lcl_it_includes TYPE STANDARD TABLE OF include,
lcl_wa_includes LIKE LINE OF lcl_it_includes.
*Variable zur Laengenbestimmung: Ermittlung der Doppelincludes
*von Funktionsbausteinen.
DATA: lcl_laenge TYPE i.

CALL FUNCTION 'GET_INCLUDETAB'


EXPORTING
progname = p_fktgroup_name
TABLES
incltab = lcl_it_includes.

* Wenn Transportauftrag: alles betrachten


* ansonsten nur Kundennamensraum....
IF p_trkorr IS INITIAL.
* Nur Betrachtung des Kundnenamensraumes
LOOP AT lcl_it_includes INTO lcl_wa_includes
WHERE ( ( name(2) = 'LY' ) OR ( name(2) = 'LZ' )
OR ( name(1) = 'Z' ) OR ( name(1) = 'Y' )
OR ( name(1) = '/' ) OR ( name(1) = '/' ) ).
*Nichtbeachtung der doppelt vorhandenen Includes der Funktionsbausteine
lcl_laenge = STRLEN( lcl_wa_includes-name ).
lcl_laenge = lcl_laenge - 3.
IF lcl_wa_includes-name+lcl_laenge(1) = '$'.
CONTINUE. "aktuellen Schleifendurchlauf hier beenden
ENDIF.
* Uebergabe des Type des Includes, um Dateinamen festlegen zu können
CLEAR ok.
PERFORM download_include USING lcl_wa_includes-name 'I'
CHANGING ok.
IF ok = 'X'. "Download include war erfolgreich
* Fktgruppenstruktur schreiben
PERFORM write_fktgruppenstruktur USING 'IN'
lcl_wa_includes-name
p_fktgroup_name.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT lcl_it_includes INTO lcl_wa_includes
WHERE name(1) <> '<' .
*Nichtbeachtung der doppelt vorhandenen Includes der Funktionsbausteine
lcl_laenge = STRLEN( lcl_wa_includes-name ).
lcl_laenge = lcl_laenge - 3.
IF lcl_wa_includes-name+lcl_laenge(1) = '$'.
CONTINUE. "aktuellen Schleifendurchlauf hier beenden
ENDIF.
* Uebergabe des Type des Includes, um Dateinamen festlegen zu können
CLEAR ok.
PERFORM download_include USING lcl_wa_includes-name 'I'
CHANGING ok.
IF ok = 'X'. "Download include war erfolgreich
* Fktgruppenstruktur schreiben
PERFORM write_fktgruppenstruktur USING 'IN'
lcl_wa_includes-name
p_fktgroup_name.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " HANDLE_INCLUDES_FKTGROUP
*&---------------------------------------------------------------------*
*& Form WRITE_FKTGRUPPENSTRUKTUR
*&---------------------------------------------------------------------*
* Schreiben der globalen Liste der Funktionsgruppenstruktur.
*----------------------------------------------------------------------*
FORM write_fktgruppenstruktur USING
p_objecttype TYPE any
p_objectname TYPE any
p_fktbstname TYPE any.
*lokale Variable fuer Laenge des uebergebenen Includes
DATA: lcl_inc_len TYPE i.
*lokale Variable fuer Includesuffix (z.B. '01' oder 'XX'
*notwendig fuer tfdir
DATA: lcl_suffix(2) TYPE c.
*lokale Variable fuer fktbstname
DATA: lcl_fktbstname TYPE tfdir-funcname.
*lokale Variable um 'u-Bestandteil' von Fktbausteinincludes
*herunterzuladen
DATA: lcl_u(1) TYPE c.

*Ueberpruefen, ob das Objekt ein Include ist welches ein Fktbaustein


*ist.
IF p_objecttype = 'IN'.
lcl_inc_len = STRLEN( p_objectname ).
lcl_inc_len = lcl_inc_len - 3.
lcl_u = p_objectname+lcl_inc_len(1).
*Nur wenn drittletzter Buchstabe ein 'u' ist liegt ein Fktbaustein vor
IF lcl_u = 'U'.
lcl_inc_len = lcl_inc_len + 1.
lcl_suffix = p_objectname+lcl_inc_len(2).
SELECT SINGLE funcname FROM tfdir INTO lcl_fktbstname
WHERE pname = p_fktbstname
AND include = lcl_suffix.
ENDIF.
ENDIF.
*Schreiben der Infos in die interne Tabelle.
CLEAR wa_fkgrp_struktur.
wa_fkgrp_struktur-objecttype = p_objecttype.
wa_fkgrp_struktur-objectname = p_objectname.
wa_fkgrp_struktur-fktbstname = lcl_fktbstname.
APPEND wa_fkgrp_struktur TO it_fkgrp_struktur.
ENDFORM. " WRITE_FKTGRUPPENSTRUKTUR
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_FKTGRPLIST
*&---------------------------------------------------------------------*
* Liste der Funktionsgruppenstruktur ins Dateisystem laden.
* Generierung der Tabelle im HTML-Format
*----------------------------------------------------------------------*
FORM download_fktgrplist USING p_name LIKE wa_trdir-name.
*Herunterladen der Strukturtabelle
**********************************************************
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Fktgruppenstrukturname
DATA: lcl_fkgrp_file TYPE string.
DATA: lcl_file_objectname LIKE wa_fkgrp_struktur-objectname.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
* begin of changes for partner namespace
* Auffuellen der Felder fuer den verwendeten file_name
LOOP AT it_fkgrp_struktur INTO wa_fkgrp_struktur.
lcl_file_objectname = wa_fkgrp_struktur-objectname.
TRANSLATE lcl_file_objectname USING '/_'.
wa_fkgrp_struktur-file_objectname = lcl_file_objectname.
MODIFY it_fkgrp_struktur FROM wa_fkgrp_struktur
INDEX sy-tabix.
ENDLOOP.
* end of changes for partner namespace
*Nur Herunterladen, wenn die Tabelle nicht initial ist
IF NOT ( it_fkgrp_struktur IS INITIAL ).
CONCATENATE 'FKGroup_' p_name INTO lcl_fkgrp_file.
*Umwandlung in HTML-Tabelle
********************************************************
*Ueberschrift zusammenbauen
CONCATENATE 'Functiongrouplist of Functiongroup' p_name
INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Objecttype' TO lcl_it_headerrow.
APPEND 'Objectname' TO lcl_it_headerrow.
APPEND 'Functionmodule' TO lcl_it_headerrow.
APPEND 'Objectname in file system' TO lcl_it_headerrow.
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_fkgrp_struktur INTO wa_fkgrp_struktur.
PERFORM create_htmltab_body USING wa_fkgrp_struktur.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************
CLEAR filename.
CONCATENATE new_dir '\' lcl_fkgrp_file '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_fkgrp_struktur
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text021 lcl_fkgrp_file
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text021 lcl_fkgrp_file
filename.
ENDIF.
ENDIF.
ENDFORM. " DOWNLOAD_FKTGRPLIST
*&---------------------------------------------------------------------*
*& Form HANDLE_SUBMITS
*&---------------------------------------------------------------------*
* Verarbeitung des in der Uebergabestruktur angegebenen Reports,
* der in einem Rahmenprogram mit SUBMiT aufgerufen worden ist.
* Anhaengen an Tabelle zur späteren Verarbeitung von Rahmen-
* programmen.
*----------------------------------------------------------------------*
FORM handle_submits USING p_wa_cross_ref TYPE cross.
*Hilfsvariable um den Namen des Programm Typkonform an
*Forms uebergeben zu können.
DATA: lcl_inlcude LIKE c_includename.
* Area for devclass.
DATA: lcl_devc TYPE tadir-devclass.
*Variable fuer globalen Namen
DATA: lcl_name LIKE wa_trdir-name.
*Überpruefen, ob Programm schon runtergeladen worden ist.
READ TABLE it_prog_stueckliste WITH KEY
name = p_wa_cross_ref-name
TRANSPORTING NO FIELDS.
*Nur downloaden wenn download noch nicht durchgefuehrt worden ist.
IF sy-subrc <> 0.
*Hilfsfeld fuer Typenkonformitaet fuellen
MOVE p_wa_cross_ref-name TO lcl_inlcude.
* Check whether this object belongs to the selected dev-class
IF NOT p_devc IS INITIAL.
SELECT SINGLE devclass FROM tadir INTO lcl_devc
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = lcl_inlcude.
CHECK lcl_devc IN o_devcl.
ENDIF.

*Hauptstuecklist schreiben.
PERFORM write_stueckliste USING '1'
p_wa_cross_ref-name
p_wa_cross_ref-include.
*Tabellen zur späteren Weiterverarbeitung zwischenspeichern
PERFORM write_global_save USING '1' lcl_inlcude.

ELSE.
*Stueckliste schreiben
PERFORM write_stueckliste USING '1'
p_wa_cross_ref-name
p_wa_cross_ref-include.
ENDIF. "Lesen der Stueckliste
ENDFORM. " HANDLE_SUBMITS
*&---------------------------------------------------------------------*
*& Form HANDLE_PERFORMEXTERN
*&---------------------------------------------------------------------*
* Verarbeitung des in der Uebergabestruktur angegebenen Reports,
* der in einem Rahmenprogram mit PERFORM IN PROGRAM aufgerufen
* worden ist.
* Anhaengen an Tabelle zur späteren Verarbeitung von Rahmen-
* programmen.
*----------------------------------------------------------------------*
FORM handle_performextern USING p_wa_cross_ref TYPE cross.
*Variable zur Zwischenspeicherung eines globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
* Area for devclass.
DATA: lcl_devc TYPE tadir-devclass.
*Überpruefen, ob Programm runtergeladen worden ist.
READ TABLE it_prog_stueckliste WITH KEY
name = p_wa_cross_ref-prog
TRANSPORTING NO FIELDS.
*Nur downloaden wenn download noch nicht durchgefuehrt worden ist.
IF sy-subrc <> 0.
* Check whether this object belongs to the selected dev-class
IF NOT p_devc IS INITIAL.
SELECT SINGLE devclass FROM tadir INTO lcl_devc
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = p_wa_cross_ref-prog.
CHECK lcl_devc IN o_devcl.
ENDIF.
*Hauptstückliste schreiben
PERFORM write_stueckliste USING '1'
p_wa_cross_ref-prog
p_wa_cross_ref-include.
*Tabellen zur späteren Weiterverarbeitung zwischenspeichern
PERFORM write_global_save USING '1' p_wa_cross_ref-prog.

ELSE.
*Stueckliste schreiben
PERFORM write_stueckliste USING '1'
p_wa_cross_ref-prog
p_wa_cross_ref-include.
ENDIF. "bereits heruntergeladen
ENDFORM. " HANDLE_PERFORMEXTERN
*&---------------------------------------------------------------------*
*& Form HANDLE_TRANSACTION
*&---------------------------------------------------------------------*
* Verarbeitung der in der Uebergabestruktur angegebenen Transaktion,
* dir in einem Rahmenprogram mit CALL TRANSACITON aufgerufen worden
* ist.
* Anhaengen an Tabelle zur späteren Verarbeitung von Rahmen-
* programmen.
*----------------------------------------------------------------------*
FORM handle_transaction USING p_wa_cross_ref TYPE cross.
*Lokale Variable für den Programmnamen aus Tabelle TSTC
DATA: lcl_progname LIKE c_includename.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
* Area for devclass.
DATA: lcl_devc TYPE tadir-devclass.
*Lesen des Programmnamens zum Transaktionscode
SELECT SINGLE pgmna FROM tstc INTO lcl_progname
WHERE tcode = p_wa_cross_ref-name.
* Check whether this object belongs to the selected dev-class
IF NOT p_devc IS INITIAL.
SELECT SINGLE devclass FROM tadir INTO lcl_devc
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = lcl_progname.
CHECK lcl_devc IN o_devcl.
ENDIF.
* Weiterbearbeitung wie ein mit submit aufgerufenes Programm
* ************************************************************
* Schreiben der Stueckliste fuer Transaktionscodes
* 1.Transaktionscode zu aufrufendem Programm (Hauptliste)
PERFORM write_stueckliste USING 'Transcation Code'
p_wa_cross_ref-name
p_wa_cross_ref-include.

* Überpruefen, ob Programm runtergeladen worden ist.


READ TABLE it_prog_stueckliste WITH KEY
name = lcl_progname
TRANSPORTING NO FIELDS.
* Nur downloaden wenn download noch nicht durchgefuehrt worden ist.
IF sy-subrc <> 0.
* 2.)Stueckliste schreiben (Hauptliste)

PERFORM write_stueckliste USING '1'


lcl_progname
p_wa_cross_ref-name.

* Tabelle zur späteren Weiterverarbeitung


PERFORM write_global_save USING '1' lcl_progname.

ELSE. "Schon in gesichert (nur zu Uebersicht


* Schreiben der Stueckliste fuer Transaktionscodes
* 1.Transaktionscode zu aufrufendem Programm
PERFORM write_stueckliste USING 'TAC'
p_wa_cross_ref-name
p_wa_cross_ref-include.
* 2.)Stueckliste schreiben
PERFORM write_stueckliste USING 'R'
lcl_progname
p_wa_cross_ref-name.
ENDIF. "schon gesichert?
ENDFORM. " HANDLE_TRANSACTION
*&---------------------------------------------------------------------*
*& Form HANDLE_AUTHORITYOBJECT
*&---------------------------------------------------------------------*
* Lesen der Infos des in der Uebergabestruktur angegebenen
* Berechtigungsobjektes. Anhaengen an globale Tabelle der
* Berechtigungsobjekte.
*----------------------------------------------------------------------*
FORM handle_authorityobject USING p_wa_cross_ref TYPE cross.
*Bereich fuer Felder
DATA: lcl_wa_authx TYPE authx.
*Tabelle fuer Felder des Berechtigungsobjektes
TYPES: BEGIN OF fields,
name TYPE xufield,
END OF fields.
DATA: lcl_it_fields TYPE STANDARD TABLE OF fields,
lcl_wa_fields LIKE LINE OF lcl_it_fields.
*Lokale Variablen für Tabellenbehandlung
DATA: lcl_wa_tobj LIKE wa_tobj,
lcl_it_tactz LIKE it_tactz.
*Selektion der Berechtigungsobjekte
SELECT SINGLE * FROM tobj INTO lcl_wa_tobj
WHERE objct = p_wa_cross_ref-name.
*Anhaengen an Gesamtliste
APPEND lcl_wa_tobj TO it_tobj.
*Identifzieren von Datenelementen im Kunennamensraum
APPEND lcl_wa_tobj-fiel1 TO lcl_it_fields.
APPEND lcl_wa_tobj-fiel2 TO lcl_it_fields.
APPEND lcl_wa_tobj-fiel3 TO lcl_it_fields.
APPEND lcl_wa_tobj-fiel4 TO lcl_it_fields.
APPEND lcl_wa_tobj-fiel5 TO lcl_it_fields.
APPEND lcl_wa_tobj-fiel6 TO lcl_it_fields.
APPEND lcl_wa_tobj-fiel7 TO lcl_it_fields.
APPEND lcl_wa_tobj-fiel8 TO lcl_it_fields.
APPEND lcl_wa_tobj-fiel9 TO lcl_it_fields.
APPEND lcl_wa_tobj-fiel0 TO lcl_it_fields.
LOOP AT lcl_it_fields INTO lcl_wa_fields
WHERE name(1) = 'Z'
OR name(1) = 'Y'.
SELECT SINGLE * FROM authx INTO lcl_wa_authx
WHERE fieldname = lcl_wa_fields-name.
IF ( ( lcl_wa_authx-rollname(1) = 'Z' )
OR ( lcl_wa_authx-rollname(1) = 'Y' ) ).
PERFORM write_dataelements USING lcl_wa_authx-rollname.
ENDIF.
ENDLOOP.
*Selektion der zu den Berechtigungsobjekten gehörigen Aktivitäten
SELECT * FROM tactz INTO TABLE lcl_it_tactz
WHERE brobj = p_wa_cross_ref-name.
APPEND LINES OF lcl_it_tactz TO it_tactz.
*Schreiben der STueckliste
PERFORM write_stueckliste USING 'Authority Object'
p_wa_cross_ref-name
p_wa_cross_ref-include.
ENDFORM. " HANDLE_AUTHORITYOBJECT
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_AUTHORITYOBJECTS
*&---------------------------------------------------------------------*
* Sicherung der Gesamttabelle der Berechtigunsobjekte
* und der Aktivitaetentabell in das Dateisystem .
* Generierung der Tabelle in HTML-Format.
*----------------------------------------------------------------------*
FORM download_authorityobjects.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Berechtigungsobjektname
DATA: lcl_authobj_name TYPE string.
*Aktivitaeten zu Berechtigungsobjekt
DATA: lcl_auth_act TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
*1.) Berechtigungsobjekttabelle
*Nur herunterladen, wenn Berechtigungsobjektabelle Inhalt hat.
IF NOT ( it_tobj IS INITIAL ).
*Ueberschrift zusammenbauen
CONCATENATE 'Structure of Authorityobjects in Mainprogram'
global_main_name INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Name of Object' TO lcl_it_headerrow.
APPEND 'Field 1' TO lcl_it_headerrow.
APPEND 'Field 2' TO lcl_it_headerrow.
APPEND 'Field 3' TO lcl_it_headerrow.
APPEND 'Field 4' TO lcl_it_headerrow.
APPEND 'Field 5' TO lcl_it_headerrow.
APPEND 'Field 6' TO lcl_it_headerrow.
APPEND 'Field 7' TO lcl_it_headerrow.
APPEND 'Field 8' TO lcl_it_headerrow.
APPEND 'Field 9' TO lcl_it_headerrow.
APPEND 'Field 10' TO lcl_it_headerrow.
APPEND 'Class' TO lcl_it_headerrow.
APPEND 'Author' TO lcl_it_headerrow.
APPEND 'Function Block' TO lcl_it_headerrow.
APPEND 'Conversion of Field' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_tobj INTO wa_tobj.
PERFORM create_htmltab_body USING wa_tobj.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************

CONCATENATE 'Auhthorities' global_main_name INTO lcl_authobj_name.


CLEAR filename.
CONCATENATE new_dir '\' lcl_authobj_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_tobj
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text031 lcl_authobj_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text031 lcl_authobj_name
filename.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Authority Objects'
'Authority Objects'
global_main_name.
ENDIF.
ENDIF. "Tabelle it_tobj gefuellt?????
*2.) Aktivitaeten zur Berechtigungsobjekttabelle
*Nur herunterladen, wenn Aktivitaetstabelle Inhalt hat.
IF NOT ( it_tactz IS INITIAL ).
CLEAR lcl_header. REFRESH lcl_it_headerrow.
* Ueberschrift zusammenbauen
CONCATENATE 'Activities of Authorization Objects in Program'
global_main_name INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Authority Object' TO lcl_it_headerrow.
APPEND 'Assigned Activity' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_tactz INTO wa_tactz.
PERFORM create_htmltab_body USING wa_tactz.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************

CONCATENATE 'AuthActivities' global_main_name INTO lcl_auth_act.


*Html-tabelle anlegen
CLEAR lcl_header. REFRESH lcl_it_headerrow.

CLEAR filename.
CONCATENATE new_dir '\' lcl_authobj_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_tactz
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text032 lcl_auth_act filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text032 lcl_auth_act filename.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Activities of Authority Objects'
'Activities of Authority Objects'
global_main_name.
ENDIF.
ENDIF. "Tabelle it_tactz gefuellt?????
ENDFORM. " DOWNLOAD_AUTHORITYOBJECTS
*&---------------------------------------------------------------------*
*& Form HANDLE_TITLEBAR
*&---------------------------------------------------------------------*
* Lesen der Gui-Titel des im Parameter P_NAME uebergebenen
* Rahmenprogramms. Anhaengen an globale Gesamtliste der GUI-Titel.
*----------------------------------------------------------------------*
FORM handle_titlebar USING p_name TYPE c
p_typus TYPE c.
*Lokale interne Tabelle fuer Titlebar aufzunehmen
DATA: lcl_it_d347t LIKE it_d347t.
CLEAR wa_d347t.
*Lesen der Titlebartabelle mit dem Schlüssel Ra
SELECT * FROM d347t INTO TABLE lcl_it_d347t
WHERE ( ( progname = p_name )
AND ( sprsl IN o_lan ) ).
LOOP AT lcl_it_d347t INTO wa_d347t.
*Anhaengen der lokalen Tabelle an die Gesamttabelle
APPEND wa_d347t TO it_d347t.
IF p_typus = 'R'. "Rahmenprogramm
*Nur schreiben wenn zu diesem Schluessel noch kein Eintrag
*existiert
READ TABLE it_prog_stueckliste WITH TABLE KEY
name = wa_d347t-obj_code
obername = p_name
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0. "nichts gefunden
PERFORM write_stueckliste USING 'Titelbar'
wa_d347t-obj_code
p_name.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " HANDLE_TITLEBAR
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_TITLEBAR
*&---------------------------------------------------------------------*
* Sicherung der Gesamtliste der GUI-Titel in das Dateisystem.
* Generierung der Tabelle in HTML-Format.
*----------------------------------------------------------------------*
FORM download_titlebar.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Dateiname fuer Download
DATA: lcl_titlebar_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.

*Nur Herunterladen wenn Tabelle nicht initial ist


IF NOT ( it_d347t IS INITIAL ).
* Ueberschrift zusammenbauen
CONCATENATE 'GUI-Titles of Object' global_main_name
INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Programname' TO lcl_it_headerrow.
APPEND 'Language' TO lcl_it_headerrow.
APPEND 'Code of Title' TO lcl_it_headerrow.
APPEND 'Text of Title' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_d347t INTO wa_d347t.
PERFORM create_htmltab_body USING wa_d347t.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************

CONCATENATE 'Titlebar_' global_main_name INTO lcl_titlebar_name.


CLEAR filename.
CONCATENATE new_dir '\' lcl_titlebar_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_d347t
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text033 lcl_titlebar_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text033 lcl_titlebar_name
filename.
ENDIF.
ENDIF. "ist it_d347t überhaupt gefüllt
ENDFORM. " DOWNLOAD_TITLEBAR
*&---------------------------------------------------------------------*
*& Form HANDLE_TACODE
*&---------------------------------------------------------------------*
* Lesen aller Transaktionscodes zu dem im Parameter P_NAME
* uebergebenen Rahmenprgramm. Anhaengen an die Gesamtliste
* der Transaktionscodes.
*----------------------------------------------------------------------*
FORM handle_tacode USING p_name LIKE wa_trdir-name.
*Lokaler Arbeitsbereich fuer Transaktionscodezuweisung
DATA: lcl_it_tstc TYPE STANDARD TABLE OF itstc.
SELECT tcode pgmna dypno FROM tstc INTO TABLE lcl_it_tstc
WHERE pgmna = p_name.
*Selektionsergebnis an Gesamttabelle anhaengen
APPEND LINES OF lcl_it_tstc TO it_tstc.

ENDFORM. " HANDLE_TACODE


*&---------------------------------------------------------------------*
*& Form DOWNLOAD_TACODELIST
*&---------------------------------------------------------------------*
* Speicherung der Gesamtliste der Tranaktionscodes
* Generierung der Tabelle in HTML-Format.
*----------------------------------------------------------------------*
FORM download_tacodelist.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Dateiname fuer Download
DATA: lcl_tacode_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.

*Nur Herunterladen wenn Tabelle nicht initial ist


IF NOT ( it_tstc IS INITIAL ).
* Ueberschrift zusammenbauen
CONCATENATE 'Transactioncodes of Program' global_main_name
INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Transactionscode' TO lcl_it_headerrow.
APPEND 'Programname' TO lcl_it_headerrow.
APPEND 'Number Start Dynpro' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_tstc INTO wa_tstc.
PERFORM create_htmltab_body USING wa_tstc.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************
CONCATENATE 'Tacodelist_' global_main_name INTO lcl_tacode_name.

CLEAR filename.
CONCATENATE new_dir '\' lcl_tacode_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_tstc
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text034 lcl_tacode_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text034 lcl_tacode_name
filename.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Tranactioncodelist'
'Tacodelist'
global_main_name.
ENDIF.
ENDIF. "ist it_d347t überhaupt gefüllt
ENDFORM. " DOWNLOAD_TACODELIST
*&---------------------------------------------------------------------*
*& Form HANDLE_PF_STATUS
*&---------------------------------------------------------------------*
* Lesen der Informationen zu den GUI-Stati des im Paramter P_NAME
* uebergebenen Rahmenprogramms. Aufruf der Routinen zur Sicherung
* der Menueliste und der Funktionstastenliste.
*----------------------------------------------------------------------*
FORM handle_pf_status USING p_name TYPE c
p_typus TYPE c.
*Variable fuer Prog-Name wegen Typkonformitaet
DATA: lcl_prog LIKE c_includename.
*Zuweisung
lcl_prog = p_name.
*Lokale Datenbereich um Status für Rahmenprogramm zu ermitteln
DATA: lcl_it_rlseu0_dok TYPE STANDARD TABLE OF rlseu0_dok,
lcl_wa_rlseu0_dok LIKE LINE OF lcl_it_rlseu0_dok.
*Sprachtabelle
LOOP AT it_lan INTO wa_lan.
*Alle Stati zu diesem Rahmenprogamm besorgen
CALL FUNCTION 'RS_CUA_STATUS'
EXPORTING
objectname = lcl_prog
language = wa_lan
TABLES
status = lcl_it_rlseu0_dok
EXCEPTIONS
object_not_found = 1
object_not_specified = 2
program_not_found = 3
OTHERS = 4.
*Wenn ungleich null; hat dieses Rahmenprogramm keine Stati
IF sy-subrc = 0.
*Jeden einzelnen Status bearbeiten
LOOP AT lcl_it_rlseu0_dok INTO lcl_wa_rlseu0_dok.
*Alle Infos fuer pf-Status abfragen
CALL FUNCTION 'RS_CUA_GET_STATUS'
EXPORTING
language = wa_lan
program = lcl_prog
status = lcl_wa_rlseu0_dok-status
* SUPPRESS_CMOD_ENTRIES = 'X'
TABLES
* STATUS_LIST =
* FKEYS =
* TREE =
* NOT_FOUND_LIST =
menutree = it_rsmpe_tree
functionkeys = it_rsmpe_keys
EXCEPTIONS
not_found_program = 1
not_found_status = 2
recursive_menues = 3
empty_list = 4
not_found_menu = 5
OTHERS = 6
.
*Nur Downloaden wenn Ausführung erfolgreich war
IF sy-subrc = 0.
*Download der Menustruktur, nur wenn Tabelle nicht leer.
IF NOT ( it_rsmpe_tree IS INITIAL ).
PERFORM download_menuliste USING lcl_prog
lcl_wa_rlseu0_dok-status
p_typus.
ENDIF.
*Download der Funktionsbausteininfos, nur wenn Tabelle nicht leer
IF NOT ( it_rsmpe_keys IS INITIAL ).
PERFORM download_functionkeys USING lcl_prog
lcl_wa_rlseu0_dok-status
p_typus.
ENDIF.
ENDIF.
*Initialisieren der globalen Standardtabellen
REFRESH it_rsmpe_keys. REFRESH it_rsmpe_tree.
ENDLOOP. "Stati
ENDIF.
ENDLOOP. "Sprachtabelle
ENDFORM. " HANDLE_PF_STATUS
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_MENULISTE
*&---------------------------------------------------------------------*
* Download der in der globalen Tabelle fuer die Menueliste
* enthaltenen Menueliste füer den Status.
* Generierung der Liste in HTML-Format.
*----------------------------------------------------------------------*
FORM download_menuliste USING p_name LIKE wa_trdir-name
p_status TYPE rlseu0_dok-status
p_typus TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Name fuer die Menuliste
DATA: lcl_menuliste_name TYPE string.
CONCATENATE 'Menulist_' p_name '_' p_status '(' wa_lan ')' INTO
lcl_menuliste_name.

*Ueberpruefen, ob dieses Element schon heruntergeladen worden ist


READ TABLE it_prog_stueckliste WITH TABLE KEY
name = lcl_menuliste_name
obername = p_name
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0. "nichts gefunden
PERFORM create_html_for_menulist USING p_status
p_name.
CLEAR filename.
CONCATENATE new_dir '\' lcl_menuliste_name '.htm' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_rsmpe_tree
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text035 lcl_menuliste_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text035 lcl_menuliste_name
filename.
ENDIF.
*Unterscheidung zu welcher Ordnungsebene die Menuliste gehoert:
*Rahmenprogramm oder Funktionsgruppe oder ...(Stueckliste!!!)
IF p_typus = 'R'. "Rahmenprogramm
PERFORM write_stueckliste USING 'PfMe'
lcl_menuliste_name
p_name.
ELSEIF p_typus = 'G'. "Funktionsgruppe
PERFORM write_fktgruppenstruktur USING 'MeLi'
lcl_menuliste_name
p_name.
ENDIF.
ENDIF. "Stueckliste lesen
ENDFORM. " DOWNLOAD_MENULISTE
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_FUNCTIONKEYS
*&---------------------------------------------------------------------*
* Download der in der globalen Tabelle fuer die Funktionstasten-
* liste enthaltenen Menueliste füer den Status.
* Generierung der Liste in HTML-Format.
*----------------------------------------------------------------------*
FORM download_functionkeys USING p_name LIKE wa_trdir-name
p_status TYPE rlseu0_dok-status
p_typus TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Lokaler Downloadtabelle für Funktionskeys(Aussagefähiger Name für Icon)
TYPES: BEGIN OF downtab,
keys LIKE rsmpe_keys,
icon_text TYPE icon-name,
END OF downtab.
DATA: lcl_it_downtab TYPE STANDARD TABLE OF downtab,
lcl_wa_downtab LIKE LINE OF lcl_it_downtab.
DATA: lcl_text TYPE icon-name.
*Ausgabestruktur fuer Html-Aufbereitung bestellen
TYPES: BEGIN OF idowntab,
* PFNO like downtab-keys-PFNO,
code TYPE downtab-keys-code,
text TYPE downtab-keys-text,
quickinfo TYPE downtab-keys-quickinfo,
icon_text TYPE downtab-icon_text,
END OF idowntab.
*Arbeitsbereich fuer Ausgabebereich
DATA: lcl_wa_idowntab TYPE idowntab.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.

*Doanloadtabelle aufbereiten: Es wird der Name des Icons noch eingefuegt


LOOP AT it_rsmpe_keys INTO lcl_wa_downtab-keys.
IF NOT ( lcl_wa_downtab-keys-icon_id IS INITIAL ).
SELECT SINGLE name FROM icon INTO lcl_text
WHERE id = lcl_wa_downtab-keys-icon_id.
MOVE lcl_text TO lcl_wa_downtab-icon_text.
ELSEIF NOT ( lcl_wa_downtab-keys-sys_icon IS INITIAL ).
SELECT SINGLE name FROM icon INTO lcl_text
WHERE id = lcl_wa_downtab-keys-sys_icon.
MOVE lcl_text TO lcl_wa_downtab-icon_text.
ENDIF.
APPEND lcl_wa_downtab TO lcl_it_downtab.
ENDLOOP.
*Name fuer die Functionkeyliste
DATA: lcl_functionkeylist_name TYPE string.
CONCATENATE 'Functionkey_' p_name '_' p_status '(' wa_lan ')'
INTO lcl_functionkeylist_name.
*Ueberschrift zusammenbauen
CONCATENATE 'Functionkeylist of Status ' p_status 'of Mainprogram'
p_name '(Language:' wa_lan ')'
INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Functioncode' TO lcl_it_headerrow.
APPEND 'Text of Function' TO lcl_it_headerrow.
APPEND 'Quick-Info' TO lcl_it_headerrow.
APPEND 'Name of Icon' TO lcl_it_headerrow.

*Umwandlung in HTML-Tabelle
********************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT lcl_it_downtab INTO lcl_wa_downtab.
*Nur wichtige Felder uebernehmen
MOVE-CORRESPONDING lcl_wa_downtab-keys TO lcl_wa_idowntab.
MOVE lcl_wa_downtab-icon_text TO lcl_wa_idowntab-icon_text.
PERFORM create_htmltab_body USING lcl_wa_idowntab.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************
*Ueberpruefen, ob dieses Element schon heruntergeladen worden ist
READ TABLE it_prog_stueckliste WITH TABLE KEY
name = lcl_functionkeylist_name
obername = p_name
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0. "nichts gefunden
CLEAR filename.
CONCATENATE new_dir '\' lcl_functionkeylist_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "lcl_it_downtab
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text036
lcl_functionkeylist_name filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text036
lcl_functionkeylist_name filename.
ENDIF.
*Unterscheidung zu welcher Ordnungsebene die Menuliste gehoert:
*Rahmenprogramm oder Funktionsgruppe oder ...(Stueckliste!!!)
IF p_typus = 'R'. "Rahmenprogramm
PERFORM write_stueckliste USING 'PfFu'
lcl_functionkeylist_name
p_name.
ELSEIF p_typus = 'G'. "Funktionsgruppe
PERFORM write_fktgruppenstruktur USING 'MeLi'
lcl_functionkeylist_name
p_name.
ENDIF.
ENDIF. "Stuecklistenueberpruefung
ENDFORM. " DOWNLOAD_FUNCTIONKEYS
*&---------------------------------------------------------------------*
*& Form HANDLE_CLASSINTERFACE
*&---------------------------------------------------------------------*
* Ermittlung der Klassen des im Uebergabeparmater p_name
* angegegbenen Rahmenprogramm. Ermittelte Klassen werden in
* Tabelle zur späteren Verarbeitung von Rahmenprogrammen
* geschrieben.
* Über die Klassen werden auch die enthaltenen Interfaces
* berücksichtigt.
*----------------------------------------------------------------------*
FORM handle_classinterface USING p_name LIKE wa_trdir-name
p_typus TYPE c.
*Bereiche um Programmlas zu verarbeiten
DATA: lcl_it_rcref TYPE STANDARD TABLE OF rcref,
lcl_wa_rcref LIKE LINE OF lcl_it_rcref.
* Area for devclass.
DATA: lcl_devc TYPE tadir-devclass.
*Klassen des Programmes laden
LOAD REPORT p_name PART 'CREF' INTO lcl_it_rcref.
*Sicherung der Klassen im Kundennamensraum
LOOP AT lcl_it_rcref INTO lcl_wa_rcref.
* WHERE name(1) = 'Z'
* OR name(1) = 'Y'
* or name(g_len_nspace) = p_nspace.
IF lcl_wa_rcref-name(1) = 'Y'
OR lcl_wa_rcref-name(1) = 'Z'
OR lcl_wa_rcref-name(g_len_nspace) = p_nspace.
* Check whether this object belongs to the selected dev-class
IF NOT p_devc IS INITIAL.
SELECT SINGLE devclass FROM tadir INTO lcl_devc
WHERE pgmid = 'R3TR'
AND object = 'CLAS'
AND obj_name = lcl_wa_rcref-name.
CHECK lcl_devc IN o_devcl.
ENDIF.
PERFORM write_global_save USING 'C' lcl_wa_rcref-name.
PERFORM write_stueckliste USING 'Class(OO)'
lcl_wa_rcref-name
p_name.
ENDIF.
ENDLOOP.
ENDFORM. "handle_classinterface
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_classLIST
*&---------------------------------------------------------------------*
* Generierung der Klassenliste fuer Methodenincludes und
* normale Includes.
* Sicherung der Klassenliste in Dateisystem
*----------------------------------------------------------------------*
FORM download_classlist USING p_name TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Variablen für den Suchstring
DATA: lcl_such(40) TYPE c.
*Variable fuer Anzahl der Zeilen der internen Tabelle
DATA: lcl_lines TYPE i.
*Variable fuer Zaehler der do-Schleife
DATA: lcl_zaehler TYPE i.
*Arbeitsbereich fuer tmdir
DATA: lcl_it_tmdir TYPE STANDARD TABLE OF tmdir,
lcl_wa_tmdir LIKE LINE OF lcl_it_tmdir.
*Arbeitsbereich fuer trdir
DATA: lcl_it_trdir TYPE STANDARD TABLE OF trdir,
lcl_wa_trdir LIKE LINE OF lcl_it_trdir.
*Varible um Laenge des uebergeben Strings zu ermittlen
DATA: lcl_laeng TYPE i.
*Name fuer die Methodenliste der Klasse-->Download
DATA: lcl_classlist_name TYPE string.
DATA: lcl_file_inc LIKE wa_classlist-file_inc.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
**************************************************************
*1.) Methodenincludes verarbeiten
**************************************************************
*Suchstring zur Selektion der Trdir aufbauen
lcl_laeng = STRLEN( p_name ).
IF lcl_laeng = 30.
CONCATENATE p_name '%CM___' INTO lcl_such.
ELSE.
CONCATENATE p_name '=%CM___' INTO lcl_such.
ENDIF.

*Alle relevanten Includes aus Trdir lesen


SELECT * FROM trdir INTO TABLE lcl_it_trdir
WHERE name LIKE lcl_such.
*Ueberpruefen, ob die Selektierten Includes den Namenkonventionen
*fuer Methodenincludes entsprechen.
LOOP AT lcl_it_trdir INTO lcl_wa_trdir.
*Wenn Laenge ungleich 35 ist diese Zeile aus interner Tabelle loeschen
*(Methodenincludes haben Laenge 35; normale Includes dürfen nur Laenge
*30 haben).
lcl_laeng = STRLEN( lcl_wa_trdir-name ).
IF lcl_laeng <> 35.
DELETE lcl_it_trdir FROM sy-tabix.
CONTINUE.
ENDIF.
ENDLOOP.
*Tabelle mit forlaufenden Nummern der Methoden selektieren
SELECT * FROM tmdir INTO TABLE lcl_it_tmdir
WHERE classname = p_name.
*Sortierung der beiden Tabellen dass sie spaeter gemischt werden
*koennen.
SORT lcl_it_trdir BY name ASCENDING.
SORT lcl_it_tmdir BY methodindx ASCENDING .
*Nur Saetze die einen Index haben sind relevant
DELETE lcl_it_tmdir WHERE methodindx IS INITIAL.
*Anzahl der Saetze ermittlen fuer Schleife zum Mischen.
DESCRIBE TABLE lcl_it_trdir LINES lcl_lines.
*Abmischen der der beiden Tabellen in Gesamttabelle
lcl_zaehler = 1.
DO lcl_lines TIMES.
READ TABLE lcl_it_trdir INDEX lcl_zaehler INTO lcl_wa_trdir.
READ TABLE lcl_it_tmdir INDEX lcl_zaehler INTO lcl_wa_tmdir.
MOVE 'Meth' TO wa_classlist-typus.
MOVE lcl_wa_trdir-name TO wa_classlist-inc.
MOVE lcl_wa_tmdir-methodname TO wa_classlist-meth.
APPEND wa_classlist TO it_classlist.
lcl_zaehler = lcl_zaehler + 1.
ENDDO.
********************************************************
*2.)Alle anderen Klassenincludes außer Methodenincludes
********************************************************
*Suchstring zur Selektion der Trdir aufbauen
lcl_laeng = STRLEN( p_name ).
IF lcl_laeng = 30.
CONCATENATE p_name '%C_' INTO lcl_such.
ELSE.
CONCATENATE p_name '=%C_' INTO lcl_such.
ENDIF.
REFRESH lcl_it_trdir. CLEAR lcl_wa_trdir.
CLEAR wa_classlist.
*Alle relevanten Includes aus Trdir lesen
SELECT * FROM trdir INTO TABLE lcl_it_trdir
WHERE name LIKE lcl_such.
LOOP AT lcl_it_trdir INTO lcl_wa_trdir.
lcl_laeng = STRLEN( lcl_wa_trdir-name ).
IF lcl_laeng = 32. "Es ist ein Klasseninclude
MOVE 'CIN' TO wa_classlist-typus.
MOVE lcl_wa_trdir-name TO wa_classlist-inc.
APPEND wa_classlist TO it_classlist.
ENDIF.
ENDLOOP.
* Get local type-pools, local macros, local classes
* Suchstring zur Selektion der Trdir aufbauen
lcl_laeng = STRLEN( p_name ).
IF lcl_laeng = 30.
CONCATENATE p_name '%CC%' INTO lcl_such.
ELSE.
CONCATENATE p_name '=%CC%' INTO lcl_such.
ENDIF.
REFRESH lcl_it_trdir. CLEAR lcl_wa_trdir.
CLEAR wa_classlist.
*Alle relevanten Includes aus Trdir lesen
SELECT * FROM trdir INTO TABLE lcl_it_trdir
WHERE name LIKE lcl_such.
LOOP AT lcl_it_trdir INTO lcl_wa_trdir.
lcl_laeng = STRLEN( lcl_wa_trdir-name ).
IF lcl_laeng = 35. "Es ist ein INclude für lokale definitions
MOVE 'CIN' TO wa_classlist-typus.
MOVE lcl_wa_trdir-name TO wa_classlist-inc.
APPEND wa_classlist TO it_classlist.
ENDIF.
ENDLOOP.
********************************************************
*3.)Klassenliste herunterladen
********************************************************
* begin of changes for partner namespace
* Auffuellen der Felder fuer den verwendeten file_name
LOOP AT it_classlist INTO wa_classlist.
lcl_file_inc = wa_classlist-inc.
TRANSLATE lcl_file_inc USING '/_'.
wa_classlist-file_inc = lcl_file_inc.
MODIFY it_classlist FROM wa_classlist INDEX sy-tabix.
ENDLOOP.
* end of changes for partner namespace
*Nur Download durchführen wenn Klassenliste nicht leer ist.
IF NOT ( it_classlist IS INITIAL ).
CONCATENATE 'Classlist_' p_name INTO lcl_classlist_name.
*Umwandlung in HTML-Tabelle
********************************************************
*Ueberschrift zusammenbauen
CONCATENATE 'Components of OO-Class' p_name
INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Include Type' TO lcl_it_headerrow.
APPEND 'Include Name ' TO lcl_it_headerrow.
APPEND 'Method Name' TO lcl_it_headerrow.
APPEND 'Include Name in file system' TO lcl_it_headerrow.

PERFORM create_htmltab_header USING lcl_it_headerrow


lcl_header.
LOOP AT it_classlist INTO wa_classlist.
PERFORM create_htmltab_body USING wa_classlist.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************
CLEAR filename.
CONCATENATE new_dir '\' lcl_classlist_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_classlist
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text039 lcl_classlist_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text039 lcl_classlist_name
filename.
ENDIF.
ENDIF. "Download nur wenn Klassenliste nicht leer ist
ENDFORM. " DOWNLOAD_METHODLIST
*&---------------------------------------------------------------------*
*& Form SELECTION
*&---------------------------------------------------------------------*
* Abfangen der Selektionen in den Selektionsbildschirmen.
*----------------------------------------------------------------------*
FORM selection.
*Variable zur Speicherung des Root-Verzeichnisses
* DATA: lcl_root(128) TYPE c.
DATA: lcl_root TYPE string.
*Bereich fuer Sprachen
DATA lcl_t002c_spras TYPE t002c-spras.
*Variable fuer Laenge eines Strings
DATA: lcl_len TYPE i.
g_nspace = p_nspace.
g_savename = p_nspace.
TRANSLATE g_savename USING '/_'.
*Ueberpruefen, ob letztes Zeichen ein Backslash ist
*-->dann loeschen des Backslashs
lcl_len = STRLEN( dir ).
lcl_len = lcl_len - 1.
IF dir+lcl_len = '\'.
dir = dir(lcl_len).
ENDIF.
*Behandlung der Sprache, gueltiger Eintrag
IF o_lan IS INITIAL.
APPEND sy-langu TO it_lan.
ELSE.
SELECT spras FROM t002c INTO TABLE it_lan WHERE spras IN o_lan.
ENDIF.

*Welche Programmgruppe soll heruntergeladen werden


IF p_single = 'X'. "Einzelne Objekte
*Ueberpruefen, ob ueberhaupt eine Selektion vorgenommen worden
IF ( o_prog IS INITIAL AND o_fkgrp IS INITIAL AND o_class IS INITIAL
AND o_intf IS INITIAL AND o_idoc IS INITIAL
AND o_cmod IS INITIAL AND o_badis IS INITIAL
AND o_inc IS INITIAL AND o_func IS INITIAL
AND o_dynp IS INITIAL AND o_tcode
AND o_iacs IS INITIAL ).
IF ( p_logic IS INITIAL ).
MESSAGE i888(sabapdocu) WITH
'Please make a Selection!'.
ELSE.
MESSAGE i888(sabapdocu) WITH
'Please choose Objects'
'to your logical Development'.
ENDIF. "Logische Entwicklung
*Zur Aufrufstelle zurückspringen
* SUBMIT (sy-cprog) via SELECTION-SCREEN.
*Selektionen durchfuehren
ELSE.
*Ueberpruefen, ob logische Entwicklungsselektion vorliegt
IF NOT ( p_logic IS INITIAL ).
PERFORM prepare_for_logical_dev.
ENDIF.
* Reports/Modulpoole
IF NOT ( o_prog IS INITIAL ).
lcl_root = dir.
PERFORM reps_mods.
dir = lcl_root.
ENDIF.
* Transaktionscodes verarbeiten
IF NOT ( o_tcode IS INITIAL ).
lcl_root = dir.
PERFORM tacode.
dir = lcl_root.
ENDIF.
* Funktionsgruppen
IF NOT ( o_fkgrp IS INITIAL ).
lcl_root = dir.
PERFORM function_group.
dir = lcl_root.
ENDIF.
* OO-Klasse
IF NOT ( o_class IS INITIAL ).
lcl_root = dir.
PERFORM classes.
dir = lcl_root.
ENDIF.
* OO-Interfaces
IF NOT ( o_intf IS INITIAL ).
lcl_root = dir.
PERFORM interfaces.
dir = lcl_root.
ENDIF.

* IDOC (Baistypen und Erweiterungen


IF NOT ( o_idoc IS INITIAL ).
lcl_root = dir.
PERFORM idocs.
dir = lcl_root.
ENDIF.
* Kundenerweiterungen CMOD
IF NOT ( o_cmod IS INITIAL ).
lcl_root = dir.
PERFORM customerenhancements.
dir = lcl_root.
ENDIF.
* Kundenerweiterungen BADI
IF NOT ( o_badis IS INITIAL ).
lcl_root = dir.
PERFORM badi_implementation.
dir = lcl_root.
ENDIF.
* IAC-Service(ITS)
IF NOT ( o_iacs IS INITIAL ).
lcl_root = dir.
PERFORM iac_service.
dir = lcl_root.
ENDIF.
* Auswahl der Modifikationen bearbeiten; pruefung auf initial der
* Selektionsvariablen ist in Routine eingebaut
lcl_root = dir.
PERFORM handle_modis.
dir = lcl_root.
*Aufbereitung und Verarbeitung der Daten fuer Download der Stueckliste
*der logischen Entwicklung
REFRESH it_prog_stueckliste.
APPEND LINES OF it_log_stueckliste TO it_prog_stueckliste.
*globale Variablen entsprechend anpassen
global_main_name = p_logic.
new_dir = dir.
*Nur Verarbeitung, wenn etwas archiviert worden ist
IF NOT ( it_protocol IS INITIAL ).
*Trennung von Einzeldateiobjekten
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM download_stueckliste.
*Leerzeile nach Ende dieser Verarbeitung
PERFORM write_protocol USING 'S' '' '' ''.
ENDIF. "Etwas Archiviert?
ENDIF. "Sind Selektionen Einzelvarbeitung vorgenommen worden
ELSEIF p_devc ='X'.
lcl_root = dir.
IF o_devcl IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'Please make a Selection!'
'You have to enter a Developmentclass!'.
ELSE.
PERFORM developmentclass.
ENDIF.
dir = lcl_root.
ELSEIF p_trkorr = 'X'.
lcl_root = dir.
IF o_trkorr IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'Please make a Selection!'
'You have to enter a Transport Request!'.
ELSE.
PERFORM transportrequest.
ENDIF.
dir = lcl_root.
ENDIF.
ENDFORM. " SELECTION
*&---------------------------------------------------------------------*
*& Form FUNCTION_GROUP
*&---------------------------------------------------------------------*
* Abfangen der selektierten Funtkionsgruppen aus dem
* Selektionsbildschirm zur Auswahl einzelner Objekte.
* Fuer jede gefundene Funktionsgruppe wird die entsprechende
* Aufrufroutine ausgeführt.
*----------------------------------------------------------------------*
FORM function_group.
*Variable zum Zusammenbauen des trdir-Names der Funktiongruppe
DATA: lcl_fktgrp LIKE wa_trdir-name.
*Bereich fuer Tabelle mit Funktionsgruppennamen
DATA: lcl_it_tlibg TYPE STANDARD TABLE OF tlibg,
lcl_wa_tlibg LIKE LINE OF lcl_it_tlibg.
*Lesen der Selektion
SELECT * FROM tlibg INTO TABLE lcl_it_tlibg
WHERE area IN o_fkgrp
AND ( ( area LIKE 'Z%' ) OR ( area LIKE 'Y%' ) OR
( area LIKE g_name ) ).
*Verlassen,wenn keine Werte gefunden worden sind
IF lcl_it_tlibg IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for Functiongroups! '
'Please check your selection. '
'The program will process your other selections.'.
*Form-Routine verlassen
EXIT.
ENDIF.

**********Ausfuehren des Programmdownloads


*** Ausführung für jede Funktionsgruppe
LOOP AT lcl_it_tlibg INTO lcl_wa_tlibg.

*SAPL-Name des Funktionsbausteins zusammenbauen


*Unterscheidung auf Partnernamensraum.
IF lcl_wa_tlibg-area(1) = '/'.
lcl_fktgrp = lcl_wa_tlibg-area.
PERFORM convert_fugrname_for_partner
CHANGING lcl_fktgrp.
ELSE. "normaler namensraum
CONCATENATE 'SAPL' lcl_wa_tlibg-area INTO lcl_fktgrp.
ENDIF.
*build global name
global_main_name = lcl_wa_tlibg-area.
*Liste mit Ober-Objekten bei Einzelselektion fuellen
MOVE lcl_fktgrp TO wa_obj_list-name.
APPEND wa_obj_list TO it_obj_list.
*Verarbeitungsroutine aufrufen
PERFORM handle_functiongroup USING lcl_fktgrp.
*Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'Functiongroup'
lcl_wa_tlibg-area
p_logic.
ENDIF.
ENDLOOP.
ENDFORM. " FUNCTION_GROUP
*&---------------------------------------------------------------------*
*& Form CLASSES
*&---------------------------------------------------------------------*
* Abfangen der selektierten Klassen aus dem
* Selektionsbildschirm zur Auswahl einzelner Objekte.
* Fuer jede gefundene Klasse wird die entsprechende
* Aufrufroutine ausgeführt
*----------------------------------------------------------------------*
FORM classes.
*Bereiche fuer seoclass
DATA: lcl_it_seoclass TYPE STANDARD TABLE OF seoclass,
lcl_wa_seoclass LIKE LINE OF lcl_it_seoclass.
*Selektieren der Programme nach Selekt-Options
SELECT * FROM seoclass INTO TABLE lcl_it_seoclass
WHERE clsname IN o_class
AND ( ( clsname LIKE 'Z%' ) OR ( clsname LIKE 'Y%' ) OR
( clsname LIKE g_name ) )
AND clstype = 0.
*Verlassen,wenn keine Werte gefunden worden sind
IF lcl_it_seoclass IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for Classes! '
'Please check your selection. '
'The program will process your other selections.'.
*Form-Routine verlassen
EXIT.
ENDIF.

*Schleife ueber select-options


LOOP AT lcl_it_seoclass INTO lcl_wa_seoclass.
*Liste mit Ober-Objekten bei Einzelselektion fuellen
MOVE lcl_wa_seoclass-clsname TO wa_obj_list-name.
APPEND wa_obj_list TO it_obj_list.
*Intitialisieren der globalen Tabellen
PERFORM initialize.
* PERFORM handle_class USING lcl_wa_seoclass-clsname.
PERFORM handle_class_extern USING lcl_wa_seoclass-clsname.
*Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'Class(OO)'
lcl_wa_seoclass-clsname
p_logic.
ENDIF.
ENDLOOP. "Klassenliste
ENDFORM. " CLASSES
*&---------------------------------------------------------------------*
*& Form WRITE_COLLECTMAINS
*&---------------------------------------------------------------------*
* Schreiben der Liste der später zu behadlenden Rahmenprogramme.
* Der Typ des Rahmenprogrammes und der Programmname werden
* beruecksichtigt.
*----------------------------------------------------------------------*
FORM write_collectmains USING p_typus TYPE collectmains-typus
p_name TYPE collectmains-mainname.
CLEAR wa_collectmains.
wa_collectmains-typus = p_typus.
wa_collectmains-mainname = p_name.
APPEND wa_collectmains TO it_collectmains.
ENDFORM. " WRITE_COLLECTMAINS

*&---------------------------------------------------------------------*
*& Form HANDLE_DIALOGMODULE
*&---------------------------------------------------------------------*
* Lesen der Informationen fuer das in der Uebergabestruktur
* angegebene Dialogmodul.
* Das zugehörige Programm wird in Tabelle fuer spaeteren Aufruf
* der Rahmenprogramme gestellt.
*----------------------------------------------------------------------*
FORM handle_dialogmodule USING p_wa_cross_ref TYPE cross.
*Lokalen Arbeitsbereich fuer Dialogbausteinelement
*Zuordnung der Parameter zum Modulpool
DATA: lcl_wa_tdct LIKE wa_tdct,
lcl_it_diapar LIKE it_diapar,
lcl_wa_diapar LIKE wa_diapar.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.

*Dialogbausteinverwaltung selektieren
SELECT SINGLE dnam prog dynr FROM tdct INTO lcl_wa_tdct
WHERE dnam = p_wa_cross_ref-name.
*An Gesamttabelle anhaengen
APPEND lcl_wa_tdct TO it_tdct.
*Parameter der Dialogbausteine selektieren
SELECT * FROM diapar INTO TABLE lcl_it_diapar
WHERE dnam = lcl_wa_tdct-dnam
AND spras IN o_lan.
*An Gesamttabelle der Parameter anhaengen
LOOP AT lcl_it_diapar INTO lcl_wa_diapar.
APPEND lcl_wa_diapar TO it_diapar.
ENDLOOP.
*Stueckliste fuer Dialogmodul bauen
PERFORM write_stueckliste USING 'Dialogmodule'
p_wa_cross_ref-name
p_wa_cross_ref-include.
*Zuordnung Modulpool zu Dialogmodul
PERFORM write_stueckliste USING 'Dialog Program'
lcl_wa_tdct-prog
p_wa_cross_ref-name.
**********************************
*Herunterladen des Modulpools, wenn er im
*Kundennamensraum liegt.
IF ( ( lcl_wa_tdct-prog(1) = 'Z' ) OR ( lcl_wa_tdct-prog(1) = 'Y' ) ).

*Tabelle zur späteren Weiterverarbeitung


PERFORM write_global_save USING '1' lcl_wa_tdct-prog.
ENDIF. "Liegt Modulpool im Kundennamensraum?
ENDFORM. " HANDLE_DIALOGMODULE
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_DIALOGMODULE_ELEMENTS
*&---------------------------------------------------------------------*
* Globale Gesamttabellen (Zuordnung und Parameter) ins
* Dateissystem speichern.
* Generierung der Tabellen in HTML-Format
*----------------------------------------------------------------------*
FORM download_dialogmodule_elements.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Dialogbausteinzuordnung
DATA: lcl_dialogmodule_name TYPE string.
*Parameterzuordnung zu Dialogbaustein
DATA: lcl_dialogmudule_params TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
***************************************************
*1.)Dialogbausteinzuordnung: it_tdct
***************************************************
*Nur downloaden, wenn nicht leer
IF NOT ( it_tdct IS INITIAL ).
* Ueberschrift zusammenbauen
CONCATENATE 'Dialog Modules called by Program' global_main_name
INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Name of Dialog Module' TO lcl_it_headerrow.
APPEND 'Program name' TO lcl_it_headerrow.
APPEND 'Screen number' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_tdct INTO wa_tdct.
PERFORM create_htmltab_body USING wa_tdct.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************
CONCATENATE 'Dlgmd_to_Modpool_' global_main_name INTO
lcl_dialogmodule_name.
CLEAR filename.
CONCATENATE new_dir '\' lcl_dialogmodule_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_tdct
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text043 lcl_dialogmodule_name
filename.
ELSE.
PERFORM write_protocol USING 'N' text043 lcl_dialogmodule_name
filename.
ENDIF. "sy-subrc
ENDIF. "Ueberpruefung auf initial

***************************************************
*2.)Parameter der Dialogbausteine: it_diapar
***************************************************
*Nur downloaden, wenn nicht leer
IF NOT ( it_diapar IS INITIAL ).
CLEAR lcl_header. REFRESH lcl_it_headerrow.
* Ueberschrift zusammenbauen
CONCATENATE 'Parameters of Dialog Modules' global_main_name
INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Name of Dialog Module' TO lcl_it_headerrow.
APPEND 'Name of Parameter' TO lcl_it_headerrow.
APPEND 'Language' TO lcl_it_headerrow.
APPEND 'Table or Structur (T=Table)' TO lcl_it_headerrow.
APPEND 'Type of Parameter' TO lcl_it_headerrow.
APPEND 'Short Text Dialog Module' TO lcl_it_headerrow.
APPEND 'Import(=I)/Export(=E)' TO lcl_it_headerrow.
APPEND 'Default Value' TO lcl_it_headerrow.
* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_diapar INTO wa_diapar.
PERFORM create_htmltab_body USING wa_diapar.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************

CONCATENATE 'Dlgmd_Params_' global_main_name INTO


lcl_dialogmudule_params.
CLEAR filename.
CONCATENATE new_dir '\' lcl_dialogmudule_params '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_diapar
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text044
lcl_dialogmudule_params filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text044
lcl_dialogmudule_params filename.
ENDIF. "sy-subrc
ENDIF. "Ueberpruefung auf initial
ENDFORM. " DOWNLOAD_DIALOGMODULE_ELEMENTS
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_HPSTAND
*&---------------------------------------------------------------------*
* Lesen des Hotpackagestandes des Systems und
* Speicherung der Tabelle im Dateisystem.
* Generierung der Tabelle in HTML-Format
*----------------------------------------------------------------------*
FORM download_hpstand.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Datenbereiche fuer Hotpackagetabelle
DATA: lcl_it_pat03 TYPE STANDARD TABLE OF pat03,
lcl_wa_pat03 LIKE LINE OF lcl_it_pat03,
lv_old_patch LIKE pat03-patch.
*Bezeichnung der Downloaddatei
DATA: lcl_downnname TYPE string.
*Typ der nur die wichtigen Infos ueber HP-Stand enthält
TYPES: BEGIN OF ipat03,
patch TYPE pat03-patch,
short_text TYPE pat03-short_text,
l_impl_rel TYPE pat03-l_impl_rel,
os TYPE pat03-os,
db TYPE pat03-db,
ancestor TYPE pat03-ancestor,
END OF ipat03.
*Filterbereich fuer HP-Informationen
DATA: lcl_wa_ipat03 TYPE ipat03.
*Variable fuer Kopfzeile der zu generierenden HTML-Tabelle
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
*Selektieren der Hotpackagetabelle nach dem aktuellen System
*Funktionsbaustein liest standardmäßig alle Komponenten des aktuellen
*Releases.
CALL FUNCTION 'SPAM_READ_PAT03'
EXPORTING
iv_patch_name = '*'
iv_patch_type = '*'
iv_base_release = 'CURR'
iv_component_id = 'CURR'
iv_component_release = 'CURR'
iv_addon_id = 'CURR'
iv_addon_release = 'CURR'
iv_activ = 'X'
iv_only_supp_packs = 'X'
* IMPORTING
* EV_PAT03_ENTRIES =
TABLES
tt_pat03_selected = lcl_it_pat03
EXCEPTIONS
wrong_release_string = 1
wrong_patch_type = 2
no_component_available = 3
wrong_component_id_release = 4
wrong_addon_id_release = 5
OTHERS = 6
.
IF sy-subrc = 0.
* sort the table
SORT lcl_it_pat03 BY patch DESCENDING.
* only keep the newest CRT from one type in mind
LOOP AT lcl_it_pat03 INTO lcl_wa_pat03.
IF lcl_wa_pat03(5) NE lv_old_patch(5).
* remember the current patch
lv_old_patch = lcl_wa_pat03-patch.
CONTINUE.
ENDIF.
DELETE lcl_it_pat03 INDEX sy-tabix.
* remember the current patch
lv_old_patch = lcl_wa_pat03-patch.
ENDLOOP.

*Download starten: in der Tabelle sind auf jeden Fall Eintraege.


CONCATENATE 'Support Packages for system' sy-sysid
INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Support Package Name' TO lcl_it_headerrow.
APPEND 'Patch Description' TO lcl_it_headerrow.
APPEND 'Release' TO lcl_it_headerrow.
APPEND 'OS Application Server' TO lcl_it_headerrow.
APPEND 'Name of central Database' TO lcl_it_headerrow.
APPEND 'Patch Predecessor' TO lcl_it_headerrow.
* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT lcl_it_pat03 INTO lcl_wa_pat03.
MOVE-CORRESPONDING lcl_wa_pat03 TO lcl_wa_ipat03.
PERFORM create_htmltab_body USING lcl_wa_ipat03.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************
CONCATENATE 'Patchlist_' instnr INTO lcl_downnname.
CLEAR filename.
CONCATENATE new_dir '\' lcl_downnname '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "lcl_it_pat03
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text045 lcl_downnname
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text045 lcl_downnname
filename.
ENDIF. "sy-subrc
ENDIF.
ENDFORM. " DOWNLOAD_HPSTAND
*&---------------------------------------------------------------------*
*& Form HANDLE_LOCKOBJECT
*&---------------------------------------------------------------------*
* Lesen und Sichern des in der Struktur P_WA_CROSS_REF uebergebenen
* Sperrobjektes bzw. Sperrfunktionsbausteins.
* Durch den Parameter P_TYPUS wird unterschieden, ob
* Funktionsbaustein uebergeben worden ist oder der Name des
* Lockobjektes.
* Generierung der Tabelle in HTML-Format
*
*----------------------------------------------------------------------*
FORM handle_lockobject USING p_wa_cross_ref TYPE cross
p_typus TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Datenbereiche zum Lesen der Tabelle mit den Eintraegen der Sperrobjekte
*(dd27s)
DATA: lcl_it_dd27s TYPE STANDARD TABLE OF dd27s,
lcl_wa_dd27s LIKE LINE OF lcl_it_dd27s.
TYPES: BEGIN OF locktab,
lock_obj TYPE dd27s-viewname,
tab TYPE dd27s-tabname,
field TYPE dd27s-fieldname,
keyflag TYPE dd27s-keyflag,
modname(30) TYPE c,
END OF locktab.
DATA: lcl_it_locktab TYPE STANDARD TABLE OF locktab,
lcl_wa_locktab LIKE LINE OF lcl_it_locktab.
*Hilfsvariablen zur Laengenberechnung des Includenamens
DATA: lcl_laenge TYPE i.
*Hilfsvariable fuer Namen des Lockobjektes
DATA: lcl_lockobj TYPE dd27s-viewname.
*Lockobjektname fuer Download
DATA: lcl_locktab_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.

*Bestimmung des Namens des Lockobjektes


IF p_typus = 'F'. "Aufruf ueber Funktionsbausteinname
lcl_laenge = STRLEN( p_wa_cross_ref-name ).
lcl_lockobj = p_wa_cross_ref-name+8.
ELSEIF p_typus = 'S'. "Aufruf ueber Sperrobjektname
lcl_lockobj = p_wa_cross_ref-name.
ENDIF.
*Nur downloaden wenn noch nicht gedownloaded, da in Stückliste.
READ TABLE it_prog_stueckliste WITH KEY name = lcl_lockobj
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0. "nichts gefunden
*Selektieren der Tabelle mit den Sperrobjekteintraegen
SELECT * FROM dd27s INTO CORRESPONDING FIELDS OF TABLE lcl_it_dd27s
WHERE viewname = lcl_lockobj.
*Die entsprechenden Eintraege in die herunterzuladende Tabelle schreiben
*und den Eintrag fuer die Lockart durch einen aussagefähigen Eintrag
*ersezten.
LOOP AT lcl_it_dd27s INTO lcl_wa_dd27s.
MOVE lcl_wa_dd27s-viewname TO lcl_wa_locktab-lock_obj.
MOVE lcl_wa_dd27s-tabname TO lcl_wa_locktab-tab.
MOVE lcl_wa_dd27s-fieldname TO lcl_wa_locktab-field.
MOVE lcl_wa_dd27s-keyflag TO lcl_wa_locktab-keyflag.
IF lcl_wa_dd27s-enqmode = 'E'.
lcl_wa_locktab-modname = 'Exclusive, cumulative'.
ELSEIF lcl_wa_dd27s-enqmode = 'S'.
lcl_wa_locktab-modname = 'Shared'.
ELSEIF lcl_wa_dd27s-enqmode = 'X'.
lcl_wa_locktab-modname = 'Exclusive, not cumulative'.
ENDIF.
APPEND lcl_wa_locktab TO lcl_it_locktab.
ENDLOOP.

***********************************************************
*****Tabelle mit Lockobjektinformationen downloaden
***********************************************************
*Ueberpruefen, ob Tabelle nicht leer ist
IF NOT ( lcl_it_locktab IS INITIAL ).
*Ueberschrift zusammenbauen
CONCATENATE 'Lockobjectinformation' lcl_lockobj
INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Name of View' TO lcl_it_headerrow.
APPEND 'Basistable of the View' TO lcl_it_headerrow.
APPEND 'Fieldname' TO lcl_it_headerrow.
APPEND 'Keyflag' TO lcl_it_headerrow.
APPEND 'Locktype' TO lcl_it_headerrow.

*Umwandlung in HTML-Tabelle
********************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT lcl_it_locktab INTO lcl_wa_locktab.
PERFORM create_htmltab_body USING lcl_wa_locktab.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************

*Schreiben der Stueckliste


IF p_typus = 'F'. "Funktionsbausteinname
PERFORM write_stueckliste USING 'Lockobject'
lcl_lockobj
p_wa_cross_ref-include.
ELSEIF p_typus = 'S'. "Sperrobjektname
PERFORM write_stueckliste USING 'Lockobject'
lcl_lockobj
global_main_name.
ENDIF. "Typabfrage

*Name fuer Download zusammenbauen


CONCATENATE 'Lockobject_' lcl_lockobj INTO lcl_locktab_name.
CLEAR filename.
CONCATENATE new_dir '\' lcl_locktab_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "lcl_it_locktab
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text046 lcl_locktab_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text046 lcl_locktab_name
filename.
ENDIF. "sy-subrc
ENDIF. "ist Tabelle gefuellt
ENDIF. "Abpruefung der Stueckliste
ENDFORM. " HANDLE_LOCKOBJECT
*&---------------------------------------------------------------------*
*& Form HANDLE_SETGETPARAMSS
*&---------------------------------------------------------------------*
* Lesen der Set/Get-Paramter-Liste des in der Struktur
* uebergebenen Parameters. Anhaengen an Gesamtliste der
* Set/Get-Parameter.
*----------------------------------------------------------------------*
FORM handle_setgetparamss USING p_wa_cross_ref TYPE cross.
CLEAR wa_tpara.
*Nur Verarbeitung wenn noch nicht in interner Parametertabelle enthalten
READ TABLE it_tpara WITH KEY paramid = p_wa_cross_ref-name
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0. "Kein Wert gefunden
*Selektion aus Parametertabelle
SELECT SINGLE * FROM tpara INTO wa_tpara
WHERE paramid = p_wa_cross_ref-name.
APPEND wa_tpara TO it_tpara.
ENDIF.
*Stueckliste aus Informationsgruenden auf jeden Fall schreiben
PERFORM write_stueckliste USING 'SET/Get-Parameter'
p_wa_cross_ref-name
p_wa_cross_ref-include.
ENDFORM. " HANDLE_SETGETPARAMSS
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_SETGETPARAMS
*&---------------------------------------------------------------------*
* Sicherung der Gesamtliste der Set/Get-Parameter in das lokale
* Dateisystem.
* Generierung der Tabelle in HTML-Format.
*----------------------------------------------------------------------*
FORM download_setgetparams.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Name set/get-Parameter
DATA: lcl_sgparams_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.

*Nur downloaden, wenn nicht leer


IF NOT ( it_tpara IS INITIAL ).
* Ueberschrift zusammenbauen
CONCATENATE 'Set/Get-Parameterlist of ' global_main_name
INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Set-/Get-Paramter-ID' TO lcl_it_headerrow.
APPEND 'Short Description' TO lcl_it_headerrow.
*Umwandlung in HTML-Tabelle
********************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_tpara INTO wa_tpara.
PERFORM create_htmltab_body USING wa_tpara.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************
CONCATENATE 'Set_Get_Params_' global_main_name INTO lcl_sgparams_name.
* begin of changes for partner namespace
TRANSLATE lcl_sgparams_name USING '/_'.
* end of changes for partner namespace CLEAR filename.
CONCATENATE new_dir '\' lcl_sgparams_name '.xml' INTO filename.
*Tabelle nach Obernamen sortieren
* sort it_prog_stueckliste by obername ascending.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_tpara
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text047 lcl_sgparams_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text047 lcl_sgparams_name
filename.
ENDIF.
ENDIF. "Tabelle it_params leer ???
ENDFORM. " DOWNLOAD_SETGETPARAMS
*&---------------------------------------------------------------------*
*& Form IDOCS
*&---------------------------------------------------------------------*
* Abfangen der selektierten IDocs aus dem
* Selektionsbildschirm zur Auswahl einzelner Objekte.
* Fuer jedes gefundene IDOC wird die entsprechende
* Aufrufroutine ausgeführt. Je nach Typ des IDOCs (Basis oder
* Erweiterng) wird ein die Verarbeitungsrroutine mit einem paramter
* aufgerufen.
*----------------------------------------------------------------------*
FORM idocs.
*Bereiche fuer Basisidoc-Tabelle
DATA: lcl_it_edbas TYPE STANDARD TABLE OF edbas,
lcl_wa_edbas LIKE LINE OF lcl_it_edbas.
*Bereiche fuer IDOc-Erweiterungen
DATA: lcl_it_edcim TYPE STANDARD TABLE OF edcim,
lcl_wa_edcim LIKE LINE OF lcl_it_edcim.

*Selektion je nach Art der Selektion


IF p_basis = 'X'. "Basisobjekt
SELECT * FROM edbas INTO TABLE lcl_it_edbas
WHERE idoctyp IN o_idoc.
*Verlassen,wenn keine Werte gefunden worden sind
IF lcl_it_edbas IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for IDoc Basistype! '
'Please check your selection. '
'The program will process your other selections.'.
* Form-Routine verlassen
EXIT.
ENDIF.

LOOP AT lcl_it_edbas INTO lcl_wa_edbas.


PERFORM handle_idoc USING lcl_wa_edbas-idoctyp
'B'.
*Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'IDOC-Basistype'
lcl_wa_edbas-idoctyp
p_logic.
ENDIF.

ENDLOOP.
ELSEIF p_enh = 'X'.
SELECT * FROM edcim INTO TABLE lcl_it_edcim
WHERE cimtyp IN o_idoc.
*Verlassen,wenn keine Werte gefunden worden sind
IF lcl_it_edcim IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for IDoc-Enhancement! '
'Please check your selection. '
'The program will process your other selections.'.
*Form-Routine verlassen
EXIT.
ENDIF.
LOOP AT lcl_it_edcim INTO lcl_wa_edcim.
PERFORM handle_idoc USING lcl_wa_edcim-cimtyp
'E'.
* Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'IDOC-Enhancement'
lcl_wa_edcim-cimtyp
p_logic.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " IDOCS
*&---------------------------------------------------------------------*
*& Form HANDLE_HTML_GENERATOR
*&---------------------------------------------------------------------*
* Formular zum Herunterladen der IDOCs
* Diese Logik ist zum Teil aus der Transaktion WE60 uebernommen
*----------------------------------------------------------------------*
* STRUCT_TYPE type LEDID_STRUCT_TYPE
* IDOCTYPE type EDI_IAPI00-IDOCTYP
* RELEASE like sy-saprl
* VERSION type EDI_VERREC-VERSION
*----------------------------------------------------------------------*
FORM handle_html_generator USING p_struct_type TYPE ledid_struct_type
p_idoctype TYPE edi_iapi00-idoctyp
p_release LIKE sy-saprl
p_version TYPE edi_verrec-version.
****Kopiertes Coding aus Funktionsbaustein IDOC_TYPE_GENERATE_HTML
DATA : idoc_struct TYPE ledid_t_idoc_struct,
idoc_type TYPE ledid_idoc_type,
segments TYPE ledid_t_segment,
segment_struct TYPE ledid_t_segment_struct,
l_returncode LIKE sy-subrc,
* l_path LIKE rlgrap-filename,
l_path TYPE string,
* l_file LIKE rlgrap-filename,
l_file TYPE char70,
l_url(1024) TYPE c,
l_browser_start LIKE edi_htmfil-edi_start.
DATA: frameset LIKE line OCCURS 0,
index LIKE line OCCURS 0,
docu LIKE line OCCURS 0.
*Lesen der IDOC-Struktur
CALL FUNCTION 'IDOC_TYPE_COMPLETE_READ'
EXPORTING
struct_type = p_struct_type
idoctype = p_idoctype
release = p_release
version = p_version
IMPORTING
idoc_type = idoc_type
TABLES
idoc_struct = idoc_struct
segments = segments
segment_struct = segment_struct
EXCEPTIONS
OTHERS = 1.
CASE sy-subrc.
WHEN 0.
*Zusammensetzen des Pfadnamens
CONCATENATE new_dir '\' INTO l_path.
*Grundtext fuer Filenamen
l_file = p_idoctype.
*Generierung des HTML-Files
CALL FUNCTION 'IDOC_TAB_GENERATE_HTML'
EXPORTING
idoc_type = idoc_type
release = p_release
version = p_version
TABLES
idoc_struct = idoc_struct
segments = segments
segment_structure = segment_struct
text_frameset = frameset
text_index = index
text_docu = docu
CHANGING
file = l_file
EXCEPTIONS
internal_error = 1
OTHERS = 2.
IF sy-subrc EQ 0.
* download html-coding to the file system
PERFORM html_download_files TABLES frameset
index
docu
USING l_file
l_path.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text048 l_file 'file'.
ENDIF.
WHEN OTHERS.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text048 l_file 'file'.
ENDCASE.
ENDFORM. " HANDLE_HTML_GENERATOR
*&---------------------------------------------------------------------*
*& Form HTML_DOWNLOAD_FILES
*&---------------------------------------------------------------------*
* Abgeaenderte Form zum Herunterladen der IDOC Strukt7ur
* (Ursprung Funktionsgruppe EDID)
*----------------------------------------------------------------------*
FORM html_download_files TABLES frameset STRUCTURE line
index STRUCTURE line
docu STRUCTURE line
USING
p_file TYPE char70
p_path TYPE string. "LIKE rlgrap-filename.
* DATA: file_ext LIKE rlgrap-filename,
DATA: file_ext TYPE string,
l_rcode LIKE sy-subrc.

CLEAR file_ext.
CONCATENATE p_file '_d' '.htm' INTO file_ext.
PERFORM download_htmltable TABLES docu
USING file_ext
space
p_path.
ENDFORM. " HTML_DOWNLOAD_FILES
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_HTMLTABLE
*&---------------------------------------------------------------------*
* Abgeaenderte Form zum Herunterladen der IDOC-Struktur
* (Ursprung Funktionsgruppe EDID)
*----------------------------------------------------------------------*
FORM download_htmltable TABLES t_text STRUCTURE line
USING p_file TYPE string "LIKE rlgrap-filename
p_with_check TYPE c
p_path TYPE string. "LIKE rlgrap-filename.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Lokale Variable fuer Filename
* DATA: lcl_complete_filename TYPE rlgrap-filename.
DATA: lcl_complete_filename TYPE string.
*Zusammensetzen des Dateinamens
CONCATENATE p_path p_file INTO lcl_complete_filename.
* begin of changes for partner namespace
TRANSLATE lcl_complete_filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING lcl_complete_filename
t_text[]
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text048 p_file
lcl_complete_filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text048 p_file
lcl_complete_filename.
ENDIF.
ENDFORM. " DOWNLOAD_HTMLTABLE
*&---------------------------------------------------------------------*
*& Form CREATE_HTMLTAB
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* Generische Erstellung des Kopfes einer Seite mit HTML-Tabelle mit
* Hilfe der Uebergabeparameter. P_HEADER enthaelt die Ueberschrift.
* P_HEADERROW enthaelt die Uebeschriften der Tabelle.
*----------------------------------------------------------------------*
FORM create_htmltab_header USING p_headerrow TYPE ANY TABLE
p_header TYPE string.
*Arbeitsbereich fuer die uebergebene Tabellen
DATA: lcl_wa_headerrow TYPE string.
*Initialsieren der Html-Tabelle, da sie von allen Downloadtabellen
*benutzt wird
REFRESH it_html.
*Schreiben des Tabellenkopfes
* APPEND '<HTML>' TO it_html.
* APPEND '<head>' TO it_html.
* APPEND '</head>' TO it_html.
* APPEND '<body>' TO it_html.
APPEND '<?xml version="1.0" encoding="iso-8859-1" ?>' TO it_html.
APPEND '<?xml-stylesheet type="text/xsl" href="table.XSL"?>'
TO it_html.
* Header-Tag
APPEND '<Doc>' TO it_html.
APPEND '<Tabelle>' TO it_html.
CONCATENATE '<header>' p_header '</header>' INTO wa_html.
APPEND wa_html TO it_html.
* Überschriften der Tabelle
APPEND '<tab_header>' TO it_html.
LOOP AT p_headerrow INTO lcl_wa_headerrow.
CONCATENATE '<value>' lcl_wa_headerrow '</value>' INTO wa_html.
APPEND wa_html TO it_html.
ENDLOOP.
APPEND '</tab_header>' TO it_html.
**Ueberschrift generieren
* CONCATENATE '<header>' p_header '</header>' INTO wa_html.
* APPEND wa_html TO it_html.
**
** APPEND '<br><br>' TO it_html.
*
*
**Tabelle mit Ueberschriften generieren
* APPEND '<table border>'
* TO it_html.
* APPEND '<tr>' TO it_html.
* LOOP AT p_headerrow INTO lcl_wa_headerrow.
* CONCATENATE '<th>' lcl_wa_headerrow '</th>' INTO wa_html.
* APPEND wa_html TO it_html.
* ENDLOOP.
* APPEND '</tr>' TO it_html.
ENDFORM. " CREATE_HTMLTAB
*&---------------------------------------------------------------------*
*& Form CREATE_HTMLTAB_BODY
*&---------------------------------------------------------------------*
* Generische Erstellung des Rumpfes einer HTML-Tabelle mit
* Hilfe des Uebergabeparameters. P_BASETABLE enthaelt die Daten
* fuer eine Zele der Tabelle.
*----------------------------------------------------------------------*
FORM create_htmltab_body USING p_basetable TYPE any.
FIELD-SYMBOLS: <data> TYPE ANY.
*Schreiben der Datenzeilen
APPEND '<item>' TO it_html.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE p_basetable TO <data>.
* IF <data> IS INITIAL.
* ASSIGN '_' TO <data>.
* ENDIF.
IF sy-subrc = 0. "Nur durchfuehren wenn nicht an Ende des Feldes
CONCATENATE '<value><![CDATA[' <data> ']]></value>' INTO wa_html.
APPEND wa_html TO it_html.
ELSE.
EXIT.
ENDIF.
ENDDO.
APPEND '</item>' TO it_html.
* APPEND '<tr>' TO it_html.
* DO.
* ASSIGN COMPONENT sy-index OF STRUCTURE p_basetable TO <data>.
* IF <data> IS INITIAL.
* ASSIGN '&nbsp' TO <data>.
* ENDIF.
* IF sy-subrc = 0. "Nur durchfuehren wenn nicht an Ende des Feldes
* CONCATENATE '<td>' <data> '</td>' INTO wa_html.
* APPEND wa_html TO it_html.
* ELSE.
* EXIT.
* ENDIF.
* ENDDO.
* APPEND '</tr>' TO it_html.
ENDFORM. " CREATE_HTMLTAB_BODY
*&---------------------------------------------------------------------*
*& Form CREATE_HTML_TAB_FOOT
*&---------------------------------------------------------------------*
* Generische Erstellung des Fußes einer Seite mit HTML-Tabelle.
* P_HEADER enthaelt die Ueberschrift.
* P_HEADERROW enthaelt die Uebeschriften der Tabelle.
*----------------------------------------------------------------------*
FORM create_html_tab_foot.
APPEND '</Tabelle>' TO it_html.
APPEND '</Doc>' TO it_html.
* APPEND '</table>' TO it_html.
* APPEND '</body>' TO it_html.
* APPEND '</Html>' TO it_html.
ENDFORM. " CREATE_HTML_TAB_FOOT
*&---------------------------------------------------------------------*
*& Form CUSTOMERENHANCEMENTS
*&---------------------------------------------------------------------*
* Abfangen der selektierten Erweiterungsprojekte aus dem
* Selektionsbildschirm zur Auswahl einzelner Objekte.
* Fuer jedes gefundene Projekt wird die
* Aufrufroutine fuer die Objekte ausgeführt
*----------------------------------------------------------------------*
FORM customerenhancements.
*Interne Tabelle fuer Kundenerweiterungsprojekte
DATA: lcl_it_modname TYPE STANDARD TABLE OF modact-name,
lcl_wa_modname LIKE LINE OF lcl_it_modname.
*Aktive Kundenerweiterungprojekte aus modattr waehlen
SELECT name FROM modattr INTO TABLE lcl_it_modname
WHERE name IN o_cmod
AND status = 'A'.
*Verlassen,wenn keine Werte gefunden worden sind
IF lcl_it_modname IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for Enhancemetprojects! '
'Please check your selection. '
'The program will process your other selections.'.
*Form-Routine verlassen
EXIT.
ENDIF.
LOOP AT lcl_it_modname INTO lcl_wa_modname.
PERFORM handle_customerenhancement USING lcl_wa_modname.
*Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'CMOD-Enhancement'
lcl_wa_modname
p_logic.
ENDIF.
ENDLOOP.
ENDFORM. " CUSTOMERENHANCEMENTS
*&---------------------------------------------------------------------*
*& Form WRITE_ENHANCEMENTLIST
*&---------------------------------------------------------------------*
* Schreiben der Uebersichtsliste zu einer Erweiterung.
*----------------------------------------------------------------------*
FORM write_enhancementlist USING p_sapenhancement TYPE modsap-name
p_comp TYPE modsap-member
p_typus TYPE c
p_intern TYPE any.
wa_enhancecomp-sapenh = p_sapenhancement.
wa_enhancecomp-comp = p_comp.
wa_enhancecomp-typus = p_typus.
wa_enhancecomp-internal = p_intern.
APPEND wa_enhancecomp TO it_enhancecomp.
ENDFORM. " WRITE_ENHANCEMENTLIST
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_ENHANCEMENTTAB
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* Sicherung der Uebersichtsliste eines Erweiterungsprojektes in
* das lokale Dateisystem.
* Generierung der Tabelle in HTML-Format.
*----------------------------------------------------------------------*
FORM download_enhancementtab USING p_name TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Dateiname fuer Download
DATA: lcl_project_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
DATA: lcl_file_internal LIKE wa_enhancecomp-file_internal.
* begin of changes for partner namespace
* Auffuellen der Felder fuer den verwendeten file_name
LOOP AT it_enhancecomp INTO wa_enhancecomp.
lcl_file_internal = wa_enhancecomp-internal.
TRANSLATE lcl_file_internal USING '/_'.
wa_enhancecomp-file_internal = lcl_file_internal.
MODIFY it_enhancecomp FROM wa_enhancecomp INDEX sy-tabix.
ENDLOOP.
* end of changes for partner namespace

*Nur Herunterladen wenn Tabelle nicht initial ist


IF NOT ( it_enhancecomp IS INITIAL ).
CONCATENATE 'Enhproject_' p_name INTO lcl_project_name.

*Umwandlung in HTML-Tabelle
********************************************************
*Ueberschrift zusammenbauen
CONCATENATE 'Enhancement List of CMOD-Enhancement' p_name
INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'SAP Extension Name' TO lcl_it_headerrow.
APPEND 'Enhancement' TO lcl_it_headerrow.
APPEND 'Component Type' TO lcl_it_headerrow.
APPEND 'Object Name' TO lcl_it_headerrow.
APPEND 'Object Name in file system' TO lcl_it_headerrow.
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_enhancecomp INTO wa_enhancecomp.
PERFORM create_htmltab_body USING wa_enhancecomp.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************
CLEAR filename.
CONCATENATE new_dir '\' lcl_project_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html ""it_enhancecomp
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text051 lcl_project_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text051 lcl_project_name
filename.
ENDIF.
ENDIF. "ist it_enhancecomp überhaupt gefüllt
ENDFORM. " DOWNLOAD_ENHANCEMENTTAB
*&---------------------------------------------------------------------*
*& Form DEVELOPMENTCLASS
*&---------------------------------------------------------------------*
* Abfangen der selektierten Entwicklungsklasse aus dem
* Selektionsbildschirm fuer Entwicklungsklassen.
* Fuer jede gefundene Entwicklungsklasse werden alle zu
* verabeitenden Objekte behandelt.
*----------------------------------------------------------------------*
FORM developmentclass.
*Dummy für tdrir-name
DATA: lcl_dummy TYPE trdir-name.
*Lokale Variable fuer Namen des Objektes in Tabelle trdir
DATA: lcl_trdirname TYPE trdir-name.
*Lokaler Arbeitsbereich fuer trdir
DATA: lcl_wa_trdir TYPE trdir.
*tabelle zur Speicherung der Stückliste
DATA: lcl_it_prog_stueckliste LIKE it_prog_stueckliste.
*Pfad
* DATA: path TYPE rlgrap-filename.
DATA: path TYPE string.
*Arbeitsbereich fuer Gruppenwechsel ueber Enwicklungsklasse
DATA: lcl_it_devclass TYPE STANDARD TABLE OF tadir-devclass,
lcl_wa_devclass LIKE LINE OF lcl_it_devclass,
lcl_root LIKE root.

*Initialisieren der Bereiche von tadir wegen evtl.Mehrfachaufruf


REFRESH it_tadir. CLEAR wa_tadir.
root = dir.
lcl_root = root.
*Entwicklungklassen selektieren
SELECT DISTINCT devclass FROM tadir INTO TABLE lcl_it_devclass
WHERE devclass IN o_devcl
AND ( ( devclass LIKE 'Z%' ) OR ( devclass LIKE 'Y%' ) OR
( devclass LIKE g_name ) ).
*Verlassen,wenn keine Werte gefunden worden sind
IF lcl_it_devclass IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for the Developmentclasses! '
'Please check your selection.'.
*Form-Routine verlassen
EXIT.
ENDIF.
LOOP AT lcl_it_devclass INTO lcl_wa_devclass.
global_main_name = lcl_wa_devclass.
*Zuordnung des Rootverzeichnisses um, Verzeichnis darunter anlegen
*zu koennen
dir = lcl_root.
root = lcl_root.
* dir = root.
**Intitialisieren der globalen Tabellen
PERFORM initialize.
*Sonderinitialisierungen
REFRESH it_trdir.
CLEAR lcl_wa_trdir.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Development Class'
lcl_wa_devclass
''.

*Ueberschrift zusammenbauen
CONCATENATE 'Developmentclass:' lcl_wa_devclass INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
*Verzeichnis fuer diese Entwicklungsklasse
PERFORM create_directory USING lcl_wa_devclass
'Devc'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
CONTINUE.
ENDIF.
path = new_dir.
*direkt an lokale Stueckliste anhaengen
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
* Selektion auf tadir
SELECT * FROM tadir INTO TABLE it_tadir
WHERE devclass = lcl_wa_devclass.
LOOP AT it_tadir INTO wa_tadir.
REFRESH it_prog_stueckliste.
*Verarbeitung der einzelnen Typen
IF wa_tadir-object = 'FUGR'. "Funktionsgruppe
*Um den globalen Gebrauch des Variable wa_trdir-name zu erhalten
* wird das Feld mit dem aktuellen Namen gefuellt.
*Unterscheidung auf Partnernamensraum.
IF wa_tadir-obj_name(1) = '/'.
lcl_trdirname = wa_tadir-obj_name.
PERFORM convert_fugrname_for_partner
CHANGING lcl_trdirname.
ELSE. "normaler namensraum
CONCATENATE 'SAPL' wa_tadir-obj_name INTO lcl_trdirname.
ENDIF.
* Existiert die Funktionsgruppe überhaupt
SELECT SINGLE name FROM trdir INTO lcl_dummy
WHERE name = lcl_trdirname.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Funktionsgruppe'
lcl_trdirname
wa_tadir-devclass.
global_main_name = lcl_trdirname.
*Stueckliste sichern
* refresh lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.

*Ueberpruefen, ob Funktionsgruppe noch existiert


SELECT SINGLE name FROM trdir INTO lcl_dummy
WHERE name = lcl_trdirname.
IF sy-subrc = 0.
*Verarbeitungsroutine fuer Funktionsgruppen aufrufen
PERFORM handle_functiongroup USING lcl_trdirname.
ENDIF.
ELSEIF wa_tadir-object = 'PROG'. "Reports und Modulpoole
*Ueberpruefen ob Rahmenprogramm oder einfaches Include vorliegt
SELECT SINGLE * FROM trdir INTO lcl_wa_trdir
WHERE name = wa_tadir-obj_name
AND ( ( subc = '1' )
OR ( subc = 'M' ) ).
IF sy-subrc = 0.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Report/Modulpool'
wa_tadir-obj_name
wa_tadir-devclass.
*Stueckliste sichern
* refresh lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
**Globale Daten aufbereiten
global_main_name = wa_tadir-obj_name.
*Aufruf der Verarbeitungsroutine fuer Reports / Modulpoole
PERFORM handle_reps_mods USING wa_tadir-obj_name.

ENDIF. "Ist das ein Report oder ein Modulpool


ELSEIF wa_tadir-object = 'CLAS'. "Klasse
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Class(OO)'
wa_tadir-obj_name
wa_tadir-devclass.
*Stueckliste sichern
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.

*Globale Daten aufbereiten


global_main_name = wa_tadir-obj_name.
*Intitialisieren der globalen Tabellen
PERFORM initialize.
* PERFORM handle_class USING wa_tadir-obj_name.
PERFORM handle_class_extern USING wa_tadir-obj_name.
ELSEIF wa_tadir-object = 'INTF'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Interface(OO)'
wa_tadir-obj_name
wa_tadir-devclass.
*Stueckliste sichern
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Globale Daten aufbereiten
global_main_name = wa_tadir-obj_name.
*Intitialisieren der globalen Tabellen
PERFORM initialize.
*Herunterladen des Interface
PERFORM handle_interface USING wa_tadir-obj_name.
ELSEIF wa_tadir-object = 'CMOD'. "Customer Enhancementprojekt
*Stueckliste schreiben
PERFORM write_stueckliste USING 'CMOD-Enhancement'
wa_tadir-obj_name
wa_tadir-devclass.
*Stueckliste sichern
* refresh lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.

*Globale Daten aufbereiten


global_main_name = wa_tadir-obj_name.
PERFORM handle_customerenhancement USING wa_tadir-obj_name.

ELSEIF wa_tadir-object = 'SXCI'. "Badiimplementierung


*Stueckliste schreiben
PERFORM write_stueckliste USING 'Badi Implementation'
wa_tadir-obj_name
wa_tadir-devclass.
*Stueckliste sichern
* refresh lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.

*Globale Daten aufbereiten


global_main_name = wa_tadir-obj_name.
PERFORM handle_badi_implementation USING wa_tadir-obj_name.

ELSEIF wa_tadir-object = 'IDOC'. "IDOC Basistyp


*Stueckliste schreiben
PERFORM write_stueckliste USING 'IDOC-Basityp'
wa_tadir-obj_name
wa_tadir-devclass.
*Stueckliste sichern
* refresh lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Globale Daten aufbereiten
global_main_name = wa_tadir-obj_name.
PERFORM handle_idoc USING wa_tadir-obj_name
'B'.

ELSEIF wa_tadir-object = 'IEXT'. "IDOC Erweiterung


*Stueckliste schreiben
PERFORM write_stueckliste USING 'IDOC-Erweiterung'
wa_tadir-obj_name
wa_tadir-devclass.
*Stueckliste sichern
* refresh lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
global_main_name = wa_tadir-obj_name.
PERFORM handle_idoc USING wa_tadir-obj_name
'E'.

ELSEIF wa_tadir-object = 'IASP'. "IAC-Service


*Stueckliste schreiben
PERFORM write_stueckliste USING 'IACS'
wa_tadir-obj_name
wa_tadir-devclass.
*Stueckliste sichern
* refresh lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
global_main_name = wa_tadir-obj_name.
PERFORM handle_iac_service USING wa_tadir-obj_name.

ENDIF.
ENDLOOP. "Entwicklungsklasse
global_main_name = lcl_wa_devclass.
new_dir = path.
REFRESH it_prog_stueckliste.
*globale Stueckliste wieder schreiben
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
*Trennung von Einzeldateiobjekten
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM download_stueckliste.
*Leerzeile nach Ende dieser Verarbeitung
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
*Suppoertpackagestand sichern
PERFORM download_hpstand.
ENDLOOP. "Selektionsparameter abfangen
dir = root.
ENDFORM. " DEVELOPMENTCLASS
*&---------------------------------------------------------------------*
*& Form handle_extprog_singleinclude
*&---------------------------------------------------------------------*
* Lesen von aufgerufenen Objekten des im Parameter P_NAME
* angegebenen Includes.
* Funktionsbausteine, Sperrobjekte, Meldungen, Programmaufrufen
* Berechtigungsobjekten und Set/Get-Parametern
*----------------------------------------------------------------------*
FORM handle_extprog_singleinclude USING p_include LIKE c_includename.
*Bereich fuer die Tabelle mit den externen Verweisen
DATA: lcl_it_cross_ref TYPE STANDARD TABLE OF cross,
lcl_wa_cross_ref LIKE LINE OF lcl_it_cross_ref.
*4.)Sperrobjektname für Patnernamensraum aufbereiten
DATA: lcl_enqueue TYPE string,
lcl_dequeue TYPE string,
lcl_len TYPE i.
*Namen für Sperrobjekte zusammenbauen
IF p_nspace(1) = '/'.
CONCATENATE 'ENQUEUE_' p_nspace 'E' INTO lcl_enqueue.
CONCATENATE 'DEQUEUE_' p_nspace 'E' INTO lcl_dequeue.
lcl_len = STRLEN( lcl_enqueue ).
ELSE.
lcl_len = 1.
ENDIF.

*Alle externen Verweise fuer dieses Include aus Tabelle cross lesen
SELECT * FROM cross INTO TABLE lcl_it_cross_ref
WHERE include = p_include.
*Verarabeitung der einzelnen Eintraege
LOOP AT lcl_it_cross_ref INTO lcl_wa_cross_ref.
*Behandlung je nach Typ
CASE lcl_wa_cross_ref-type.
WHEN 'N'. "Verarbeitung von messages
PERFORM handle_message USING lcl_wa_cross_ref.
WHEN 'F'. "Verarbeitung Funktionsbaustein
"Kundennamenraum ueberpruefen
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' ) )
OR ( lcl_wa_cross_ref-include(g_len_nspace) = p_nspace ).
PERFORM handle_functionmodule USING lcl_wa_cross_ref.
ENDIF. "Kundennamensraum
*Behandlung von Sperrobjekten im Kundennamensraum
IF ( ( lcl_wa_cross_ref-name(10) = 'ENQUEUE_EZ' ) OR
( lcl_wa_cross_ref-name(10) = 'ENQUEUE_EY' ) OR
( lcl_wa_cross_ref-name(lcl_len) = lcl_enqueue ) OR
( lcl_wa_cross_ref-name(10) = 'DEQUEUE_EZ' ) OR
( lcl_wa_cross_ref-name(10) = 'DEQUEUE_EY' ) OR
( lcl_wa_cross_ref-name(lcl_len) = lcl_dequeue ) ).
PERFORM handle_lockobject USING lcl_wa_cross_ref
'F'.
"Name ist ein Funktionbausteinname
ENDIF.
WHEN 'R'. "Aufruf eines anderen Reports (submit program)
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_submits USING lcl_wa_cross_ref.
ENDIF.
WHEN 'U'. "Aufruf einer Form in einem anderen Programm
IF ( ( lcl_wa_cross_ref-prog(1) = 'Z' )
OR ( lcl_wa_cross_ref-prog(1) = 'Y' )
OR ( lcl_wa_cross_ref-prog(g_len_nspace) = p_nspace ) ).
PERFORM handle_performextern USING lcl_wa_cross_ref.
ENDIF.
WHEN 'T'. "Behandlung von Transaktionen (call transaction)
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_transaction USING lcl_wa_cross_ref.
ENDIF.
WHEN 'A'. "Behandlung von Berechtigungsobjekten
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_authorityobject USING lcl_wa_cross_ref.
ENDIF.
WHEN 'D'. "Dialogbaustein
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_dialogmodule USING lcl_wa_cross_ref.
ENDIF.
WHEN 'P'. "set/get Parameterpaar
IF ( ( lcl_wa_cross_ref-name(1) = 'Z' )
OR ( lcl_wa_cross_ref-name(1) = 'Y' )
OR ( lcl_wa_cross_ref-name(g_len_nspace) = p_nspace ) ).
PERFORM handle_setgetparamss USING lcl_wa_cross_ref.
ENDIF.
ENDCASE.
ENDLOOP.
ENDFORM. " HANDLE_EXTPROG_CMODENH
*&---------------------------------------------------------------------*
*& Form BADI_IMPLEMENTATION
*&---------------------------------------------------------------------*
* Abfangen der selektierten Badiimplementierungen aus dem
* Selektionsbildschirm zur Auswahl einzelner Objekte.
* Fuer jede gefundene Implementierung wird die
* Verarbeitungsroutine ausgeführt.
*----------------------------------------------------------------------*
FORM badi_implementation.
*Bereich fuer die selektierten aktiven Enhancements
DATA: lcl_it_impsel TYPE STANDARD TABLE OF sxc_attr-imp_name,
lcl_wa_impsel LIKE LINE OF lcl_it_impsel.

*Tabelle fuer Badiimplementierung initialisieren


REFRESH it_ges_sxc_exit.
*Nur die aktiven Implementierungen der Selektion waehlen
SELECT imp_name FROM sxc_attr INTO TABLE lcl_it_impsel
WHERE imp_name IN o_badis
AND active = 'X'.
*Verlassen,wenn keine Werte gefunden worden sind
IF lcl_it_impsel IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable Selection' 'for Badiimplementations! '
'Please check your selection. '
'The program will process your other selections.'.
*Form-Routine verlassen
EXIT.
ENDIF.
LOOP AT lcl_it_impsel INTO lcl_wa_impsel.
PERFORM handle_badi_implementation USING lcl_wa_impsel.
ENDLOOP.
ENDFORM. " BADI_IMPLEMENTATION
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_BADI_FILTERPARAMS
*&---------------------------------------------------------------------*
* Sicherung der Liste der Filterparameter in das Dateisystem.
* Generierung der TAbelle in HTML-Format.
*----------------------------------------------------------------------*
FORM download_badi_filterparams USING p_badiimpl TYPE c.
"sxc_attr-imp_name.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Arbeitsbereich fuer die TAbelle
DATA: lcl_wa_ges_sxc_exit LIKE LINE OF it_ges_sxc_exit.
*Name fuer die Gesamtmessagetabelle des Rahmenprogramms
DATA: lcl_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.

*Nur Download durchführen wenn Tabelle nicht leer ist.


IF NOT ( it_ges_sxc_exit IS INITIAL ).
*Ueberschrift zusammenbauen
CONCATENATE 'Filterparameters of Badi' global_main_name
INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Badi Implementation' TO lcl_it_headerrow.
APPEND 'Badi Definition' TO lcl_it_headerrow.
APPEND 'Filter Value' TO lcl_it_headerrow.
*Umwandlung in HTML-Tabelle
********************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_ges_sxc_exit INTO lcl_wa_ges_sxc_exit.
PERFORM create_htmltab_body USING lcl_wa_ges_sxc_exit.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************
CONCATENATE 'BadiImpFilter_' global_main_name INTO lcl_name.
CLEAR filename.
CONCATENATE new_dir '\' lcl_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_ges_sxc_exit
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text055 lcl_name filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text055 lcl_name filename.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Filterparameter'
'Filterparameter'
global_main_name.
ENDIF.
ENDIF. "Download nur wenn Tabelle nicht leer ist
ENDFORM. " DOWNLOAD_BADI_FILTERPARAMS
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_MENUEXITCODELIST
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* Sicherung der Liste der Menuexitcods in das Dateisystem.
* Generierung der TAbelle in HTML-Format.
*----------------------------------------------------------------------*
FORM download_menuexitcodelist USING p_name TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Arbeitsbereich nur fuer die wichtigen Felder der Liste
DATA: lcl_wa_icuatexts TYPE icuatexts.
*Dateiname fuer Download
DATA: lcl_project_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
*Bereich fuer Verarbeitung der Exitcodeliste
DATA: lcl_wa_cuatexts LIKE LINE OF it_cuatexts.

*Nur Herunterladen wenn Tabelle nicht initial ist


IF NOT ( it_cuatexts IS INITIAL ).
*Ueberschrift zusammenbauen
CONCATENATE 'Menuexitcodelist of Customerenhancement'
global_main_name INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Programname' TO lcl_it_headerrow.
APPEND 'Code' TO lcl_it_headerrow.
APPEND 'Language' TO lcl_it_headerrow.
APPEND 'Longtext' TO lcl_it_headerrow.
APPEND 'Shottext' TO lcl_it_headerrow.
APPEND 'Infotext' TO lcl_it_headerrow.
APPEND 'Icon Name' TO lcl_it_headerrow.
*Umwandlung in HTML-Tabelle
********************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_cuatexts INTO lcl_wa_cuatexts.
MOVE-CORRESPONDING lcl_wa_cuatexts TO lcl_wa_icuatexts.
PERFORM create_htmltab_body USING lcl_wa_icuatexts.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************
CONCATENATE 'Menuexits_' p_name INTO lcl_project_name.
CLEAR filename.
CONCATENATE new_dir '\' lcl_project_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_cuatexts
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text056 lcl_project_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text056 lcl_project_name
filename.
ENDIF.
ENDIF. "ist it_cuatexts ueberhaupt gefüllt
ENDFORM. " DOWNLOAD_MENUEXITCODELIST
*&---------------------------------------------------------------------*
*& Form TRANSPORTREQUEST
*&---------------------------------------------------------------------*
* Hier findet die Auswahl über die Tranportaufträge statt, die
* im Selektionsbildschrim fuer Trasnportauftraege eingegeben
* worden sind. Fuer jeden Transportauftrag werden alle
* unterstuetzten Objekte verarbeitet.
*----------------------------------------------------------------------*
FORM transportrequest.
*Bereich fuer Uebberobjekte
DATA: lcl_it_trkorr_ueber TYPE STANDARD TABLE OF e070-strkorr,
lcl_wa_trkorr_ueber LIKE LINE OF lcl_it_trkorr_ueber.
*Bereiche fuer das Lesen der Selektionsbedingungen
DATA: lcl_it_trkorr TYPE STANDARD TABLE OF e071-trkorr,
lcl_wa_trkorr LIKE LINE OF lcl_it_trkorr.
DATA: lcl_released TYPE e070-trstatus.

*Alle Unterauftraege selektieren


SELECT DISTINCT trkorr FROM e071 INTO TABLE lcl_it_trkorr
WHERE trkorr IN o_trkorr.
*evtl. angegebene Oberauftraege angeben; Verarbeitung am Ende der
*Routine
SELECT DISTINCT strkorr FROM e070 INTO TABLE lcl_it_trkorr_ueber
WHERE strkorr IN o_trkorr.
*Verlassen,wenn keine Werte gefunden worden sind
IF ( ( lcl_it_trkorr IS INITIAL )
AND ( lcl_it_trkorr_ueber IS INITIAL ) ).
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for the Transportrequests! '
'Please check your selection.'.
*Form-Routine verlassen
EXIT.
ENDIF.

*Verarbeitung Unterauftraege
LOOP AT lcl_it_trkorr INTO lcl_wa_trkorr.
PERFORM handle_transportrequest USING lcl_wa_trkorr.
ENDLOOP.

*Verarbeitung Oberauftraege
LOOP AT lcl_it_trkorr_ueber INTO lcl_wa_trkorr_ueber.
CLEAR lcl_released.
*Ueberpruefen,ob auftrag schon released
SELECT SINGLE trstatus FROM e070 INTO lcl_released
WHERE trkorr = lcl_wa_trkorr_ueber.
IF lcl_released = 'R' OR lcl_released = 'N'.
PERFORM handle_transportrequest USING lcl_wa_trkorr_ueber.
ELSE.
REFRESH lcl_it_trkorr.
* Alle Unterauftraege zu den Oberauftrag selektieren
SELECT DISTINCT trkorr FROM e070 INTO TABLE lcl_it_trkorr
WHERE strkorr = lcl_wa_trkorr_ueber.
*Ueberschrift zusammenbauen
CONCATENATE 'Main Transport Request:' lcl_wa_trkorr_ueber
INTO header SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
FORMAT COLOR COL_BACKGROUND.
* ***************
* Verarbeitung Unterauftraege
LOOP AT lcl_it_trkorr INTO lcl_wa_trkorr.
PERFORM handle_transportrequest USING lcl_wa_trkorr.
ENDLOOP.
ENDIF. "Oberauftrag bereits freigegeben
ENDLOOP.
ENDFORM. " TRANSPORTREQUEST
*&---------------------------------------------------------------------*
*& Form GET_SELECTED_SCREEN
*&---------------------------------------------------------------------*
* Nach Selektionen im Startbildschirm wird hier entschieden,
* welcher Folgescreen prozessiert wird.
* Nach dem Abbrechen des Folgescreens wird durch Neustart der
* Startselektionsbildschirm angezeigt.
*----------------------------------------------------------------------*
FORM get_selected_screen.
IF p_single = 'X'.
CALL SELECTION-SCREEN '102'. "log.Entwicklung, einzelne Objekte
ENDIF.
*Rueckkehr zu Startselektionsbilschirm zu Standardbedingungen
IF sy-subrc = 4.
SET SCREEN 0.
STOP.
ENDIF.
IF p_trkorr = 'X'.
CALL SELECTION-SCREEN '100'. "Transportauftrag
ENDIF.
*Rueckkehr zu Startselektionsbilschirm zu Standardbedingungen
IF sy-subrc = 4.
SET SCREEN 0.
STOP.
ENDIF.
IF p_devc = 'X'.
CALL SELECTION-SCREEN '101'. "Entwicklungsklasse
ENDIF.
*Rueckkehr zu Startselektionsbilschirm zu Standardbedingungen
IF sy-subrc = 4.
SET SCREEN 0.
STOP.
ENDIF.
*Rueckkehr zu Startselektionsbilschirm zu Standardbedingungen
IF sy-subrc = 4.
SET SCREEN 0.
STOP.
ENDIF.
*** Kundeneigener Namensraum beruecksichtigen
IF p_nspace IS INITIAL.
p_nspace = 'Z'.
ENDIF.
CONCATENATE p_nspace '%' INTO g_name.
CONDENSE g_name NO-GAPS.
*Länge des Partnernamensraumpräfixes bestimmen
g_len_nspace = STRLEN( p_nspace ).
ENDFORM. " GET_SELECTED_SCREEN
*&---------------------------------------------------------------------*
*& Form handle_trkorr_domains
*&---------------------------------------------------------------------*
* Informationen zur Domaine in einem Transportauftrag
* behandeln. Sonderbehandlung, da hier Domaene unabhaengig vom
* Datenelement auftritt.
* Download der Headertabelle und evtl. der Wertehilfe.
* Generierung der Tabellen in HTML-Format.
*----------------------------------------------------------------------*
FORM handle_trkorr_domains USING
p_it_domains TYPE ANY TABLE.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Arbeitsbereich fuer uebergebene Tabelle
DATA: lcl_wa_domains TYPE dd04v-domname.
*Variablen fuer Download (Filename) festlegen
DATA: lcl_domainheader_name TYPE string.
DATA: lcl_domainvalues_name TYPE string.
*Lokaler Datenbereich fuer temporaere Verarbeitung von dd07v(enthält
*evtl. Wertebereich der Domaene.
DATA: lcl_it_dd07v TYPE STANDARD TABLE OF dd07v,
lcl_wa_dd07v LIKE LINE OF lcl_it_dd07v.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
*Arbeitsbereich nur fuer die sinnvolen Attrbute der Domaene
DATA: lcl_wa_idd01v TYPE idd01v.
*Arbeitsbereich nur fuer die sinnvolen Festwerte der Domaene
DATA: lcl_wa_idd07v TYPE idd07v.
*Schleife ueber die Kundeneigenen Datenelemente
*Es werden alle Domaenen (auch die SAP-Domaenen)
*betrachtet, da sie wegen der referentiellen Intgrität
*in der Datenbank notwendig sind
LOOP AT p_it_domains INTO lcl_wa_domains.
*Sprachtabelle
LOOP AT it_lan INTO wa_lan.
REFRESH lcl_it_dd07v.
CALL FUNCTION 'DDIF_DOMA_GET'
EXPORTING
name = lcl_wa_domains
state = 'A'
langu = wa_lan
IMPORTING
* GOTSTATE =
dd01v_wa = wa_dd01v
TABLES
dd07v_tab = lcl_it_dd07v
* EXCEPTIONS
* ILLEGAL_INPUT = 1
* OTHERS = 2
.
IF sy-subrc = 0.
* Domaeneninfos in Gesamttabelle schreiben
APPEND wa_dd01v TO it_dd01v.
* Wertelistetabelle (dd07v) in Gesamtwerteliste schreiben.
* Nur ausführen wenn lcl_it_dd07v nicht leer ist. Nur aus-
* fuehren wenn Domaenen im Kundennamensraum liegen.
IF NOT ( lcl_it_dd07v IS INITIAL ).
LOOP AT lcl_it_dd07v INTO lcl_wa_dd07v.
IF ( lcl_wa_dd07v-domname(1) = 'Z'
OR lcl_wa_dd07v-domname(1) = 'Y' ).
APPEND lcl_wa_dd07v TO it_dd07v.
ENDIF. "Kundennamensraum
ENDLOOP.
ENDIF. "initialpruefung
ENDIF. "sy-subrc
ENDLOOP. "Sprachtabelle
ENDLOOP.
******************************************************************
*Download der allgemeinen Informationen
******************************************************************
*Nur Download wenn it_dd01v nicht leer ist
IF NOT ( it_dd01v IS INITIAL ).
* Ueberschrift zusammenbauen
CONCATENATE 'Domain Attributes of ' global_main_name
INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Domain Name' TO lcl_it_headerrow.
APPEND 'Language Key' TO lcl_it_headerrow.
APPEND 'Data Type' TO lcl_it_headerrow.
APPEND 'Length of Type' TO lcl_it_headerrow.
APPEND 'Output Length' TO lcl_it_headerrow.
APPEND 'Decimal places' TO lcl_it_headerrow.
APPEND 'Lowercase letters (flag)' TO lcl_it_headerrow.
APPEND 'Sign (flag)' TO lcl_it_headerrow.
APPEND 'Flag for fixed Values' TO lcl_it_headerrow.
APPEND 'Value Table' TO lcl_it_headerrow.
APPEND 'Conversion Routine' TO lcl_it_headerrow.
APPEND 'Short Text' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_dd01v INTO wa_dd01v.
*nur sinnvolle Felder nutzen
MOVE-CORRESPONDING wa_dd01v TO lcl_wa_idd01v.
PERFORM create_htmltab_body USING lcl_wa_idd01v.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************
CONCATENATE 'DomHeader_' global_main_name
INTO lcl_domainheader_name.
CLEAR filename.
CONCATENATE new_dir '\' lcl_domainheader_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_dd01v
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text023 lcl_domainheader_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text023 lcl_domainheader_name
filename.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Domainheader'
'Domainheader'
global_main_name.
ENDIF.
ENDIF. "Ist Tabelle it_dd01v gefüllt.
******************************************************
*Herunterladen der Wertehilfen
******************************************************
*Nur Download wenn it_dd07v nicht leer ist
IF NOT ( it_dd07v IS INITIAL ).
CLEAR lcl_header. REFRESH lcl_it_headerrow.
* Ueberschrift zusammenbauen
CONCATENATE 'Value Range and Short Text of Domains used in '
global_main_name INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Domain Name' TO lcl_it_headerrow.
APPEND 'Position in Value List' TO lcl_it_headerrow.
APPEND 'Language' TO lcl_it_headerrow.
APPEND 'Single Value/lower Limit' TO lcl_it_headerrow.
APPEND 'Upper limit' TO lcl_it_headerrow.
APPEND 'Short Text for fixed Values' TO lcl_it_headerrow.
* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_dd07v INTO wa_dd07v.
*nur sinnvolle Felder nutzen
MOVE-CORRESPONDING wa_dd07v TO lcl_wa_idd07v.
PERFORM create_htmltab_body USING lcl_wa_idd07v.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************

CONCATENATE 'DomValues_' global_main_name INTO lcl_domainvalues_name.


CLEAR filename.
CONCATENATE new_dir '\' lcl_domainvalues_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html ""it_dd07v
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text024 lcl_domainvalues_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text024 lcl_domainvalues_name
filename.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Domainvalues'
'Domainvalues'
global_main_name.
ENDIF.
ENDIF.
ENDFORM. " handle_trkorr_domains
*&---------------------------------------------------------------------*
*& Form trkorr_handle_dialogmodules
*&---------------------------------------------------------------------*
* Behandlung von Dialogmodulen in
* Transportauftraegen. Sonderbehandlung, da sie hier unabhaengig
* von einem Rahmenprogramm verarbeitet werden.
* Das zugehoerige Programm wird nicht beachtet, da Aufruf aus
* einem Transportauftrag heraus erfolgt.
*----------------------------------------------------------------------*
FORM trkorr_handle_dialogmodules USING p_name TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
DATA: lcl_dialogmudule_params TYPE string.
*Tabelle und Arbeitsbereich fuer Joins
DATA: lcl_it_dialogmodule TYPE STANDARD TABLE OF dialogmodule,
lcl_wa_dialogmodule LIKE LINE OF lcl_it_dialogmodule.
SELECT * FROM tdct
INNER JOIN diapar ON diapar~dnam = tdct~dnam
INTO TABLE LCL_IT_DIALOGMODULE
WHERE tdct~dnam = p_name
AND spras IN o_lan.

***************************************************
*Parameter des Dialogbausteine: lcl_it_diapar
***************************************************
*Nur downloaden, wenn nicht leer
CONCATENATE 'Dlgmd_Params_' p_name INTO
lcl_dialogmudule_params.
CLEAR filename.
CONCATENATE new_dir '\' lcl_dialogmudule_params '.TXT' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
lcl_it_dialogmodule
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text044
lcl_dialogmudule_params filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text044
lcl_dialogmudule_params filename.
ENDIF. "sy-subrc
ENDFORM. " trkorr_handle_dialogmodules
*&---------------------------------------------------------------------*
*& Form trkorr_handleauthorityobject
*&---------------------------------------------------------------------*
* Behandlung von Berecchtigungsobjekten in
* Transportauftraegen. Sonderbehandlung, da sie hier unabhaengig
* von einem Rahmenprogramm verarbeitet werden.Der Parameter P_NAME
* enthaelt den Namen der Bereichtigungsobhekte.
*----------------------------------------------------------------------*
FORM trkorr_handleauthorityobject USING p_name TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Lokale Variablen für Tabellenbehandlung; Objekte und Aktivitaeten
DATA: lcl_it_tobj LIKE it_tobj,
lcl_wa_tobj LIKE LINE OF lcl_it_tobj,
lcl_it_tactz LIKE it_tactz,
lcl_wa_tactz LIKE LINE OF lcl_it_tactz.
*Variablen fuer Download
*Berechtigungsobjektname
DATA: lcl_authobj_name TYPE string.
*Aktivitaeten zu Berechtigungsobjekt
DATA: lcl_auth_act TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.

*Selektion der Berechtigungsobjekte


SELECT * FROM tobj INTO TABLE lcl_it_tobj
WHERE objct = p_name.
IF lcl_it_tobj IS INITIAL.
EXIT.
ENDIF.
*Selektion der zu den Berechtigungsobjekten gehörigen Aktivitäten
SELECT * FROM tactz INTO TABLE lcl_it_tactz
WHERE brobj = p_name.

*Download dieser Tabellen


*1.) Berechtigungsobjekttabelle
*Nur herunterladen, wenn Berechtigungsobjektabelle Inhalt hat.
IF NOT ( lcl_it_tobj IS INITIAL ).
*Ueberschrift zusammenbauen
CONCATENATE 'Structure of Authorityobject'
p_name INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Name of Object' TO lcl_it_headerrow.
APPEND 'Field 1' TO lcl_it_headerrow.
APPEND 'Field 2' TO lcl_it_headerrow.
APPEND 'Field 3' TO lcl_it_headerrow.
APPEND 'Field 4' TO lcl_it_headerrow.
APPEND 'Field 5' TO lcl_it_headerrow.
APPEND 'Field 6' TO lcl_it_headerrow.
APPEND 'Field 7' TO lcl_it_headerrow.
APPEND 'Field 8' TO lcl_it_headerrow.
APPEND 'Field 9' TO lcl_it_headerrow.
APPEND 'Field 10' TO lcl_it_headerrow.
APPEND 'Class' TO lcl_it_headerrow.
APPEND 'Name of Author' TO lcl_it_headerrow.
APPEND 'Function Block' TO lcl_it_headerrow.
APPEND 'Conversion of Field' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT lcl_it_tobj INTO lcl_wa_tobj.
PERFORM create_htmltab_body USING lcl_wa_tobj.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************
CONCATENATE 'Auhthorityobject_' p_name INTO lcl_authobj_name.
CLEAR filename.
CONCATENATE new_dir '\' lcl_authobj_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "lcl_it_tobj
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text031 lcl_authobj_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text031 lcl_authobj_name
filename.
*Stueckliste aufbereiten
PERFORM write_stueckliste USING 'Authority Object(TR)'
p_name
global_main_name.
ENDIF.
ENDIF. "Tabelle it_tobj gefuellt?????
*2.) Aktivitaeten zur Berechtigungsobjekttabelle
*Nur herunterladen, wenn Aktivitaetstabelle Inhalt hat.
IF NOT ( lcl_it_tactz IS INITIAL ).
CLEAR lcl_header. REFRESH lcl_it_headerrow.
*Ueberschrift zusammenbauen
CONCATENATE 'Activities of Authorization Object'
p_name INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Authority Object' TO lcl_it_headerrow.
APPEND 'Assigned Activity' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT lcl_it_tactz INTO lcl_wa_tactz.
PERFORM create_htmltab_body USING lcl_wa_tactz.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************

CONCATENATE 'AuthActivities' p_name INTO lcl_auth_act.


CLEAR filename.
CONCATENATE new_dir '\' lcl_auth_act '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "lcl_it_tactz
CHANGING lcl_subrc.

IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text032 lcl_auth_act filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text032 lcl_auth_act filename.
ENDIF.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Activities of Authority Object'
p_name
global_main_name.
ENDIF. "Tabelle it_tactz gefuellt?????

ENDFORM. " trkorr_handleauthorityobject


*&---------------------------------------------------------------------*
*& Form trkorr_handle_authorityfield
*&---------------------------------------------------------------------*
* Behandlung der Berechtigungsfelder bei Tranportauftraegen.
* Die Felder koennen einzeln in Transportauftraegen vorkommmen.
* Sie selektierten Daten werden an die Gesamttabelle angehängt.
*----------------------------------------------------------------------*
FORM trkorr_handle_authorityfield USING p_name.
*lokalen Arbeitsbereicht fuer Tabelle authx(Beschreibung
*Berechtigungsfelder
DATA: lcl_wa_authx TYPE authx.
SELECT SINGLE * FROM authx INTO lcl_wa_authx
WHERE fieldname = p_name.
APPEND lcl_wa_authx TO it_authx.
ENDFORM. " trkorr_handle_authorityfield
*&---------------------------------------------------------------------*
*& Form TRKORR_DOWNLOAD_AUTHORITYFIELD
*&---------------------------------------------------------------------*
* Tabelle der Berechtigungsfelder in Dateisystem speichern.
* Genierung der Tabelle in HTML-Format.
*----------------------------------------------------------------------*
FORM trkorr_download_authorityfield USING p_it_authx LIKE it_authx.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
DATA: lcl_authorityfields TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.

*Ueberschrift zusammenbauen
CONCATENATE 'List of Authorityfield' global_main_name
INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Fieldname' TO lcl_it_headerrow.
APPEND 'Dataelelment' TO lcl_it_headerrow.
APPEND 'Check Table' TO lcl_it_headerrow.

CONCATENATE 'Authortyfields_' global_main_name INTO


lcl_authorityfields.

CLEAR filename.
CONCATENATE new_dir '\' lcl_authorityfields '.xml' INTO filename.
IF NOT ( p_it_authx IS INITIAL ).
*Umwandlung in HTML-Tabelle
********************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT p_it_authx INTO wa_authx.
PERFORM create_htmltab_body USING wa_authx.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************

* begin of changes for partner namespace


TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "p_it_authx
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text061 lcl_authorityfields
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text061 lcl_authorityfields
filename.
ENDIF. "sy-subrc
ENDIF.
ENDFORM. " TRKORR_DOWNLOAD_AUTHORITYFIELD

*&---------------------------------------------------------------------*
*& Form interfaces
*&---------------------------------------------------------------------*
* Abfangen der selektierten Interfaces des
* Selektionsbildschirm zur Auswahl einzelner Objekte.
* Fuer jede gefundenes Interface wird die
* Verarbeitungsroutine ausgeführt.
*----------------------------------------------------------------------*
FORM interfaces.
DATA: lcl_it_seoclass TYPE STANDARD TABLE OF seoclass,
lcl_wa_seoclass LIKE LINE OF lcl_it_seoclass.
*Arbeitsbereich fuer select-options:
* data: lcl_wa_options like o_intf.
*Selektieren der Programme nach Selekt-Options
SELECT * FROM seoclass INTO TABLE lcl_it_seoclass
WHERE clsname IN o_intf
AND ( ( clsname LIKE 'Z%' ) OR ( clsname LIKE 'Y%' ) OR
( clsname LIKE g_name ) )
AND clstype = 1.
*Verlassen,wenn keine Werte gefunden worden sind
IF lcl_it_seoclass IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for Interfaces! '
'Please check your selection. '
'The program will process your other selections.'.
*Form-Routine verlassen
EXIT.
ENDIF.

LOOP AT lcl_it_seoclass INTO lcl_wa_seoclass.


*Liste mit Ober-Objekten bei Einzelselektion fuellen
MOVE lcl_wa_seoclass-clsname TO wa_obj_list-name.
APPEND wa_obj_list TO it_obj_list.
PERFORM handle_interface USING lcl_wa_seoclass-clsname.
*Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'Interface(OO)'
lcl_wa_seoclass-clsname
p_logic.
ENDIF.
ENDLOOP. "Klassenliste
ENDFORM. " interfaces
*&---------------------------------------------------------------------*
*& Form download_interface
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_LCL_WA_OPTIONS_LOW text
*----------------------------------------------------------------------*
FORM download_interface USING p_name TYPE any.
*Variable fuer Laenge des Klassenname
DATA: lcl_laeng TYPE i.
*Suchstringvariable
DATA: lcl_such LIKE wa_trdir-name.
*Arbeitsbereich fuer trdir-name
DATA: lcl_it_trdir_name TYPE STANDARD TABLE OF trdir-name,
lcl_wa_trdir_name LIKE LINE OF lcl_it_trdir_name.
*Bereich fuer Typgruppentabelle
DATA: lcl_it_vseotypep TYPE STANDARD TABLE OF vseotypep,
lcl_wa_vseotypep LIKE LINE OF lcl_it_vseotypep.
*Variable fuer Includenamen einer Typgruppe
DATA: lcl_typpconv LIKE wa_trdir-name.
*Bereiche fuer implementierte Interfaces
DATA: lcl_it_seometarel TYPE STANDARD TABLE OF seometarel,
lcl_wa_seometarel LIKE LINE OF lcl_it_seometarel.
*Aufbau des Suchstrings
*Laenge des Interfacenamens
lcl_laeng = STRLEN( p_name ).
*Zeichen '=' anfuegen (kann nicht bei Anlage verwendet werden)
IF lcl_laeng < 30.
CONCATENATE p_name '=%I%' INTO lcl_such.
ELSE.
CONCATENATE p_name '%I%' INTO lcl_such.
ENDIF.
SELECT name FROM trdir INTO TABLE lcl_it_trdir_name
WHERE name LIKE lcl_such.

*************************************************
*Download der dazugehoerigen Includes
*************************************************
LOOP AT lcl_it_trdir_name INTO lcl_wa_trdir_name.
CLEAR ok.
PERFORM download_include USING lcl_wa_trdir_name
'J'
CHANGING ok .
IF ok = 'X'. "Download war erfolgreich
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Include'
lcl_wa_trdir_name
p_name.
ENDIF.
ENDLOOP.
*2.)Typgruppe dieser Klasse behandeln
*Tabelle in der Zuordnung von Typgruppen zu Klassen stehen
SELECT * FROM vseotypep INTO TABLE lcl_it_vseotypep
WHERE clsname = p_name.
IF NOT ( lcl_it_vseotypep IS INITIAL ).
LOOP AT lcl_it_vseotypep INTO lcl_wa_vseotypep.
*Nur herunterladenm, wenn Typegroup in Kundennamensraum
IF ( ( lcl_wa_vseotypep-typegroup(1) = 'Z' )
OR ( lcl_wa_vseotypep-typegroup(1) = 'Y' )
OR ( lcl_wa_vseotypep-typegroup(g_len_nspace) = p_nspace ) ).
CLEAR ok.
*Zusammensetzen des Includenamen fuer die Typgruppe
CONCATENATE '%_C' lcl_wa_vseotypep-typegroup INTO lcl_typpconv.
*Typgruppeninclude herunterladen
PERFORM download_include USING lcl_typpconv
'T'
CHANGING ok .
IF ok = 'X'. "Download war erfolgreich
*Klassenliste schreiben.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Typgroup'
lcl_wa_vseotypep-typegroup
global_main_name.
ENDIF. "Ok-abfrage
ENDIF.
ENDLOOP.
ENDIF.
*3.)Implementierte Interfaces sichern
SELECT DISTINCT clsname refclsname FROM seometarel
INTO CORRESPONDING FIELDS OF TABLE lcl_it_seometarel
WHERE clsname = p_name.
LOOP AT lcl_it_seometarel INTO lcl_wa_seometarel.
IF ( ( lcl_wa_seometarel-refclsname(1) = 'Z' )
OR ( lcl_wa_seometarel-refclsname(1) = 'Y' )
OR ( lcl_wa_seometarel-refclsname(g_len_nspace) = p_nspace ) ).

PERFORM write_global_save USING 'I' lcl_wa_seometarel-refclsname.


*Stueckliste schreiben
PERFORM write_stueckliste USING 'Interface'
lcl_wa_seometarel-refclsname
global_main_name.
ENDIF.
ENDLOOP.
ENDFORM. " download_interface
*&---------------------------------------------------------------------*
*& Form read_classes
*&---------------------------------------------------------------------*
* Lesen der Klassentabelle mit dem im Uebergabeparameter
* P_NAME angegebenen Klassennamen
*----------------------------------------------------------------------*
FORM read_classes USING p_name TYPE c
CHANGING p_wa_vseoclass TYPE vseoclass.
SELECT SINGLE * FROM vseoclass INTO p_wa_vseoclass
WHERE clsname = p_name.
ENDFORM. " read_programs_for_class
*&---------------------------------------------------------------------*
*& Form handle_class
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* Verarbeitungsroutine fuer Klassen. Fuer die im Parameter
* P_NAME angegeben Klassen werden die Objekte gesichert.
*----------------------------------------------------------------------*
FORM handle_class USING p_name TYPE c.
*Bereich fuer Klassenview
DATA: lcl_it_vseoclass TYPE STANDARD TABLE OF vseoclass,
lcl_wa_vseoclass LIKE LINE OF lcl_it_vseoclass.
*Bereich fuer Typgruppentabelle
DATA: lcl_it_vseotypep TYPE STANDARD TABLE OF vseotypep,
lcl_wa_vseotypep LIKE LINE OF lcl_it_vseotypep.
*Variable fuer Includenamen einer Typgruppe
DATA: lcl_typpconv LIKE wa_trdir-name.
*Bereiche fuer Interface
DATA: lcl_it_vseoimplem TYPE STANDARD TABLE OF vseoimplem,
lcl_wa_vseoimplem LIKE LINE OF lcl_it_vseoimplem.
*Variable zur Zwischenspeicherung der Stueckliste
DATA: lcl_it_prog_stueckliste LIKE it_prog_stueckliste.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
*Zwischenspeicherung Pfad
* DATA: path TYPE rlgrap-filename.
DATA: path TYPE string.
*Zwischenspeicherugng Pfad fuer Klassen OO
DATA: it_path TYPE STANDARD TABLE OF string, "rlgrap-filename,
wa_path LIKE LINE OF it_path.
*Variable fuer Laengenbestimmung
DATA: lcl_len TYPE i.
*Rootverzeichnis bei Einstieg
* DATA: lcl_root TYPE rlgrap-filename.
DATA: lcl_root TYPE string.
*aktuellen Eintrag aus Vererbungsliste löschen wenn Eintrag besteht
DELETE it_inheritance INDEX 1.

*** Read relevant classes


PERFORM read_classes USING p_name
CHANGING lcl_wa_vseoclass.
*select single name from trdir into lcl_wa_trdir_name
* where name like lcl_such.
**********Ausfuehren des Programmdownloads
IF NOT ( lcl_wa_vseoclass IS INITIAL ).
*Stueckliste fuer Klasse schreibvne
PERFORM write_stueckliste USING 'Class'
lcl_wa_vseoclass-clsname
''.
global_main_name = lcl_wa_vseoclass-clsname.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING lcl_wa_vseoclass-clsname
'C'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'Class:' lcl_wa_vseoclass-clsname INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.

*1.) Klassenincludes herunterladen


PERFORM download_classincludes USING lcl_wa_vseoclass-clsname.
*2.)Typgruppe dieser Klasse behandeln
*Tabelle in der Zuordnung von Typgruppen zu Klassen stehen
SELECT * FROM vseotypep INTO TABLE lcl_it_vseotypep
WHERE clsname = lcl_wa_vseoclass-clsname.
IF NOT ( lcl_it_vseotypep IS INITIAL ).
LOOP AT lcl_it_vseotypep INTO lcl_wa_vseotypep.
*Nur herunterladenm, wenn Typegroup in Kundennamensraum
IF ( ( lcl_wa_vseotypep-typegroup(1) = 'Z' )
OR ( lcl_wa_vseotypep-typegroup(1) = 'Y' ) ).
CLEAR ok.
*Zusammensetzen des Includenamen fuer die Typgruppe
CONCATENATE '%_C' lcl_wa_vseotypep-typegroup INTO lcl_typpconv.
*Typgruppeninclude herunterladen
PERFORM download_include USING lcl_typpconv
'T'
CHANGING ok .
IF ok = 'X'. "Download war erfolgreich
*Klassenliste schreiben.
CLEAR wa_classlist.
MOVE lcl_wa_vseotypep-typegroup TO wa_classlist-inc.
MOVE 'Typgroup' TO wa_classlist-typus.
APPEND wa_classlist TO it_classlist.
ENDIF. "Ok-abfrage
ENDIF.
ENDLOOP.
ENDIF.
*3.)Uebersichtsliste ueber diese Klasse
PERFORM download_classlist USING lcl_wa_vseoclass-clsname.

* Sicherung Pfad fuer Stueckliste in Tabelle um rekursiv darauf z


* zugreifen zu können
INSERT new_dir INTO it_path INDEX 1.
*Nur Pfad anlegen wenn nicht innerhalb von Entwicklungsklasse angelegt
IF p_devc <> 'X'.
SEARCH new_dir FOR '\S\'.
IF sy-subrc <> 0.
* Neues Basisverzeichnis fuer alllen weiteren Verarbeitungen
lcl_root = dir.
dir = new_dir.
* Erzeugen des Ausgabeverzeichnisses fuer untergeordnete Objekte
* Interfaces und Klassen
PERFORM create_directory USING lcl_wa_vseoclass-clsname
'SUB'.
dir = new_dir.
ELSE. "zurück zu bereits erstelltem subpfad
* Verzeichnis auf Sub-Verzeichnis zurücksetzen
sy-fdpos = sy-fdpos + 2.
dir = new_dir(sy-fdpos).
ENDIF.
ENDIF.
*4.)Implementierte Interfaces sichern
SELECT DISTINCT clsname refclsname FROM vseoimplem
INTO CORRESPONDING FIELDS OF TABLE lcl_it_vseoimplem
WHERE clsname = lcl_wa_vseoclass-clsname.
LOOP AT lcl_it_vseoimplem INTO lcl_wa_vseoimplem
WHERE refclsname(1) = 'Z'
OR refclsname(1) = 'Y'.
global_main_name = lcl_wa_vseoimplem-refclsname.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Interface'
lcl_wa_vseoimplem-refclsname
lcl_wa_vseoclass-clsname.
*Ueberschrift zusammenbauen
CONCATENATE 'Interface:' lcl_wa_vseoimplem-refclsname INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
*Verzeichnis sichern
* path = new_dir.
root = dir.
* dir = new_dir.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING lcl_wa_vseoimplem-refclsname
'I'.
*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Eigentlicher Download durchfuehren
PERFORM download_interface USING lcl_wa_vseoimplem-refclsname.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
*Verzeichnis wiederherstellen
dir = root.
* new_dir = path.
ENDLOOP.

global_main_name = lcl_wa_vseoclass-clsname.

*5.) Klassen der Vererbungshierarchie sichern


PERFORM get_class_inheritance USING lcl_wa_vseoclass-clsname.
*6.)Vererbte Klassen herunterladen
PERFORM download_class_inheritance.
global_main_name = lcl_wa_vseoclass-clsname.

******abschließende Routinen fuer ganze Klassen


PERFORM write_protocol USING 'L' '' '' ''.
*Rekursives Lesen des Pfades
READ TABLE it_path INDEX 1 INTO wa_path.
new_dir = wa_path.
DELETE it_path INDEX 1.
*Domaenen downloaden
PERFORM download_domains.
*Datenelementliste downloaden
PERFORM download_dataelements.
*Berechtigungsobjekt Infos downloaden
PERFORM download_authorityobjects.
*Titlebars herunterladen
PERFORM download_titlebar.
*Meldungen herunterladen
PERFORM download_messages.
*Gesamtliste der Transaktionscodes herunterladen
PERFORM download_tacodelist.
*Gesamtliste mit Dialogbaustein->Funktionsbausteinzuordnung
*herunterladen und Gesamtliste mit Dialogpoolparametern herunterladen.
PERFORM download_dialogmodule_elements.
*Gesamtliste der Parameter herunterschreiben
PERFORM download_setgetparams.
*Gesamtstückliste
PERFORM download_stueckliste.
*HotPackagestand sichern
PERFORM download_hpstand.
* SKIP. "Listausgabeformatierung
PERFORM write_protocol USING 'S' '' '' ''.

*7.)Die Liste der extern aufgerufenen Rahmenprogramme abarbeieten


*Globalen Namen setzen
lcl_name = global_main_name.
*Sicherung und Initialisierung der globalen Tabellen
PERFORM initialize.
*7Die Liste der extern aufgerufenen Rahmenprogramme abarbeieten
PERFORM handle_externalprogs.
*Ruecksicherung des Verzeichnisses
dir = lcl_root.

ENDIF. "Klasse gefunden??


ENDFORM. " handle_class
*&---------------------------------------------------------------------*
*& Form download_classincludes
*&---------------------------------------------------------------------*
* Verarbeitung der Objekte von Klassen die auf Includes
* basieren. Insbesondere Objekte fuer deren Selektion das
* Classpoolinclude notwendig ist.
*----------------------------------------------------------------------*
FORM download_classincludes USING p_name TYPE c.
*Varible fuer Laenge einer Zeichenkette
DATA: lcl_laeng TYPE i.
*Suchstringvariable
DATA: lcl_such LIKE wa_trdir-name.
*Lokaler Bereich fuer trdir
DATA: lcl_it_trdir TYPE STANDARD TABLE OF trdir,
lcl_wa_trdir LIKE LINE OF lcl_it_trdir.
*Variabel fuer Maininclude
DATA: mainname LIKE wa_trdir-name.
*Aufbau des Suchstrings
*Das evtl '*' Zeichen durch % ersetzen
REPLACE '*' WITH '%' INTO p_name.
WHILE sy-subrc <> 4. "Ein Vorkommen
REPLACE '*' WITH '%' INTO p_name.
ENDWHILE.
*Laenge des Klassennamens
lcl_laeng = STRLEN( p_name ).
*Zeichen '=' anfuegen (kann nicht bei Anlage verwendet werden)
IF lcl_laeng < 30.
CONCATENATE p_name '=%' INTO lcl_such.
ELSE.
CONCATENATE p_name '%' INTO lcl_such.
ENDIF.
*Alle Includes selektieren
SELECT * FROM trdir INTO TABLE lcl_it_trdir
WHERE name LIKE lcl_such.
LOOP AT lcl_it_trdir INTO lcl_wa_trdir.
*Rahmenprogramm herunterladen
CLEAR ok.
PERFORM download_include USING lcl_wa_trdir-name
'C'
CHANGING ok.
*Ok wird nicht abgefragt da Klassenliste nicht geschrieben wird.
*wenn Rahmeninclude: Bezug auf alle Teile der Klasse
*Rahmeninclude zusammenbauen
* concatenate lcl_such 'CP' into lcl_such.
IF lcl_wa_trdir-name+30(2) = 'CP'.
*Externe Verweise herunterladen
PERFORM handle_extprog USING lcl_wa_trdir-name.
*Textelemente
PERFORM download_textelements USING lcl_wa_trdir-name
'R'.
*Datadictionaryobjekte
PERFORM handle_ddic USING lcl_wa_trdir-name
'R'.
*Benutzte Klassen und Interface behandeln
PERFORM handle_classinterface USING lcl_wa_trdir-name
'R'.

*Selbstaufrufe der Klasse loeschen.


DELETE it_prog_stueckliste WHERE type = 'Class(OO)'
AND name = p_name
AND obername = lcl_wa_trdir-name.
*Koennnen nicht fuer Klassen angelegt werden
**Echter Screen des Rahmenprogramms herunterladen
* PERFORM handle_screens USING lcl_wa_trdir-name
* 'R'.
**pf-Stati verarbeiten
* PERFORM handle_pf_status USING lcl_wa_trdir-name
* 'R'.
*
**Titlebars suchen
* PERFORM handle_titlebar USING lcl_wa_trdir-name
* 'R'.

*eventueller Transaktionscode zu Rahmenprogramm


PERFORM handle_tacode_for_class USING p_name.

ENDIF.
ENDLOOP.

ENDFORM. " download_classincludes


*&---------------------------------------------------------------------*
*& Form get_class_inheritance
*&---------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
* Vererbungshierarchie der im Parameter p_name uebergebenen
* Klasse wird im Kundennamensraum ermittelt. Die ermittelten
* Klassen werden in eine globale Tabelle zur spaeteren Verarbeitung
* gespeichert.
*----------------------------------------------------------------------*
FORM get_class_inheritance USING p_name TYPE c.
DATA: lcl_wa_inheritance TYPE inheritance.
SELECT SINGLE clsname refclsname FROM vseoextend
INTO lcl_wa_inheritance
WHERE clsname = p_name
AND ( ( refclsname LIKE 'Z%' )
OR ( refclsname LIKE 'Y%' )
OR ( refclsname LIKE g_name ) ).
IF sy-subrc = 0.
APPEND lcl_wa_inheritance TO it_inheritance.
ENDIF.
*Vererbungshierarchie aufwärts durcharbeiten wenn im
*Kundennamensraum
WHILE ( sy-subrc = 0 ).
SELECT SINGLE clsname refclsname FROM vseoextend
INTO lcl_wa_inheritance
WHERE clsname = lcl_wa_inheritance-super
AND ( ( refclsname LIKE 'Z%' )
OR ( refclsname LIKE 'Y%' )
OR ( refclsname LIKE g_name ) ).
IF sy-subrc = 0.
APPEND lcl_wa_inheritance TO it_inheritance.
ENDIF.
ENDWHILE.

ENDFORM. " get_class_inheritance


*&---------------------------------------------------------------------*
*& Form download_class_inheritance
*&---------------------------------------------------------------------*
* Klassen der Vererbungshierarchie (globale Tabelle) werden
* durch die Verarbeitungsroutine fuer Klassen.
*----------------------------------------------------------------------*
FORM download_class_inheritance.
*Sicherungsvariable
DATA: lcl_it_prog_stueckliste LIKE it_prog_stueckliste.
* DATA: path TYPE rlgrap-filename.
DATA: path TYPE string.

LOOP AT it_inheritance INTO wa_inheritance.


*Stueckliste schreiben
PERFORM write_stueckliste USING 'Class(OO)'
wa_inheritance-super
wa_inheritance-sub.
*Verzeichnis sichern
path = new_dir.
root = dir.
dir = new_dir.
*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.

*Klasse verarbeiten
PERFORM initialize.
PERFORM handle_class USING wa_inheritance-super.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
*Verzeichnis wiederherstellen
dir = root.
new_dir = path.
ENDLOOP.

ENDFORM. " download_class_inheritance


*&---------------------------------------------------------------------*
*& Form trkorr_handle_single_method
*&---------------------------------------------------------------------*
* Einzelne Methode aus einem Transportauftrag in
* lokales Dateisystem sichern.
*----------------------------------------------------------------------*
FORM trkorr_handle_single_method USING p_name TYPE c.
*Variablen für den Suchstring
DATA: lcl_such LIKE wa_trdir-name.
*Variable fuer Anzahl der Zeilen der internen Tabelle
DATA: lcl_lines TYPE i.
*Variable fuer Zaehler der do-Schleife
DATA: lcl_zaehler TYPE i.
*Arbeitsbereich fuer tmdir
DATA: lcl_it_tmdir TYPE STANDARD TABLE OF tmdir,
lcl_wa_tmdir LIKE LINE OF lcl_it_tmdir.
*Arbeitsbereich fuer trdir
DATA: lcl_it_trdir TYPE STANDARD TABLE OF trdir,
lcl_wa_trdir LIKE LINE OF lcl_it_trdir.
*Varible um Laenge des uebergeben Strings zu ermittlen
DATA: lcl_laeng TYPE i.
*Variable fuer Klassen- und Methodenname
DATA: lcl_class LIKE lcl_wa_tmdir-classname,
lcl_method LIKE lcl_wa_tmdir-methodname.
*Bereiche lokale Klassenliste
DATA: lcl_it_classlist TYPE STANDARD TABLE OF classlist,
lcl_wa_classlist LIKE LINE OF lcl_it_classlist.

lcl_class = p_name(30).
lcl_method = p_name+30.
*1.) Suchen des passenden Methodenincludes zu der Methode
**************************************************************
*Suchstring zur Selektion der Trdir aufbauen
CONCATENATE lcl_class '%CM___' INTO lcl_such.
*Alle relevanten Includes aus Trdir lesen
SELECT * FROM trdir INTO TABLE lcl_it_trdir
WHERE name LIKE lcl_such.
*Ueberpruefen, ob die Selektierten Includes den Namenkonventionen
*fuer Methodenincludes entsprechen.
LOOP AT lcl_it_trdir INTO lcl_wa_trdir.
*Wenn Laenge ungleich 35 ist diese Zeile aus interner Tabelle loeschen
*(Methodenincludes haben Laenge 35; normale Includes dürfen nur Laenge
*30 haben).
lcl_laeng = STRLEN( lcl_wa_trdir-name ).
IF lcl_laeng <> 35.
DELETE lcl_it_trdir FROM sy-tabix.
CONTINUE.
ENDIF.
ENDLOOP.
*Tabelle mit forlaufenden Nummern der Methoden selektieren
SELECT * FROM tmdir INTO TABLE lcl_it_tmdir
WHERE classname = lcl_class.
*Sortierung der beiden Tabellen dass sie spaeter gemischt werden
*koennen.
SORT lcl_it_trdir BY name ASCENDING.
SORT lcl_it_tmdir BY methodindx ASCENDING .
*Nur Saetze die einen Index haben sind relevant
DELETE lcl_it_tmdir WHERE methodindx IS INITIAL.
*Anzahl der Saetze ermittlen fuer Schleife zum Mischen.
DESCRIBE TABLE lcl_it_trdir LINES lcl_lines.
*Abmischen der der beiden Tabellen in Gesamttabelle
lcl_zaehler = 1.
DO lcl_lines TIMES.
READ TABLE lcl_it_trdir INDEX lcl_zaehler INTO lcl_wa_trdir.
READ TABLE lcl_it_tmdir INDEX lcl_zaehler INTO lcl_wa_tmdir.
MOVE 'Meth' TO lcl_wa_classlist-typus.
MOVE lcl_wa_trdir-name TO lcl_wa_classlist-inc.
MOVE lcl_wa_tmdir-methodname TO lcl_wa_classlist-meth.
APPEND lcl_wa_classlist TO lcl_it_classlist.
lcl_zaehler = lcl_zaehler + 1.
ENDDO.
*Die Zeile mit der gesuchten Methode lesen
READ TABLE lcl_it_classlist
WITH KEY meth = lcl_method
INTO lcl_wa_classlist.
*Include herunterladen
CLEAR ok.
PERFORM download_include USING lcl_wa_classlist-inc 'C'
CHANGING ok.
*Download war erfolgreich
IF ok = 'X'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Method'
lcl_wa_classlist-meth
global_main_name.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Methodinclude'
lcl_wa_classlist-inc
lcl_wa_classlist-meth.
ENDIF.

ENDFORM. " trkorr_handle_single_method


*&---------------------------------------------------------------------*
*& Form handle_modis
*&---------------------------------------------------------------------*
* Abfangen der selektierten Modifikationen aus dem
* Selektionsbildschirm zur Auswahl einzelner Objekte.
* Jede selektierte Modifikation wird gesichert.
* Es werden Includes, Funktionsbausteine und Screen unterstuetzt
*----------------------------------------------------------------------*
FORM handle_modis.
*Loakaler Bereich fuer trdir
DATA: lcl_it_trdir LIKE it_trdir,
lcl_wa_trdir LIKE LINE OF lcl_it_trdir.
*Bereich fuer tfdir
DATA: lcl_it_tfdir TYPE STANDARD TABLE OF tfdir,
lcl_wa_tfdir LIKE LINE OF lcl_it_tfdir.
*Includename fuer Funktionsbaustein
DATA: lcl_funcinclude LIKE wa_trdir-name.
*Bereiche fuer smodilog:Modifikationstabelle
DATA: lcl_it_smodilog TYPE STANDARD TABLE OF smodilog,
lcl_wa_smodilog LIKE LINE OF lcl_it_smodilog.
*Bereich fuer d020s: Screeninformationen
DATA: lcl_wa_d020s TYPE d020s.
*Flag, ob Ueberschrift schon geschrieben worden ist
DATA: lcl_header TYPE c.
*Nur auswählen, wenn Modis selektiert sind.
IF NOT ( o_inc IS INITIAL AND o_func IS INITIAL AND o_dynp IS INITIAL ).
global_main_name = 'Modification'.
*Initialisieren der Stueckliste
REFRESH it_prog_stueckliste.
*Sicherung Verzeichnis
IF ( new_dir IS INITIAL ).
root = dir.
ELSE.
root = new_dir.
ENDIF.
*Verabeitung Selektion der modfizierten Includes
IF NOT ( o_inc IS INITIAL ).
*Selektion abfangen
SELECT * FROM trdir INTO TABLE lcl_it_trdir
WHERE name IN o_inc
AND name NOT LIKE 'Z%'
AND name NOT LIKE 'Y%'
AND name NOT LIKE g_name.
*Wenn keine Werte gefunden Info-Melungen anzeigen
IF lcl_it_trdir IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable Selection' 'for modificated Includes! '
'Please check your selelction. '
'The program will process your other selections.'.
ELSE.
*Wenn noch nicht geschrieben Ueberschrift schreiben
IF lcl_header IS INITIAL.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' 'Modifications:'.
* Flag setzen
lcl_header = 'X'.
ENDIF.

*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm


PERFORM create_directory USING global_main_name
'M'.
LOOP AT lcl_it_trdir INTO lcl_wa_trdir.
* Include herunterladen
CLEAR ok.
PERFORM download_include USING lcl_wa_trdir-name 'I'
CHANGING ok.
* Download war erfolgreich
IF ok = 'X'.
* Stueckliste schreiben
PERFORM write_stueckliste USING 'Include(Modi)'
lcl_wa_trdir-name
global_main_name.
ENDIF.
* Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'Include(Modi)'
lcl_wa_trdir-name
p_logic.
ENDIF. "logiche Entwicklung ???
ENDLOOP. "selektierte Einträge
ENDIF. "gueltige Selektion
ENDIF. "Includes

*Verarbeitung der modifizierten Funktionsbausteine


IF NOT ( o_func IS INITIAL ) .
SELECT * FROM tfdir INTO TABLE lcl_it_tfdir
WHERE funcname IN o_func
AND funcname NOT LIKE 'Z%'
AND funcname NOT LIKE 'Y%'
AND funcname NOT LIKE g_name.
*Wenn keine Werte gefunden Info-Melungen anzeigen
IF lcl_it_tfdir IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for modificated '
'Functiionmodules! Please check your selection. '
'The program will process your other selections.'.
ELSE.
*Wenn noch nicht geschrieben Ueberschrift schreiben
IF lcl_header IS INITIAL.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' 'Modifications:'.
* Flag setzen
lcl_header = 'X'.
ENDIF.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING global_main_name
'M'.

LOOP AT lcl_it_tfdir INTO lcl_wa_tfdir.


CONCATENATE lcl_wa_tfdir-pname+3 'U' lcl_wa_tfdir-include
INTO lcl_funcinclude.
* Include herunterladen
CLEAR ok.
PERFORM download_include USING lcl_funcinclude 'I'
CHANGING ok.
* Download war erfolgreich
IF ok = 'X'.
* Stueckliste schreiben
PERFORM write_stueckliste USING 'Functionmodule(Modi)'
lcl_wa_tfdir-funcname
global_main_name.
PERFORM write_stueckliste USING 'Functioninclude(Modi)'
lcl_funcinclude
lcl_wa_tfdir-funcname.

ENDIF. "Donwload erfolgreich


* Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'Functionmodule(Modi)'
lcl_wa_tfdir-funcname
p_logic.
ENDIF.
ENDLOOP.
ENDIF. "gültige Selektion FB's
ENDIF. "Funktionsbausteine
IF NOT ( o_dynp IS INITIAL ).
SELECT * FROM smodilog INTO TABLE lcl_it_smodilog
WHERE sub_name IN o_dynp.
SORT lcl_it_smodilog.
* Duplikate loeschen
DELETE ADJACENT DUPLICATES FROM lcl_it_smodilog
COMPARING obj_name sub_name.
*Wenn keine Werte gefunden Info-Melungen anzeigen
IF lcl_it_smodilog IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for modificated '
'Screens! Please check your selection. '
'The program will process your other selections.'.
ELSE.
*Wenn noch nicht geschrieben Ueberschrift schreiben
IF lcl_header IS INITIAL.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' 'Modifications:'.
* Flag setzen
lcl_header = 'X'.
ENDIF.

*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm


*Kein Handling wenn bereits angelegt wegen
PERFORM create_directory USING global_main_name
'M'.

LOOP AT lcl_it_smodilog INTO lcl_wa_smodilog.


SELECT SINGLE prog dnum FROM d020s INTO lcl_wa_d020s
WHERE prog = lcl_wa_smodilog-sub_name(40)
AND dnum = lcl_wa_smodilog-sub_name+40.
PERFORM download_dynpro USING lcl_wa_d020s.
* Stueckliste schreiben
PERFORM write_stueckliste USING 'Dynpro(Modi)'
lcl_wa_smodilog-sub_name
global_main_name.
* Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'Screen(Modi)'
lcl_wa_smodilog-sub_name
p_logic.
ENDIF.
ENDLOOP.
ENDIF. "gültige Selektion?
ENDIF."Screeen ausgewählt?
*Stueckliste sichern
IF NOT ( it_prog_stueckliste IS INITIAL ).
*Trennung von Einzeldateiobjekten
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM download_stueckliste.
*HP-Stand sichern
PERFORM download_hpstand.
*Leerzeile nach Ende dieser Verarbeitung
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
ENDIF.
*Ruecksicherung des Verzeichnisse
new_dir = root.
ENDIF. "Gesamtfleder
ENDFORM. " handle_modis
*&---------------------------------------------------------------------*
*& Form write_global_save
*&---------------------------------------------------------------------*
* Schreiben der globalen Tabelle fuer Rahmenprogramme, die
* später verarbeitet werden.
*----------------------------------------------------------------------*
FORM write_global_save USING p_typus TYPE c
p_name TYPE c.
MOVE p_typus TO wa_global_save-type.
MOVE p_name TO wa_global_save-name.
APPEND wa_global_save TO it_global_save.
ENDFORM. " write_global_save
*&---------------------------------------------------------------------*
*& Form handle_externalprogs
*&---------------------------------------------------------------------*
* Abarbeitung der Tabelle mit den Rahmenprogrammen, die
* spaeter abgearbeitet werden. Je nach Typ des Rahmenprogramms
* werden die entsprechenden Verarbeitungsroutinen abgearbeitet.
*----------------------------------------------------------------------*
FORM handle_externalprogs.
*Flag fuer extern Verarbeitung setzen
extern = 'X'.
*Duplikate loeschen
SORT it_global_save.
DELETE ADJACENT DUPLICATES FROM it_global_save COMPARING ALL FIELDS.
*solange ein eintrag drin ist diesen lesen; und danach loeschen
WHILE NOT ( it_global_save IS INITIAL ).
CLEAR wa_global_save.
READ TABLE it_global_save INDEX 1 INTO wa_global_save.
*Ueberpruefen, ob schon gespeichert als Oberprogramm
READ TABLE it_obj_list WITH KEY name = wa_global_save-name
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
*globale Tabellen Initialisieren
PERFORM initialize.
**Globalen Namen fuellen
global_main_name = wa_global_save-name.
*Verzeichnis sichern:
root = dir.
dir = new_dir.
IF wa_global_save-type = '1'.
PERFORM handle_extprog_report USING wa_global_save.
ELSEIF wa_global_save-type = 'F'.
PERFORM handle_extprog_fkgrp USING wa_global_save.
ELSEIF wa_global_save-type = 'C'.
PERFORM handle_class_extern USING wa_global_save-name.
ELSEIF wa_global_save-type = 'I'.
PERFORM handle_interface_extern USING wa_global_save.
ENDIF.
*Verzeichnis zurücksichern
new_dir = dir.
dir = root.
ENDIF. "Bereits gesichert
*Dieses Rahmenprogramm loeschen; Stack
DELETE it_global_save INDEX 1.
ENDWHILE.
*Flag fuer externe Verarbeitung ausschalten
CLEAR extern.
ENDFORM. " handle_externalprogs
*&---------------------------------------------------------------------*
*& Form handle_extprog_report
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* Verarbeitung der Reports/Modulpools, die zu spaeteren Zeitpunkt
* verarbeitet werden. (siehe auch Routine handle_reps_mods)
*----------------------------------------------------------------------*
FORM handle_extprog_report USING p_wa_global_save LIKE wa_global_save.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
*Globalen Namen setzen
lcl_name = global_main_name.
global_main_name = p_wa_global_save-name.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING p_wa_global_save-name
'R'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.

**********Ausfuehren des Programmdownloads


*Ueberschrift zusammenbauen
CONCATENATE 'Report/Modulpool:' p_wa_global_save-name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************
*Rahmenprogramm herunterladen
CLEAR ok.
PERFORM download_include USING p_wa_global_save-name 'R'
CHANGING ok.
*Download war erfolgreich
IF ok = 'X'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Report/Modulpool'
p_wa_global_save-name
''.
ENDIF.
*Textelemente des Rahmenprogramms herunterladen
PERFORM download_textelements USING p_wa_global_save-name
'R'.
*Stueckliste wird in 'download_textelements' geschrieben
*Echter Screen des Rahmenprogramms herunterladen
PERFORM handle_screens USING p_wa_global_save-name
'R'.
*pf-Stati verarbeiten
PERFORM handle_pf_status USING p_wa_global_save-name
'R'.
*Titlebars suchen
PERFORM handle_titlebar USING p_wa_global_save-name
'R'.
*eventueller Transaktionscode zu Rahmenprogramm
PERFORM handle_tacode USING p_wa_global_save-name.
*Normale Includes des Rahmenprogramms herunterladen
PERFORM handle_normal_includes USING p_wa_global_save-name.

*Klassen und Interface behandeln


PERFORM handle_classinterface USING p_wa_global_save-name
'R'.
*Tabellen/Strukturen herunterladen
PERFORM handle_ddic USING p_wa_global_save-name
'R' .

*Externe Programmaufrufe, Funktionsbausteine und Messages


*des Rahmenprogramms behandeln.
PERFORM handle_extprog USING global_main_name.

*Aktivitäten die sich auf gesamtes Rahmenprogramm beziehen


* ULINE. "Listausgabeformatierung
PERFORM write_protocol USING 'L' '' '' ''.
*Domaenen downloaden
PERFORM download_domains.
*Datenelementliste downloaden
PERFORM download_dataelements.
*Berechtigungsobjekt Infos downloaden
PERFORM download_authorityobjects.
*Titlebars herunterladen
PERFORM download_titlebar.
*Meldungen herunterladen
PERFORM download_messages.
*Gesamtliste der Transaktionscodes herunterladen
PERFORM download_tacodelist.
*Gesamtliste mit Dialogbaustein->Funktionsbausteinzuordnung
*herunterladen und Gesamtliste mit Dialogpoolparametern herunterladen.
PERFORM download_dialogmodule_elements.
*Gesamtliste der Parameter herunterschreiben
PERFORM download_setgetparams.
*Gesamtstückliste
PERFORM download_stueckliste.
*HP-Stand sichern
PERFORM download_hpstand.
* SKIP. "Listausgabeformatierung
PERFORM write_protocol USING 'S' '' '' ''.
*globalen Namen setzen
global_main_name = lcl_name.
ENDFORM. " handle_extprog_report
*&---------------------------------------------------------------------*
*& Form handle_extprog_fkgrp
*&---------------------------------------------------------------------*
* Verarbeitung der Funktionsgruppen, die zu einem spaeteren
* Zeitpunkt verarbeitet werden. (siehe auch Routine
* handle_functiongroup)
*----------------------------------------------------------------------*
FORM handle_extprog_fkgrp USING p_wa_global_save LIKE wa_global_save.

*Ueberschrift zusammenbauen
CONCATENATE 'Functiongroup:' p_wa_global_save-name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING p_wa_global_save-name
'F'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*Stuecklisteneintrag fuer diese Funktionsgruppe.
PERFORM write_stueckliste USING 'Functiongroup'
p_wa_global_save-name
''.
*1.) Funktionsgruppe herunterladen
PERFORM download_functiongroup USING p_wa_global_save-name.
*2) Externe Verweise herunterladen
PERFORM handle_extprog USING p_wa_global_save-name.
*Aktivitäten die sich auf gesamtes Rahmenprogramm beziehen
* ULINE. "Listausgabeformatierung
PERFORM write_protocol USING 'L' '' '' ''.
*Domaenen downloaden
PERFORM download_domains.
*Datenelementliste downloaden
PERFORM download_dataelements.
*Berechtigungsobjekt Infos downloaden
PERFORM download_authorityobjects.
*Titlebars herunterladen
PERFORM download_titlebar.
*Meldungen herunterladen
PERFORM download_messages.
*Gesamtliste der Transaktionscodes herunterladen
PERFORM download_tacodelist.
*Gesamtliste der Parameter herunterschreiben
PERFORM download_setgetparams.
*Gesamtstückliste
PERFORM download_stueckliste.
*HP-Stand sichern
PERFORM download_hpstand.
PERFORM write_protocol USING 'S' '' '' ''.

ENDFORM. " handle_extprog_fkgrp


*&---------------------------------------------------------------------*
*& Form get_performs_from_include
*&---------------------------------------------------------------------*
* Ermittelt die Aufgerufenen Formroutinen des im Parameter
* P_INC übermittelten Includes. Die Tabelle der Formroutinen
* wird an den Aufrufer zurueckgegeben (p_it_performs).
*----------------------------------------------------------------------*
FORM get_performs_from_include USING p_inc LIKE wa_trdir-name
CHANGING p_it_performs TYPE performtab.
*ABAP-Sourcentabelle
DATA: lcl_abap TYPE STANDARD TABLE OF abaptxt255. "abapsource .
*Tabelle mit zu durschsuchende Schluesselwörtern
DATA: BEGIN OF lcl_it_keys OCCURS 15,
keywords(30),
END OF lcl_it_keys.
*Token-Bereich fuer scan abap
DATA: lcl_it_token TYPE STANDARD TABLE OF stoken.
DATA: lcl_wa_token LIKE LINE OF lcl_it_token.
*Statement-Tabelle fuer abap scan
DATA: lcl_it_statements TYPE STANDARD TABLE OF sstmnt.
DATA: lcl_index TYPE i.
APPEND 'PERFORM' TO lcl_it_keys.

READ REPORT p_inc INTO lcl_abap.


SCAN ABAP-SOURCE downtab KEYWORDS FROM lcl_it_keys
TOKENS INTO lcl_it_token
STATEMENTS INTO lcl_it_statements.
LOOP AT lcl_it_token INTO lcl_wa_token.
IF lcl_wa_token-str = 'PERFORM'.
lcl_index = sy-tabix + 1.
READ TABLE lcl_it_token INDEX lcl_index INTO lcl_wa_token.
APPEND lcl_wa_token-str TO p_it_performs.
ENDIF.
ENDLOOP.
SORT p_it_performs.
*Duplikate loeschen
DELETE ADJACENT DUPLICATES FROM p_it_performs COMPARING ALL FIELDS.

ENDFORM. " get_performs_from_include


*&---------------------------------------------------------------------*
*& Form get_includes_of_forms
*&---------------------------------------------------------------------*
* Ermittelt aus der uebergebenen Tabelle der aufgerufenen
* (Parameter P_IT_FORMS) Form-Routinen die
* Includes in denen die Routinen stehen.
*----------------------------------------------------------------------*
FORM get_includes_of_forms
USING p_it_forms TYPE performtab
p_inc LIKE wa_trdir-name
CHANGING p_it_includes TYPE includetab.
*Arbeitsbereich fuer Forms
DATA: lcl_wa_forms TYPE string.
*Variable fuer Inclde in dem include steht
DATA: lcl_wa_includes TYPE include.
*Dummytabellen zum Aufruf des Funktionsbausteins
DATA: lcl_it_source TYPE STANDARD TABLE OF abaptxt255, "abapsource
lcl_it_form TYPE STANDARD TABLE OF abaptxt255. "abapsource .
DATA: lcl_objectname TYPE string,
lcl_objecttype TYPE string,
lcl_program TYPE string,
lcl_operation TYPE string.
LOOP AT p_it_forms INTO lcl_wa_forms.
CLEAR lcl_wa_includes.

CALL FUNCTION 'RS_SEARCH_FORM'


EXPORTING
i_incl = p_inc
i_objectname = lcl_wa_forms
IMPORTING
o_incl = lcl_wa_includes
o_objectname = lcl_objectname
o_objecttype = lcl_objecttype
o_program = lcl_program
o_operation = lcl_operation
TABLES
i_source = lcl_it_source
o_form_tab = lcl_it_form.
APPEND lcl_wa_includes TO p_it_includes.
ENDLOOP.
SORT p_it_includes.
*Duplikate loeschen
DELETE ADJACENT DUPLICATES FROM p_it_includes COMPARING ALL FIELDS.
ENDFORM. " get_includes_of_forms
*&---------------------------------------------------------------------*
*& Form handle_reps_mods
*&---------------------------------------------------------------------*
* Verarbeitungsroutine fuer einen Report/Modulpool der im
* Parameter P_NAME uebergebene wird. Die unterstuetzten
* Objekte werden in das Filesystem gesichert.
*----------------------------------------------------------------------*
FORM handle_reps_mods USING p_name TYPE trdir-name.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.

*Globales Namensfeld füllen


global_main_name = p_name.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING p_name
'R'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'Report/Modulpool:' global_main_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************
*Intitialisieren der globalen Tabellen
PERFORM initialize.

**Die folgenden Elemente nur behandeln wenn das Rahmengprogramm


**im Kundennamensraum liegt.
* IF ( ( p_name(1) = 'Z' ) OR ( p_name(1) = 'Y' ) ).

*Rahmenprogramm herunterladen
CLEAR ok.
PERFORM download_include USING p_name 'R'
CHANGING ok.
*Download war erfolgreich
IF ok = 'X'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Report/Modulpool'
p_name
''.
ENDIF.
*Textelemente des Rahmenprogramms herunterladen
PERFORM download_textelements USING p_name
'R'.
*Stueckliste wird in 'download_textelements' geschrieben
*Echter Screen des Rahmenprogramms herunterladen
PERFORM handle_screens USING p_name
'R'.
*pf-Stati verarbeiten
PERFORM handle_pf_status USING p_name
'R'.
*Titlebars suchen
PERFORM handle_titlebar USING p_name
'R'.
*eventueller Transaktionscode zu Rahmenprogramm
PERFORM handle_tacode USING p_name.
* ENDIF.
*Normale Includes des Rahmenprogramms herunterladen
PERFORM handle_normal_includes USING p_name.

*Klassen und Interface behandeln


PERFORM handle_classinterface USING p_name
'R'.
*Tabellen/Strukturen herunterladen
PERFORM handle_ddic USING p_name
'R' .
*Externe Programmaufrufe, Funktionsbausteine und Messages
*des Rahmenprogramms behandeln.
PERFORM handle_extprog USING p_name.

*Aktivitäten die sich auf gesamtes Rahmenprogramm beziehen


* ULINE. "Listausgabeformatierung
PERFORM write_protocol USING 'L' '' '' ''.
*Domaenen downloaden
PERFORM download_domains.
*Datenelementliste downloaden
PERFORM download_dataelements.
*Berechtigungsobjekt Infos downloaden
PERFORM download_authorityobjects.
*Titlebars herunterladen
PERFORM download_titlebar.
*Meldungen herunterladen
PERFORM download_messages.
*Gesamtliste der Transaktionscodes herunterladen
PERFORM download_tacodelist.
*Gesamtliste mit Dialogbaustein->Funktionsbausteinzuordnung
*herunterladen und Gesamtliste mit Dialogpoolparametern herunterladen.
PERFORM download_dialogmodule_elements.
*Gesamtliste der Parameter herunterschreiben
PERFORM download_setgetparams.
*Gesamtstückliste
PERFORM download_stueckliste.
PERFORM download_hpstand.
* SKIP. "Listausgabeformatierung
PERFORM write_protocol USING 'S' '' '' ''.
*Externe Rahmenprogrammaufrufe nicht behandeln wenn
*Aufruf aus Transportauftrag
IF p_trkorr IS INITIAL.
* Verarbeitung der extern aufgerufenen Programme
* Globalen Namen setzen
lcl_name = global_main_name.
PERFORM initialize.
* Die Liste der extern aufgerufenen Rahmenprogramme abarbeieten
PERFORM handle_externalprogs.
* globalen Namen setzen
global_main_name = lcl_name.
ENDIF.
ENDFORM. " handle_reps_mods
*&---------------------------------------------------------------------*
*& Form handle_functiongroup
*&---------------------------------------------------------------------*
* Verarbeitungsroutine fuer eine Funktionsgruppe die im
* Parameter P_NAME uebergebene wird. Die unterstuetzten
* Objekte werden in das Filesystem gesichert.
*----------------------------------------------------------------------*
FORM handle_functiongroup USING p_name TYPE trdir-name.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING p_name
'F'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'Functiongroup:' global_main_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************
*Intitialisieren der globalen Tabellen
PERFORM initialize.
*Stuecklisteneintrag fuer diese Funktionsgruppe.
PERFORM write_stueckliste USING 'Functiongroup'
global_main_name
''.
*1.) Funktionsgruppe herunterladen
PERFORM download_functiongroup USING p_name .
*2) Externe Verweise herunterladen
PERFORM handle_extprog USING p_name.
*Aktivitäten die sich auf gesamtes Rahmenprogramm beziehen
* ULINE. "Listausgabeformatierung
PERFORM write_protocol USING 'L' '' '' ''.
*Domaenen downloaden
PERFORM download_domains.
*Datenelementliste downloaden
PERFORM download_dataelements.
*Berechtigungsobjekt Infos downloaden
PERFORM download_authorityobjects.
*Titlebars herunterladen
PERFORM download_titlebar.
*Meldungen herunterladen
PERFORM download_messages.
*Gesamtliste der Transaktionscodes herunterladen
PERFORM download_tacodelist.
*Gesamtliste der Parameter herunterschreiben
PERFORM download_setgetparams.
*Gesamtstückliste
PERFORM download_stueckliste.
* Hotpackagestand sichern
* if ( p_logic is initial ).
PERFORM download_hpstand.
* endif.
* SKIP. "Listausgabeformatierung
PERFORM write_protocol USING 'S' '' '' ''.
*Externe Rahmenprogrammaufrufe nicht behandeln wenn
*Aufruf aus Transportauftrag
IF p_trkorr IS INITIAL.
* 3.)Die Liste der extern aufgerufenen Rahmenprogramme abarbeieten
* Globalen Namen setzen
lcl_name = global_main_name.
PERFORM initialize.
* Die Liste der extern aufgerufenen Rahmenprogramme abarbeieten
PERFORM handle_externalprogs.
* globalen Namen setzen
global_main_name = lcl_name.
ENDIF.

ENDFORM. " handle_functiongroup


*&---------------------------------------------------------------------*
*& Form handle_interface
*&---------------------------------------------------------------------*
* Verarbeitungsroutine fuer ein Interface das im
* Parameter P_NAME uebergeben wird. Die beiden Includes
* des Interfaces werdengesichert.
*----------------------------------------------------------------------*
FORM handle_interface USING p_name TYPE c.
*Variable fuer Sicherung des Verzeichnisnamens
* DATA: lcl_name TYPE rlgrap-filename.
DATA: lcl_name TYPE string.
*Intitialisieren der globalen Tabellen
PERFORM initialize.
* ULINE. "Listausgabeformatierung
PERFORM write_protocol USING 'L' '' '' ''.
*Globales Feld fuellen, da oft verwendet
CLEAR wa_trdir.
global_main_name = p_name.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING p_name
'I'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'Interface:' global_main_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
*Rootverzeichnis sichern
root = dir.
*Oberster Knoten der Stueckliste
PERFORM write_stueckliste USING 'Interface(OO)'
p_name
''.
*Eigentlicher Download durchfuehren
PERFORM download_interface USING p_name.
*Trennung von Einzeldateiobjekten
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
*Gesamtstückliste
PERFORM download_stueckliste.
* Verarbeitung der extern aufgerufenen Programme
* Globalen Namen setzen
lcl_name = global_main_name.
*Initialisierung der globalen Tabellen
PERFORM initialize.
* Die Liste der extern aufgerufenen Rahmenprogramme abarbeieten
PERFORM handle_externalprogs.
* globalen Namen setzen
global_main_name = lcl_name.

* SKIP. "Listausgabeformatierung
PERFORM write_protocol USING 'S' '' '' ''.
*Rootverzeichnis wiederherstellen
dir = root.
ENDFORM. " handle_interface
*&---------------------------------------------------------------------*
*& Form handle_IDoc
*&---------------------------------------------------------------------*
* Verarbeitungsroutine fuer IDOC. Der Name des IDocs wird im
* Parameter P_NAME. Der IDoc-Typ (BAsis oder Erweiterung) wird
* im Parameter P_Typus uebergeben.
*----------------------------------------------------------------------*
FORM handle_idoc USING p_name TYPE c
p_typus TYPE c.
*Variable zur Bestimmung des Typs des IDocs (Basis oder Erweiterung)
*fuer Funktionsbaustein der ueberprueft, ob Eingabe richtig war
DATA: lcl_typus(3) TYPE c.
*Variable fuer Objekttyp (benoetigt Html-Konverter, Funktionsbaustein)
DATA: lcl_objtype TYPE ledid_struct_type.
*Variable wegen Typkonformitaet fuer Existenzpruefung Erweiterung
DATA: lcl_exist_enh TYPE edi_iapi00-cimtyp.
*Variable fuer Typkonformitaet fuer Existenzpruefung IDOC
DATA: lcl_exit_idoc TYPE edi_iapi00-idoctyp.
*Variable fuer Aufruf der HTML-Generierung
DATA: lcl_htmlname TYPE edi_iapi00-idoctyp.
*Variable fuer Option zur Verzeichnisanlage (Name)
*Typ festlegen
IF p_typus = 'B'. "Basisobjekt
lcl_typus = 'ORG'.
lcl_objtype = 'B'.
lcl_exit_idoc = p_name.
lcl_htmlname = p_name.
ELSEIF p_typus = 'E'.
lcl_typus = 'EXT'. "Erweiterung
lcl_objtype = 'E'.
lcl_exist_enh = p_name.
lcl_htmlname = p_name.
ENDIF.
****************
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING p_name
lcl_typus.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
IF p_typus = 'B'. "Basisidoc
*Ueberschrift zusammenbauen
CONCATENATE 'BasisIDoc:' p_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
*Ueberpruefung, ob eine Erweiterung ein Basisobjekt vorliegt
CALL FUNCTION 'IDOCTYPE_EXISTENCE_CHECK'
EXPORTING
pi_idoctyp = lcl_exit_idoc
* PI_READ_DEVC = 'X'
* IMPORTING
* PE_ATTRIBUTES =
EXCEPTIONS
object_not_found = 1
db_error = 2
OTHERS = 3
.
IF sy-subrc <> 0.
EXIT.
ENDIF.
ELSE. "Es liegt Erweiterung vor
*Ueberschrift zusammenbauen
CONCATENATE 'IDocEnhancement:' p_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
CALL FUNCTION 'EXTTYPE_EXISTENCE_CHECK'
EXPORTING
pi_cimtyp = lcl_exist_enh
* PI_READ_DEVC = 'X'
* IMPORTING
* PE_ATTRIBUTES =
EXCEPTIONS
object_not_found = 1
db_error = 2
OTHERS = 3
.
IF sy-subrc <> 0.
EXIT.
ENDIF.
ENDIF. "Basisidoc oder Erweiterung
*Wenn Coding bishierher durchlaufen wurde existiert das IDoc/Erweiterung
*Der HTML-Download kann durchgeführt werden.
*Aufruf des abgeaenderten Codings des Funktionsbausteins
*'IDOC_TYPE_GENERATE_HTML'....
PERFORM handle_html_generator USING lcl_objtype
lcl_htmlname
sy-saprl
'3'.
ENDFORM. " handle_IDoc
*&---------------------------------------------------------------------*
*& Form handle_customerenhancement
*&---------------------------------------------------------------------*
* Verarbeitungsroutine fuer ein Erweiterungsprojekt das im
* Parameter P_NAME uebergeben wird. Die unterstuetzten
* Objekte werden in das Filesystem gesichert.
*----------------------------------------------------------------------*
FORM handle_customerenhancement USING p_name TYPE c.
*Lokaler Datenbereich fuer TAbelle modact (Zuordnung von
*SAP-Erweiterungen zu Kundenerweiterungsprojekten
DATA: lcl_it_modact TYPE STANDARD TABLE OF modact,
lcl_wa_modact LIKE LINE OF lcl_it_modact.
*Lokale Variabel fuer Includename
DATA: lcl_zinc LIKE c_includename.
*Lokale Variable fuer Funktionsgruppennamen, Nummer des FB-Bausteins
DATA: lcl_wa_tfdir TYPE tfdir.
*Lokaler Datenbereich fuer Tabelle modsap (Zuordnung der
*Komponenten zu SAP-Erweiterung.
DATA: lcl_it_modsap TYPE STANDARD TABLE OF modsap,
lcl_wa_modsap LIKE LINE OF lcl_it_modsap.
*Lokale Variablen fuer Funtkionsgruppenmemory
DATA: lcl_it_memory TYPE STANDARD TABLE OF tfdir-pname,
lcl_wa_memory LIKE LINE OF lcl_it_memory.
*Variable fuer die Laenge einer Zeichenkette
DATA: lcl_len TYPE i.
*Selektionsvariablen fuer die Funktionsgruppenverarbeitung
DATA: lcl_negativ LIKE c_includename.
*Lokaler Datenbereich fuer abhaengige Includes
DATA: lcl_it_d010inc TYPE STANDARD TABLE OF d010inc,
lcl_wa_d010inc LIKE LINE OF lcl_it_d010inc.
*Lokaler Datenbereich fuer Screens
DATA: lcl_wa_d020s TYPE d020s.
*3 Lokale Variablen fuer split des Customer Subscreenstrings
DATA: lcl_dummysplit1 TYPE string,
lcl_dummysplit2 TYPE string,
lcl_datasplit TYPE string.
*Variabel fuer Funktionsgruppe
DATA: lcl_fktgroup TYPE tfdir-pname.
*Variable fuer Dynpronummer
DATA: lcl_dynpnr(4) TYPE c.
*Variable fuer Sreenidentifizierer
DATA: lcl_dynpname TYPE string.
*Dummyincludename fuer Typkonformitaet
DATA: lcl_wa_dd02l TYPE dd02l.
*bereich fuer tadir-obj_name
DATA: lcl_tadir_obj TYPE tadir-obj_name.
*Variable fuer Code eines Menueexits
DATA: lcl_menuexitcode TYPE cuatexts-code.
*lokale Bereich fuer Infos zur Menuexits
DATA: lcl_wa_cuatexts LIKE LINE OF it_cuatexts.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
*Tabelle fuer Forms in einem Include
DATA: lcl_it_performs TYPE STANDARD TABLE OF string.
*Tabelle, um temporaer Includename speichern zu koennen
DATA: lcl_it_tempinclude TYPE STANDARD TABLE OF include.
*Tabelle, um fuer ganzes Enhancement Includename speichern zu koennen
DATA: lcl_it_include TYPE STANDARD TABLE OF include,
lcl_wa_include LIKE LINE OF lcl_it_include.

*SAP-Erweiterungen zu den entsprechenden Kundenprojekten waehlen


*und die Entsprechenden Elemente verarbeiten
*global_main_name fuer globalen Gebrauch aufbereiten
*-->Parametrisierung umgangen
*Globalen Namen setzen
global_main_name = p_name.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING p_name
'E'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'CMOD-Enhnancment:' global_main_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************
*Intitialisieren der globalen Tabellen
PERFORM initialize. REFRESH it_enhancecomp. REFRESH it_cuatexts.

*Stueckliste fuer allgemeine Teile des Enhancements


PERFORM write_stueckliste USING 'Enhancement Project'
p_name
''.

*Zum Erweiterungsprojekt das/die dazugehörige SAP-Projekte waehlen


REFRESH lcl_it_modact.
SELECT * FROM modact INTO TABLE lcl_it_modact
WHERE ( ( name = p_name )
AND ( member NE space ) ).
LOOP AT lcl_it_modact INTO lcl_wa_modact.
*Fuer jedes SAP-Erweiterungsprojekt die dazugehörigen Komponenten
*waehlen.
REFRESH lcl_it_modsap.
SELECT * FROM modsap INTO TABLE lcl_it_modsap
WHERE ( ( name = lcl_wa_modact-member )
AND ( member NE space ) ).
*Bearbeitung der einzelnen Komponenten
LOOP AT lcl_it_modsap INTO lcl_wa_modsap.
*Initialisierungen
REFRESH lcl_it_performs. REFRESH lcl_it_tempinclude.
*Behandlung der Funktionsbausteinexits
IF lcl_wa_modsap-typ = 'E'. "Funktionsbausteinexit
SELECT SINGLE * FROM tfdir INTO lcl_wa_tfdir
WHERE funcname = lcl_wa_modsap-member.
*Funktionsgruppenname in Memorytabelle schreiben, wenn
*dieser dort nicht schon steht.
READ TABLE lcl_it_memory WITH KEY
lcl_wa_tfdir-pname TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
APPEND lcl_wa_tfdir-pname TO lcl_it_memory.
ENDIF.
*Zusammenbauen des Strings des ZIncludes
CLEAR lcl_zinc.
CONCATENATE 'Z' lcl_wa_tfdir-pname+4 'U'
lcl_wa_tfdir-include INTO lcl_zinc.
*Include herunterladen
CLEAR ok.
PERFORM download_include USING lcl_zinc
'E'
CHANGING ok.
IF ok = 'X'. "Download war erfolgreich
*Stueckliste dieser Kundenerweiterung schreiben
PERFORM write_enhancementlist USING lcl_wa_modsap-name
lcl_wa_modsap-member
'Function Exit'
lcl_zinc.
ENDIF. "War Download erfolgreich?
*Exterene Verweise diese Funktionsbausteines/Includes herunterladen
PERFORM handle_extprog_singleinclude USING lcl_zinc.
*Form-Routinen in diesem Include ermitteln
PERFORM get_performs_from_include USING lcl_zinc
CHANGING lcl_it_performs.
IF NOT ( lcl_it_performs IS INITIAL ).
*Includes der Form-Routinen ermitteln
PERFORM get_includes_of_forms
USING lcl_it_performs
lcl_zinc
CHANGING lcl_it_tempinclude.
*Inlcude löschen,wenn es das aufrufende ist
DELETE lcl_it_tempinclude WHERE name = lcl_zinc.
*an Gesamtincludeliste anhängen
APPEND LINES OF lcl_it_tempinclude TO lcl_it_include.
ENDIF.

ELSEIF lcl_wa_modsap-typ = 'S'. "Subscreen


*Zerlegen der Memberzeichenkette (nur der letzte Teil ist relevant)
SPLIT lcl_wa_modsap-member AT '_' INTO lcl_dummysplit1
lcl_dummysplit2 lcl_datasplit.
*Funktionsgruppennamen ('SAPL'...) und Dynpronummer ermitteln
lcl_len = STRLEN( lcl_datasplit ).
lcl_len = lcl_len - 4.
lcl_fktgroup = lcl_datasplit(lcl_len).
lcl_dynpnr = lcl_datasplit+lcl_len.
*passenden Eintrag aus Dynprotabelle d020s ermitteln
SELECT SINGLE * FROM d020s INTO lcl_wa_d020s
WHERE prog = lcl_fktgroup
AND dnum = lcl_dynpnr.
*diesen Screen herunterladen
PERFORM download_dynpro USING lcl_wa_d020s.
*An Memorytabelle fuer Funktionsgruppen anhaengen, wenn noch nicht drin.
READ TABLE lcl_it_memory WITH KEY
lcl_fktgroup TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
APPEND lcl_fktgroup TO lcl_it_memory.
ENDIF.
*Identifikationstring fuer Screen zusammenbauen
CONCATENATE lcl_fktgroup ', screen: ' lcl_dynpnr INTO lcl_dynpname.
*Stueckliste der Kundenerweiterungen schreiben
PERFORM write_enhancementlist USING lcl_wa_modsap-name
lcl_wa_modsap-member
'Dynpro-Exit'
lcl_dynpname.
ELSEIF lcl_wa_modsap-typ = 'C'. "Menueexit
*Zeichenkette aufsplitten
SPLIT lcl_wa_modsap-member AT '+' INTO lcl_dummysplit1
lcl_dummysplit2 lcl_datasplit.
*Menuexit-Code zusammenbauen
CONCATENATE '+' lcl_dummysplit2 INTO lcl_menuexitcode.
*Funktionsgruppennamen holen
lcl_fktgroup = lcl_dummysplit1.
*An Memorytabelle fuer Funktionsgruppen anhaengen, wenn noch nicht drin.
READ TABLE lcl_it_memory WITH KEY
lcl_fktgroup TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
APPEND lcl_fktgroup TO lcl_it_memory.
ENDIF.
*Infos zu diesem Menuexit lesen; nur ein Satz
CLEAR lcl_wa_cuatexts.
LOOP AT it_lan INTO wa_lan.
SELECT SINGLE * FROM cuatexts INTO lcl_wa_cuatexts
WHERE prog = lcl_fktgroup
AND code = lcl_menuexitcode
AND sprsl = wa_lan.
IF sy-subrc = 0.
APPEND lcl_wa_cuatexts TO it_cuatexts.
ENDIF.
ENDLOOP.
*Stueckliste der Kundenerweiterungen schreiben
PERFORM write_enhancementlist USING lcl_wa_modsap-name
lcl_wa_modsap-member
'Menu Exit'
lcl_menuexitcode.

ELSEIF lcl_wa_modsap-typ = 'T'. "Includetabelle


*Ueberpruefen, ob verwendet
SELECT SINGLE obj_name FROM tadir INTO lcl_tadir_obj
WHERE obj_name = lcl_wa_modsap-member.
IF sy-subrc = 0.
*Umkopieren wegen Typkonformitaet
lcl_wa_dd02l-tabname = lcl_wa_modsap-member.
PERFORM download_table USING lcl_wa_dd02l 'S'.
*Stueckliste der Kundenerweiterungen schreiben
PERFORM write_enhancementlist USING lcl_wa_modsap-name
lcl_wa_modsap-member
'Customizing Include'
lcl_wa_modsap-member.
ENDIF. "Includetabelle aktiv
ENDIF. "Typ des Customerextits
ENDLOOP. "Komponenten der SAP-Erweiterungen
ENDLOOP. "Sap-Erweiterungen in Kundenerweiterungen
*Sichern der Includes mit benutzten Formroutinen
SORT lcl_it_include.
DELETE ADJACENT DUPLICATES FROM lcl_it_include COMPARING ALL FIELDS.
LOOP AT lcl_it_include INTO lcl_wa_include.
*Include herunterladen
CLEAR ok.
PERFORM download_include USING lcl_wa_include-name
'E'
CHANGING ok.
IF ok = 'X'. "Download war erfolgreich
*Stueckliste dieser Kundenerweiterung schreiben
PERFORM write_enhancementlist USING lcl_wa_modsap-name
''
'Form Include'
lcl_wa_include-name.
ENDIF. "War Download erfolgreich?
ENDLOOP.
*Herunterladen der kundeneigene DDic-Elemente, und Klassen,
*der im Projekt verwendeten Funktionsgruppen
*-->geht zur Zeit nur auf Ebenen einer Funktionsgruppe
LOOP AT lcl_it_memory INTO lcl_wa_memory.
*Tabellen und Strukturen herunterladen
PERFORM handle_ddic USING lcl_wa_memory
'R'.
*Klassen und Interface behandeln
PERFORM handle_classinterface USING lcl_wa_memory
'R'.
ENDLOOP.
*Stueckliste dieser Kundenerweiterung schreiben
IF NOT ( it_enh_d010tab IS INITIAL ).
LOOP AT it_enh_d010tab INTO wa_enh_d010tab.
PERFORM write_enhancementlist USING lcl_wa_modsap-name
''
wa_enh_d010tab-typus
wa_enh_d010tab-tabname.
ENDLOOP.
ENDIF.

*********************************************************
*Taetigkeiten die sich auf gesamtes Cmod-Projekt beziehen
* ULINE. "Listausgabeformatierung
PERFORM write_protocol USING 'L' '' '' ''.
*Herunterladen der Menuexitcodeliste
PERFORM download_menuexitcodelist USING p_name.
*Herunterladen der Gesamttabelle
PERFORM download_enhancementtab USING p_name.
*Domaenen downloaden
PERFORM download_domains.
**Datenelementliste downloaden
PERFORM download_dataelements.
**Berechtigungsobjekt Infos downloaden
PERFORM download_authorityobjects.
**Meldungen herunterladen
PERFORM download_messages.
**Gesamtliste der Transaktionscodes herunterladen
PERFORM download_tacodelist.
**Gesamtliste mit Dialogbaustein->Funktionsbausteinzuordnung
**herunterladen und Gesamtliste mit Dialogpoolparametern herunterladen.
PERFORM download_dialogmodule_elements.
**Gesamtliste der Parameter herunterschreiben
PERFORM download_setgetparams.
**Gesamtstückliste:
PERFORM download_stueckliste.
*Hotpackagestand sichern
PERFORM download_hpstand.
*Leerzeile nach Ende dieser Verarbeitung
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
*Externe Rahmenprogrammaufrufe nicht behandeln wenn
*Aufruf aus Transportauftrag
IF p_trkorr IS INITIAL.
* Die Liste der extern aufgerufenen Rahmenprogramme abarbeieten
lcl_name = global_main_name.
PERFORM initialize.
* Die Liste der extern aufgerufenen Rahmenprogramme abarbeieten
PERFORM handle_externalprogs.
* globalen Namen setzen
global_main_name = lcl_name.
ENDIF.
ENDFORM. " handle_customerenhancement
*&---------------------------------------------------------------------*
*& Form prepare_for_logical_dev
*&---------------------------------------------------------------------*
* Bei Angabe einer Bezeichnung fuer eine Logische Entwicklung
* wird das Programm fuer dies Verarbeitung hier vorbereitet.
*----------------------------------------------------------------------*
FORM prepare_for_logical_dev.
*Ueberschrift zusammenbauen
CONCATENATE 'Logical Development:' p_logic INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************
*Verzeichnis fuer die logische Entwicklung schaffen
PERFORM create_directory USING p_logic
'L'.
*Haupverzeichnis fuer die gesamte weitere Verarbeitung aender
dir = new_dir.
*Stuecklistenanfang schreiben
PERFORM write_log_stueckliste USING 'Logical Development'
p_logic
''.
ENDFORM. " prepare_for_logical_dev
*&---------------------------------------------------------------------*
*& Form write_log_stueckliste
*&---------------------------------------------------------------------*
* Schreiben der Logischen Stueckliste
*----------------------------------------------------------------------*
FORM write_log_stueckliste USING p_type TYPE any
p_name TYPE any
p_obername TYPE any.
wa_log_stueckliste-type = p_type.
wa_log_stueckliste-name = p_name.
wa_log_stueckliste-obername = p_obername.
wa_log_stueckliste-instnr = instnr.
APPEND wa_log_stueckliste TO it_log_stueckliste.
ENDFORM. " write_log_stueckliste
*&---------------------------------------------------------------------*
*& Form CREATE_HTMLTAB_FOR_TEXTELEMENT
*&---------------------------------------------------------------------*
* Aufbereitung der im Parameter P_IT_TEXTELEMENTS uebergebenen
* Textelemente in einer HTML-Datei.
*----------------------------------------------------------------------*
FORM create_htmltab_for_textelement
USING p_it_textelements LIKE it_textpool.
*Variable fuer Kopfzeilen
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabellen
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string,
lcl_wa_headerrow LIKE LINE OF lcl_it_headerrow.
*Arbeitsbereich fuer Textelemente
DATA: lcl_wa_textelements TYPE textpool.

*Headertabelle zusammenbauen
APPEND 'Textelement Key' TO lcl_it_headerrow.
APPEND 'Text of Textelement' TO lcl_it_headerrow.
*Gesamtuebershcrift zusammenbauen
CONCATENATE '<h1>' 'Textelements of ' global_main_name '</h1>'
INTO lcl_header SEPARATED BY space.
REFRESH it_html.
*Anfang HTML-Dokument schreiben
APPEND '<HTML>' TO it_html.
APPEND '<head>' TO it_html.
APPEND '<LINK REL="STYLESHEET" TYPE="text/css" HREF="formate.css"/>'
TO it_html.
APPEND '</head>' TO it_html.
APPEND '<body>' TO it_html.
*Gesamtueberschrift schreiben
APPEND lcl_header TO it_html.
APPEND '<br><br>' TO it_html.
*Reporttitel schreiben
READ TABLE p_it_textelements WITH KEY id = 'R'
INTO lcl_wa_textelements.
IF sy-subrc = 0.
CONCATENATE '<h2>' 'Report Title:' lcl_wa_textelements-entry
'</h2>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
ENDIF.
APPEND '<br><br>' TO it_html.
CLEAR lcl_wa_textelements.
*1.) Tabelle fuer Selektionsparameter zusammenbauen
*ueberschrift
*Existieren Selektionstexte
READ TABLE p_it_textelements WITH KEY id = 'S'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CONCATENATE '<h2>' 'Selection Texts' '</h2>'
INTO lcl_header SEPARATED BY space.
APPEND lcl_header TO it_html.
*Tabelle mit Ueberschriften generieren
APPEND '<table border>' TO it_html.
APPEND '<tr>' TO it_html.
LOOP AT lcl_it_headerrow INTO lcl_wa_headerrow.
CONCATENATE '<th>' lcl_wa_headerrow '</th>' INTO wa_html.
APPEND wa_html TO it_html.
ENDLOOP.
APPEND '</tr>' TO it_html.
*Datenzeilen generieren
LOOP AT p_it_textelements INTO lcl_wa_textelements
WHERE id = 'S'.
APPEND '<tr>' TO it_html.
CONCATENATE '<td>' lcl_wa_textelements-key '</td>' INTO wa_html.
APPEND wa_html TO it_html.
CONCATENATE '<td>' lcl_wa_textelements-entry '</td>' INTO wa_html.
APPEND wa_html TO it_html.
APPEND '</tr>' TO it_html.
ENDLOOP.
APPEND '</table>' TO it_html.
APPEND '<br><br>' TO it_html.
ENDIF.

CLEAR lcl_wa_textelements.
*2.) Tabelle fuer Textsymbole zusammenbauen
*Existieren Textsymbole
READ TABLE p_it_textelements WITH KEY id = 'I'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
*ueberschrift
CONCATENATE '<h2>' 'Text Symbols' '</h2>'
INTO lcl_header SEPARATED BY space.
APPEND lcl_header TO it_html.
*Tabelle mit Ueberschriften generieren
APPEND '<table border>' TO it_html.
APPEND '<tr>' TO it_html.
LOOP AT lcl_it_headerrow INTO lcl_wa_headerrow.
CONCATENATE '<th>' lcl_wa_headerrow '</th>' INTO wa_html.
APPEND wa_html TO it_html.
ENDLOOP.
APPEND '</tr>' TO it_html.
*Datenzeilen generieren
LOOP AT p_it_textelements INTO lcl_wa_textelements
WHERE id = 'I'.
APPEND '<tr>' TO it_html.
CONCATENATE '<td>' lcl_wa_textelements-key '</td>' INTO wa_html.
APPEND wa_html TO it_html.
CONCATENATE '<td>' lcl_wa_textelements-entry '</td>' INTO wa_html.
APPEND wa_html TO it_html.
APPEND '</tr>' TO it_html.
ENDLOOP.
APPEND '</table>' TO it_html.
APPEND '<br><br>' TO it_html.
ENDIF.
CLEAR lcl_wa_textelements.
*3.) List Header schreiben
READ TABLE p_it_textelements WITH KEY id = 'T'
INTO lcl_wa_textelements.
IF sy-subrc = 0.
CONCATENATE '<h2>' 'List Header:' lcl_wa_textelements-entry
'</h2>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
ENDIF.
APPEND '<br><br>' TO it_html.
CLEAR lcl_wa_textelements.
*4.Spaltenueberschriften schreiben
*Existieren Textsymbole
READ TABLE p_it_textelements WITH KEY id = 'H'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
*ueberschrift
CONCATENATE '<h2>' 'Column Headings' '</h2>'
INTO lcl_header SEPARATED BY space.
APPEND lcl_header TO it_html.
*Tabelle mit Ueberschriften generieren
APPEND '<table border>' TO it_html.
APPEND '<tr>' TO it_html.
LOOP AT lcl_it_headerrow INTO lcl_wa_headerrow.
CONCATENATE '<th>' lcl_wa_headerrow '</th>' INTO wa_html.
APPEND wa_html TO it_html.
ENDLOOP.
APPEND '</tr>' TO it_html.
*Datenzeilen generieren
LOOP AT p_it_textelements INTO lcl_wa_textelements
WHERE id = 'H'.
APPEND '<tr>' TO it_html.
CONCATENATE '<td>' lcl_wa_textelements-key '</td>' INTO wa_html.
APPEND wa_html TO it_html.
CONCATENATE '<td>' lcl_wa_textelements-entry '</td>' INTO wa_html.
APPEND wa_html TO it_html.
APPEND '</tr>' TO it_html.
ENDLOOP.
APPEND '</table>' TO it_html.
APPEND '<br>' TO it_html.
ENDIF.
CLEAR lcl_wa_textelements.
*Endbereich schreiben
APPEND '</body>' TO it_html.
APPEND '</Html>' TO it_html.
ENDFORM. " CREATE_HTMLTAB_FOR_TEXTELEMENT
*&---------------------------------------------------------------------*
*& Form create_html_for_menulist
*&---------------------------------------------------------------------*
* Aufbereitung der Menuliste (globale Tabelle) in eine HTML-Datei.
*----------------------------------------------------------------------*
FORM create_html_for_menulist USING p_status TYPE c
p_name TYPE c.
*Feld fuer aktiv
DATA: lcl_active(3) TYPE c.
*Flag,wo man in einem Menu ist; 1= Ebene1; 2=Ebene2; leer=Hauptmenu
DATA: lcl_pos TYPE i.
*Ebene des Submenues
DATA: lcl_level1 TYPE i.
DATA: lcl_level2 TYPE i.
*Menuzaehler fuer Submenu 1. Ebene; 2. Ebene speichern
DATA: lcl_zaehler TYPE i.
*Positionsvarialen fuer Menustruktur
DATA: lcl_pos1 TYPE i,
lcl_pos2 TYPE i,
lcl_pos3 TYPE i,
lcl_pos4 TYPE i.
*Initialsieren der Html-Tabelle, da sie von allen Downloadtabellen
*benutzt wird
REFRESH it_html.
*Anfang der Seite
APPEND '<HTML>' TO it_html.
APPEND '<head>' TO it_html.
APPEND '</head>' TO it_html.
APPEND '<body>' TO it_html.
*Ueberschrift generieren
CONCATENATE '<h1>' 'Menustructure of Status' p_status
'in Main-Program' p_name '(Language' wa_lan ')</h1>' INTO wa_html
SEPARATED BY space.
APPEND wa_html TO it_html.
APPEND '<br><br>' TO it_html.
*Liste schreiben
LOOP AT it_rsmpe_tree INTO wa_rsmpe_tree.
lcl_pos1 = wa_rsmpe_tree-pos_1.
lcl_pos2 = wa_rsmpe_tree-pos_2.
lcl_pos3 = wa_rsmpe_tree-pos_3.
lcl_pos4 = wa_rsmpe_tree-pos_4.
*neuer Menupunkt
IF ( ( lcl_pos2 = 0 ) AND ( lcl_pos3 = 0 ) AND ( lcl_pos4 = 0 ) ).
lcl_pos = 0.
IF sy-tabix <> 1.
APPEND '</ul>' TO it_html.
ENDIF.
APPEND '<ul>' TO it_html.
ENDIF.

IF wa_rsmpe_tree-type = 'M'.
IF ( ( lcl_pos2 = 0 ) AND ( lcl_pos3 = 0 ) AND ( lcl_pos4 = 0 ) ).
lcl_pos = 0.
APPEND '<br><br>' TO it_html.
CONCATENATE '<h3> Menu: <b>' wa_rsmpe_tree-text '</b> </h3>'
INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
ELSE. "Submenu
CONCATENATE '<li>' 'Submenu: <b>' wa_rsmpe_tree-text '</b></li>'
INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
* append '<ul>' to it_html.
IF lcl_pos = 0.
lcl_pos = 1.
lcl_level1 = wa_rsmpe_tree-pos_2.
ELSEIF lcl_pos = 1.
lcl_pos = 2.
lcl_level2 = wa_rsmpe_tree-pos_3.
ENDIF.

APPEND '<ul>' TO it_html.


ENDIF.
ELSEIF wa_rsmpe_tree-type = 'S'. "horizontaler Strich
*evtl. Submenustruktur bearbeit
IF ( lcl_pos = 1 AND wa_rsmpe_tree-pos_2 <> lcl_level1 ).
APPEND '</ul>' TO it_html.
CLEAR lcl_level1.
lcl_pos = 0.
ELSEIF ( lcl_pos = 2 AND wa_rsmpe_tree-pos_3 <> lcl_level2 ).
APPEND '</ul>' TO it_html.
CLEAR lcl_level2.
lcl_pos = 1.
ENDIF.
CONCATENATE
'<li>' '<hr noshade width="300" size="3" align=left>' '</li>'
INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.

ELSEIF wa_rsmpe_tree-type = 'F'. "normaler Funktionscode

*Aktiv-Flag setzen
IF wa_rsmpe_tree-active = 'X'.
lcl_active = 'YES'.
ELSE.
lcl_active = 'NO'.
ENDIF.
*evtl. Submenustruktur bearbeit
IF ( lcl_pos = 1 AND wa_rsmpe_tree-pos_2 <> lcl_level1 ).
APPEND '</ul>' TO it_html.
CLEAR lcl_level1.
lcl_pos = 0.
ELSEIF ( lcl_pos = 2 AND wa_rsmpe_tree-pos_3 <> lcl_level2 ).
APPEND '</ul>' TO it_html.
CLEAR lcl_level2.
lcl_pos = 1.
ENDIF.
*Eintrag zusammenbauen
CONCATENATE
'<li>Menufunction:' wa_rsmpe_tree-text
'(Code:"' wa_rsmpe_tree-code '"; active="' lcl_active
'")' '</li>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
ENDIF.
ENDLOOP.
APPEND '</ul>' TO it_html.
*Ende der Seite
APPEND '</body>' TO it_html.
APPEND '</Html>' TO it_html.
ENDFORM. " create_html_for_menulist
*&---------------------------------------------------------------------*
*& Form tacode
*&---------------------------------------------------------------------*
* Abfangen der selektierten Transaktionen aus dem
* Selektionsbildschirm zur Auswahl einzelner Objekte.
* Fuer jede gefundene Transaktion werden
* die Objekte gesichert.
*----------------------------------------------------------------------*
FORM tacode.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
*Sicherungsvariable fuer Stueckliste
DATA: lcl_it_prog_stueckliste LIKE it_prog_stueckliste.
*Bereich fuer Parametertabelle
DATA: lcl_wa_tstcp TYPE tstcp.
*Bereich fuer Transaktionscodetabelle
DATA: lcl_it_tstc TYPE STANDARD TABLE OF tstc,
lcl_wa_tstc LIKE LINE OF it_tstc.
*Klassennamenvarialble
DATA: lcl_class TYPE seoclass-clsname.
*Variablen fuer Start-und Endposition
DATA: lcl_start TYPE i,
lcl_end TYPE i.

SELECT * FROM tstc INTO TABLE lcl_it_tstc


WHERE tcode IN o_tcode
AND ( ( tcode LIKE 'Z%' ) OR ( tcode LIKE 'Y%' ) OR
( tcode LIKE g_name ) ).
*Verlassen,wenn keine Werte gefunden worden sind
IF lcl_it_tstc IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for Transaction! '
'Please check your selection. '
'The program will process your other selections.'.
*Form-Routine verlassen
EXIT.
ENDIF.

LOOP AT lcl_it_tstc INTO lcl_wa_tstc.

* Globales Namensfeld füllen


global_main_name = lcl_wa_tstc-tcode.

* Intitialisieren der globalen Tabellen


PERFORM initialize.

* Speziellle Verarbeitung bei Klassen


IF lcl_wa_tstc-pgmna IS INITIAL.
SELECT SINGLE * FROM tstcp INTO lcl_wa_tstcp
WHERE tcode = lcl_wa_tstc-tcode.
*Suche nach dem Klassennamen
SEARCH lcl_wa_tstcp-param FOR 'CLASS='.
IF sy-subrc <> 0. "Nichts gefunden
CONTINUE.
ENDIF.
*Name der Klasse finden
lcl_start = sy-fdpos.
*String "CLASS=" wegloeschen
lcl_start = lcl_start + 6.
SEARCH lcl_wa_tstcp-param FOR ';' STARTING AT lcl_start.
lcl_end = sy-fdpos - 1.
lcl_class = lcl_wa_tstcp-param+lcl_start(lcl_end).
*Verarbeitung, da Klasse gefunden
* Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING lcl_wa_tstc-tcode
'TA'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
CONTINUE.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'Transaction:' global_main_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
* ***************
*Tacode schreiben
PERFORM write_stueckliste USING 'Transaction'
lcl_wa_tstc-tcode
''.
*Eintrag fuer Funktiosgruppe schreiben
PERFORM write_stueckliste USING 'Class'
lcl_class
lcl_wa_tstc-tcode.

PERFORM write_global_save USING 'C' lcl_class.


*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Verarbeitung fuer aufgerufene Programme anstarten
PERFORM handle_externalprogs.
*Rücksichern der STückliste
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO it_prog_stueckliste.
*Namen wiederherstellen
global_main_name = lcl_wa_tstc-tcode.
PERFORM download_stueckliste.

ELSE. "Normale Transaktionen


* Die folgenden Elemente nur behandeln wenn das Rahmengprogramm
* im Kundennamensraum liegt.
IF ( ( lcl_wa_tstc-pgmna(1) = 'Z' )
OR ( lcl_wa_tstc-pgmna(1) = 'Y' )
OR ( lcl_wa_tstc-pgmna(g_len_nspace) = g_nspace
AND lcl_wa_tstc-pgmna+g_len_nspace(4) NE 'SAPL' ) ).
*Liste mit Ober-Objekten bei Einzelselektion fuellen(keine rekursive
*Sicherung, da bereits gesichert.
MOVE lcl_wa_tstc-pgmna TO wa_obj_list-name.
APPEND wa_obj_list TO it_obj_list.
* Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING lcl_wa_tstc-tcode
'TA'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
CONTINUE.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'Transaction:' global_main_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
* ***************

* Rahmenprogramm herunterladen
CLEAR ok.
PERFORM download_include USING lcl_wa_tstc-pgmna 'R'
CHANGING ok.
* Download war erfolgreich
IF ok = 'X'.
* Stueckliste schreiben
*Tacode
PERFORM write_stueckliste USING 'Transaction'
lcl_wa_tstc-tcode
''.
*Program zu Transaktionscode
PERFORM write_stueckliste USING 'Report/Modulpool'
lcl_wa_tstc-pgmna
lcl_wa_tstc-tcode.
ENDIF.
* Textelemente des Rahmenprogramms herunterladen
PERFORM download_textelements USING lcl_wa_tstc-pgmna
'R'.
* Stueckliste wird in 'download_textelements' geschrieben
* Echter Screen des Rahmenprogramms herunterladen
PERFORM handle_screens USING lcl_wa_tstc-pgmna
'R'.
* pf-Stati verarbeiten
PERFORM handle_pf_status USING lcl_wa_tstc-pgmna
'R'.
* Titlebars suchen
PERFORM handle_titlebar USING lcl_wa_tstc-pgmna
'R'.
* eventueller Transaktionscode zu Rahmenprogramm
PERFORM handle_tacode USING lcl_wa_tstc-pgmna.
* Normale Includes des Rahmenprogramms herunterladen
PERFORM handle_normal_includes USING lcl_wa_tstc-pgmna.
* Klassen und Interface behandeln
PERFORM handle_classinterface USING lcl_wa_tstc-pgmna
'R'.
* Tabellen/Strukturen herunterladen
PERFORM handle_ddic USING lcl_wa_tstc-pgmna
'R' .
* Externe Programmaufrufe, Funktionsbausteine und Messages
* des Rahmenprogramms behandeln.
PERFORM handle_extprog USING lcl_wa_tstc-pgmna.

* Aktivitäten die sich auf gesamtes Rahmenprogramm beziehen


* ULINE. "Listausgabeformatierung
PERFORM write_protocol USING 'L' '' '' ''.
* Domaenen downloaden
PERFORM download_domains.
* Datenelementliste downloaden
PERFORM download_dataelements.
* Berechtigungsobjekt Infos downloaden
PERFORM download_authorityobjects.
* Titlebars herunterladen
PERFORM download_titlebar.
* Meldungen herunterladen
PERFORM download_messages.
* Gesamtliste der Transaktionscodes herunterladen
PERFORM download_tacodelist.
* Gesamtliste mit Dialogbaustein->Funktionsbausteinzuordnung
* herunterladen und Gesamtliste mit Dialogpoolparametern herunterladen.
PERFORM download_dialogmodule_elements.
* Gesamtliste der Parameter herunterschreiben
PERFORM download_setgetparams.
* Gesamtstückliste
PERFORM download_stueckliste.
*Hotpackagestand sichern
PERFORM download_hpstand.
*Leerzeile nach Ende dieser Verarbeitung
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
* Globalen Namen setzen
lcl_name = global_main_name.
PERFORM initialize.
* perform handle_collectmains.
* Die Liste der extern aufgerufenen Rahmenprogramme abarbeieten
PERFORM handle_externalprogs.
* globalen Namen setzen
global_main_name = lcl_name.

ELSEIF ( ( lcl_wa_tstc-pgmna(5) = 'SAPLZ' )


OR ( lcl_wa_tstc-pgmna(5) = 'SAPLY' )
OR ( lcl_wa_tstc-pgmna(g_len_nspace) = g_nspace
AND lcl_wa_tstc-pgmna+g_len_nspace(4) = 'SAPL' ) ).
* Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING lcl_wa_tstc-tcode
'TA'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
CONTINUE.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'Transaction:' global_main_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
* ***************
*Tacode schreiben
PERFORM write_stueckliste USING 'Transaction'
lcl_wa_tstc-tcode
''.
*Eintrag fuer Funktiosgruppe schreiben
PERFORM write_stueckliste USING 'Functiongroup'
lcl_wa_tstc-pgmna
lcl_wa_tstc-tcode.

PERFORM write_global_save USING 'F' lcl_wa_tstc-pgmna.


*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Verarbeitung fuer aufgerufene Programme anstarten
PERFORM handle_externalprogs.
*Rücksichern der STückliste
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO it_prog_stueckliste.
*Namen wiederherstellen
global_main_name = lcl_wa_tstc-tcode.
PERFORM download_stueckliste.

ENDIF. "Namensraum
ENDIF. "Klasse oder normales verbundenes Objekt
*Stueckliste fuer logische Entwicklung schreiben
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'Transaction'
lcl_wa_tstc-tcode
p_logic.

PERFORM write_log_stueckliste USING 'Report/Modulpool(TA)'


lcl_wa_tstc-pgmna
lcl_wa_tstc-tcode.
ENDIF.
ENDLOOP.
ENDFORM. " tacode
*&---------------------------------------------------------------------*
*& Form create_nav_files
*&---------------------------------------------------------------------*
* Erstellung der Framset Datei und der Navigationsdatei der
* HTML-Navigation.
*----------------------------------------------------------------------*
FORM create_nav_files USING file TYPE string.
*Variable fuer Art des Objektes
DATA: lcl_typus TYPE string.
*Arbeitsbereich fuer Stueckliste
DATA: lcl_it_prog_stueckliste LIKE it_prog_stueckliste,
lcl_wa_prog_stueckliste LIKE LINE OF lcl_it_prog_stueckliste.
*Anzahl Zeilen in tabellen
DATA: lcl_line TYPE i.
*Sicherung des Tabix der aktuellen Tabelle
DATA: lcl_savetabix TYPE i.
*Bereich fuer Textelementname
DATA: lcl_text(30) TYPE c.
*variable to replace special characters
DATA: lcl_global_main_name LIKE global_main_name.
* variables for subitem-generation
DATA: lcl_name LIKE wa_html,
lcl_url LIKE wa_html.
* begin of changes for partner namespace
lcl_global_main_name = global_main_name.
TRANSLATE lcl_global_main_name USING '/_'.
* end of changes for partner namespace
*Typ des Rahmenobjektes lesen
READ TABLE it_prog_stueckliste INDEX 1 INTO lcl_wa_prog_stueckliste.
lcl_typus = lcl_wa_prog_stueckliste-type.

REFRESH it_html.
*Framset zusammenbauen
APPEND '<HTML>' TO it_html.
APPEND '<HEAD>' TO it_html.
APPEND '<TITLE>' TO it_html.
APPEND global_main_name TO it_html.
APPEND '</TITLE>' TO it_html.
APPEND '</HEAD>' TO it_html.
APPEND '<FRAMESET COLS="30%,*">' TO it_html.
APPEND '<FRAME SRC="nav.xml" NAME="nav">' TO it_html.
CONCATENATE '<FRAME SRC="' '"NAME="main">' INTO wa_html.
APPEND wa_html TO it_html.
APPEND '</FRAMESET>' TO it_html.
APPEND '</HTML>' TO it_html.
*Frameset herunterladen
PERFORM download_html_file USING 'F'.

*Navigationsfile zusammenbauen
REFRESH it_html.
APPEND '<?xml version="1.0" encoding="iso-8859-1" ?>' TO it_html.
APPEND '<?xml-stylesheet type="text/xsl" href="nav.xsl"?>'
TO it_html.
APPEND '<Nav>' TO it_html.
*Ueberschrift generieren je nach Typus
CASE lcl_typus.
WHEN 'Logical Development'.
CONCATENATE '<header>Logical Development'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN 'Report/Modulpool'.
CONCATENATE '<header>Report or Modulpool'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN 'Transaction'.
CONCATENATE '<header>Transaction'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.

WHEN 'Functiongroup'.
CONCATENATE '<header>Functiongroup'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN 'Class'.
CONCATENATE '<header>Class (ABAP OO)'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN 'Interface(OO)'.
CONCATENATE '<header>Interface (ABAP OO)'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN 'Interface(OO)'.
CONCATENATE '<header>Interface (ABAP OO)'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN 'Enhancement Project'.
CONCATENATE '<header>Enhancement Project'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN 'Badiimp'.
CONCATENATE '<header>Badi Implementation'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN 'Development Class'.
CONCATENATE '<header>Development Class'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN 'Transportrequest'.
CONCATENATE '<header>Transportrequest'
global_main_name '</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN 'IACS'.
CONCATENATE '<header>IAC-Service(ITS)'
'</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
WHEN OTHERS.
CONCATENATE '<header>Modifications'
'</header>' INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.

ENDCASE.
*Installationsnummer und Systemkennung mit ausgeben
CONCATENATE '<inst>' instnr '</inst>' INTO wa_html
SEPARATED BY space.
APPEND wa_html TO it_html.
CONCATENATE '<sysname>' sy-sysid '</sysname>' INTO wa_html
SEPARATED BY space.
APPEND wa_html TO it_html.
*gesonderte Verarbeitung fuer einzelene Typen
IF lcl_typus = 'Report/Modulpool' OR lcl_typus = 'Transaction'.
PERFORM create_inc_for_rm USING lcl_typus.
ELSEIF lcl_typus = 'Functiongroup'.
PERFORM create_inc_for_fk.
ELSEIF lcl_typus = 'Class'.
PERFORM create_inc_for_class.
ELSEIF lcl_typus = 'Interface(OO)'.
PERFORM create_html_for_intf.
ELSEIF lcl_typus = 'Logical Development'.
PERFORM create_html_for_logdev.
*Navigationsfile herunterladen
PERFORM download_html_file USING 'N'.
*Routine verlassen
EXIT.
ELSEIF lcl_typus = 'Enhancement Project'.
PERFORM create_html_for_enh.
ELSEIF lcl_typus = 'Development Class'.
PERFORM create_html_for_devclass.
ELSEIF lcl_typus = 'Transportrequest'.
PERFORM create_html_for_trkorr.
ELSEIF lcl_typus = 'Badiimp'.
PERFORM create_html_for_badiimps.
ELSEIF lcl_typus = 'IACS'.
PERFORM create_html_for_iacs.
ELSE.
PERFORM create_html_for_modis.
ENDIF.

*Textelemente wenn vorhanden


READ TABLE it_prog_stueckliste WITH KEY type = 'TE'
INTO lcl_wa_prog_stueckliste.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Textelements:</value>' TO it_html.

LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste


WHERE type = 'TE'.
IF p_trkorr IS INITIAL.
CONCATENATE lcl_wa_prog_stueckliste-file_name
'.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name+3.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ELSE.
*Workaround fuer Klassenincludes
SEARCH lcl_wa_prog_stueckliste-name FOR '='.
IF sy-subrc = 4.
lcl_text = lcl_wa_prog_stueckliste-name+3.
ELSE.
sy-fdpos = sy-fdpos - 3.
lcl_text =
lcl_wa_prog_stueckliste-name+3(sy-fdpos).
ENDIF.
CONCATENATE lcl_wa_prog_stueckliste-file_name
'.htm' INTO lcl_url.
lcl_name = lcl_text.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
APPEND wa_html TO it_html.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*exerne Funktionsbausteine wenn vorhanden


*Keine Beachtung in Transportauftraegen
IF p_trkorr <> 'X'.
READ TABLE it_prog_stueckliste WITH KEY type = 'Functionmodule'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Called Functionmodules:</value>' TO it_html.
* Verarbeitung der Funktionsbausteine--> Verweis auf Funktionsgruppe
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Functionmodule'.
* begin of changes for partner namespace
TRANSLATE lcl_wa_prog_stueckliste-obername USING '/_'.
* end of changes for partner namespace
*Je nach wird der Verweis unterschiedlich aufgebaut
IF extern = 'X' OR p_devc = 'X' OR p_trkorr = 'X'.
*Ueberpruefen, ob Verweis da Oberprogramm ist
READ TABLE it_obj_list WITH KEY
name = lcl_wa_prog_stueckliste-obername
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CONCATENATE
'../../FG_' lcl_wa_prog_stueckliste-obername
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ELSE.
CONCATENATE
'../FG_' lcl_wa_prog_stueckliste-obername
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDIF. "Lste Oberobjekte
ELSE.
CONCATENATE './FG_' lcl_wa_prog_stueckliste-obername
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank' .
ENDIF. "Externe Programme

ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF. "Funktionsbausteine
ENDIF. "Transportauftraege
*Screens verarbeiten, wenn vorhanden
READ TABLE it_prog_stueckliste WITH KEY type = 'SCR'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Screens:</value>' TO it_html.
* Verarbeitung der Screens
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'SCR'.
IF p_trkorr = 'X' "fuer tranportauftrag Namen anders bauen
AND lcl_wa_prog_stueckliste-file_name+5(1) NE space.
CONCATENATE 'SC_' lcl_wa_prog_stueckliste-file_name '.txt'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
* begin of changes for partner namespace
TRANSLATE lcl_wa_prog_stueckliste-obername USING '/_'.
* end of changes for partner namespace
CONCATENATE 'SC_' lcl_wa_prog_stueckliste-obername
lcl_wa_prog_stueckliste-file_name '.txt' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF. "Screens

*Functionkeys verarbeiten, wenn vorhanden


READ TABLE it_prog_stueckliste WITH KEY type = 'PfFu'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Funcktionkeys of Status:</value>' TO it_html.
* Verarbeitung der Functionkeys
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'PfFu'.
CONCATENATE lcl_wa_prog_stueckliste-file_name '.xml'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name+12.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF. "Functionkeys
*Menuelisten verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'PfMe'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Menuelist of Status:</value>' TO it_html.
* Menuliste
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'PfMe'.
CONCATENATE lcl_wa_prog_stueckliste-file_name '.htm'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name+9.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.

ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF. "Menuelisten
*Tiltbarliste wenn vorhanden
READ TABLE it_prog_stueckliste WITH KEY type = 'Titelbar'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Titlebar:</value>' TO it_html.
CONCATENATE 'Titlebar_' lcl_global_main_name '.xml'
INTO lcl_url.
lcl_name = global_main_name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.

APPEND '</item>' TO it_html.


ENDIF.
*Messages wenn vorhanden
READ TABLE it_prog_stueckliste WITH KEY type = 'MSG'
INTO lcl_wa_prog_stueckliste.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Messages:</value>' TO it_html.
CONCATENATE 'Messagetable_' lcl_global_main_name '.xml'
INTO lcl_url.
lcl_name = global_main_name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
APPEND '</item>' TO it_html.
ENDIF.
*DATA-Dictionary Objekte verarbeiten
PERFORM create_ddic_for_nav.
*Typgruppen verarbeiten, wenn vorhanden
READ TABLE it_prog_stueckliste WITH KEY type = 'Typgroup'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Typgroups:</value>' TO it_html.
* Verarbeitung der Functionkeys
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Typgroup'.
CONCATENATE 'TGR_' lcl_wa_prog_stueckliste-file_name '.xml'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.

ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF. "Functionkeys
*Transaktionscodeliste wenn vorhanden
READ TABLE it_prog_stueckliste WITH KEY type = 'Tranactioncodelist'
INTO lcl_wa_prog_stueckliste.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Transactioncodes:</value>' TO it_html.
CONCATENATE 'Tacodelist_' lcl_global_main_name '.xml'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-obername.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
APPEND '</item>' TO it_html.
ENDIF.
*Lockobject verarbeiten wenn vorhanden
REFRESH lcl_it_prog_stueckliste.
*Lockobjekte in lokale Tabellen kopieren
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Lockobject'.
APPEND lcl_wa_prog_stueckliste TO lcl_it_prog_stueckliste.
ENDLOOP.
DESCRIBE TABLE lcl_it_prog_stueckliste LINES lcl_line.
*Lockobject verarbeiten
LOOP AT lcl_it_prog_stueckliste INTO lcl_wa_prog_stueckliste.
lcl_savetabix = sy-tabix.
*Erster Eintrag
IF sy-tabix = 1.
APPEND '<item>' TO it_html.
APPEND '<value>Lockobjects:</value>' TO it_html.
ENDIF.
CONCATENATE 'Lockobject_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
*Letzter Eintrag
IF lcl_savetabix = lcl_line.
APPEND '</item>' TO it_html.
ENDIF.
ENDLOOP.

*Dialogmodule in lokale Tabellen kopieren


READ TABLE it_prog_stueckliste WITH KEY type = 'Dialogmodule'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
* begin of changes for partner namespace
TRANSLATE lcl_wa_prog_stueckliste-obername USING '/_'.
* end of changes for partner namespace
*verarbeiten
APPEND '<item>' TO it_html.
APPEND '<value>Dialogmodules:</value>' TO it_html.
*Dialogmodulzuordnung
CONCATENATE 'Dlgmd_to_Modpool_' lcl_wa_prog_stueckliste-obername
'.xml' INTO lcl_url.
lcl_name = 'Assignment of Modulpool'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
*Dialogmodulparameter
CONCATENATE 'Dlgmd_Params_' lcl_wa_prog_stueckliste-obername
'.xml' INTO lcl_url.
lcl_name = 'Dialogmodul Parameter'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.

*Den Dialogmodulen zugeordnetes Program


APPEND '<item>' TO it_html.
APPEND '<value>Assigned Programs:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Dialog Program'.
IF extern = 'X' OR p_devc = 'X' OR p_trkorr = 'X'.
*Ueberpruefen, ob Verweis da Oberprogramm ist
READ TABLE it_obj_list WITH KEY
name = lcl_wa_prog_stueckliste-obername
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CONCATENATE
'../../RM_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
CONCATENATE
'../RM_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF. "Lste Oberobjekte
ELSE.
CONCATENATE './RM_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF. "extern, DC, Tr
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
APPEND '</item>' TO it_html.
ENDIF.

*Berechtigungsobjektlisten, wenn vorhanden


READ TABLE it_prog_stueckliste WITH KEY type = 'Authority Object'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Authority Objects:</value>' TO it_html.
*Authority-Objectliste
CONCATENATE 'Auhthorities' lcl_global_main_name '.xml'
INTO lcl_url.
lcl_name = 'Authority Object List'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
*Aktivitaetenliste, wenn vorhanden
READ TABLE it_prog_stueckliste WITH KEY
type = 'Activities of Authority Objects' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CONCATENATE 'AuthActivities' lcl_global_main_name '.xml'
INTO lcl_url.
lcl_name = 'Activities of Authority Objects'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
APPEND '</item>' TO it_html.
ENDIF.
*Felder der Berechtigungsobjekte (nur bei Tranportautrag moeglich)
READ TABLE it_prog_stueckliste WITH KEY type = 'Authorityfield'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Authorityfields:</value>' TO it_html.
CONCATENATE 'Authortyfields_' lcl_global_main_name '.xml'
INTO lcl_url.
lcl_name = 'Authorityfields'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
APPEND '</item>' TO it_html.
ENDIF.

*Set/GetParameterlisteliste wenn vorhanden


READ TABLE it_prog_stueckliste WITH KEY type = 'SET/Get-Parameter'
INTO lcl_wa_prog_stueckliste.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Set/Get-Parameter:</value>' TO it_html.
CONCATENATE 'Set_Get_Params_' lcl_global_main_name '.xml'
INTO lcl_url.
lcl_name = 'Set/Get-Parameterlist'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
APPEND '</item>' TO it_html.
ENDIF.

*Externe Programmaufrufe, wenn nicht in Transportauftrag


IF p_trkorr IS INITIAL.
PERFORM create_html_extern.
ENDIF.
*Verwendete Klassen verarbeiten Transportauftrag und
*Entwicklungsklasse werden extra gehandhabt
IF lcl_typus <> 'Transportrequest' AND lcl_typus <> 'Development Class'.
READ TABLE it_prog_stueckliste WITH KEY type = 'Class(OO)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Used Classes:</value>' TO it_html.
* Verarbeitung der Klassen--> Verweis auf Verzeichnis der Klassen
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Class(OO)'.
* Je nach wird der Verweis unterschiedlich aufgebaut
IF extern = 'X' OR p_devc = 'X'.
READ TABLE it_obj_list WITH KEY
name = lcl_wa_prog_stueckliste-obername
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CONCATENATE
'../../OC_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
CONCATENATE
'../OC_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF. "Oberobjekt
ELSEIF p_trkorr = 'X'.
CONCATENATE lcl_wa_prog_stueckliste-name
'(not linked)' INTO lcl_name.
CLEAR lcl_url.
ELSE.
CONCATENATE './OC_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
ENDIF. "Lieg Tr or DC vor
*Hotpackagestand anzeigen, außer bei Interface (uninteressant da kein
*kein Coding in Tinerfaces enthalten)
IF lcl_typus <> 'Interface(OO)'.
READ TABLE it_prog_stueckliste INDEX 1 INTO lcl_wa_prog_stueckliste.
* Listeneintrag schreiben
APPEND '<item>' TO it_html.
APPEND '<value>Hotpackages:</value>' TO it_html.
CONCATENATE 'Patchlist_' lcl_wa_prog_stueckliste-instnr '.xml'
INTO lcl_url.
lcl_name = 'List of Hotpackages'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
APPEND '</item>' TO it_html.
ENDIF. "Interface
*Ende der Navigationsseite
APPEND '</Nav>' TO it_html.
*Navigationsfile herunterladen
PERFORM download_html_file USING 'N'.
ENDFORM. " create_nav_files
*&---------------------------------------------------------------------*
*& Form download_html_file
*&---------------------------------------------------------------------*
* Download der Framesetdatei und der Navigationsdatei
* je nach Wert im Uebergabeparameter P_TYPUS.
*----------------------------------------------------------------------*
FORM download_html_file USING p_typus TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
CLEAR filename.
*Feststellen, welche Dateiart vorhandnen ist.
IF p_typus = 'F'. "Framsetdatei
CONCATENATE new_dir '\index.htm' INTO filename.
ELSEIF p_typus = 'N'.
CONCATENATE new_dir '\nav.xml' INTO filename.
ELSEIF p_typus = '1'. "ABAP.xsl
CONCATENATE new_dir '\ABAP.xsl' INTO filename.
ELSEIF p_typus = '2'. "nav.xsl
CONCATENATE new_dir '\nav.xsl' INTO filename.
ELSEIF p_typus = '3'. "table.xsl
CONCATENATE new_dir '\table.xsl' INTO filename.
ELSEIF p_typus = '4'. "formate.css
CONCATENATE new_dir '\formate.css' INTO filename.
ELSEIF p_typus = '5'. "blank.xsl
CONCATENATE new_dir '\blank.xsl' INTO filename.
ENDIF.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
* download
IF p_typus = '1'.
PERFORM call_ws_download USING filename
it_abap_xsl
CHANGING lcl_subrc.
ELSEIF p_typus = '2'.
PERFORM call_ws_download USING filename
it_nav_xsl
CHANGING lcl_subrc.
ELSEIF p_typus = '3'.
PERFORM call_ws_download USING filename
it_table_xsl
CHANGING lcl_subrc.
ELSEIF p_typus = '4'.
PERFORM call_ws_download USING filename
it_formate_css
CHANGING lcl_subrc.
ELSEIF p_typus = '5'.
PERFORM call_ws_download USING filename
it_blank_xsl
CHANGING lcl_subrc.

ELSE.
PERFORM call_ws_download USING filename
it_html
CHANGING lcl_subrc.
ENDIF.
ENDFORM. " download_html_file
*&---------------------------------------------------------------------*
*& Form create_ddic_for_nav
*&---------------------------------------------------------------------*
* Erstellung der Eintraege in der Navigationsdatei
* fuer die DATA-Dictionnary Objekte.
*----------------------------------------------------------------------*
FORM create_ddic_for_nav.
*Lokale Stueckliste fuer Verarbeitung
DATA: lcl_it_prog_stueckliste LIKE it_prog_stueckliste,
lcl_wa_prog_stueckliste LIKE LINE OF lcl_it_prog_stueckliste.
*Zwischenspeicherung der Zeilenanzahl
DATA: lcl_tmp TYPE i.
*Anzahl Zeilen in tabellen
DATA: lcl_line TYPE i.
*Sicherung des Tabix der aktuellen Tabelle
DATA: lcl_savetabix TYPE i.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.

APPEND '<item>' TO it_html.


MOVE '<value>Data-Dictionnary Objekte:</value>' TO wa_html.
APPEND wa_html TO it_html.
APPEND '</item>' TO it_html.
REFRESH lcl_it_prog_stueckliste.
*Tabellen in lokale Tabellen kopierenverarbeiten
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Table'.
APPEND lcl_wa_prog_stueckliste TO lcl_it_prog_stueckliste.
ENDLOOP.
DESCRIBE TABLE lcl_it_prog_stueckliste LINES lcl_line.
*Tabellen verarbeiten
LOOP AT lcl_it_prog_stueckliste INTO lcl_wa_prog_stueckliste.
lcl_savetabix = sy-tabix.
*Erster Eintrag
IF sy-tabix = 1.
APPEND '<item>' TO it_html.
APPEND '<value>Tables:</value>' TO it_html.
ENDIF.
CONCATENATE 'TAB_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
*Letzter Eintrag
IF lcl_savetabix = lcl_line.
APPEND '</item>' TO it_html.
ENDIF.
ENDLOOP.
REFRESH lcl_it_prog_stueckliste.
*Strukturen in lokale Tabellen kopieren
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Structure'.
APPEND lcl_wa_prog_stueckliste TO lcl_it_prog_stueckliste.
ENDLOOP.
DESCRIBE TABLE lcl_it_prog_stueckliste LINES lcl_line.
*Strukturen verarbeiten
LOOP AT lcl_it_prog_stueckliste INTO lcl_wa_prog_stueckliste.
lcl_savetabix = sy-tabix.
*Erster Eintrag
IF sy-tabix = 1.
APPEND '<item>' TO it_html.
APPEND '<value>Structures:</value>' TO it_html.
ENDIF.
CONCATENATE 'STR_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
*Letzter Eintrag
IF lcl_savetabix = lcl_line.
APPEND '</item>' TO it_html.
ENDIF.
ENDLOOP.
REFRESH lcl_it_prog_stueckliste.
*Tabellentypen in lokale Tabellen kopieren
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Tabletype'.
APPEND lcl_wa_prog_stueckliste TO lcl_it_prog_stueckliste.
ENDLOOP.
DESCRIBE TABLE lcl_it_prog_stueckliste LINES lcl_line.
*Tabellentypen verarbeiten
LOOP AT lcl_it_prog_stueckliste INTO lcl_wa_prog_stueckliste.
lcl_savetabix = sy-tabix.
*Erster Eintrag
IF sy-tabix = 1.
APPEND '<item>' TO it_html.
APPEND '<value>Tabletypes:</value>' TO it_html.
ENDIF.
CONCATENATE 'Tabletype_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
*Letzter Eintrag
IF lcl_savetabix = lcl_line.
APPEND '</item>' TO it_html.
ENDIF.
ENDLOOP.
REFRESH lcl_it_prog_stueckliste.
*Appends in lokale Tabellen kopieren
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Append'.
APPEND lcl_wa_prog_stueckliste TO lcl_it_prog_stueckliste.
ENDLOOP.
DESCRIBE TABLE lcl_it_prog_stueckliste LINES lcl_line.
*Appends verarbeiten
LOOP AT lcl_it_prog_stueckliste INTO lcl_wa_prog_stueckliste.
lcl_savetabix = sy-tabix.
*Erster Eintrag
IF sy-tabix = 1.
APPEND '<item>' TO it_html.
APPEND '<value>Appends:</value>' TO it_html.
ENDIF.
CONCATENATE 'App_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
*Letzter Eintrag
IF lcl_savetabix = lcl_line.
APPEND '</item>' TO it_html.
ENDIF.
ENDLOOP.
REFRESH lcl_it_prog_stueckliste.
*Views in lokale Tabellen kopieren
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'View'.
APPEND lcl_wa_prog_stueckliste TO lcl_it_prog_stueckliste.
ENDLOOP.
DESCRIBE TABLE lcl_it_prog_stueckliste LINES lcl_line.
*Views verarbeiten
LOOP AT lcl_it_prog_stueckliste INTO lcl_wa_prog_stueckliste.
lcl_savetabix = sy-tabix.
*Erster Eintrag
IF sy-tabix = 1.
APPEND '<item>' TO it_html.
APPEND '<value>Views:</value>' TO it_html.
ENDIF.
CONCATENATE 'View_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
*Letzter Eintrag
IF lcl_savetabix = lcl_line.
APPEND '</item>' TO it_html.
ENDIF.
ENDLOOP.
*Datenelemente
READ TABLE it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WITH KEY type = 'Dataelements'.
IF sy-subrc = 0.
* begin of changes for partner namespace
TRANSLATE lcl_wa_prog_stueckliste-obername USING '/_'.
* end of changes for partner namespace
* APPEND '<item_linked>' TO it_html.
*
* APPEND '<value>Dataelements</value>' to it_html.
*
* concatenate '<url>Dataelements_'
* lcl_wa_prog_stueckliste-obername '.xml</url>' into wa_html.
* append wa_html to it_html.
*
* APPEND '<target>main</target>' to it_html.
*
* APPEND '</item_linked>' TO it_html.
APPEND '<item>' TO it_html.
APPEND '<value>Dataelements:</value>' TO it_html.
CONCATENATE 'Dataelements_'
lcl_wa_prog_stueckliste-obername '.xml' INTO lcl_url.
lcl_name = 'Dataelements'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
APPEND '</item>' TO it_html.
ENDIF.
*Domainen
READ TABLE it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WITH KEY type = 'Domainheader'.
IF sy-subrc = 0.
* begin of changes for partner namespace
TRANSLATE lcl_wa_prog_stueckliste-obername USING '/_'.
* end of changes for partner namespace
APPEND '<item>' TO it_html.
APPEND '<value>Domains:</value>' TO it_html.
CONCATENATE 'DomHeader_'
lcl_wa_prog_stueckliste-obername '.xml' INTO lcl_url.
lcl_name = 'Domainheader'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.

READ TABLE it_prog_stueckliste INTO lcl_wa_prog_stueckliste


WITH KEY type = 'Domainvalues'.
IF sy-subrc = 0.
* begin of changes for partner namespace
TRANSLATE lcl_wa_prog_stueckliste-obername USING '/_'.
* end of changes for partner namespace
CONCATENATE 'DomValues_'
lcl_wa_prog_stueckliste-obername '.xml' INTO lcl_url.
lcl_name = 'Domain Values'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
APPEND '</item>' TO it_html.
ENDIF.

*Ueberpruefen, ob Entraege geschriegben worden sind


*außer Rahmen
DESCRIBE TABLE it_html LINES lcl_line.
lcl_tmp = lcl_line - 1.
READ TABLE it_html INDEX lcl_tmp INTO wa_html.
*Loeschen der bisher generierten Daten
IF wa_html = '<value>Data-Dictionnary Objekte:</value>'.
lcl_tmp = lcl_tmp - 1.
DELETE it_html FROM lcl_tmp TO lcl_line.
ENDIF.
ENDFORM. " create_ddic_for_nav
*&---------------------------------------------------------------------*
*& Form create_html_exetern
*&---------------------------------------------------------------------*
* Erstellung der Eintraege in die Navigationsdatei
* fuer aufgerufene Reports/Modulpools.
*----------------------------------------------------------------------*
FORM create_html_extern.
*Lokale Stueckliste fuer Verarbeitung
DATA: lcl_it_prog_stueckliste LIKE it_prog_stueckliste,
lcl_wa_prog_stueckliste LIKE LINE OF lcl_it_prog_stueckliste.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
*Anzahl Zeilen in tabellen
DATA: lcl_line TYPE i.
*Sicherung des Tabix der aktuellen Tabelle
DATA: lcl_savetabix TYPE i.

REFRESH lcl_it_prog_stueckliste.
*Externe Programmaufrufe in lokale Tabellen kopieren
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = '1'.
APPEND lcl_wa_prog_stueckliste TO lcl_it_prog_stueckliste.
ENDLOOP.
DESCRIBE TABLE lcl_it_prog_stueckliste LINES lcl_line.
*Externe Programmaufrufe verarbeiten
LOOP AT lcl_it_prog_stueckliste INTO lcl_wa_prog_stueckliste.
lcl_savetabix = sy-tabix.
*Erster Eintrag
IF sy-tabix = 1.
APPEND '<item>' TO it_html.
APPEND '<value>Externe Programmaufrufe:</value>' TO it_html.
ENDIF.
*Je Ebenenach wird der Verweis unterschiedlich aufgebaut
IF extern = 'X' OR p_devc = 'X'.
READ TABLE it_obj_list WITH KEY
name = lcl_wa_prog_stueckliste-name
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CONCATENATE '../../RM_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
CONCATENATE '../RM_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF.
ELSE.
READ TABLE it_obj_list WITH KEY
name = lcl_wa_prog_stueckliste-name
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
lcl_url = 'index.htm'.
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
CONCATENATE './RM_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF.
ENDIF. "Extern?
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
* Letzter Eintrag
IF lcl_savetabix = lcl_line.
APPEND '</item>' TO it_html.
ENDIF.
ENDLOOP.
ENDFORM. " create_html_exetern
*&---------------------------------------------------------------------*
*& Form create_inc_for_rm
*&---------------------------------------------------------------------*
* Erstellung der Eintraege in der Navigationsdatei
* fuer die Includes in Reports/Modulpools.
*----------------------------------------------------------------------*
FORM create_inc_for_rm USING p_typus TYPE string.
*Arbeitsbereich fuer Stueckliste
DATA: lcl_it_prog_stueckliste LIKE it_prog_stueckliste,
lcl_wa_prog_stueckliste LIKE LINE OF lcl_it_prog_stueckliste.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
*Transaktionen zu Funktionsgruppen und Klassen abfangen
READ TABLE it_prog_stueckliste INDEX 1
INTO lcl_wa_prog_stueckliste.
IF lcl_wa_prog_stueckliste-type ='Transaction'.
READ TABLE it_prog_stueckliste INDEX 2
INTO lcl_wa_prog_stueckliste.
IF lcl_wa_prog_stueckliste-type ='Functiongroup'.
APPEND '<item>' TO it_html.
APPEND '<value>Related Functiongroup:</value>' TO it_html.
CONCATENATE './FG_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
APPEND '</item>' TO it_html.
ELSEIF lcl_wa_prog_stueckliste-type = 'Class'.
APPEND '<item>' TO it_html.
APPEND '<value>Related Class:</value>' TO it_html.
CONCATENATE './OC_' lcl_wa_prog_stueckliste-file_name '/index.htm'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
APPEND '</item>' TO it_html.
ENDIF.
* APPEND '</item>' to it_html.
ENDIF.
*Incudes schreiben wenn vorhanden
READ TABLE it_prog_stueckliste WITH KEY type = 'IN'
INTO lcl_wa_prog_stueckliste.
IF sy-subrc = 0.
* Includes schreiben
APPEND '<item>' TO it_html.
APPEND '<value>Includes:</value>' TO it_html.
* Schreiben der Includes je nach Typ des Programmes
IF p_typus = 'Report/Modulpool' OR p_typus = 'Transaction'.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Report/Modulpool'
OR type = 'IN'.
IF lcl_wa_prog_stueckliste-type = 'Report/Modulpool'.
CONCATENATE 'R_' lcl_wa_prog_stueckliste-file_name '.xml'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
CONCATENATE 'IN_' lcl_wa_prog_stueckliste-file_name '.xml'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF. "Typus
ELSE.
READ TABLE it_prog_stueckliste WITH KEY type = 'Report/Modulpool'
INTO lcl_wa_prog_stueckliste.
IF sy-subrc = 0.
* Includes schreiben
APPEND '<item>' TO it_html.
APPEND '<value>Includes:</value>' TO it_html.
* Schreiben der Includes je nach Typ des Programmes
IF p_typus = 'Report/Modulpool' OR p_typus = 'Transaction'.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Report/Modulpool'
OR type = 'IN'.
IF lcl_wa_prog_stueckliste-type = 'Report/Modulpool'.
CONCATENATE 'R_' lcl_wa_prog_stueckliste-file_name '.xml'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
CONCATENATE 'IN_' lcl_wa_prog_stueckliste-file_name '.xml'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF. "Typus
ENDIF. "Report/Modulpoole
ENDIF. "INclude
ENDFORM. " create_inc_for_rm
*&---------------------------------------------------------------------*
*& Form create_inc_for_fk
*&---------------------------------------------------------------------*
* Erstellung der Eintraege in der Navigationsdatei
* fuer die Includes und Funktionsbausteine in Funktionsgruppen.
*----------------------------------------------------------------------*
FORM create_inc_for_fk.
*Lokale Bereiche fuer Funktionsgruppenstruktur
DATA: lcl_it_fkgrp_struktur LIKE it_fkgrp_struktur,
lcl_wa_fkgrp_struktur LIKE LINE OF lcl_it_fkgrp_struktur.
*Anzahl Zeilen in tabellen
DATA: lcl_line TYPE i.
*Sicherung des Tabix der aktuellen Tabelle
DATA: lcl_savetabix TYPE i.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.

*Funktionsbausteinincludes bearbeiten
REFRESH lcl_it_fkgrp_struktur.
*Externe Programmaufrufe in lokale Tabellen kopieren
LOOP AT it_fkgrp_struktur INTO lcl_wa_fkgrp_struktur
WHERE NOT ( fktbstname IS INITIAL ).
APPEND lcl_wa_fkgrp_struktur TO lcl_it_fkgrp_struktur.
ENDLOOP.
DESCRIBE TABLE lcl_it_fkgrp_struktur LINES lcl_line.
*Funktionsbausteinincludes bearbeiten
LOOP AT lcl_it_fkgrp_struktur INTO lcl_wa_fkgrp_struktur.
lcl_savetabix = sy-tabix.
*Erster Eintrag
IF sy-tabix = 1.
APPEND '<item>' TO it_html.
APPEND '<value>Functionmdules:</value>' TO it_html.
ENDIF.
CONCATENATE 'IN_' lcl_wa_fkgrp_struktur-file_objectname '.xml'
INTO lcl_url.
lcl_name = lcl_wa_fkgrp_struktur-fktbstname.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
*Letzter Eintrag
IF lcl_savetabix = lcl_line.
APPEND '</item>' TO it_html.
ENDIF.
ENDLOOP. "Funktionsbausteine

*Andere Includes bearbeiten


REFRESH lcl_it_fkgrp_struktur.
*Includes in lokale Tabellen kopieren
LOOP AT it_fkgrp_struktur INTO lcl_wa_fkgrp_struktur
WHERE fktbstname IS INITIAL.
APPEND lcl_wa_fkgrp_struktur TO lcl_it_fkgrp_struktur.
ENDLOOP.
DESCRIBE TABLE lcl_it_fkgrp_struktur LINES lcl_line.
*Funktionsbausteinincludes bearbeiten
LOOP AT lcl_it_fkgrp_struktur INTO lcl_wa_fkgrp_struktur.
lcl_savetabix = sy-tabix.
*Erster Eintrag
IF sy-tabix = 1.
APPEND '<item>' TO it_html.
APPEND '<value>Includes</value>' TO it_html.
ENDIF.
CONCATENATE 'IN_' lcl_wa_fkgrp_struktur-file_objectname '.xml'
INTO lcl_url.
lcl_name = lcl_wa_fkgrp_struktur-objectname.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
*Letzter Eintrag
IF lcl_savetabix = lcl_line.
APPEND '</item>' TO it_html.
ENDIF.
ENDLOOP. "Funktionsbausteine
ENDFORM. " create_inc_for_fk
*&---------------------------------------------------------------------*
*& Form create_inc_for_class
*&---------------------------------------------------------------------*
* Erstellung der Eintraege in der Navigationsdatei
* fuer die Includes und Methoden in Klassen.
*----------------------------------------------------------------------*
FORM create_inc_for_class.
*Lokale Bereiche fuer Klassenstruktur
DATA: lcl_it_classlist TYPE STANDARD TABLE OF classlist,
lcl_wa_classlist LIKE LINE OF lcl_it_classlist.
*Stuecklisenbereich
DATA: lcl_wa_prog_stueckliste LIKE LINE OF it_prog_stueckliste.
*Hilfvariable Laenge
DATA: lcl_len TYPE i.
*global_main_name
DATA: lcl_global_main_name LIKE global_main_name.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
* begin of changes for partner namespace
lcl_global_main_name = global_main_name.
TRANSLATE lcl_global_main_name USING '/_'.
* end of changes for partner namespace

READ TABLE it_classlist WITH KEY typus = 'Meth'


TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Methods</value>' TO it_html.
* Verarbeitung der Methodenincludes
LOOP AT it_classlist INTO lcl_wa_classlist
WHERE typus = 'Meth'.
CONCATENATE 'CLIN_' lcl_wa_classlist-file_inc '.xml'
INTO lcl_url.
lcl_name = lcl_wa_classlist-meth.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Hauptincludes
APPEND '<item>' TO it_html.
APPEND '<value>Mainincludes</value>' TO it_html.
*Traegerinclude
READ TABLE it_classlist INTO lcl_wa_classlist
WITH KEY typus = 'CIN' inc+30 = 'CP'.
IF sy-subrc = 0.
CONCATENATE 'CLIN_' lcl_wa_classlist-file_inc '.xml'
INTO lcl_url.
lcl_name = 'Classpoolinclude'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
*Public Section
READ TABLE it_classlist INTO lcl_wa_classlist
WITH KEY typus = 'CIN' inc+30 = 'CU'.
IF sy-subrc = 0.
CONCATENATE 'CLIN_' lcl_wa_classlist-file_inc '.xml'
INTO lcl_url.
lcl_name = 'Public Section'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
*Private Section
READ TABLE it_classlist INTO lcl_wa_classlist
WITH KEY typus = 'CIN' inc+30 = 'CI'.
IF sy-subrc = 0.
CONCATENATE 'CLIN_' lcl_wa_classlist-file_inc '.xml'
INTO lcl_url.
lcl_name = 'Private Section'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
*Protected Section
READ TABLE it_classlist INTO lcl_wa_classlist
WITH KEY typus = 'CIN' inc+30 = 'CO'.
IF sy-subrc = 0.
CONCATENATE 'CLIN_' lcl_wa_classlist-file_inc '.xml'
INTO lcl_url.
lcl_name = 'Protected Section'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
*Local Types
READ TABLE it_classlist INTO lcl_wa_classlist
WITH KEY typus = 'CIN' inc+30 = 'CCDEF'.
IF sy-subrc = 0.
CONCATENATE 'CLIN_' lcl_wa_classlist-file_inc '.xml'
INTO lcl_url.
lcl_name = 'Locale Types'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
* Local Macros
READ TABLE it_classlist INTO lcl_wa_classlist
WITH KEY typus = 'CIN' inc+30 = 'CCMAC'.
IF sy-subrc = 0.
CONCATENATE 'CLIN_' lcl_wa_classlist-file_inc '.xml'
INTO lcl_url.
lcl_name = 'Local Macros'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
* Local Class Implementations
READ TABLE it_classlist INTO lcl_wa_classlist
WITH KEY typus = 'CIN' inc+30 = 'CCIMP'.
IF sy-subrc = 0.
CONCATENATE 'CLIN_' lcl_wa_classlist-file_inc '.xml'
INTO lcl_url.
lcl_name = 'Local Class Implementations'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
*Dummy Include
READ TABLE it_classlist INTO lcl_wa_classlist
WITH KEY typus = 'CIN' inc+30 = 'CT'.
IF sy-subrc = 0.
CONCATENATE 'CLIN_' lcl_wa_classlist-file_inc '.xml'
INTO lcl_url.
lcl_name = 'Dummy Include'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
APPEND '</item>' TO it_html.
*Interfaces wenn vorhandnen
READ TABLE it_prog_stueckliste WITH KEY type = 'Interface'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Interfaces:</value>' TO it_html.
* Verarbeitung der Interfaces
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Interface'.
**Unterscheidung, ob bei extern in DC'S oder TR's
IF extern = 'X' OR p_devc = 'X'.
CONCATENATE '../OI_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
*
ELSEIF p_trkorr = 'X'. "Transportrequest
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
CONCATENATE './OI_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Spezielle Transaktionscodeliste fuer Klassen
READ TABLE it_prog_stueckliste WITH KEY
type = 'Transactioncodelist(Class)'
INTO lcl_wa_prog_stueckliste.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Transactioncodes:</value>' TO it_html.
CONCATENATE 'Tacodeclass_' lcl_global_main_name '.xml'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-obername.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
APPEND '</item>' TO it_html.
ENDIF.
ENDFORM. " create_inc_for_class
*&---------------------------------------------------------------------*
*& Form create_html_for_logdev
*&---------------------------------------------------------------------*
* Aufbau der Navigationsliste fuer eine Logische Entwicklung.
*----------------------------------------------------------------------*
FORM create_html_for_logdev.
*lokale Bereiche fuer STuecklistenverarbeitung
DATA: lcl_it_prog_stueckliste TYPE STANDARD TABLE OF prog_stueckliste,
lcl_wa_prog_stueckliste LIKE LINE OF lcl_it_prog_stueckliste.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
*Reports/Modulpools verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'Report/Modulpool'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Reports/Modulpoole:</value>' TO it_html.
* Menuliste
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Report/Modulpool'.
CONCATENATE './RM_' lcl_wa_prog_stueckliste-file_name '/index.htm'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Transaktionen verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'Transaction'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Transactions:</value>' TO it_html.
* Transaktionen
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Report/Modulpool(TA)'.
* begin of changes for partner namespace
TRANSLATE lcl_wa_prog_stueckliste-obername USING '/_'.
* end of changes for partner namespace
CONCATENATE './TA_' lcl_wa_prog_stueckliste-obername '/index.htm'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-obername.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Functiongroup verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'Functiongroup'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Functiongroups:</value>' TO it_html.
* Functiongroup
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Functiongroup'.
CONCATENATE './FG_SAPL' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Class(OO) verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'Class(OO)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Classes:</value>' TO it_html.
* Class(OO)
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Class(OO)'.
CONCATENATE './OC_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Interface(OO)) verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'Interface(OO)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Interfaces:</value>' TO it_html.
* Interface(OO)
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Interface(OO)'.
CONCATENATE './OI_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*IDOC-Basistype verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'IDOC-Basistype'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>IDOC-Basistypes:</value>' TO it_html.
* IDOC-Basistype
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'IDOC-Basistype'.
CONCATENATE './IB_' lcl_wa_prog_stueckliste-file_name
'/' lcl_wa_prog_stueckliste-file_name '_d.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*IDOC-Enhancement verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'IDOC-Enhancement'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>IDoc-Enhancement:</value>' TO it_html.
* IDOC-Enhancement
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'IDOC-Enhancement'.
CONCATENATE './IB_' lcl_wa_prog_stueckliste-file_name
'/' lcl_wa_prog_stueckliste-file_name '_d.htm'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*IAC-Service
READ TABLE it_prog_stueckliste WITH KEY type = 'IACS'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>IAC-Service(ITS):</value>' TO it_html.
* Menuliste
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'IACS'.
CONCATENATE './IAC_' lcl_wa_prog_stueckliste-file_name
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*CMOD-Enhancement verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'CMOD-Enhancement'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Enhancement-Project:</value>' TO it_html.
* CMOD-Enhancement
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'CMOD-Enhancement'.
CONCATENATE './EP_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*BADI-Imlementation verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'BADI-Imlementation'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>BADI-Imlementations:</value>' TO it_html.
* BADI-Imlementation
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'BADI-Imlementation'.
CONCATENATE './BI_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Modifikationen
READ TABLE it_prog_stueckliste WITH KEY type = 'Include(Modi)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Modifications</value>' TO it_html.
CONCATENATE './Modifications' '/index.htm' INTO lcl_url.
lcl_name = 'Modificationoverview'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
APPEND '</item>' TO it_html.
ELSE.
READ TABLE it_prog_stueckliste WITH KEY type = 'Functionmodule(Modi)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Modifications</value>' TO it_html.
CONCATENATE './Modifications' '/index.htm' INTO lcl_url.
lcl_name = 'Modificationoverview'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
APPEND '</item>' TO it_html.
ELSE.
READ TABLE it_prog_stueckliste WITH KEY type = 'Screen(Modi)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Modifications</value>' TO it_html.
CONCATENATE './Modifications' '/index.htm' INTO lcl_url.
lcl_name = 'Modificationoverview'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
APPEND '</item>' TO it_html.
ENDIF. "Sreens
ENDIF. "Functionmodules
ENDIF. "Includes
*Ende der Navigationsseite
APPEND '</Nav>' TO it_html.
ENDFORM. " create_html_for_logdev
*&---------------------------------------------------------------------*
*& Form create_html_for_enh
*&---------------------------------------------------------------------*
* Navigationsdatei fuer Erweiterungsprojekt generieren.
*----------------------------------------------------------------------*
FORM create_html_for_enh.
*Bereiche fuer Ehnancementkomponenten
DATA: lcl_wa_enhancecomp TYPE enhancecomp.
*Rahmenprogrammname für Screenn
DATA: lcl_screenprog TYPE string.
*Variable fuer Screennummer
DATA: lcl_dynp(5) TYPE c.
*global_main_name
DATA: lcl_global_main_name LIKE global_main_name.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
* begin of changes for partner namespace
lcl_global_main_name = global_main_name.
TRANSLATE lcl_global_main_name USING '/_'.
* end of changes for partner namespace

*Funktionsbausteinexits
READ TABLE it_enhancecomp WITH KEY typus = 'Function Exit'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Function Exits:</value>' TO it_html.
*Funktionsbausteinexits
LOOP AT it_enhancecomp INTO lcl_wa_enhancecomp
WHERE typus = 'Function Exit'.
CONCATENATE 'Enh_' lcl_wa_enhancecomp-file_internal
'.xml' INTO lcl_url.
lcl_name = lcl_wa_enhancecomp-comp.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Dynproexits
READ TABLE it_enhancecomp WITH KEY typus = 'Dynpro-Exit'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Dynpro Exits:</value>' TO it_html.
*Dynproexits
LOOP AT it_enhancecomp INTO lcl_wa_enhancecomp
WHERE typus = 'Dynpro-Exit'.
*Dateinamen des Dynproexits zusammenbauen.
SEARCH lcl_wa_enhancecomp-file_internal FOR ','.
lcl_screenprog = lcl_wa_enhancecomp-file_internal(sy-fdpos).
SEARCH lcl_wa_enhancecomp-file_internal FOR ':'.
sy-fdpos = sy-fdpos + 1.
lcl_dynp = lcl_wa_enhancecomp-file_internal+sy-fdpos(4).
CONCATENATE lcl_screenprog lcl_dynp INTO lcl_screenprog.
*Listeneintrag schreiben
CONCATENATE 'SC_' lcl_screenprog '.txt' INTO lcl_url.
lcl_name = lcl_wa_enhancecomp-internal.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Customizing Include
READ TABLE it_enhancecomp WITH KEY typus = 'Customizing Include'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Customizing Includes:</value>' TO it_html.
LOOP AT it_enhancecomp INTO lcl_wa_enhancecomp
WHERE typus = 'Customizing Include'.
*Listeneintrag schreiben
CONCATENATE 'STR_' lcl_wa_enhancecomp-file_internal '.xml'
INTO lcl_url.
lcl_name = lcl_wa_enhancecomp-comp.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Menuexitcodelist
READ TABLE it_enhancecomp WITH KEY typus = 'Menu Exit'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Menu Exits:</value>' TO it_html.
*Listeneintrag schreiben
CONCATENATE 'Menulist_' lcl_global_main_name '.xml'
INTO lcl_url.
lcl_name = 'Menuexitcodelist'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
APPEND '</item>' TO it_html.
ENDIF.
*Form Includes wenn vorhanden
READ TABLE it_enhancecomp WITH KEY typus = 'Form Include'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Used Form Includes:</value>' TO it_html.
*Form-Includes
LOOP AT it_enhancecomp INTO lcl_wa_enhancecomp
WHERE typus = 'Form Include'.
*Listeneintrag schreiben
CONCATENATE 'Enh_' lcl_wa_enhancecomp-file_internal '.xml'
INTO lcl_url.
lcl_name = lcl_wa_enhancecomp-internal.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
ENDFORM. " create_html_for_enh
*&---------------------------------------------------------------------*
*& Form create_html_for_modis
*&---------------------------------------------------------------------*
* Generieren der Navigationsliste fuer Modifikationen.
*----------------------------------------------------------------------*
FORM create_html_for_modis.
*Variable fuer STringbezeichnung
DATA: lcl_dynp TYPE string.
*Bereich fuer Stueckliste
DATA: lcl_wa_prog_stueckliste TYPE prog_stueckliste.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
*Modidfizierte Includes verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'Include(Modi)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Modificated Includes</value>' TO it_html.
*Modidfizierte Includes
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Include(Modi)'.
CONCATENATE 'IN_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Modidfizierte Funktionsbausteine verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'Functionmodule(Modi)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Modificated Function Modules</value>' TO it_html.
*Modidfizierte Includes
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Functioninclude(Modi)'.

CONCATENATE 'IN_' lcl_wa_prog_stueckliste-file_name


'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-obername.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Modidfizierte Dynpros verarbeiten
READ TABLE it_prog_stueckliste WITH KEY type = 'Dynpro(Modi)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Modificated Dynpros</value>' TO it_html.
*Modidfizierte Dynpros
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Dynpro(Modi)'.
*Dynproname zusammenbauen
lcl_dynp = lcl_wa_prog_stueckliste-file_name.
CONDENSE lcl_dynp NO-GAPS.
CONCATENATE 'SC_' lcl_dynp
'.txt' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'..
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
ENDFORM. " create_html_for_modis
*&---------------------------------------------------------------------*
*& Form handle_class_extern
*&---------------------------------------------------------------------*
* Verabeitungsroutine fuer Klassen die bei späterer Verarbeitung
* aufgerufen werden. Die unterstuetzten Objekte der im Parameter
* P_NAME angegebenen Klasse werden gespeichert.
*----------------------------------------------------------------------*
FORM handle_class_extern USING p_name TYPE c.
DATA: lcl_it_inheritance TYPE STANDARD TABLE OF inheritance,
lcl_wa_inheritance LIKE LINE OF lcl_it_inheritance.
*Variable fuer Includenamen einer Typgruppe
DATA: lcl_typpconv LIKE wa_trdir-name.
*Bereiche fuer Interface
DATA: lcl_it_vseoimplem TYPE STANDARD TABLE OF vseoimplem,
lcl_wa_vseoimplem LIKE LINE OF lcl_it_vseoimplem.
*Bereich fuer Typgruppentabelle
DATA: lcl_it_vseotypep TYPE STANDARD TABLE OF vseotypep,
lcl_wa_vseotypep LIKE LINE OF lcl_it_vseotypep.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
*Variable fuer Klassenname
DATA: lcl_classname TYPE vseoclass-clsname.
*Klassenname setzen
lcl_classname = p_name.
*Globalen Namen setzen
lcl_name = global_main_name.
global_main_name = p_name.
*Stueckliste fuer Klasse schreibvne
PERFORM write_stueckliste USING 'Class'
lcl_classname
''.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING lcl_classname
'C'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'Class:' lcl_classname INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************
*1.) Klassenincludes herunterladen
PERFORM download_classincludes USING lcl_classname.
*2.)Typgruppe dieser Klasse behandeln
*Tabelle in der Zuordnung von Typgruppen zu Klassen stehen
SELECT * FROM vseotypep INTO TABLE lcl_it_vseotypep
WHERE clsname = lcl_classname.
IF NOT ( lcl_it_vseotypep IS INITIAL ).
LOOP AT lcl_it_vseotypep INTO lcl_wa_vseotypep.
*Nur herunterladenm, wenn Typegroup in Kundennamensraum
IF ( ( lcl_wa_vseotypep-typegroup(1) = 'Z' )
OR ( lcl_wa_vseotypep-typegroup(1) = 'Y' ) ).
CLEAR ok.
*Zusammensetzen des Includenamen fuer die Typgruppe
CONCATENATE '%_C' lcl_wa_vseotypep-typegroup INTO lcl_typpconv.
*Typgruppeninclude herunterladen
PERFORM download_include USING lcl_typpconv
'T'
CHANGING ok .
IF ok = 'X'. "Download war erfolgreich
*Klassenliste schreiben.
CLEAR wa_classlist.
MOVE lcl_wa_vseotypep-typegroup TO wa_classlist-inc.
MOVE 'Typgroup' TO wa_classlist-typus.
APPEND wa_classlist TO it_classlist.
ENDIF. "Ok-abfrage
ENDIF.
ENDLOOP.
ENDIF.
*3.)Uebersichtsliste ueber diese Klasse
PERFORM download_classlist USING lcl_classname.

*4.)Implementierte Interfaces sichern


SELECT DISTINCT clsname refclsname FROM vseoimplem
INTO CORRESPONDING FIELDS OF TABLE lcl_it_vseoimplem
WHERE clsname = lcl_classname.
LOOP AT lcl_it_vseoimplem INTO lcl_wa_vseoimplem.
IF ( lcl_wa_vseoimplem-refclsname(1) = 'Z'
OR lcl_wa_vseoimplem-refclsname(1) = 'Y' ).

PERFORM write_global_save USING 'I' lcl_wa_vseoimplem-refclsname.


*Stueckliste schreiben
PERFORM write_stueckliste USING 'Interface'
lcl_wa_vseoimplem-refclsname
lcl_classname.
ENDIF.
ENDLOOP.
*5.) Klassen der Vererbungshierarchie sichern
SELECT SINGLE clsname refclsname FROM vseoextend
INTO lcl_wa_inheritance
WHERE clsname = lcl_classname
AND ( ( refclsname LIKE 'Z%' )
OR ( refclsname LIKE 'Y%' )
OR ( refclsname LIKE g_name ) ).
IF sy-subrc = 0.
APPEND lcl_wa_inheritance TO lcl_it_inheritance.
ENDIF.
*Vererbungshierarchie aufwärts durcharbeiten wenn im
*Kundennamensraum
WHILE ( sy-subrc = 0 ).
SELECT SINGLE clsname refclsname FROM vseoextend
INTO lcl_wa_inheritance
WHERE clsname = lcl_wa_inheritance-super
AND ( ( refclsname LIKE 'Z%' )
OR ( refclsname LIKE 'Y%' )
OR ( refclsname LIKE g_name ) ).
IF sy-subrc = 0.
APPEND lcl_wa_inheritance TO lcl_it_inheritance.
ENDIF.
ENDWHILE.
*In Liste fuer exterene Programmaufrufe schreiben
LOOP AT lcl_it_inheritance INTO lcl_wa_inheritance.
PERFORM write_global_save USING 'C'
lcl_wa_inheritance-super.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Class(OO)'
lcl_wa_inheritance-super
lcl_classname.
ENDLOOP.
*Trennung von Einzeldateiobjekten
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
*6.)Vererbte Klassen herunterladen
PERFORM download_class_inheritance.
*Domaenen downloaden
PERFORM download_domains.
*Datenelementliste downloaden
PERFORM download_dataelements.
*Berechtigungsobjekt Infos downloaden
PERFORM download_authorityobjects.
*Titlebars herunterladen
PERFORM download_titlebar.
*Meldungen herunterladen
PERFORM download_messages.
*Gesamtliste der Transaktionscodes fuer Klasse herunterladen
PERFORM download_tacodelist_for_class.
*Gesamtliste mit Dialogbaustein->Funktionsbausteinzuordnung
*herunterladen und Gesamtliste mit Dialogpoolparametern herunterladen.
PERFORM download_dialogmodule_elements.
*Gesamtliste der Parameter herunterschreiben
PERFORM download_setgetparams.
*Gesamtstückliste
PERFORM download_stueckliste.
*HP-Stand sichern
PERFORM download_hpstand.
* SKIP. "Listausgabeformatierung
PERFORM write_protocol USING 'S' '' '' ''.
*Wenn nicht bei externer Verarbeitung aufgerufen Aufruf der
*externen Verarbeitung
IF extern IS INITIAL.
*Externe Rahmenprogrammaufrufe nicht behandeln wenn
*Aufruf aus Transportauftrag
IF p_trkorr IS INITIAL.
PERFORM handle_externalprogs.
ENDIF. "Flag fuer Transportauftrag
ENDIF. "in externer Verarbeitung
*globalen Namen setzen
global_main_name = lcl_name.
ENDFORM. " handle_class_extern
*&---------------------------------------------------------------------*
*& Form handle_interface_extern
*&---------------------------------------------------------------------*
* Verabeitungsroutine fuer Interfaces die bei späterer Verarbeitung
* aufgerufen werden.
*----------------------------------------------------------------------*
FORM handle_interface_extern USING p_wa_global_save LIKE wa_global_save.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
*Globalen Namen setzen
lcl_name = global_main_name.
global_main_name = p_wa_global_save-name.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING p_wa_global_save-name
'I'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*Ausgabeformatierungen: Ueberschrift
* FORMAT COLOR COL_HEADING.
* WRITE: / 'Interface: ', p_wa_global_save-name.
* FORMAT COLOR COL_BACKGROUND.
* ULINE.
*Ueberschrift zusammenbauen
CONCATENATE 'Interface:' p_wa_global_save-name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************
*Oberster Knoten der Stueckliste
PERFORM write_stueckliste USING 'Interface(OO)'
p_wa_global_save-name
''.
*Eigentlicher Download durchfuehren
PERFORM download_interface USING p_wa_global_save-name.
*Trennung von Einzelobjekten
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
*Gesamtstückliste
PERFORM download_stueckliste.
*globalen Namen setzen
global_main_name = lcl_name.
ENDFORM. " handle_interface_extern
*&---------------------------------------------------------------------*
*& Form handle_badi_implementation
*&---------------------------------------------------------------------*
* Verarbeitungsroutine fuer Badiimplementierungen. Der Name der
* Implementierung wird im Parameter P_NAME uebermittelt.
*----------------------------------------------------------------------*
FORM handle_badi_implementation USING p_name TYPE c.
*Bereich fuer Implementierungsklasse
DATA: lcl_it_impclass TYPE STANDARD TABLE OF sxc_class-imp_class,
lcl_wa_impclass LIKE LINE OF lcl_it_impclass.
*Bereich fuer trdir-Namen fuer Klassenverarbeitung
DATA: lcl_wa_trdirname TYPE trdir-name.
*Variable fuer Laengenbestimmung eines Includes
DATA: lcl_len TYPE i.
*Variable fuer Suchstring trdir-name
DATA: lcl_such TYPE trdir-name.
*Bereiche fuer Uebersicht Badi zu Implementierung und Filterparameter
DATA: lcl_it_sxc_exit TYPE STANDARD TABLE OF sxc_exit.
*Bereich fuer Badisubscreens
DATA: lcl_it_sxc_scrn TYPE STANDARD TABLE OF sxc_scrn,
lcl_wa_sxc_scrn LIKE LINE OF lcl_it_sxc_scrn.
*Bereich fuer Subscreen
DATA: lcl_wa_d020s TYPE d020s.
*Variable zur Speicherung des globalen Namens
DATA: lcl_name LIKE wa_trdir-name.
*Variablen zur Speicherung der Verzeichnisnamem.
DATA: lcl_new_dir LIKE new_dir,
lcl_dir LIKE dir.
*Stueckliste scihern
DATA: lcl_it_prog_stueckliste LIKE it_prog_stueckliste.

*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm


PERFORM create_directory USING p_name
'B'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*global_main_name fuer globalen Gebrauch aufbereiten
*-->Parametrisierung umgangen
global_main_name = p_name.
*Ueberschrift zusammenbauen
CONCATENATE 'Badiimplementation:' global_main_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************
*Intitialisieren der globalen Tabellen
PERFORM initialize.

*Schreiben der Stueckliste fuer diese Badi-Implementierung


PERFORM write_stueckliste USING 'Badiimp'
p_name
''.
*1.)evtl. Subscreens der Implementierung herunterladen
SELECT * FROM sxc_scrn INTO TABLE lcl_it_sxc_scrn
WHERE imp_name = p_name.
IF sy-subrc = 0.
LOOP AT lcl_it_sxc_scrn INTO lcl_wa_sxc_scrn.
lcl_wa_d020s-prog = lcl_wa_sxc_scrn-scr_a_prog.
lcl_wa_d020s-dnum = lcl_wa_sxc_scrn-scr_a_num.
PERFORM download_dynpro USING lcl_wa_d020s.
ENDLOOP.
ENDIF.
*Implementierungsklassen fuer diese Badiimplementierung wählen
SELECT imp_class FROM sxc_class INTO TABLE lcl_it_impclass
WHERE imp_name = p_name.
*Verarbeitung der Implementierungsklassen dieser Badiimplementierung
LOOP AT lcl_it_impclass INTO lcl_wa_impclass.
*Schreiben der Stueckliste fuer diese Klass
PERFORM write_stueckliste USING 'Class'
lcl_wa_impclass
p_name.

*2.)Uebersicht von Filter,Badi zu Implementierung schreiben


REFRESH lcl_it_sxc_exit.
SELECT * FROM sxc_exit INTO TABLE lcl_it_sxc_exit
WHERE imp_name = p_name.
APPEND LINES OF lcl_it_sxc_exit TO it_ges_sxc_exit.
*Ubersicht der Filterparameter der Implementierung schreiben
PERFORM download_badi_filterparams USING p_name.
*3.)Klasse herunterladen
* PERFORM handle_classinterface USING lcl_wa_trdirname
* 'K'.
*Name sicern
lcl_name = global_main_name.
*Stueckliste sichern
lcl_it_prog_stueckliste = it_prog_stueckliste.
*Verzeichnisse sichern
lcl_dir = dir.
lcl_new_dir = new_dir.
dir = new_dir.
PERFORM initialize.
*Klasse sichern
* PERFORM handle_class USING lcl_wa_impclass.
PERFORM handle_class_extern USING lcl_wa_impclass .
*Verzeichnisse zurücksichern
dir = lcl_dir.
new_dir = lcl_new_dir.
*Ruecksicherung Stueckliste
it_prog_stueckliste = lcl_it_prog_stueckliste .
*Ruecksicherung Name
global_main_name = lcl_name.
ENDLOOP. "Implementierungsklassen

* ULINE. "Listausgabeformatierung
PERFORM write_protocol USING 'L' '' '' ''.
*Gesamtstückliste
PERFORM download_stueckliste.

*Hp-Stand sichern
PERFORM download_hpstand.
*Leerzeile nach Ende dieser Verarbeitung
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
*Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'BADI-Imlementation'
global_main_name
p_logic.
ENDIF.
ENDFORM. " handle_badi_implementation
*&---------------------------------------------------------------------*
*& Form create_html_for_devclass
*&---------------------------------------------------------------------*
* Generieren der Eintraege in der Navigationsdatei fuer
* Entwicklungsklassen.
*----------------------------------------------------------------------*
FORM create_html_for_devclass.
*Lokaler Arbeitsbereich fuer Stueckliste
DATA: lcl_wa_prog_stueckliste TYPE prog_stueckliste.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
*Funktionsgruppen
READ TABLE it_prog_stueckliste WITH KEY type = 'Funktionsgruppe'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Functiongroups:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Funktionsgruppe'.
CONCATENATE './FG_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Reports/Modulpoole
READ TABLE it_prog_stueckliste WITH KEY type = 'Report/Modulpool'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Reports/Modulpools :</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Report/Modulpool'.
CONCATENATE './RM_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Klassen
READ TABLE it_prog_stueckliste WITH KEY type = 'Class(OO)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Classes:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Class(OO)'.
CONCATENATE './OC_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Interfaces
READ TABLE it_prog_stueckliste WITH KEY type = 'Interface(OO)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Used Interfaces</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Interface(OO)'.

CONCATENATE './OI_' lcl_wa_prog_stueckliste-file_name


'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Enhancement Projects
READ TABLE it_prog_stueckliste WITH KEY type = 'CMOD-Enhancement'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Enhancement Projects:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'CMOD-Enhancement'.
CONCATENATE './EP_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Badi Implementation
READ TABLE it_prog_stueckliste WITH KEY type = 'Badi Implementation'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Badiimplementation:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Badi Implementation'.
CONCATENATE './BI_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*IAC-Services
READ TABLE it_prog_stueckliste WITH KEY type = 'IACS'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>IAC-Services:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'IACS'.
CONCATENATE './IAC_' lcl_wa_prog_stueckliste-file_name
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*IDoc-Erweiterung
READ TABLE it_prog_stueckliste WITH KEY type = 'IDOC-Basistyp'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>IDoc Basistype:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'IDOC-Basityp'.
CONCATENATE './IB_' lcl_wa_prog_stueckliste-file_name
'/' lcl_wa_prog_stueckliste-file_name '_d.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*IDOC-Erweiterung
READ TABLE it_prog_stueckliste WITH KEY type = 'IDOC-Erweiterung'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>IDoc Enhancement:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'IDOC-Erweiterung'.
CONCATENATE './IE_' lcl_wa_prog_stueckliste-file_name
'/' lcl_wa_prog_stueckliste-file_name '_d.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
ENDFORM. " create_html_for_devclass
*&---------------------------------------------------------------------*
*& Form create_html_for_trkorr
*&---------------------------------------------------------------------*
* Generieren der speziellen Eintraege in der Navigationsdatei fuer
* Transportauftraege.
*----------------------------------------------------------------------*
FORM create_html_for_trkorr.
*lokaler Arbeitsbereich fuer Stueckliste.
DATA: lcl_wa_prog_stueckliste TYPE prog_stueckliste.
*Bereich fuer Ermittlung des Klassennamens
DATA: lcl_text(30) TYPE c.
*global_main_name
DATA: lcl_global_main_name LIKE global_main_name.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
* begin of changes for partner namespace
lcl_global_main_name = global_main_name.
TRANSLATE lcl_global_main_name USING '/_'.
* end of changes for partner namespace

*Report oder Modulpoole


READ TABLE it_prog_stueckliste WITH KEY type = 'PROG'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Reports / Modulpools:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'PROG'.
CONCATENATE 'RM_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Einzelne Inlcudes
READ TABLE it_prog_stueckliste WITH KEY type = 'REPS'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Includes:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'REPS'.
CONCATENATE 'IN_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Funktionsbausteine
READ TABLE it_prog_stueckliste WITH KEY type = 'IN'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Functionmodule:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'IN'.
CONCATENATE './Func_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
CONCATENATE lcl_wa_prog_stueckliste-obername '('
lcl_wa_prog_stueckliste-name ')'
INTO lcl_name SEPARATED BY space.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Funktionsgruppe
READ TABLE it_prog_stueckliste WITH KEY type = 'Functiongroup'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Functiongroup:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Functiongroup'.
CONCATENATE './FG_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*IAC-Service
READ TABLE it_prog_stueckliste WITH KEY type = 'IACS'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>IAC-Service:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'IACS'.
CONCATENATE 'IAC_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*IAC-Template
READ TABLE it_prog_stueckliste WITH KEY type = 'IACT'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>IAC-Templates</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'IACT'.
IF lcl_wa_prog_stueckliste-name+16(4) IS INITIAL.
MOVE lcl_wa_prog_stueckliste-name+20
TO lcl_name.
REPLACE '/' WITH '-' INTO lcl_wa_prog_stueckliste-name.
CONCATENATE './TEMPLATES'
'/' lcl_wa_prog_stueckliste-name(14)
'/' lcl_wa_prog_stueckliste-name+14(2)
'/' lcl_wa_prog_stueckliste-name+20
'.txt' INTO lcl_url.
ELSE.
CONCATENATE lcl_wa_prog_stueckliste-name+20
'_' lcl_wa_prog_stueckliste-name+16(4)
INTO lcl_name.
REPLACE '/' WITH '-' INTO lcl_wa_prog_stueckliste-name.
CONCATENATE './TEMPLATES'
'/' lcl_wa_prog_stueckliste-name(14)
'/' lcl_wa_prog_stueckliste-name+14(2)
'/' lcl_wa_prog_stueckliste-name+20
'_' lcl_wa_prog_stueckliste-name+16(4)
'.txt' INTO lcl_url.
ENDIF.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*IDoc-Erweiterung
READ TABLE it_prog_stueckliste WITH KEY type = 'BasisIDoc'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>IDoc Basistype:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'BasisIDoc'.
CONCATENATE './IB_' lcl_wa_prog_stueckliste-file_name
'/' lcl_wa_prog_stueckliste-file_name '_d.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*IDOC-Erweiterung
READ TABLE it_prog_stueckliste WITH KEY type = 'IDOC-Erweiterung'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>IDoc Enhancement:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'IDOC-Erweiterung'.
CONCATENATE './IE_' lcl_wa_prog_stueckliste-file_name
'/' lcl_wa_prog_stueckliste-file_name '_d.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Enhancement Projects
READ TABLE it_prog_stueckliste WITH KEY type = 'Enhancement Project'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Enhancement Projects:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Enhancement Project'.
CONCATENATE './EP_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Badi Implementation
READ TABLE it_prog_stueckliste WITH KEY type = 'Badi Implementation'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Badi Implementation:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Badi Implementation'.
CONCATENATE './BI_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Private Header Include


READ TABLE it_prog_stueckliste WITH KEY type = 'PrivateHeaderInclude'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Private Header of:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'PrivateHeaderInclude'.
*Workaround fuer Klassennamen
SEARCH lcl_wa_prog_stueckliste-name FOR '='.
IF sy-subrc = 4.
lcl_text = lcl_wa_prog_stueckliste-name.
ELSE.
lcl_text =
lcl_wa_prog_stueckliste-name(sy-fdpos).
ENDIF.

CONCATENATE 'CLIN_' lcl_wa_prog_stueckliste-file_name


'.xml' INTO lcl_url.
lcl_name = lcl_text.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Protected Header Include


READ TABLE it_prog_stueckliste WITH KEY type = 'ProtectedHeaderInclude'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Protected Header of:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'ProtectedHeaderInclude'.
*Workaround fuer Klassennamen
SEARCH lcl_wa_prog_stueckliste-name FOR '='.
IF sy-subrc = 4.
lcl_text = lcl_wa_prog_stueckliste-name.
ELSE.
lcl_text =
lcl_wa_prog_stueckliste-name(sy-fdpos).
ENDIF.
CONCATENATE 'CLIN_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_text.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Public Header Include


READ TABLE it_prog_stueckliste WITH KEY type = 'PublicHeaderInclude'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Public Header of</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'PublicHeaderInclude'.
*Workaround fuer Klassennamen
SEARCH lcl_wa_prog_stueckliste-name FOR '='.
IF sy-subrc = 4.
lcl_text = lcl_wa_prog_stueckliste-name.
ELSE.
lcl_text =
lcl_wa_prog_stueckliste-name(sy-fdpos).
ENDIF.
CONCATENATE 'CLIN_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_text.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Mehtoden Include
READ TABLE it_prog_stueckliste WITH KEY type = 'Methodinclude'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Methods</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Methodinclude'.
CONCATENATE 'CLIN_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-obername.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Klasseninclude
READ TABLE it_prog_stueckliste WITH KEY type = 'CINC'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Classincludes</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'CINC'.
CONCATENATE 'CLIN_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Klassen, nur Hinweis darauf(nicht verlinken)


READ TABLE it_prog_stueckliste WITH KEY type = 'Class'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Used Classes</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Class'.
CONCATENATE './OC_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Interfaces
READ TABLE it_prog_stueckliste WITH KEY type = 'Interface'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Used Interfaces</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Interface'.

CONCATENATE './OI_' lcl_wa_prog_stueckliste-file_name


'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Messageklassen
READ TABLE it_prog_stueckliste WITH KEY type = 'MSAG'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Mesageclasses</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'MSAG'.
CONCATENATE lcl_wa_prog_stueckliste-file_name '.xml'
INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.

*Berechtigungsobjekte
READ TABLE it_prog_stueckliste WITH KEY type = 'Authority Object(TR)'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Authority Objects:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type ='Authority Object(TR)'.
* Authority-Objectliste
CONCATENATE 'Auhthorityobject_'
lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
* Aktivitaetenliste, wenn vorhanden
READ TABLE it_prog_stueckliste WITH KEY
type = 'Activities of Authority Object'
name = lcl_wa_prog_stueckliste-name
INTO lcl_wa_prog_stueckliste.
IF sy-subrc = 0.
CONCATENATE 'AuthActivities'
lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = 'Activities of Authority Objects'.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDIF.
APPEND '</item>' TO it_html.
ENDIF.
*Spezielle Transaktionscodeliste fuer Klassen
READ TABLE it_prog_stueckliste WITH KEY
type = 'Transactioncodelist(Class)'
INTO lcl_wa_prog_stueckliste.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Transactioncodes:</value>' TO it_html.
CONCATENATE 'Tacodeclass_'
lcl_global_main_name '.xml' INTO lcl_url.
CONCATENATE lcl_wa_prog_stueckliste-obername '(Classes)'
INTO lcl_name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
APPEND '</item>' TO it_html.
ENDIF.
ENDFORM. " create_html_for_trkorr
*&---------------------------------------------------------------------*
*& Form create_html_for_badiimps
*&---------------------------------------------------------------------*
* Generieren der Eintraege der Navigationsdatei fuer
* Badiimplementierungen.
*----------------------------------------------------------------------*
FORM create_html_for_badiimps.
*Arbeitsbereich fuer Stuecklisten
DATA: lcl_wa_prog_stueckliste TYPE prog_stueckliste.
*Bereiche fuer die Ermittlung des Badi zur Implementiuerung
DATA: lcl_badi TYPE sxc_exit-exit_name.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
*Ermittlung des namens des implementierten Badis
READ TABLE it_prog_stueckliste INDEX 1 INTO
lcl_wa_prog_stueckliste.
SELECT SINGLE exit_name FROM sxc_exit INTO lcl_badi
WHERE imp_name = lcl_wa_prog_stueckliste-name.
APPEND '<item>' TO it_html.
CONCATENATE '<value>Implemented Badi:' lcl_badi '</value>'
INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
*Implementierungsklassen
READ TABLE it_prog_stueckliste WITH KEY type = 'Class'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.

* Verarbeitung der Klassen--> Verweis auf Verzeichnis der Klassen


LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Class'.
IF p_trkorr IS INITIAL AND p_devc IS INITIAL.
CONCATENATE './OC_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
CONCATENATE '../OC_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF.

PERFORM nav_xml_add_subitem USING lcl_url


lcl_name
'_blank'.
ENDLOOP.
ENDIF. "Klassen vorhanden
APPEND '</item>' TO it_html.

*Filterparameter
READ TABLE it_prog_stueckliste WITH KEY type = 'Filterparameter'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Filterparameter:</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Filterparameter'.
* begin of changes for partner namespace
TRANSLATE lcl_wa_prog_stueckliste-obername USING '/_'.
* end of changes for partner namespace
CONCATENATE 'BadiImpFilter_'
lcl_wa_prog_stueckliste-obername '.xml' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
ENDFORM. " create_html_for_badiimps
*&---------------------------------------------------------------------*
*& Form trkorr_messageclass
*&---------------------------------------------------------------------*
* Verarbetungsroutine fuer komplette Nachrichtenklassen, die in
* Transportauftraegen enthalten sind. Der Name der
* Nachrichtenklasse wird im Parameter P_NAME uebermittelt.
*----------------------------------------------------------------------*
FORM trkorr_messageclass USING p_name TYPE e071-obj_name
p_trkorr TYPE c.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Bereich der Nachrichtentabellle
DATA: lcl_it_messages TYPE STANDARD TABLE OF t100,
lcl_wa_messages LIKE LINE OF lcl_it_messages.
*Name fuer die Gesamtmessagetabelle des Rahmenprogramms
DATA: lcl_messagetab_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.
*Schleife ueber Sprachtabelle
LOOP AT it_lan INTO wa_lan.
REFRESH it_html.
CLEAR wa_html.
REFRESH lcl_it_headerrow.
*Messagetabelle fuer Klasse lesen
SELECT * FROM t100 INTO TABLE lcl_it_messages
WHERE arbgb = p_name
AND sprsl = wa_lan.
IF sy-subrc = 0. "Saetze gelesen
CONCATENATE 'Messageclass_' p_name '(' wa_lan ')' INTO
lcl_messagetab_name.
*Umwandlung in HTML-Tabelle
********************************************************
*Ueberschrift zusammenbauen
CONCATENATE 'Messageclass'
p_name '(Language:' wa_lan ')' INTO lcl_header
SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Language' TO lcl_it_headerrow.
APPEND 'Working Area' TO lcl_it_headerrow.
APPEND 'Message Number' TO lcl_it_headerrow.
APPEND 'Message Text' TO lcl_it_headerrow.

PERFORM create_htmltab_header USING lcl_it_headerrow


lcl_header.
LOOP AT lcl_it_messages INTO lcl_wa_messages.
PERFORM create_htmltab_body USING lcl_wa_messages.
ENDLOOP.
PERFORM create_html_tab_foot.
*********************************************************

CLEAR filename.
CONCATENATE new_dir '\' lcl_messagetab_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_messages
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text071 lcl_messagetab_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text071 lcl_messagetab_name
filename.
*Stueckliste schreiben fuer dieses Objekt
PERFORM write_stueckliste USING 'MSAG'
lcl_messagetab_name
p_trkorr.

ENDIF.
ENDIF. "Download nur wenn Messagetabelle nicht leer ist
ENDLOOP.
ENDFORM. " trkorr_messageclass
*&---------------------------------------------------------------------*
*& Form handle_tabletype
*&---------------------------------------------------------------------*
* Verarbeitung des im Parameter p_name uebergebenen
* Tabellentyps.
*----------------------------------------------------------------------*
FORM handle_tabletype USING p_name TYPE c.
*Bereich zur Feststellung des Tabellentyps
DATA: lcl_wa_dd02l TYPE dd02l.
*Bereich zum Feststellen des Referenztyps
DATA: lcl_reftype TYPE seoclass-clstype.
REFRESH it_tabletypes.
SELECT SINGLE * FROM dd40vv INTO wa_tabletypes
WHERE typename = p_name.
APPEND wa_tabletypes TO it_tabletypes.
CASE wa_tabletypes-rowkind.
WHEN 'S'. "Strukturierter Typ: Struktur oder Tabelle
*Liegt Bezugstype im Kundennamensraum
IF wa_tabletypes-rowtype(1) = 'Z'
OR wa_tabletypes-rowtype(1) = 'Y'
OR wa_tabletypes-rowtype(g_len_nspace) = p_nspace.
* Feststellen des Typs des DDicobjektes
SELECT SINGLE * FROM dd02l INTO lcl_wa_dd02l
WHERE tabname = wa_tabletypes-rowtype.
* Behandlung der Faelle
CASE lcl_wa_dd02l-tabclass.
WHEN 'TRANSP'. "normale Tabellen
PERFORM download_table USING lcl_wa_dd02l 'T'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Table'
wa_tabletypes-rowtype
global_main_name.
WHEN 'VIEW'. "View
PERFORM download_table USING lcl_wa_dd02l 'V'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'View'
wa_tabletypes-rowtype
global_main_name.
WHEN 'INTTAB'. "Struktur
PERFORM download_table USING lcl_wa_dd02l 'S'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Structure'
wa_tabletypes-rowtype
global_main_name.
ENDCASE.
ENDIF.
WHEN 'L'. "Tabellentyp
PERFORM handle_tabletype USING wa_tabletypes-rowtype.
WHEN 'R'. "Referenztyp Interface oder Klasse
SELECT SINGLE clstype FROM seoclass INTO lcl_reftype
WHERE clsname = wa_tabletypes-rowtype.
IF lcl_reftype = 0.
PERFORM write_global_save USING 'C' wa_tabletypes-rowtype.
ELSE.
PERFORM write_global_save USING 'I' wa_tabletypes-rowtype.
ENDIF.
WHEN 'E'. "Datenelement
*Liegt Bezugstype im Kundennamensraum
IF wa_tabletypes-rowtype(1) = 'Z'
OR wa_tabletypes-rowtype(1) = 'Y'
OR wa_tabletypes-rowtype(g_len_nspace) = p_nspace.
PERFORM write_dataelements USING wa_tabletypes-rowtype.
ENDIF.
WHEN 'D'. "Domaene
*Liegt Bezugstype im Kundennamensraum
IF wa_tabletypes-rowtype(1) = 'Z'
OR wa_tabletypes-rowtype(1) = 'Y'
OR wa_tabletypes-rowtype(g_len_nspace) = p_nspace.
wa_dataelements-domname = wa_tabletypes-rowtype.
APPEND wa_dataelements TO it_dataelements.
ENDIF.
ENDCASE.
*Herunterladen des Tabellentyps
PERFORM download_tabletypes USING p_name.
ENDFORM. " get_tabletype
*&---------------------------------------------------------------------*
*& Form download_tabletypes
*&---------------------------------------------------------------------*
* Sicherung des im Parmeter P_NAME uebermittelten Tabellentyps
* in das Dateisystem.
*----------------------------------------------------------------------*
FORM download_tabletypes USING p_name.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Stücklistenname
DATA: lcl_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string,
lcl_wa_headerrow LIKE LINE OF lcl_it_headerrow.
*interner Bereich fuer Infos zu Tabellentypen
DATA: lcl_wa_itabletypes TYPE itabletypes.
*Bereiche fuer Verarbeitung der Schlüsselfelder
DATA: lcl_it_idd42s TYPE STANDARD TABLE OF idd42s,
lcl_wa_idd42s LIKE LINE OF lcl_it_idd42s.
*Lesen evtl. Schlüsselfelder
SELECT keyfdpos keyfield FROM dd42s INTO TABLE lcl_it_idd42s
WHERE typename = p_name.
*Ueberschrift zusammenbauen
CONCATENATE 'Tabletypes' p_name
INTO lcl_header SEPARATED BY space.
*Headertabelle zusammenbauen
APPEND 'Typename' TO lcl_it_headerrow.
APPEND 'Name of row type ' TO lcl_it_headerrow.
APPEND 'Dictionary type' TO lcl_it_headerrow.
APPEND 'Data Type' TO lcl_it_headerrow.
APPEND 'Length of Datatype' TO lcl_it_headerrow.
APPEND 'Number of decimal places' TO lcl_it_headerrow.
APPEND 'Access modes' TO lcl_it_headerrow.
APPEND 'Key definition' TO lcl_it_headerrow.
APPEND 'Key category' TO lcl_it_headerrow.
APPEND 'Generic (flag)' TO lcl_it_headerrow.

*Umwandlung in HTML-Tabelle
********************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_tabletypes INTO wa_tabletypes.
MOVE-CORRESPONDING wa_tabletypes TO lcl_wa_itabletypes.
*Ersetzen der aussagelosen Flags
PERFORM substitute_flags_for_tabletype CHANGING lcl_wa_itabletypes.
PERFORM create_htmltab_body USING lcl_wa_itabletypes.
ENDLOOP.
*Build detailed Table manually
*Anzeige der Schluesselfelder
IF NOT ( lcl_it_idd42s IS INITIAL ).
APPEND '</Tabelle>' TO it_html.
APPEND '<Tabelle>' TO it_html.
APPEND '<header>Keyfields</header>' TO it_html.
REFRESH lcl_it_headerrow.
APPEND '<tab_header>' TO it_html.
APPEND '<value>Position of key component in key</value>' TO it_html.
APPEND '<value>Key component</value>' TO it_html.
APPEND '</tab_header>' TO it_html.
LOOP AT lcl_it_idd42s INTO lcl_wa_idd42s.
PERFORM create_htmltab_body USING lcl_wa_idd42s.
ENDLOOP.
ENDIF.

PERFORM create_html_tab_foot.
*********************************************************
CONCATENATE 'Tabletype_' p_name INTO lcl_name.
CLEAR filename.
CONCATENATE new_dir '\' lcl_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text072 lcl_name filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text072 lcl_name filename.
ENDIF.

ENDFORM. " download_tabletypes


*&---------------------------------------------------------------------*
*& Form substitute_flags_for_tabletype
*&---------------------------------------------------------------------*
* Ersetzen bestimmmter Flags in der uebergebenen Struktur
* p_wa_itabletype durch aussagefähige Eintraege.
*----------------------------------------------------------------------*
FORM substitute_flags_for_tabletype
CHANGING p_wa_itabletype TYPE itabletypes.

*Aenderung des Feldes accessmode


CASE p_wa_itabletype-accessmode.
WHEN 'A'.
p_wa_itabletype-accessmode = 'not specified'.
WHEN 'I'.
p_wa_itabletype-accessmode = 'Indextable'.
WHEN 'T'.
p_wa_itabletype-accessmode = 'Standard Table'.
WHEN 'S'.
p_wa_itabletype-accessmode = 'Sorted Table'.
WHEN 'H'.
p_wa_itabletype-accessmode = 'Hash Table'.
ENDCASE.
*Aenderung des Feldes keydef
CASE p_wa_itabletype-keydef.
WHEN 'D'.
p_wa_itabletype-keydef = 'Standardkey'.
WHEN 'T'.
p_wa_itabletype-keydef = 'Rowtype'.
WHEN 'G'.
p_wa_itabletype-keydef = 'Not specified'.
WHEN 'K'.
p_wa_itabletype-keydef = 'Key Components'.
ENDCASE.
*Aenderung des Feldes keykind
CASE p_wa_itabletype-keykind.
WHEN 'U'.
p_wa_itabletype-keykind = 'Unique'.
WHEN 'N'.
p_wa_itabletype-keykind = 'Non-unique'.
WHEN 'G'.
p_wa_itabletype-keykind = 'Not specified'.
ENDCASE.
*Aenderung des Feldes ROWKIND
CASE p_wa_itabletype-rowkind.
WHEN 'E'.
p_wa_itabletype-rowkind = 'Elementary Type'.
WHEN 'S'.
p_wa_itabletype-rowkind = 'Structured type'.
WHEN 'L'.
p_wa_itabletype-rowkind = 'Table Type'.
WHEN ''.
p_wa_itabletype-rowkind = 'Direct type entry'.
WHEN 'R'.
p_wa_itabletype-rowkind = 'Reference Type'.
WHEN ''.
p_wa_itabletype-rowkind = 'Domain'.
ENDCASE.
ENDFORM. " substitute_flags_for_tabletype

*&---------------------------------------------------------------------*
*& Form download_view
*&---------------------------------------------------------------------*
* Verarbeitungsrouttine fuer Views
* Lesen und Speicherun der Joinbedingungen
*----------------------------------------------------------------------*
FORM download_view USING p_wa_dd02l TYPE dd02l.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Ausgabename
DATA: lcl_name TYPE string.
*Bereiche zur Aufnahme der Selektionsbedingungen
DATA: lcl_it_idd28s TYPE STANDARD TABLE OF idd28s,
lcl_wa_idd28s LIKE LINE OF lcl_it_idd28s.
*Bereiche zur Aufnnahme der Join-Bedingungen
DATA: lcl_it_idd28j TYPE STANDARD TABLE OF idd28j,
lcl_wa_idd28j LIKE LINE OF lcl_it_idd28j.
*Verich fuer Viewfelder
DATA: lcl_it_idd27s TYPE STANDARD TABLE OF idd27s,
lcl_wa_idd27s LIKE LINE OF lcl_it_idd27s.
*Tabelle fuer Viewtabellen
DATA: lcl_it_dd02l TYPE STANDARD TABLE OF dd02l,
lcl_wa_dd02l LIKE LINE OF lcl_it_dd02l.
*Ueberschrift fuer HTML-Tablle
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string,
lcl_wa_headerrow LIKE LINE OF lcl_it_headerrow.
* Data defintion for function module
* Basistabellen
DATA: lcl_it_dd26v TYPE STANDARD TABLE OF dd26v,
lcl_wa_dd26v LIKE LINE OF lcl_it_dd26v.
* Fields of the view
DATA: lcl_it_dd27p TYPE STANDARD TABLE OF dd27p,
lcl_wa_dd27p LIKE LINE OF lcl_it_dd27p.
* Join-Conditions
DATA: lcl_it_dd28j TYPE STANDARD TABLE OF dd28j,
lcl_wa_dd28j LIKE LINE OF lcl_it_dd28j.
* Selection Conditions
DATA: lcl_it_dd28v TYPE STANDARD TABLE OF dd28v,
lcl_wa_dd28v LIKE LINE OF lcl_it_dd28v.

CALL FUNCTION 'DDIF_VIEW_GET'


EXPORTING
name = p_wa_dd02l-tabname
state = 'A'
* LANGU =
* IMPORTING
* GOTSTATE =
* DD25V_WA =
* DD09L_WA =
TABLES
dd26v_tab = lcl_it_dd26v
dd27p_tab = lcl_it_dd27p
dd28j_tab = lcl_it_dd28j
dd28v_tab = lcl_it_dd28v
EXCEPTIONS
illegal_input = 1
OTHERS = 2
.
IF sy-subrc <> 0.
EXIT.
ENDIF.
* Convert data from format of function module to internal format
* Fields of view
LOOP AT lcl_it_dd27p INTO lcl_wa_dd27p.
MOVE-CORRESPONDING lcl_wa_dd27p TO lcl_wa_idd27s.
APPEND lcl_wa_idd27s TO lcl_it_idd27s.
ENDLOOP.
* Selection conditions
LOOP AT lcl_it_dd28j INTO lcl_wa_dd28j.
MOVE-CORRESPONDING lcl_wa_dd28j TO lcl_wa_idd28j.
APPEND lcl_wa_idd28j TO lcl_it_idd28j.
ENDLOOP.
*Joinbedingungen
LOOP AT lcl_it_dd28v INTO lcl_wa_dd28v.
MOVE-CORRESPONDING lcl_wa_dd28v TO lcl_wa_idd28s.
APPEND lcl_wa_idd28s TO lcl_it_idd28s.
ENDLOOP.

**Joinbedingungen selektieren
* SELECT tabname fieldname operator constants FROM dd28s
* INTO TABLE lcl_it_idd28s
* WHERE condname = p_wa_dd02l-tabname.
*
**Tabellenfelder selektieren
* SELECT viewfield tabname fieldname FROM dd27s INTO TABLE lcl_it_idd27s
* WHERE viewname = p_wa_dd02l-tabname.
*Tabelle des Joins an Tabellen-Tabelle anhaengen
LOOP AT lcl_it_idd28s INTO lcl_wa_idd28s.
* lcl_wa_idd28s-operator = 'equal'.
MOVE lcl_wa_idd28s-tabname TO lcl_wa_dd02l-tabname.
APPEND lcl_wa_dd02l TO lcl_it_dd02l.
ENDLOOP.
*Duplikate in Tabellen-Tabelle loeschen
SORT lcl_it_dd02l BY tabname.
DELETE ADJACENT DUPLICATES FROM lcl_it_dd02l COMPARING tabname.
*Tabellen im Kundennamensraum sichern
LOOP AT lcl_it_dd02l INTO lcl_wa_dd02l.
READ TABLE it_prog_stueckliste WITH TABLE KEY
name = lcl_wa_dd02l-tabname
obername = global_main_name
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0. "nichts gefunden
IF lcl_wa_dd02l-tabname(1) = 'Z' OR lcl_wa_dd02l-tabname(1) = 'Y'.
PERFORM download_table USING lcl_wa_dd02l 'T'.
ENDIF. "
ENDIF. "Stuecklistenueberpruefung
ENDLOOP.
*****************
*1. Allgemeiner Teil
*Initialsieren der Html-Tabelle, da sie von allen Downloadtabellen
*benutzt wird
REFRESH it_html.
APPEND '<?xml version="1.0" encoding="iso-8859-1" ?>' TO it_html.
APPEND '<?xml-stylesheet type="text/xsl" href="table.XSL"?>'
TO it_html.
* Header-Tag
APPEND '<Doc>' TO it_html.
* 2. Selektionsbedingen
IF NOT ( lcl_it_idd28s IS INITIAL ).
APPEND '<Tabelle>' TO it_html.
*Ueberschrift zusammenbauen
CONCATENATE '<header>' 'Selection Conditions of View'
p_wa_dd02l-tabname '</header>'
INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
* Headertabelle zusammenbauen
APPEND '<tab_header>' TO it_html.
APPEND '<value>Tablename</value>' TO it_html.
APPEND '<value>Fieldname</value>' TO it_html.
APPEND '<value>Operator</value>' TO it_html.
APPEND '<value>Constant Value</value>' TO it_html.
APPEND '</tab_header>' TO it_html.

LOOP AT lcl_it_idd28s INTO lcl_wa_idd28s.


PERFORM create_htmltab_body USING lcl_wa_idd28s.
ENDLOOP.
APPEND '</Tabelle>' TO it_html.
ENDIF.
* 3. Joinbedingungen
IF NOT ( lcl_it_idd28j IS INITIAL ).
APPEND '<Tabelle>' TO it_html.
*Ueberschrift zusammenbauen
CONCATENATE '<header>' 'Join Conditions of View'
p_wa_dd02l-tabname '</header>'
INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
* Headertabelle zusammenbauen
APPEND '<tab_header>' TO it_html.
APPEND '<value>Tablename1</value>' TO it_html.
APPEND '<value>Fieldname1</value>' TO it_html.
APPEND '<value>Operator</value>' TO it_html.
APPEND '<value>Tablename2</value>' TO it_html.
APPEND '<value>Fieldname2</value>' TO it_html.
APPEND '</tab_header>' TO it_html.

LOOP AT lcl_it_idd28j INTO lcl_wa_idd28j.


PERFORM create_htmltab_body USING lcl_wa_idd28j.
ENDLOOP.
APPEND '</Tabelle>' TO it_html.
ENDIF.
* 4. Felder
IF NOT ( lcl_it_idd27s IS INITIAL ).
*Headertabelle zusammenbauen
APPEND '<Tabelle>' TO it_html.
CONCATENATE '<header>' 'Fields of View'
p_wa_dd02l-tabname '</header>'
INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.
REFRESH lcl_it_headerrow.
APPEND '<tab_header>' TO it_html.
APPEND '<value>Name of Viewfield</value>' TO it_html.
APPEND '<value>Table</value>' TO it_html.
APPEND '<value>Name of Tablefield</value>' TO it_html.
APPEND '</tab_header>' TO it_html.

LOOP AT lcl_it_idd27s INTO lcl_wa_idd27s.


PERFORM create_htmltab_body USING lcl_wa_idd27s.
ENDLOOP.
ENDIF.
PERFORM create_html_tab_foot.
*********************************************************
*Pfadname generieren
CLEAR filename.
CONCATENATE new_dir '\' cv p_wa_dd02l-tabname
'.xml' INTO filename.

*** Tables/View downloaden


* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html
CHANGING lcl_subrc.
*lcl_t_DD03P-ROLLNAME.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text060 p_wa_dd02l-tabname
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text060 p_wa_dd02l-tabname
filename.
ENDIF. "subrc-Abfrage des Download

ENDFORM. " download_view


*&---------------------------------------------------------------------*
*& Form handle_transportrequest
*&---------------------------------------------------------------------*
* Feststellung welche Objekte in einem Transportauftrag sind und
* Anstoßen der Archivierung der Objekte.
*----------------------------------------------------------------------*
FORM handle_transportrequest USING p_name TYPE e071-trkorr.
*Bereiche fuer die allgemeine Tabelle e071
DATA: lcl_it_e071 TYPE STANDARD TABLE OF e071,
lcl_wa_e071 LIKE LINE OF lcl_it_e071.
*Variable um den Trdir-Objektnamen eines Includes aufzunehmen
DATA: lcl_include LIKE c_includename.
*Suchvariable fuer Klassenincludes
DATA: lcl_such LIKE wa_trdir-name.
*Bereiche um die Rahmenprogramme zu einem Include zu finden
*Wird benötigt um die Reporttext-Eintraege aufzuloesen
DATA: lcl_it_mastername TYPE STANDARD TABLE OF d010inc-master,
lcl_wa_mastername LIKE LINE OF lcl_it_mastername.
*Variable fuer Laengeberechnung von Zeichenketten
DATA: lcl_len TYPE i.
*Bereich konform zu d020s wegen Aufruf der Formroutine fuer Screens
DATA: lcl_wa_d020s LIKE wa_d020s.
*Lokale Variablen zum zerlegen der messagevariable in
*Klasse und Nummer.
DATA: lcl_message_class TYPE t100-arbgb,
lcl_message_nr TYPE t100-msgnr.
*Feld um den Namen der Message (Klasse/Name) in Stückliste aufnehmen zu
*können.
DATA: lcl_message_name TYPE trdir-name.
*Arbeitsbereich tfdir um zu eine Funktionsbaustein seinen Incldename
*zu finden.
DATA: lcl_wa_tfdir TYPE tfdir.
*Temporaere Variablen zur Sicherung der Verzeichnisstruktur
* DATA: lcl_tmp_dir TYPE rlgrap-filename,
* lcl_tmp_new_dir TYPE rlgrap-filename.
DATA: lcl_tmp_dir TYPE string,
lcl_tmp_new_dir TYPE string.
*Temporaere Variable zur Sicherung der Stueckliste
*Temporaere Variable zur Sicherung der Messagetabelle
DATA: lcl_tmp_it_messages TYPE STANDARD TABLE OF t100.
*Arbeitsbereich um Sperrobjekt-Routine typkonform aufrufen zu können
DATA: lcl_wa_cross TYPE cross.
*Lokaler Arbeitsbereich fuer Transaktionscodezuweisung
DATA: lcl_wa_tstc TYPE tstc.
*Wegen typkonformitaet mit Datenelement-Routine
DATA: lcl_dataelement LIKE wa_dataelements-rollname.
*Lokale Tabelle fuer alle Datenelemente
DATA: lcl_it_dataelements TYPE STANDARD TABLE OF dd04v.
*Variable zum feststellen des Tabellentyps
DATA: lcl_wa_dd02l TYPE dd02l.
*Sicherungstabelle fuer Stuecklisten
DATA: lcl_it_prog_stueckliste TYPE STANDARD TABLE OF prog_stueckliste.
*Dummyvariable fuer trdir-name
DATA: lcl_dummy TYPE trdir-name.
*Bereiche fuer das Lesen der Selektionsbedingungen
*data: lcl_it_trkorr type standard table of e071-trkorr,
* lcl_wa_trkorr like line of lcl_it_trkorr.
*Sicherung des Anfangsverzeichnisses
* DATA: lcl_root(128) TYPE c.
DATA: lcl_root TYPE string.
*lokale Tabelle der Domaenen
DATA: lcl_it_domains TYPE STANDARD TABLE OF dd04v-domname,
lcl_wa_domains LIKE LINE OF lcl_it_domains.
*Lokale Tabelle fuer Berechtigungsfelder
DATA: lcl_it_authx LIKE it_authx.
*Tabelle fuer Tranaktionscodeliste von Report/Modulpoole
DATA: lcl_it_tstc LIKE it_tstc.
*Lokale Tabelle fuer Transaktionscodeliste von Klassen
DATA: lcl_it_tstcp LIKE it_tstcp.
*Lokale interne Tabelle fuer Titlebar aufzunehmen
DATA: lcl_it_d347t LIKE it_d347t.
*Lokale Tabelle für Parameter
DATA: lcl_it_tpara LIKE it_tpara.
*Dummyvariable für Zugriff auf Programmtyp in trdir
DATA: lcl_subc TYPE trdir-subc.
lcl_root = dir.

*Intitialisieren der globalen Tabellen


PERFORM initialize.
*Um Datenformat einzuhalen globales Feld wa_trdir-name fuellen.
*und wegen globaler Verwendung des Arbeitsbereiches wa_trdir
global_main_name = p_name.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING p_name
'T'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'Transport Request:' p_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************

*Basisverzeichnis herstellen
dir = lcl_root.
*Stueckliste schreiben fuer diesen Transportauftrag
PERFORM write_stueckliste USING 'Transportrequest'
p_name
''.

*Alle Objekte des Transportauftrages selektieren


SELECT * FROM e071 INTO TABLE lcl_it_e071
WHERE trkorr = p_name.
*Schleife ueber die Objekte des Transportrequests
LOOP AT lcl_it_e071 INTO lcl_wa_e071.
*Verarbeitung der einzelnen Objekte
CASE lcl_wa_e071-object.
WHEN 'REPS' OR 'REPO' OR 'PROG' OR 'XPRA'. "Includes od.
"Rahmenprogram
*Überprüfen was denn nun wirklich vorliegt
SELECT SINGLE subc FROM trdir INTO lcl_subc
WHERE name = lcl_wa_e071-obj_name.
IF lcl_subc = 'I'
OR lcl_wa_e071-object = 'REPS'. "Include

*Wegen Typkonformitaet Objektname umkopieren; hier entspricht


*der Objektname der Typ-Vereinbarung.
lcl_include = lcl_wa_e071-obj_name.
CLEAR ok.
PERFORM download_include USING lcl_include 'I'
CHANGING ok.
*Download war erfolgreich
IF ok = 'X'.
*Stueckliste schreiben fuer dieses Objekt
PERFORM write_stueckliste USING 'REPS'
lcl_wa_e071-obj_name
p_name.
ENDIF.
ELSEIF lcl_subc = '1' OR lcl_subc = 'M'. "Rahmenprogramm
*Wegen Typkonformitaet Objektname umkopieren; hier entspricht
*der Objektname der Typ-Vereinbarung.
lcl_include = lcl_wa_e071-obj_name.

*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Sicherung der Messagetabelle, wegen Initialisierung in Routine
lcl_tmp_it_messages = it_messages.
*Sicherung der Verzeichnisstruktur: Aenderungen der Variablen in Routine
lcl_tmp_dir = dir.
lcl_tmp_new_dir = new_dir.
*Zuweisen des erzeugten Verzeichnisses des Transportauftrages zur root,
*damit die Rahmenprogramme unter dem Verzeichnis des Transportauftrages
*liegen.
dir = new_dir.
*Globalen Namen setzen
global_main_name = lcl_wa_e071-obj_name.
PERFORM handle_reps_mods USING lcl_include.
*Wiederherstellen der Verzeichnisstruktur,
dir = lcl_tmp_dir.
new_dir = lcl_tmp_new_dir.
*Ruecksicherung der Stueckliste
it_prog_stueckliste = lcl_it_prog_stueckliste.
*Ruecksicherung der Messagetabe0lle
it_messages = lcl_tmp_it_messages.
*Wiederherstellen des globalen Feldes global_main_name
CLEAR wa_trdir.
global_main_name = lcl_wa_e071-trkorr.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
*Stueckliste schreiben fuer dieses Objekt
PERFORM write_stueckliste USING 'PROG'
lcl_wa_e071-obj_name
p_name.

* no include found --->next entry


ELSE.
CONTINUE.

ENDIF. "welcher Programmtyp liegt nun wirklich vor


*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.

WHEN 'REPT' OR 'REPO'. "Textelemente zu Reports


*Wegen Typkonformitaet Objektname umkopieren; hier entspricht
*der Objektname der Typ-Vereinbarung.
lcl_include = lcl_wa_e071-obj_name.
*Auloesen der Eintraege -->Finden des Masterincludes, da Name des
*Masterincludes dem Namen des Textpools entspricht (es koennen auch
*mehrere masterincludes sein
SELECT master FROM d010inc INTO TABLE lcl_it_mastername
WHERE include = lcl_include.
global_main_name = lcl_wa_e071-obj_name.
IF sy-subrc = 0. "Master gefunden
LOOP AT lcl_it_mastername INTO lcl_wa_mastername.
*Textelemente des Rahmenprogramms herunterladen
PERFORM download_textelements USING lcl_wa_mastername
'T'.
*Stueckliste wird in 'download_textelements' geschrieben --> Typ 'T'
ENDLOOP.
ELSE. "Eintrag in Transportauftrag ist Master
*Textelemente des Rahmenprogramms herunterladen
PERFORM download_textelements USING lcl_include
'T'.
ENDIF.
global_main_name = lcl_wa_e071-trkorr.
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'TYPD' OR 'TYPE'. "Typgruppe
*Zusammensetzen des Includenamens der Typgruppe: Praefix %_C vor Namen
CONCATENATE '%_C' lcl_wa_e071-obj_name INTO lcl_include.
*Uebergabe des Typ des Includes, um Dateinamen festlegen zu können
CLEAR ok.
PERFORM download_include USING lcl_include 'T'
CHANGING ok.
IF ok = 'X'. "Download include war erfolgreich
*Stueckliste schreiben, wenn download erfolgreich
PERFORM write_stueckliste USING 'Typgroup'
lcl_wa_e071-obj_name
p_name.
ENDIF. "downnload erfolgreich???
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'DYNP'. "Dynpro
*Programmname und Dynpronummer aus Objektnamen des Transportrequests
*ermitteln
lcl_len = STRLEN( lcl_wa_e071-obj_name ).
lcl_len = lcl_len - 4.
lcl_wa_d020s-prog = lcl_wa_e071-obj_name(lcl_len).
lcl_wa_d020s-dnum = lcl_wa_e071-obj_name+lcl_len.
*Dynpro herunterladen; Keine Ueberpruefung ob schon heruntergeladen,
*da ein Screen nur einmal in einem Transportauftrag vorkommen kann.
PERFORM download_dynpro USING lcl_wa_d020s.
PERFORM write_stueckliste USING 'SCR'
lcl_wa_e071-obj_name
lcl_wa_d020s-prog.
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'MESS'. "einzelne Message
*Keine Ueberpruefung, ob schon heruntergeladen, da Message
*nur einmal im Transportauftrag vorhanden sein kann.
*Laengenbestimmung um Feld auseinanderzunehmen.
lcl_len = STRLEN( lcl_wa_e071-obj_name ).
lcl_len = lcl_len - 3.
*Db-Feld auseinandernehmen fuer Messageklasse und Nummer
lcl_message_class = lcl_wa_e071-obj_name(lcl_len).
lcl_message_nr = lcl_wa_e071-obj_name+lcl_len.
*Schleife ueber Sprachtabelle
LOOP AT it_lan INTO wa_lan.
*Name für Stückliste zusammensetzen
CONCATENATE lcl_message_class '/' lcl_message_nr '/' wa_lan
INTO lcl_message_name.
CLEAR wa_messages.
*Messagetabelle lesen mit Schlüssel nur bei Fehler nichts tun
SELECT SINGLE * FROM t100 INTO wa_messages
WHERE arbgb = lcl_message_class
AND msgnr = lcl_message_nr
AND sprsl = wa_lan.
IF sy-subrc = 0.
*Schreiben der Gesamt-Messagetabellle
APPEND wa_messages TO it_messages.
*Schreiben der Stückliste, nicht länderspezifisch nur einmal
PERFORM write_stueckliste USING 'MSG'
lcl_message_name
p_name.
ENDIF.
ENDLOOP. "Sprachtabelle
WHEN 'MSAG'.
*Verarbeitung der Messageklasse
PERFORM trkorr_messageclass USING lcl_wa_e071-obj_name
p_name.
WHEN 'FUNC'. "Funktionsbaustein
*Lesen, um zu dem Funktionsnamen den Includename zu finden
SELECT SINGLE * FROM tfdir INTO lcl_wa_tfdir
WHERE funcname = lcl_wa_e071-obj_name.
*Verarbeitung abhängig von Namensraum
IF lcl_wa_tfdir-pname(1) = '/'.
*Partnernamensraum
PERFORM convert_funcname_for_partner USING lcl_wa_tfdir
CHANGING lcl_include.
ELSE.
*Zusammensetzen des Includenamens; Beim Funktionsgruupennamen Praefix
*'SAP' abschneiden: -->Offset
CONCATENATE lcl_wa_tfdir-pname+3 'U' lcl_wa_tfdir-include
INTO lcl_include.
ENDIF.
*Download des Includes
CLEAR ok.
PERFORM download_include USING lcl_include 'F'
CHANGING ok.
IF ok = 'X'. "Download include war erfolgreich
*Stueckliste schreiben, wenn download erfolgreich
*Funktionsbauseinname:
PERFORM write_stueckliste USING 'FUNC'
lcl_wa_e071-obj_name
p_name.
*Includename des Funktionsbaustein
PERFORM write_stueckliste USING 'IN'
lcl_include
lcl_wa_e071-obj_name.
ENDIF. "downnload erfolgreich???
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'FUGT'. "Funktionsgruppentext
*SAPL-Name des Funktionsbausteins zusammenbauen
*Unterscheidung auf Partnernamensraum.
IF lcl_wa_e071-obj_name(1) = '/'.
PERFORM convert_fugrname_for_partner
CHANGING lcl_wa_e071-obj_name.
lcl_include = lcl_wa_e071-obj_name.
ELSE. "normaler namensraum
CONCATENATE 'SAPL' lcl_wa_e071-obj_name INTO lcl_include.
ENDIF.
*Textelemente des Rahmenprogramms herunterladen
PERFORM download_textelements USING lcl_include
'T'.
*Stueckliste wird in 'download_textelements' geschrieben --> Typ 'T
WHEN 'IASP'. "IAC-Service
*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Sicherung der Messagetabelle, wegen Initialisierung in Routine
lcl_tmp_it_messages = it_messages.
*Sicherung der Verzeichnisstruktur: Aenderungen der Variablen in Routine
lcl_tmp_dir = dir.
lcl_tmp_new_dir = new_dir.
*Zuweisen des erzeugten Verzeichnisses des Transportauftrages zur root,
*damit die Rahmenprogramme unter dem Verzeichnis des Transportauftrages
*liegen.
dir = new_dir.
*Globalen Namen setzen
global_main_name = lcl_wa_e071-obj_name.
*Ueberpruefen, ob Service noch existiert
SELECT SINGLE service FROM iacservice INTO lcl_dummy
WHERE service = lcl_wa_e071-obj_name.
IF sy-subrc = 0.
*Verarbeitungsroutine fuer Funktionsgruppen aufrufen
PERFORM handle_iac_service USING lcl_wa_e071-obj_name.
ELSE.
CONTINUE.
ENDIF.
*Wiederherstellen der Verzeichnisstruktur,
dir = lcl_tmp_dir.
new_dir = lcl_tmp_new_dir.
*Ruecksicherung der Stueckliste
it_prog_stueckliste = lcl_it_prog_stueckliste.
*Ruecksicherung der Messagetabe0lle
it_messages = lcl_tmp_it_messages.
*Wiederherstellen des globalen Feldes global_main_name
CLEAR wa_trdir.
global_main_name = lcl_wa_e071-trkorr.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
PERFORM write_stueckliste USING 'IACS'
lcl_wa_e071-obj_name
p_name.
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.

WHEN 'IATU' OR 'IATL'.


* Globalen Namen setzen
global_main_name = lcl_wa_e071-obj_name.
PERFORM download_iac_template USING lcl_wa_e071-obj_name
new_dir.
PERFORM write_stueckliste USING 'IACT'
lcl_wa_e071-obj_name
p_name.
*Wiederherstellen des globalen Feldes global_main_name
CLEAR wa_trdir.
global_main_name = lcl_wa_e071-trkorr.
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.

WHEN 'FUGR' OR 'FUGX' OR 'FUGS' . "Gesamte Funktionsgruppe


"(normal oder Erweiterungsgruppe
*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Sicherung der Messagetabelle, wegen Initialisierung in Routine
lcl_tmp_it_messages = it_messages.
*Sicherung der Verzeichnisstruktur: Aenderungen der Variablen in Routine
lcl_tmp_dir = dir.
lcl_tmp_new_dir = new_dir.
*Zuweisen des erzeugten Verzeichnisses des Transportauftrages zur root,
*damit die Rahmenprogramme unter dem Verzeichnis des Transportauftrages
*liegen.
dir = new_dir.

*Globalen Namen setzen


global_main_name = lcl_wa_e071-obj_name.
*SAPL-Name des Funktionsbausteins zusammenbauen
*Unterscheidung auf Partnernamensraum.
IF lcl_wa_e071-obj_name(1) = '/'.
PERFORM convert_fugrname_for_partner
CHANGING lcl_wa_e071-obj_name.
lcl_include = lcl_wa_e071-obj_name.
ELSE. "normaler namensraum
CONCATENATE 'SAPL' lcl_wa_e071-obj_name INTO lcl_include.
ENDIF.

*Ueberpruefen, ob Funktionsgruppe noch existiert


SELECT SINGLE name FROM trdir INTO lcl_dummy
WHERE name = lcl_include.
IF sy-subrc = 0.
*Verarbeitungsroutine fuer Funktionsgruppen aufrufen
PERFORM handle_functiongroup USING lcl_include.
ELSE.
CONTINUE.
ENDIF.
*Wiederherstellen der Verzeichnisstruktur,
dir = lcl_tmp_dir.
new_dir = lcl_tmp_new_dir.
*Ruecksicherung der Stueckliste
it_prog_stueckliste = lcl_it_prog_stueckliste.
*Ruecksicherung der Messagetabe0lle
it_messages = lcl_tmp_it_messages.
*Wiederherstellen des globalen Feldes global_main_name
CLEAR wa_trdir.
global_main_name = lcl_wa_e071-trkorr.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
PERFORM write_stueckliste USING 'Functiongroup'
lcl_include
p_name.
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'ENQU' OR 'ENQD'. "Sperrobjekt
*lcl_wa_cross fuellen um Sperrobjektroutin typkonform aufrufen zu
*können
CLEAR lcl_wa_cross-name.
lcl_wa_cross-name = lcl_wa_e071-obj_name.
*Sperrobjekt-Routine aufrufen
PERFORM handle_lockobject USING lcl_wa_cross
'S'. "Name ist Sperrobjektname
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'IDOC'. "IDOC-Basistyp
*Sicherung der Verzeichnisstruktur: Aenderungen der Variablen in Routine
lcl_tmp_dir = dir.
lcl_tmp_new_dir = new_dir.
*Zuweisen des erzeugten Verzeichnisses des Transportauftrages zur root,
*damit die Rahmenprogramme unter dem Verzeichnis des Transportauftrages
*liegen.
dir = new_dir.
*Globale Daten aufbereiten, um IDOC-Routine aufrufen zu koennen
global_main_name = lcl_wa_e071-obj_name.
*IDOC-Routine ausfuehren
PERFORM handle_idoc USING lcl_wa_e071-obj_name
'B'.
*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Wiederherstellen der Verzeichnisstruktur,
dir = lcl_tmp_dir.
new_dir = lcl_tmp_new_dir.
*Wiederherstellen des globalen Feldes wa_trdir-name
CLEAR wa_trdir.
global_main_name = p_name.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
PERFORM write_stueckliste USING 'BasisIDoc'
lcl_wa_e071-obj_name
global_main_name.
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'IEXT'. "IDOC-Erweiterung
*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Sicherung der Verzeichnisstruktur: Aenderungen der Variablen in Routine
lcl_tmp_dir = dir.
lcl_tmp_new_dir = new_dir.
*Zuweisen des erzeugten Verzeichnisses des Transportauftrages zur root,
*damit die Rahmenprogramme unter dem Verzeichnis des Transportauftrages
*liegen.
dir = new_dir.
*Globale Daten aufbereiten, um IDOC-Routine aufrufen zu koennen
global_main_name = lcl_wa_e071-obj_name.
*IDOC-Routine ausfuehren
PERFORM handle_idoc USING lcl_wa_e071-obj_name
'E'.
*Wiederherstellen der Verzeichnisstruktur,
dir = lcl_tmp_dir.
new_dir = lcl_tmp_new_dir.
*Wiederherstellen des globalen Feldes global_main_name
CLEAR wa_trdir.
global_main_name = p_name.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
PERFORM write_stueckliste USING 'IDocEnhancement'
lcl_wa_e071-obj_name
global_main_name.
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'PARA'. "Set/GetParameter
*Globale Tabelle leeren
REFRESH it_tpara.
*lcl_wa_cross fuellen um Parameterroutine typkonform aufrufen zu
*können
CLEAR lcl_wa_cross-name.
lcl_wa_cross-name = lcl_wa_e071-obj_name.
*Aufruf des Handlers fuer Set/Get-Parameter
PERFORM handle_setgetparamss USING lcl_wa_cross.
APPEND LINES OF it_tpara TO lcl_it_tpara.
WHEN 'TRAN'. "Transaktionscode
*Tabelle der TA-Codes selektieren und an Gesamttabelle haengen
SELECT SINGLE * FROM tstc INTO lcl_wa_tstc
WHERE tcode = lcl_wa_e071-obj_name.
IF NOT ( lcl_wa_tstc-pgmna IS INITIAL ). "Report/Modulpool
IF NOT lcl_wa_tstc IS INITIAL.
APPEND lcl_wa_tstc TO lcl_it_tstc.
ENDIF.
ELSE. "Klassen
SELECT SINGLE * FROM tstcp INTO wa_tstcp
WHERE tcode = lcl_wa_e071-obj_name.
IF NOT wa_tstcp IS INITIAL.
APPEND wa_tstcp TO lcl_it_tstcp.
ENDIF.
ENDIF.
WHEN 'DOMD' OR 'DOMA'. "Domaene
*Ueberpruefen ob schon heruntergeladen (wegen or-Bedingung)
READ TABLE it_prog_stueckliste WITH KEY name = lcl_wa_e071-obj_name
type = 'Domaene' TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Domaene'
lcl_wa_e071-obj_name
global_main_name.
lcl_wa_domains = lcl_wa_e071-obj_name.
APPEND lcl_wa_domains TO lcl_it_domains.
ENDIF. "Stuecklistenueberpruefung
WHEN 'DTED' OR 'DTEL'. "Datenelemente
*Ueberpruefen ob schon heruntergeladen (wegen or-Bedingung)
READ TABLE it_prog_stueckliste WITH KEY name = lcl_wa_e071-obj_name
type = 'Datenelement' TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Datenelement'
lcl_wa_e071-obj_name
global_main_name.
*Zuweisung des Datenelementnamens wegen Typkonformitaet
lcl_dataelement = lcl_wa_e071-obj_name.
*Initialsierung der globalen Tabelle (Routine nutzt diese)
REFRESH it_dataelements.
PERFORM write_dataelements USING lcl_dataelement.
*Anhaengen der der Zeilen an lokale Tabelle
APPEND LINES OF it_dataelements TO lcl_it_dataelements.
ENDIF. "Stuecklistenueberpruefung

WHEN 'TABD' OR 'TABT' OR 'TABL'.


"Tabelle/Strukturen/Views
*Feststellen ob Tabelle oder Struktur vorliegt
SELECT SINGLE * FROM dd02l INTO lcl_wa_dd02l
WHERE tabname = lcl_wa_e071-obj_name.
*Fuer Typ T feststellen ob Struktur, oder Taelle
IF lcl_wa_dd02l-tabclass = 'TRANSP'. "normale Tabelle
*Ueberpruefen ob schon heruntergeladen (wegen or-Bedingung)
READ TABLE it_prog_stueckliste WITH KEY name = lcl_wa_e071-obj_name
type = 'Tabelle' TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
*Infos suchen und diese Downloaden
PERFORM download_table USING lcl_wa_dd02l
'T'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Table'
lcl_wa_e071-obj_name
global_main_name.
* PERFORM trkorr_handle_table USING lcl_wa_dd02l
* 'T'.
ENDIF. "Stuecklistenueberpruefung
ELSEIF lcl_wa_dd02l-tabclass = 'INTTAB'. "Struktur
*Ueberpruefen ob schon heruntergeladen (wegen or-Bedingung)
READ TABLE it_prog_stueckliste WITH KEY name = lcl_wa_e071-obj_name
type = 'Struktur' TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
*Infos suchen und diese Downloaden
* 'S'.
PERFORM download_table USING lcl_wa_dd02l
'S'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Structure'
lcl_wa_e071-obj_name
global_main_name.

ENDIF. "Stuecklistenueberpruefung

ELSEIF lcl_wa_dd02l-tabclass = 'APPEND'. "Appendstruktur


*Ueberpruefen ob schon heruntergeladen (wegen or-Bedingung)
READ TABLE it_prog_stueckliste WITH KEY name = lcl_wa_e071-obj_name
type = 'Append' TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
*Infos suchen und diese Downloaden
* 'A'.
PERFORM download_table USING lcl_wa_dd02l
'A'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Append'
lcl_wa_e071-obj_name
global_main_name.

ENDIF. "Stuecklistenueberpruefung
ENDIF.
*Markierungen zur Trennung von naechstem Objekt
* uline.
PERFORM write_protocol USING 'L' '' '' ''.
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'TTYP' OR 'TTYX' OR 'TTYD'. "Tabellentyp
*Überüfung, ob Tabellentyp überhaupt noch existiert.
SELECT SINGLE * FROM dd40vv INTO wa_tabletypes
WHERE typename = lcl_wa_e071-obj_name.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
PERFORM handle_tabletype USING lcl_wa_e071-obj_name.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Tabletype'
lcl_wa_e071-obj_name
global_main_name.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'VIEW' OR 'VIED' OR 'VIET'.
*Tabelle lesen wegen Typkonformem Aufruf der Routine
SELECT SINGLE * FROM dd02l INTO lcl_wa_dd02l
WHERE tabname = lcl_wa_e071-obj_name.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
*Ueberpruefen ob schon heruntergeladen (wegen or-Bedingung)
READ TABLE it_prog_stueckliste WITH KEY name = lcl_wa_e071-obj_name
type = 'View' TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
CLEAR wa_ddictypes.
wa_ddictypes-tabname = lcl_wa_e071-obj_name.
PERFORM download_view USING wa_ddictypes.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'View'
lcl_wa_e071-obj_name
global_main_name.
ENDIF. "Stuecklistenueberpruefung
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'DIAL'. "Dialogbaustein
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Dialogmodule'
lcl_wa_e071-obj_name
global_main_name.
PERFORM trkorr_handle_dialogmodules USING lcl_wa_e071-obj_name.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'SUSO'. "Authorityobject
*Stueckliste schreiben
PERFORM trkorr_handleauthorityobject USING
lcl_wa_e071-obj_name.

WHEN 'AUTH'. "Feld eines Berechtigungsobjektes


PERFORM write_stueckliste USING 'Authorityfield'
lcl_wa_e071-obj_name
global_main_name.
REFRESH it_authx.
PERFORM trkorr_handle_authorityfield
USING lcl_wa_e071-obj_name.
*Sicherung de Berechtigungsobjektfelder
APPEND LINES OF it_authx TO lcl_it_authx.
WHEN 'CMOD'. "CMOD-Erweiterungsprojekt
*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Sicherung der Verzeichnisstruktur: Aenderungen der Variablen in Routine
lcl_tmp_dir = dir.
lcl_tmp_new_dir = new_dir.
*Zuweisen des erzeugten Verzeichnisses des Transportauftrages zur root,
*damit die Rahmenprogramme unter dem Verzeichnis des Transportauftrages
*liegen.
dir = new_dir.
*Globale Daten aufbereiten, um IDOC-Routine aufrufen zu koennen
global_main_name = lcl_wa_e071-obj_name.
APPEND o_cmod.
*CMOD-Routine ausfuehren
PERFORM handle_customerenhancement USING lcl_wa_e071-obj_name.
*Wiederherstellen der Verzeichnisstruktur,
dir = lcl_tmp_dir.
new_dir = lcl_tmp_new_dir.
*Wiederherstellen des globalen Feldes global_main_name
CLEAR wa_trdir.
global_main_name = p_name.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
PERFORM write_stueckliste USING 'Enhancement Project'
lcl_wa_e071-obj_name
global_main_name.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.

WHEN 'SXCI'. "Badiimplementierung


*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Sicherung der Verzeichnisstruktur: Aenderungen der Variablen in Routine
lcl_tmp_dir = dir.
lcl_tmp_new_dir = new_dir.
*Zuweisen des erzeugten Verzeichnisses des Transportauftrages zur root,
*damit die Rahmenprogramme unter dem Verzeichnis des Transportauftrages
*liegen.
dir = new_dir.
*Globale Daten aufbereiten, um IDOC-Routine aufrufen zu koennen
global_main_name = lcl_wa_e071-obj_name.
*CMOD-Routine ausfuehren
PERFORM handle_badi_implementation USING lcl_wa_e071-obj_name.
*Wiederherstellen der Verzeichnisstruktur,
dir = lcl_tmp_dir.
new_dir = lcl_tmp_new_dir.
*Wiederherstellen des globalen Feldes global_main_name
CLEAR wa_trdir.
global_main_name = p_name.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
PERFORM write_stueckliste USING 'Badi Implementation'
lcl_wa_e071-obj_name
global_main_name.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'CPRI'. "Private Header-Include einer Klasse
*Laenge des Klassennamens
lcl_len = STRLEN( lcl_wa_e071-obj_name ).
*Zeichen '=' anfuegen (kann nicht bei Anlage verwendet werden)
IF lcl_len < 30.
CONCATENATE lcl_wa_e071-obj_name '=%CI' INTO lcl_such.
ELSE.
CONCATENATE lcl_wa_e071-obj_name '%CI' INTO lcl_such.
ENDIF.
*das Include suchen
CLEAR lcl_include.
SELECT SINGLE name FROM trdir INTO lcl_include
WHERE name LIKE lcl_such.
*Include herunterladen
CLEAR ok.
PERFORM download_include USING lcl_include 'C'
CHANGING ok.
*Download war erfolgreich
IF ok = 'X'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'PrivateHeaderInclude'
lcl_include
global_main_name.
ENDIF.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'CPRO'. "Protected Header-Include einer Klasse
*Laenge des Klassennamens
lcl_len = STRLEN( lcl_wa_e071-obj_name ).
*Zeichen '=' anfuegen (kann nicht bei Anlage verwendet werden)
IF lcl_len < 30.
CONCATENATE lcl_wa_e071-obj_name '=%CO' INTO lcl_such.
ELSE.
CONCATENATE lcl_wa_e071-obj_name '%CO' INTO lcl_such.
ENDIF.
*das Include suchen
CLEAR lcl_include.
SELECT SINGLE name FROM trdir INTO lcl_include
WHERE name LIKE lcl_such.
*Include herunterladen
CLEAR ok.
PERFORM download_include USING lcl_include 'C'
CHANGING ok.
*Download war erfolgreich
IF ok = 'X'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'ProtectedHeaderInclude'
lcl_include
global_main_name.
ENDIF.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'CPUB'. "Public Header-Include einer Klasse
*Laenge des Klassennamens
lcl_len = STRLEN( lcl_wa_e071-obj_name ).
*Zeichen '=' anfuegen (kann nicht bei Anlage verwendet werden)
IF lcl_len < 30.
CONCATENATE lcl_wa_e071-obj_name '=%CU' INTO lcl_such.
ELSE.
CONCATENATE lcl_wa_e071-obj_name '%CU' INTO lcl_such.
ENDIF.
*das Include suchen
CLEAR lcl_include.
SELECT SINGLE name FROM trdir INTO lcl_include
WHERE name LIKE lcl_such.
*Include herunterladen
CLEAR ok.
PERFORM download_include USING lcl_include 'C'
CHANGING ok.
*Download war erfolgreich
IF ok = 'X'.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'PublicHeaderInclude'
lcl_include
global_main_name.
ENDIF.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'METH'. "Methodeninclude einer Klasse
PERFORM trkorr_handle_single_method USING lcl_wa_e071-obj_name.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'CINC'. "Klasseninclude
*Wegen Typkonformitaet Objektname umkopieren; hier entspricht
*der Objektname der Typ-Vereinbarung.
lcl_include = lcl_wa_e071-obj_name.
CLEAR ok.
PERFORM download_include USING lcl_include 'C'
CHANGING ok.
*Download war erfolgreich
IF ok = 'X'.
*Stueckliste schreiben fuer dieses Objekt
PERFORM write_stueckliste USING lcl_wa_e071-object
lcl_wa_e071-obj_name
p_name.
ENDIF.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'CLAS' OR 'CLSD'. "objektorientierte Klasse
*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Sicherung der Verzeichnisstruktur: Aenderungen der Variablen in Routine
lcl_tmp_dir = dir.
lcl_tmp_new_dir = new_dir.
*Zuweisen des erzeugten Verzeichnisses des Transportauftrages zur root,
*damit die Rahmenprogramme unter dem Verzeichnis des Transportauftrages
*liegen.
dir = new_dir.
*Suchstring fuer Klasse
* concatenate lcl_wa_e071-OBJ_NAME '*CP' into lcl_include.
*Globale Daten aufbereiten, um IDOC-Routine aufrufen zu koennen
global_main_name = lcl_wa_e071-obj_name.
*Klassen-Routine ausfuehren
*Intitialisieren der globalen Tabellen
PERFORM initialize.
PERFORM handle_class_extern USING lcl_wa_e071-obj_name.
*Wiederherstellen der Verzeichnisstruktur,
dir = lcl_tmp_dir.
new_dir = lcl_tmp_new_dir.
*Wiederherstellen des globalen Feldes global_main_name
CLEAR wa_trdir.
global_main_name = p_name.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
PERFORM write_stueckliste USING 'Class'
lcl_wa_e071-obj_name
global_main_name.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.

WHEN 'INTF'. "Interface


*Stueckliste sichern
REFRESH lcl_it_prog_stueckliste.
APPEND LINES OF it_prog_stueckliste TO lcl_it_prog_stueckliste.
*Sicherung der Verzeichnisstruktur: Aenderungen der Variablen in Routine
lcl_tmp_dir = dir.
lcl_tmp_new_dir = new_dir.
*Zuweisen des erzeugten Verzeichnisses des Transportauftrages zur root,
*damit die Rahmenprogramme unter dem Verzeichnis des Transportauftrages
*liegen.
dir = new_dir.
*Sicherung globales Bezeichnungsfeld
global_main_name = lcl_wa_e071-obj_name.
PERFORM handle_interface USING lcl_wa_e071-obj_name.
*Wiederherstellen der Verzeichnisstruktur,
dir = lcl_tmp_dir.
new_dir = lcl_tmp_new_dir.
*Wiederherstellen des globalen Feldes global_main_name
CLEAR wa_trdir.
global_main_name = p_name.
*Stückliste wiederherstellen und schreiben
REFRESH it_prog_stueckliste.
APPEND LINES OF lcl_it_prog_stueckliste TO
it_prog_stueckliste.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Interface'
lcl_wa_e071-obj_name
global_main_name.
*Markierungen zur Trennung von naechstem Objekt
PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
WHEN 'CUAD'. "Programmoberflaeche
*pf-Stati verarbeiten
PERFORM handle_pf_status USING lcl_wa_e071-obj_name
'R'.
*Titlebars suchen
REFRESH it_d347t.
PERFORM handle_titlebar USING lcl_wa_e071-obj_name
'R'.
APPEND LINES OF it_d347t TO lcl_it_d347t.

*Markierungen zur Trennung von naechstem Objekt


PERFORM write_protocol USING 'L' '' '' ''.
PERFORM write_protocol USING 'S' '' '' ''.
ENDCASE. "Welcher Objekttyp liegt vor
ENDLOOP. "Schleife ueber Objekte eines Transportrequests
*Verarbeitung der globalen Elemente dieses Transportauftrages

*Datenelemente herunterladen
REFRESH it_dataelements.
APPEND LINES OF lcl_it_dataelements TO it_dataelements.
PERFORM download_dataelements.
**Domaenen downloaden
PERFORM handle_trkorr_domains USING lcl_it_domains.
*Titlebars herunterladen
REFRESH it_d347t.
APPEND LINES OF lcl_it_d347t TO it_d347t.
PERFORM download_titlebar.
*Meldungen herunterladen
PERFORM download_messages.
*Liste mit allen Berechtigungsfelder des Auftrages sichern
PERFORM trkorr_download_authorityfield USING lcl_it_authx.
*Gesamtliste der Parameter herunterschreiben
REFRESH it_tpara.
APPEND LINES OF lcl_it_tpara TO it_tpara.
PERFORM download_setgetparams.
*Gesamtliste der Transaktionscodes herunterladen (Reps/Modulpools/Fkgrp
REFRESH it_tstc.
APPEND LINES OF lcl_it_tstc TO it_tstc.
PERFORM download_tacodelist.
*Gesamtliste der Transaktionscodes fuer Klasse herunterladen
REFRESH it_tstcp.
APPEND LINES OF lcl_it_tstcp TO it_tstcp.
PERFORM download_tacodelist_for_class.
*Stueckliste diese Transportauftrages herunterladen
PERFORM download_stueckliste.
*Hot-Package-Stand des Systems herunterladen
PERFORM download_hpstand.

*Leerzeile nach Ende dieser Verarbeitung


* skip.
PERFORM write_protocol USING 'S' '' '' ''.

ENDFORM. " handle_transportrequest


*&---------------------------------------------------------------------*
*& Form handle_tacode_for_class
*&---------------------------------------------------------------------*
* Feststellen, ob einer Klasse ein Transaktionscode zugeordnet ist.
*----------------------------------------------------------------------*
FORM handle_tacode_for_class USING p_name TYPE c.
*Bereich fuer die Parametertabelle von Transaktionscodes
DATA: lcl_it_tstcp TYPE STANDARD TABLE OF tstcp,
lcl_wa_tstcp LIKE LINE OF lcl_it_tstcp.
*Variable fuer Suchstring der uebergebenen Klasse
DATA: lcl_such TYPE string.
*Suchstring zusammensetzen.
CONCATENATE 'CLASS=' p_name INTO lcl_such.
*Alle Paramertercodes in Kundennamensraum selektieren
SELECT * FROM tstcp INTO TABLE lcl_it_tstcp
WHERE tcode LIKE 'Z%' OR tcode = 'Y%' OR
tcode = g_name.
LOOP AT lcl_it_tstcp INTO lcl_wa_tstcp.
SEARCH lcl_wa_tstcp-param FOR lcl_such.
IF sy-subrc = 0.
APPEND lcl_wa_tstcp TO it_tstcp.
ENDIF.
ENDLOOP.
ENDFORM. " handle_tacode_for_class
*&---------------------------------------------------------------------*
*& Form download_tacodelist_for_class
*&---------------------------------------------------------------------*
* Generierung und Sicherung der Transaktionscodeliste bei
* Klassen, denen Transakrinen zugeordnet sind.
*----------------------------------------------------------------------*
FORM download_tacodelist_for_class.
* subrc für Downloadform-routine
DATA: lcl_subrc TYPE sy-subrc.
*Dateiname fuer Download
DATA: lcl_tacode_name TYPE string.
*Variable fuer Kopfzeile
DATA: lcl_header TYPE string.
*Headertabelle fuer HTML-Tabelle
DATA: lcl_it_headerrow TYPE STANDARD TABLE OF string.

*Nur Herunterladen wenn Tabelle nicht initial ist


IF NOT ( it_tstcp IS INITIAL ).
* Ueberschrift zusammenbauen
CONCATENATE 'Transactioncodes of Mehtods in Class' global_main_name
INTO lcl_header SEPARATED BY space.
* Headertabelle zusammenbauen
APPEND 'Transactionscode' TO lcl_it_headerrow.
APPEND 'Parameters' TO lcl_it_headerrow.

* Umwandlung in HTML-Tabelle
* *******************************************************
PERFORM create_htmltab_header USING lcl_it_headerrow
lcl_header.
LOOP AT it_tstcp INTO wa_tstcp.
PERFORM create_htmltab_body USING wa_tstcp.
ENDLOOP.
PERFORM create_html_tab_foot.
* ********************************************************
CONCATENATE 'Tacodeclass_' global_main_name INTO lcl_tacode_name.

CLEAR filename.
CONCATENATE new_dir '\' lcl_tacode_name '.xml' INTO filename.
* begin of changes for partner namespace
TRANSLATE filename USING '/_'.
* end of changes for partner namespace
PERFORM call_ws_download USING filename
it_html "it_tstc
CHANGING lcl_subrc.
IF lcl_subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' text034 lcl_tacode_name
filename.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' text034 lcl_tacode_name
filename.
*Stueckliste schreiben
PERFORM write_stueckliste USING 'Transactioncodelist(Class)'
'Transactioncodelist(Class)'
global_main_name.
ENDIF.
ENDIF. "ist it_tstcp überhaupt gefüllt
ENDFORM. " download_tacodelist_for_class
*&---------------------------------------------------------------------*
*& Form create_html_for_intf
*&---------------------------------------------------------------------*
* Routine zur Generierung des HTML-Codes der Navigationsleiste
* fuer Interfaces
*----------------------------------------------------------------------*
FORM create_html_for_intf.
DATA: lcl_wa_prog_stueckliste TYPE prog_stueckliste.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
APPEND '<item>' TO it_html.
APPEND '<value>Interfaceincludes</value>' TO it_html.
READ TABLE it_prog_stueckliste WITH KEY type = 'Interface(OO)'
INTO wa_prog_stueckliste.
IF sy-subrc = 0.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE obername = wa_prog_stueckliste-name
AND type = 'Include'.
IF lcl_wa_prog_stueckliste-name+30(2) = 'IP'.
CONCATENATE 'Intf_' lcl_wa_prog_stueckliste-file_name '.xml'
INTO lcl_url.
lcl_name = 'Poolinclude'.
ELSE.
CONCATENATE 'Intf_' lcl_wa_prog_stueckliste-file_name
'.xml' INTO lcl_url.
lcl_name = 'Components'.
ENDIF. "Poolinclude
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'main'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
*Interfaces, die im Interface implementiert sind
READ TABLE it_prog_stueckliste WITH KEY type = 'Interface'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND '<item>' TO it_html.
APPEND '<value>Used Interfaces</value>' TO it_html.
LOOP AT it_prog_stueckliste INTO lcl_wa_prog_stueckliste
WHERE type = 'Interface'.
IF extern = 'X' OR p_devc = 'X' OR p_trkorr = 'X'.
CONCATENATE '../OI_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
CONCATENATE './OI_' lcl_wa_prog_stueckliste-file_name
'/index.htm' INTO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF.
PERFORM nav_xml_add_subitem USING lcl_url
lcl_name
'_blank'.
ENDLOOP.
APPEND '</item>' TO it_html.
ENDIF.
ENDFORM. " create_html_for_intf
*&---------------------------------------------------------------------*
*& Form write_protocol
*&---------------------------------------------------------------------*
* Mit dieser Routine wird die interne Tabelle fuer
* die Protokollliste gefuellt.
*----------------------------------------------------------------------*
FORM write_protocol USING p_typus TYPE any
p_objtype TYPE any
p_objname TYPE any
p_filename TYPE any.
*Arbeitsbereich initialisieren
CLEAR wa_protocol.
*Arbeitsbereich fuellen
wa_protocol-typus = p_typus.
wa_protocol-objtype = p_objtype.
wa_protocol-objname = p_objname.
wa_protocol-filename = p_filename.
*Tabelle fuellen
APPEND wa_protocol TO it_protocol.
ENDFORM. " write_protocol
*&---------------------------------------------------------------------*
*& Form output_protocol
*&---------------------------------------------------------------------*
* Verarbeitung der Protokolltabelle zum
* Archivierungsprotokoll.
*----------------------------------------------------------------------*
FORM output_protocol.
*Warnausgabe, wenn Protokolltabelle leer ist.
IF it_protocol IS INITIAL.
FORMAT INTENSIFIED COLOR = 6.
WRITE: / 'All your Selections are not valid!',
/ 'Please use valid selection criteria!'.
EXIT.
ENDIF.
LOOP AT it_protocol INTO wa_protocol.
CASE wa_protocol-typus.
WHEN 'L'. "Underline
ULINE.
WHEN 'S'. "Skip
SKIP.
WHEN 'U'. "Ueberschrift
FORMAT COLOR COL_HEADING.
WRITE: / wa_protocol-filename.
FORMAT COLOR COL_BACKGROUND.
ULINE.
WHEN 'N'. "Normaler Eintrag
WRITE: / wa_protocol-objtype, wa_protocol-objname, text004,
wa_protocol-filename.
WHEN 'E'. "Fehlerhafter Eintrag
FORMAT INTENSIFIED COLOR = 6.
WRITE: / wa_protocol-objtype, wa_protocol-objname, text013,
wa_protocol-filename.
FORMAT INTENSIFIED COLOR = 0.
ENDCASE.
ENDLOOP.
ENDFORM. " output_protocol

*&---------------------------------------------------------------------*
*& Form convert_fugrname_for_partner
*&---------------------------------------------------------------------*
* Der interne Funktionsgruppenname wird für den Partnernamensraum
* ermittelt.
*----------------------------------------------------------------------*
* <--P_WA_TADIR_OBJ_NAME text
*----------------------------------------------------------------------*
FORM convert_fugrname_for_partner CHANGING p_name TYPE any.
DATA: lcl_include TYPE rs38l-include.
DATA: lcl_namespace TYPE rs38l-namespace.
DATA: lcl_without TYPE rs38l-include.

*1. Get Partner name space:


lcl_include = p_name.
CALL FUNCTION 'RS_PROGNAME_SPLIT'
EXPORTING
progname_with_namespace = lcl_include
IMPORTING
namespace = lcl_namespace
progname_without_namespace = lcl_without
* EXPORTING
.
IF sy-subrc <> 0.
EXIT.
ELSE.
CONCATENATE lcl_namespace 'SAPL' lcl_without
INTO p_name.
ENDIF.

ENDFORM. " convert_fugrname_for_partner


*&---------------------------------------------------------------------*
*& Form convert_funcname_for_partner
*&---------------------------------------------------------------------*
* Der interne Funktionsbausteinname wird für den Partnernamensraum
* ermittelt. --> Includename
*----------------------------------------------------------------------*
FORM convert_funcname_for_partner USING p_wa_tfdir TYPE tfdir
CHANGING p_include.
DATA: lcl_include TYPE rs38l-include.
DATA: lcl_namespace TYPE rs38l-namespace.
DATA: lcl_without TYPE rs38l-include.
lcl_include = p_wa_tfdir-pname.
CALL FUNCTION 'RS_PROGNAME_SPLIT'
EXPORTING
progname_with_namespace = lcl_include
IMPORTING
namespace = lcl_namespace
progname_without_namespace = lcl_without
* EXPORTING
.
IF sy-subrc <> 0.
EXIT.
ELSE.
CONCATENATE lcl_namespace lcl_without+3 'U' p_wa_tfdir-include
INTO p_include.
ENDIF.
ENDFORM. " convert_funcname_for_partner

*&---------------------------------------------------------------------*
*& Form call_ws_download
*&---------------------------------------------------------------------*
* Gekapselter Aufruf des Funktionsbausteins
* zum Download auf das Frontend
*----------------------------------------------------------------------*
FORM call_ws_download USING p_filename LIKE filename
p_table TYPE any
CHANGING p_subrc TYPE sy-subrc.
DATA: lcl_filename TYPE string.
DATA: lcl_progress TYPE string.

* Map input parameters to parameters for function module


ASSIGN p_table TO <ty_downtab>.
* Conversion for 6.x:
lcl_filename = p_filename.
* Build text for progress indicator...
CONCATENATE 'Downloading:' p_filename
INTO lcl_progress SEPARATED BY space.
*Gui-Download is obsolet with 6.x basis
* CALL FUNCTION 'WS_DOWNLOAD'
* EXPORTING
* filename = p_filename
* filetype = 'ASC'
* IMPORTING
* filelength = size
* TABLES
* data_tab = <ty_downtab>
* EXCEPTIONS
* file_open_error = 1
* file_write_error = 2
* invalid_filesize = 3
* invalid_type = 4
* no_batch = 5
* unknown_error = 6
* invalid_table_width = 7
* gui_refuse_filetransfer = 8
* customer_error = 9
* OTHERS = 10.
* Explizit call of Progress Indicator.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = lcl_progress
EXCEPTIONS
error_message = 98
OTHERS = 99.
IF sy-subrc <> 0.
CLEAR: sy-subrc.
ENDIF.
* Download for 6.x
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lcl_filename
filetype = 'ASC'
IMPORTING
filelength = size
TABLES
data_tab = <ty_downtab>
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc = 0.
p_subrc = sy-subrc.
ELSE.
p_subrc = sy-subrc.
ENDIF.
ENDFORM. " call_ws_download
*&---------------------------------------------------------------------*
*& Form convert_include_to_xml
*&---------------------------------------------------------------------*
* Convert an abap-include source to an xml-file
*----------------------------------------------------------------------*
* <--P_LCL_IT_XML text
*----------------------------------------------------------------------*
FORM convert_include_to_xml TABLES p_it_xml
USING p_include.
DATA: lcl_wa_xml TYPE tbl2048.
*data: lcl_wa_downtab like line of downtab.
DATA: lcl_wa_downtab LIKE LINE OF downtab.
DATA: lcl_split1 LIKE lcl_wa_downtab.
DATA: lcl_split2 LIKE lcl_split1.
DATA: lcl_counter TYPE i.
DATA: lcl_c_counter TYPE string.
DATA: lcl_modi(1) TYPE c.
* <?xml version="1.0" encoding="iso-8859-1" ?>
WRITE '<?xml version="1.0" encoding="iso-8859-1" ?>' TO lcl_wa_xml.
APPEND lcl_wa_xml TO p_it_xml.
APPEND '<?xml-stylesheet type="text/xsl" href="ABAP.xsl"?>' TO p_it_xml.
*Report-Tag
APPEND '<report>' TO p_it_xml.
*Title-Tag
CONCATENATE '<title>' filename '</title>' INTO lcl_wa_xml.
APPEND lcl_wa_xml TO p_it_xml.
*Description-Tag
*concatenate '<description>' '<' '![CDATA[' into lcl_wa_xml.
*append lcl_wa_xml to p_it_xml.
*Open Code Tag
APPEND '<code>' TO p_it_xml.
*Transform ABAP-Code
LOOP AT downtab INTO lcl_wa_downtab.
lcl_counter = lcl_counter + 1.
lcl_c_counter = lcl_counter.
* Switch on for modification
IF lcl_wa_downtab(2) = '*{'.
lcl_modi = 'X'.
ENDIF.

* Modificated part
IF lcl_modi = 'X'.
* Suche nach ]] wegen CDATA - Anweisung
SEARCH lcl_wa_downtab FOR ']]'.
IF sy-subrc = 0.
SPLIT lcl_wa_downtab AT ']]' INTO lcl_split1 lcl_split2.
CONCATENATE
'<modi no="' lcl_c_counter '"><![CDATA[' lcl_split1 ']' ']' '>'
']]'
'<![CDATA[' lcl_split2 ']' ']' '>'
INTO lcl_wa_xml.

ELSE. "keine gefähliche Stelle


CONCATENATE '<modi no="' lcl_c_counter '"><![CDATA['
lcl_wa_downtab ']' ']' '>' INTO lcl_wa_xml.
ENDIF.
* Close modi tag
CONCATENATE lcl_wa_xml '<' '/modi' '>' INTO lcl_wa_xml.
APPEND lcl_wa_xml TO p_it_xml.
* Kommentare
ELSEIF lcl_wa_downtab(1) = '*'.
CONCATENATE
'<comment no="' lcl_c_counter '"><![CDATA[' lcl_wa_downtab ']' ']'
'>' '</comment>' INTO lcl_wa_xml.
APPEND lcl_wa_xml TO p_it_xml.

* Normal Source code


ELSE.
* Open-Source Tag
* Suche nach ]] wegen CDATA - Anweisung
SEARCH lcl_wa_downtab FOR ']]'. "'<![CDATA['.
IF sy-subrc = 0.
SPLIT lcl_wa_downtab AT ']]' INTO lcl_split1 lcl_split2.
CONCATENATE
'<source no="' lcl_c_counter '"><![CDATA[' lcl_split1 ']' ']' '>'
']]'
'<![CDATA[' lcl_split2 ']' ']' '>'
INTO lcl_wa_xml.

ELSE. "keine gefähliche Stelle


CONCATENATE '<source no="' lcl_c_counter '"><![CDATA['
lcl_wa_downtab ']' ']' '>' INTO lcl_wa_xml.
ENDIF.
* Close-Source Tag
CONCATENATE lcl_wa_xml '<' '/source' '>' INTO lcl_wa_xml.
APPEND lcl_wa_xml TO p_it_xml.
ENDIF.
*Switch off for modifications
IF lcl_wa_downtab(2) = '*}'.
CLEAR lcl_modi.
ENDIF.
ENDLOOP.
*Clodes
APPEND '</code>' TO p_it_xml.
APPEND '</report>' TO p_it_xml.
ENDFORM. " convert_include_to_xml
*&---------------------------------------------------------------------*
*& Form nav_xml_add_subitem
*&---------------------------------------------------------------------*
* Einhängen eins Subitems in die Navigationsdatei
*----------------------------------------------------------------------*
FORM nav_xml_add_subitem USING p_url
p_name
p_target.
IF NOT p_url IS INITIAL.
APPEND '<subitem>' TO it_html.
CONCATENATE '<value>' p_name '</value>' INTO wa_html.
APPEND wa_html TO it_html.
CONCATENATE '<url>' p_url '</url>' INTO wa_html.
APPEND wa_html TO it_html.
CONCATENATE '<target>' p_target '</target>' INTO wa_html.
APPEND wa_html TO it_html.
APPEND '</subitem>' TO it_html.
ELSE.
APPEND '<subitem_no_link>' TO it_html.
CONCATENATE '<value>' p_name '</value>' INTO wa_html.
APPEND '</subitem_no_link>' TO it_html.
ENDIF.

ENDFORM. " nav_xml_add_subitem


*&---------------------------------------------------------------------*
*& Form create_xsl_files
*&---------------------------------------------------------------------*
* This form-routine creates and downloads the static xsl and css
* Files
*----------------------------------------------------------------------*
FORM create_xsl_files.
DATA: lcl_line LIKE LINE OF it_html.
***********************
* Create and download ABAP.xsl
*create if empty
IF it_abap_xsl IS INITIAL.
APPEND '<?xml version="1.0" encoding="iso-8859-1"?>' TO it_abap_xsl.
CONCATENATE '<xsl:stylesheet language="JavaScript"'
'xmlns:xsl="http://www.w3.org/TR/WD-xsl"'
'xmlns:HTML="http://www.w3.org/Profiles/XHTML-transitional">'
INTO lcl_line SEPARATED BY space.
APPEND lcl_line TO it_abap_xsl.
APPEND '<xsl:template>' TO it_abap_xsl.
APPEND '<xsl:apply-templates/>' TO it_abap_xsl.
APPEND '</xsl:template>' TO it_abap_xsl.
APPEND '<xsl:template match="report" >' TO it_abap_xsl.
CONCATENATE '<HTML xmlns="http://www.w3.org/1999/xhtml"'
'xml:lang="en" lang="en">' INTO lcl_line SEPARATED BY space.
APPEND lcl_line TO it_abap_xsl.
APPEND '<HEADER>' TO it_abap_xsl.
APPEND '<title><xsl:value-of select="title"/></title>' TO it_abap_xsl.
APPEND '<LINK REL="STYLESHEET" TYPE="text/css" HREF="formate.css"/>'
TO it_abap_xsl.
APPEND '<XML id="xmldso"></XML>' TO it_abap_xsl.
APPEND '<XML id="xsldso"></XML>' TO it_abap_xsl.
APPEND '<SCRIPT><xsl:comment><![CDATA[' TO it_abap_xsl.
APPEND 'function switchLineNo(){' TO it_abap_xsl.
APPEND 'xmldso.async = false;' TO it_abap_xsl.
APPEND 'xsldso.load("blank.xsl");' TO it_abap_xsl.
APPEND 'xmldso.load(document.title+".xml");' TO it_abap_xsl.
CONCATENATE 'listing.innerHTML ='
'xmldso.transformNode(xsldso.cloneNode(true)) ;'
INTO lcl_line SEPARATED BY space.
APPEND lcl_line TO it_abap_xsl.
APPEND '}' TO it_abap_xsl.
APPEND ']]></xsl:comment></SCRIPT>' TO it_abap_xsl.
APPEND '</HEADER>' TO it_abap_xsl.
APPEND '<BODY>' TO it_abap_xsl.
APPEND '<div id="listing"/>' TO it_abap_xsl.
APPEND '<table summary="Name" border="0" width="100%">' TO it_abap_xsl.
APPEND '<tr>' TO it_abap_xsl.
APPEND '<td><H1><xsl:value-of select="title"/></H1></td>'
TO it_abap_xsl.
APPEND '</tr>' TO it_abap_xsl.
APPEND '<tr>' TO it_abap_xsl.
APPEND '<xsl:if test="description[.$ne$'' '']">' TO it_abap_xsl.
APPEND '<td><H2><xsl:value-of select="description"/></H2></td>'
TO it_abap_xsl.
APPEND '</xsl:if>' TO it_abap_xsl.
APPEND '</tr>' TO it_abap_xsl.
APPEND '</table>' TO it_abap_xsl.
CONCATENATE '<DIV onClick="switchLineNo()"'
'STYLE="color:#003399;cursor:hand;text-decoration:none;">['
'Blank text to copy in MS-Word ]</DIV>'
INTO lcl_line SEPARATED BY space.
APPEND lcl_line TO it_abap_xsl.
APPEND '<PRE/>' TO it_abap_xsl.
APPEND '<TABLE border="1" width="100%" cellspacing="1" rules="cols">'
TO it_abap_xsl.
APPEND '<COLGROUP><COL WIDTH="30"/><COL WIDTH="*"/></COLGROUP>'
TO it_abap_xsl.
APPEND '<xsl:apply-templates select="code"/>' TO it_abap_xsl.
APPEND '</TABLE>' TO it_abap_xsl.
APPEND '</BODY>' TO it_abap_xsl.
APPEND '</HTML>' TO it_abap_xsl.
APPEND '</xsl:template>' TO it_abap_xsl.
APPEND '<xsl:template match="code">' TO it_abap_xsl.
APPEND '<xsl:apply-templates select="comment|source|modi" />'
TO it_abap_xsl.
APPEND '</xsl:template>' TO it_abap_xsl.

APPEND '<xsl:template match="comment">' TO it_abap_xsl.


APPEND '<TR>' TO it_abap_xsl.
CONCATENATE '<TH class="source"'
'align="right"><xsl:value-of select="@no"/></TH>'
INTO lcl_line SEPARATED BY space.
APPEND lcl_line TO it_abap_xsl.
APPEND '<TD class="source">' TO it_abap_xsl.
CONCATENATE '<nobr><pre class="code"/><FONT'
'color="green"><xsl:value-of select="."/></FONT></nobr>'
INTO lcl_line SEPARATED BY space.
APPEND lcl_line TO it_abap_xsl.
APPEND '</TD>' TO it_abap_xsl.
APPEND '</TR>' TO it_abap_xsl.
APPEND '</xsl:template>' TO it_abap_xsl.
APPEND '<xsl:template match="source">' TO it_abap_xsl.
APPEND '<TR>' TO it_abap_xsl.
CONCATENATE '<TH class="source"'
'align="right"><xsl:value-of select="@no"/></TH>'
INTO lcl_line SEPARATED BY space.
APPEND lcl_line TO it_abap_xsl.
APPEND '<TD class="source"><nobr><pre class="code"/>' TO it_abap_xsl..
APPEND '<xsl:choose>' TO it_abap_xsl.
APPEND '<xsl:when test="anker">' TO it_abap_xsl.
CONCATENATE '<a><xsl:attribute name="name">'
'<xsl:value-of select="anker"/>'
'</xsl:attribute><xsl:value-of select="abap"/></a>'
INTO lcl_line.
APPEND lcl_line TO it_abap_xsl.
APPEND '</xsl:when>' TO it_abap_xsl.
CONCATENATE '<xsl:when test="abap|call_function|perform|include">'
'<xsl:apply-templates /></xsl:when>'
INTO lcl_line.
APPEND lcl_line TO it_abap_xsl.
APPEND '<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>'
TO it_abap_xsl.
APPEND '</xsl:choose>' TO it_abap_xsl.
APPEND '</nobr></TD>' TO it_abap_xsl.
APPEND '</TR>' TO it_abap_xsl.
APPEND '</xsl:template>' TO it_abap_xsl.
APPEND '<xsl:template match="modi">' TO it_abap_xsl.
APPEND '<TR>' TO it_abap_xsl.
CONCATENATE '<TH class="modi" align="right">'
'<xsl:value-of select="@no"/></TH>'
INTO lcl_line.
APPEND lcl_line TO it_abap_xsl.
CONCATENATE '<TD class="modi"><nobr><pre class="code"/>'
'<FONT color="red"><xsl:choose>'
INTO lcl_line.
APPEND lcl_line TO it_abap_xsl.
APPEND '<xsl:when test="anker">' TO it_abap_xsl.
CONCATENATE '<a><xsl:attribute name="name">'
'<xsl:value-of select="anker"/></xsl:attribute>'
'<xsl:value-of select="abap"/></a>'
INTO lcl_line.
APPEND lcl_line TO it_abap_xsl.
APPEND '</xsl:when>' TO it_abap_xsl.
CONCATENATE '<xsl:when test="abap|call_function|perform|include">'
'<xsl:apply-templates /></xsl:when>'
INTO lcl_line.
APPEND lcl_line TO it_abap_xsl.
APPEND '<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>'
TO it_abap_xsl.
APPEND '</xsl:choose></FONT>' TO it_abap_xsl.
APPEND '</nobr></TD>' TO it_abap_xsl.
APPEND '</TR>' TO it_abap_xsl.
APPEND '</xsl:template>' TO it_abap_xsl.
APPEND '</xsl:stylesheet>' TO it_abap_xsl.
ENDIF.
*Download der Tabelle
PERFORM download_html_file USING '1'.
***********************

***********************
* Create and download nav.xsl
IF it_nav_xsl IS INITIAL.
APPEND '<?xml version="1.0" encoding="iso-8859-1"?>' TO it_nav_xsl.
CONCATENATE '<xsl:stylesheet language="JavaScript"'
'xmlns:xsl="http://www.w3.org/TR/WD-xsl"'
'xmlns:HTML="http://www.w3.org/Profiles/XHTML-transitional">'
INTO lcl_line SEPARATED BY space.
APPEND lcl_line TO it_nav_xsl.
APPEND '<xsl:template>' TO it_nav_xsl.
APPEND '<xsl:apply-templates/>' TO it_nav_xsl.
APPEND '</xsl:template>' TO it_nav_xsl.
APPEND '<xsl:template match="Nav">' TO it_nav_xsl.
APPEND
'<HTML xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'
TO it_nav_xsl.
APPEND '<LINK REL="STYLESHEET" TYPE="text/css" HREF="formate.css"/>'
TO it_nav_xsl.
APPEND '<H3 align="center"><i>' TO it_nav_xsl.
APPEND '<xsl:value-of select="header"/>' TO it_nav_xsl.
APPEND '</i></H3>' TO it_nav_xsl.
APPEND '<p/>' TO it_nav_xsl.
APPEND 'Installation: <xsl:value-of select="inst"/>' TO it_nav_xsl.
APPEND '<p/>' TO it_nav_xsl.
APPEND 'System Name: <xsl:value-of select="sysname"/>' TO it_nav_xsl.
APPEND '<xsl:for-each select="item">' TO it_nav_xsl.
APPEND '<h4>' TO it_nav_xsl.
APPEND '<xsl:value-of select="value"/>' TO it_nav_xsl.
APPEND '</h4>' TO it_nav_xsl.
APPEND '<ul>' TO it_nav_xsl.
APPEND '<xsl:for-each select="subitem">' TO it_nav_xsl.
APPEND '<li>' TO it_nav_xsl.
APPEND '<a>' TO it_nav_xsl.
CONCATENATE '<xsl:attribute name="HREF">'
'<xsl:value-of select="url"/></xsl:attribute>'
INTO lcl_line.
APPEND lcl_line TO it_nav_xsl.
CONCATENATE '<xsl:attribute name="target">'
'<xsl:value-of select="target"/></xsl:attribute>'
INTO lcl_line.
APPEND lcl_line TO it_nav_xsl.
APPEND '<xsl:value-of select="value"/>' TO it_nav_xsl.
APPEND '</a>' TO it_nav_xsl.
APPEND '</li>' TO it_nav_xsl.
APPEND '</xsl:for-each>' TO it_nav_xsl.
APPEND '<xsl:for-each select="subitem_no_link">' TO it_nav_xsl.
APPEND '<li>' TO it_nav_xsl.
APPEND '<xsl:value-of select="value"/>' TO it_nav_xsl.
APPEND '</li>' TO it_nav_xsl.
APPEND '</xsl:for-each>' TO it_nav_xsl.
APPEND '</ul>' TO it_nav_xsl.
APPEND '</xsl:for-each>' TO it_nav_xsl.
APPEND '<xsl:for-each select="item_linked">' TO it_nav_xsl.
APPEND '<h4>' TO it_nav_xsl.
APPEND '<a>' TO it_nav_xsl.
CONCATENATE '<xsl:attribute name="HREF">'
'<xsl:value-of select="url"/></xsl:attribute>'
INTO lcl_line.
APPEND lcl_line TO it_nav_xsl.
CONCATENATE '<xsl:attribute name="target">'
'<xsl:value-of select="target"/></xsl:attribute>'
INTO lcl_line.
APPEND lcl_line TO it_nav_xsl.
APPEND '<xsl:value-of select="value"/>' TO it_nav_xsl.
APPEND '</a>' TO it_nav_xsl.
APPEND '</h4>' TO it_nav_xsl.
APPEND '<ul>' TO it_nav_xsl.
APPEND '<xsl:for-each select="subitem">' TO it_nav_xsl.
APPEND '<li>' TO it_nav_xsl.
APPEND '<a>' TO it_nav_xsl.
CONCATENATE '<xsl:attribute name="HREF">'
'<xsl:value-of select="url"/></xsl:attribute>'
INTO lcl_line.
APPEND lcl_line TO it_nav_xsl.
CONCATENATE '<xsl:attribute name="target">'
'<xsl:value-of select="target"/></xsl:attribute>'
INTO lcl_line.
APPEND lcl_line TO it_nav_xsl.
APPEND '<xsl:value-of select="value"/>' TO it_nav_xsl.
APPEND '</a>' TO it_nav_xsl.
APPEND '</li>' TO it_nav_xsl.
APPEND '</xsl:for-each>' TO it_nav_xsl.
APPEND '<xsl:for-each select="subitem_no_link">' TO it_nav_xsl.
APPEND '<li>' TO it_nav_xsl.
APPEND '<xsl:value-of select="value"/>' TO it_nav_xsl.
APPEND '</li>' TO it_nav_xsl.
APPEND '</xsl:for-each>' TO it_nav_xsl.
APPEND '</ul>' TO it_nav_xsl.
APPEND '</xsl:for-each>' TO it_nav_xsl.
APPEND '</HTML>' TO it_nav_xsl.
APPEND '</xsl:template>' TO it_nav_xsl.
APPEND '</xsl:stylesheet>' TO it_nav_xsl.
ENDIF.
*Download der Tabelle
PERFORM download_html_file USING '2'.
**********************
***********************
* Create and download table.xsl
IF it_table_xsl IS INITIAL.
APPEND '<?xml version="1.0" encoding="iso-8859-1"?>' TO it_table_xsl.
CONCATENATE '<xsl:stylesheet language="JavaScript"'
'xmlns:xsl="http://www.w3.org/TR/WD-xsl"'
'xmlns:HTML="http://www.w3.org/Profiles/XHTML-transitional">'
INTO lcl_line SEPARATED BY space.
APPEND lcl_line TO it_table_xsl.
APPEND '<xsl:template>' TO it_table_xsl.
APPEND '<xsl:apply-templates/>' TO it_table_xsl.
APPEND '</xsl:template>' TO it_table_xsl.
APPEND '<xsl:template match="Tabelle">' TO it_table_xsl.
APPEND
'<HTML xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'
TO it_table_xsl.
APPEND '<LINK REL="STYLESHEET" TYPE="text/css" HREF="formate.css"/>'
TO it_table_xsl.
APPEND '<head>' TO it_table_xsl.
APPEND '<title><xsl:value-of select="header"/></title>'
TO it_table_xsl.
APPEND '</head>' TO it_table_xsl.
APPEND '<body>' TO it_table_xsl.
APPEND '<h1><xsl:value-of select="header"/></h1>' TO it_table_xsl.
APPEND '<br></br>' TO it_table_xsl.
APPEND '<table border="0">' TO it_table_xsl.
APPEND '<xsl:for-each select="tab_header">' TO it_table_xsl.
APPEND '<tr>' TO it_table_xsl.
APPEND '<xsl:for-each select="value">' TO it_table_xsl.
APPEND '<th>' TO it_table_xsl.
APPEND '<xsl:value-of select="."/>' TO it_table_xsl.
APPEND '</th>' TO it_table_xsl.
APPEND '</xsl:for-each>' TO it_table_xsl.
APPEND '</tr>' TO it_table_xsl.
APPEND '</xsl:for-each>' TO it_table_xsl.
APPEND '<xsl:for-each select="item">' TO it_table_xsl.
APPEND '<TBODY style="background-color: #fafad2;"/>' TO it_table_xsl.
APPEND '<tr>' TO it_table_xsl.
APPEND '<xsl:for-each select="value">' TO it_table_xsl.
APPEND '<td>' TO it_table_xsl.
APPEND '<xsl:value-of select="."/>' TO it_table_xsl.
APPEND '</td>' TO it_table_xsl.
APPEND '</xsl:for-each>' TO it_table_xsl.
APPEND '</tr>' TO it_table_xsl.
APPEND '</xsl:for-each>' TO it_table_xsl.
APPEND '</table>' TO it_table_xsl.
APPEND '</body>' TO it_table_xsl.
APPEND '</HTML>' TO it_table_xsl.
APPEND '</xsl:template>' TO it_table_xsl.
APPEND '</xsl:stylesheet>' TO it_table_xsl.
ENDIF.
*Download der Tabelle
PERFORM download_html_file USING '3'.
***********************
***********************
* Create and download formate.css
IF it_formate_css IS INITIAL.
APPEND 'thead { background-color:#EEEEEE; }' TO it_formate_css.
APPEND 'th { text-align: left; background-color:#EEEEEE; }'
TO it_formate_css.
APPEND 'th.source { text-align: right; background-color:#EEEEEE; }'
TO it_formate_css.
APPEND 'th.modi { text-align: right; background-color:#EEEEEE; }'
TO it_formate_css.
APPEND 'th.center { text-align: center }' TO it_formate_css.
APPEND 'tbody.content { background-color:#FFFFE0; }'
TO it_formate_css.
APPEND 'td.text { font-family:Arial,sans-serif; background-color:' &
'#FFFFFF; }' TO it_formate_css.
APPEND 'td.content { background-color:#FFFFE0; vertical-align: top; }'
TO it_formate_css.
APPEND 'td.centerContent { background-color:#FFFFE0; vertical-align: '
&
'top; align: center}' TO it_formate_css.
APPEND 'tr.zwisu { background-color:#EEEEEA; }' TO it_formate_css.
APPEND 'tr.highlight { background-color:#CCFFCC; }' TO it_formate_css.
APPEND
'DIV.clTopMenu{position:absolute; width:150px; height:150px; clip:' &
'rect(0px,150px,18px,0px); visibility:hidden; z-index:31; ' &
'layer-background-color:#EEEEEE; background-color:#EEEEEE}'
TO it_formate_css.
APPEND
'DIV.clTopMenuBottom{position:absolute; width:150px; ' &
'height:3px; clip:rect(0px,150px,3px,0px); top:11px; ' &
'layer-background-color:#CECFCE; background-color:#CECFCE; ' &
'z-index:2}'
TO it_formate_css.
APPEND
'DIV.clTopMenuText{position:absolute; width:140px; left:5px; ' &
'top:20px; font-family:arial,helvetica; font-size:11px;' &
'background-color:#EEEEEE; z-index:1} '
TO it_formate_css.
APPEND
'DIV.clTopSelect{position:absolute; width:250px; ' &
'visibility:hidden; }'
TO it_formate_css.
APPEND 'DIV.clHidden{visibility:hidden;}' TO it_formate_css.
APPEND 'DIV.clVisible{ position:absolute; top:50px; ' &
'left:10px; visibility:visible;}'
TO it_formate_css.
APPEND
'#divLoadCont{position:absolute; width:100%; height:100%; ' &
'top:0px; left:0px; background-color:white; ' &
'layer-background-color:white; font-family:arial,helvetica; ' &
'z-index:100}'
TO it_formate_css.
APPEND 'body { margin-top:10px; margin-bottom:10px; }'
TO it_formate_css.
APPEND
'p, h1, h2, h3, h4, ul, ol, li, div, td, th, address, ' &
'blockquote, nobr, b, i'
TO it_formate_css.
APPEND '{ font-family:Arial,sans-serif; }' TO it_formate_css.
APPEND 'h1 { font-size:18pt; }' TO it_formate_css.
APPEND 'h2 { font-size:16pt; }' TO it_formate_css.
APPEND 'h2.sh2 { font-size:16pt; }' TO it_formate_css.
APPEND 'h3, h3.xmp, h3.xpl, h3.inf, h3.tip ' &
'{ font-size:12pt; }'
TO it_formate_css.
APPEND 'h4 { font-size:10pt; }' TO it_formate_css.
APPEND 'p, ul, ol, li, div, td, th, address, nobr, b, i ' &
'{ font-size:10pt; }'
TO it_formate_css.
APPEND 'pre { font-family:"Courier New,Courier"; font-size:10pt; ' &
'color:#0000C0; }'
TO it_formate_css.
APPEND 'tt { font-family:Courier New,Courier; ' &
'font-size:10pt; color:#0000C0; }'
TO it_formate_css.
APPEND 'td.xmpcode { border-width:1pt; border-style:solid; ' &
'border-color:#999999; background-color:#FFFFE0; }'
TO it_formate_css.
APPEND 'td.source { font-family:"Courier New,Courier"; ' &
'font-size:10pt; background-color:#FFFFE0; ' &
'padding-left:2mm}'
TO it_formate_css.
APPEND 'td.modi { font-family:"Courier New,Courier"; ' &
'font-size:10pt; color:"red" background-color:#FFFFE0; ' &
'padding-left:2mm}'
TO it_formate_css.
APPEND '.code { background-color:#FFFFE0; }' TO it_formate_css.
APPEND 'td.xplcode { background-color:#EEEEFF; }' TO it_formate_css.
APPEND '.doc { background-color:#EEEEEE; }' TO it_formate_css.
APPEND '.qbar { background-color:#FFFFE0; font-size:9pt; ' &
'font-family:Arial,sans-serif; }'
TO it_formate_css.
APPEND 'pre.normal { color:#000000; }' TO it_formate_css.

APPEND 'a:link { color:#000066; text-decoration:none; }'


TO it_formate_css.
APPEND 'a:visited { color:#002266; text-decoration:none; }'
TO it_formate_css.
APPEND 'a:active { color:#red; text-decoration:none; }'
TO it_formate_css.
APPEND 'a:hover {color:red; text-decoration:none }'
TO it_formate_css.
APPEND 'a.an { text-decoration:none; }' TO it_formate_css.
APPEND '.ColumnLabel {font-weight:bold}' TO it_formate_css.
ENDIF.
*Download der Tabelle
PERFORM download_html_file USING '4'.
***********************

***********************
* Create and download blank.xsl
IF it_blank_xsl IS INITIAL.
APPEND '<?xml version="1.0" encoding="iso-8859-1"?>' TO it_blank_xsl.
CONCATENATE '<xsl:stylesheet language="JavaScript"'
'xmlns:xsl="http://www.w3.org/TR/WD-xsl"'
'xmlns:HTML="http://www.w3.org/Profiles/XHTML-transitional">'
INTO lcl_line SEPARATED BY space.
APPEND lcl_line TO it_blank_xsl.
APPEND '<xsl:template>' TO it_blank_xsl.
APPEND '<xsl:apply-templates/>' TO it_blank_xsl.
APPEND '</xsl:template>' TO it_blank_xsl.
APPEND '<xsl:template match="report" >' TO it_blank_xsl.
APPEND '<HTML xmlns="http://www.w3.org/1999/xhtml" ' &
'xml:lang="en" lang="en">'
TO it_blank_xsl.
APPEND '<HEADER>' TO it_blank_xsl.
APPEND '<title><xsl:value-of select="title"/></title>'
TO it_blank_xsl.
APPEND '<LINK REL="STYLESHEET" TYPE="text/css" HREF="formate.css"/>'
TO it_blank_xsl.
APPEND '<SCRIPT><xsl:comment><![CDATA[' TO it_blank_xsl.
APPEND 'function switchLineNo(){' TO it_blank_xsl.
APPEND 'open(document.title+".xml");' TO it_blank_xsl.
APPEND '}' TO it_blank_xsl.
APPEND ']]></xsl:comment></SCRIPT>' TO it_blank_xsl.
APPEND '</HEADER>' TO it_blank_xsl.
APPEND '<BODY>' TO it_blank_xsl.
APPEND '<a href="javascript:open(document.title+''.xml'',' &
'''_self'')" STYLE="color:#003399;cursor:hand;text-decoration:' &
'none;">' &
'[ Formatted text with line numbers ]</a>'
TO it_blank_xsl.
APPEND '<xsl:apply-templates select="code"/>' TO it_blank_xsl.
APPEND '</BODY>' TO it_blank_xsl.
APPEND '</HTML>' TO it_blank_xsl.
APPEND '</xsl:template>' TO it_blank_xsl.
APPEND '<xsl:template match="code">' TO it_blank_xsl.
APPEND '<xsl:apply-templates select="comment|source|modi" />'
TO it_blank_xsl.
APPEND '</xsl:template>' TO it_blank_xsl.
APPEND '<xsl:template match="comment">' TO it_blank_xsl.
APPEND '<nobr><pre><xsl:value-of select="."/></pre></nobr>'
TO it_blank_xsl.
APPEND '</xsl:template>' TO it_blank_xsl.
APPEND '<xsl:template match="source">' TO it_blank_xsl.
APPEND '<nobr><pre><xsl:value-of select="."/></pre></nobr>'
TO it_blank_xsl.
APPEND '</xsl:template>' TO it_blank_xsl.
APPEND '<xsl:template match="modi">' TO it_blank_xsl.
APPEND '<nobr><pre><xsl:value-of select="."/></pre></nobr>'
TO it_blank_xsl.
APPEND '</xsl:template>' TO it_blank_xsl.
APPEND '</xsl:stylesheet>' TO it_blank_xsl.
ENDIF.
*Download der Tabelle
PERFORM download_html_file USING '5'.
***********************
ENDFORM. " create_xsl_files
*&---------------------------------------------------------------------*
*& Form iac_service
*&---------------------------------------------------------------------*
FORM iac_service .
DATA: lcl_it_iacs TYPE STANDARD TABLE OF iachtml-service,
lcl_wa_iacs LIKE LINE OF lcl_it_iacs.
*Aktive Kundenerweiterungprojekte aus modattr waehlen
SELECT service FROM iacservice INTO TABLE lcl_it_iacs
WHERE service IN o_iacs.
*Verlassen,wenn keine Werte gefunden worden sind
IF lcl_it_iacs IS INITIAL.
MESSAGE i888(sabapdocu) WITH
'No suitable selection' 'for IAC-Service(ITS)! '
'Please check your selection. '
'The program will process your other selections.'.
*Form-Routine verlassen
EXIT.
ENDIF.
LOOP AT lcl_it_iacs INTO lcl_wa_iacs.
PERFORM handle_iac_service USING lcl_wa_iacs.
*Stueckliste fuer logische Entwicklung
IF NOT ( p_logic IS INITIAL ).
PERFORM write_log_stueckliste USING 'IACS'
lcl_wa_iacs
p_logic.
ENDIF.
ENDLOOP.

ENDFORM. " iac_service


*&---------------------------------------------------------------------*
*& Form handle_iac_service
*&---------------------------------------------------------------------*
FORM handle_iac_service USING p_iacs TYPE c.
DATA:
lcl_it_dir_table TYPE filetable,
lcl_dir LIKE LINE OF lcl_it_dir_table,
lv_count TYPE i,
lcl_w3path TYPE w3path,
lcl_path TYPE string,
lcl_tmp_path TYPE string,
lcl_service TYPE itsappl.

*global_main_name fuer globalen Gebrauch aufbereiten


*-->Parametrisierung umgangen
*Globalen Namen setzen
global_main_name = p_iacs.
*Erzeugen des Ausgabeverzeichnisses fuer dieses Rahmenprogramm
PERFORM create_directory USING p_iacs
'S'.
*Abbrechen da es schon existiert
IF direxists = 'X'.
EXIT.
ENDIF.
*Ueberschrift zusammenbauen
CONCATENATE 'IAC-Service(ITS):' global_main_name INTO header
SEPARATED BY space.
*Protokollliste schreiben.
PERFORM write_protocol USING 'U' '' '' header.
****************
*Intitialisieren der globalen Tabellen
PERFORM initialize.
*Stueckliste fuer allgemeine IAC-SERVICE
PERFORM write_stueckliste USING 'IACS'
p_iacs
''.
********************************************
* Now we can download the whole service
lcl_w3path = new_dir.
lcl_service = p_iacs.
* Publish Service
CALL FUNCTION 'W3_PUBLISH_SERVICE_LOCAL'
EXPORTING
p_service = lcl_service
p_path = lcl_w3path
EXCEPTIONS
object_not_found = 1
permission_failure = 2
data_invalid = 3
action_cancelled = 4
no_publishing_path = 5
wrong_or_no_gui = 6
error_occured = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
* get all subirectories
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = new_dir
directories_only = 'X'
CHANGING
file_table = lcl_it_dir_table
count = lv_count
EXCEPTIONS
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
not_supported_by_gui = 5
OTHERS = 6.
IF sy-subrc <> 0.
EXIT.
ENDIF.
LOOP AT lcl_it_dir_table INTO lcl_dir.
CONCATENATE new_dir '\' lcl_dir INTO lcl_tmp_path.
PERFORM iac_check_rename_files USING lcl_tmp_path.

ENDLOOP.
*********************************************
*End working on this item
**Gesamtstückliste:
PERFORM download_stueckliste.
*Hotpackagestand sichern
PERFORM download_hpstand.
*Leerzeile nach Ende dieser Verarbeitung
* skip.
PERFORM write_protocol USING 'S' '' '' ''.
ENDFORM. " handle_iac_service
*&---------------------------------------------------------------------*
*& Form iac_check_rename_files
*&---------------------------------------------------------------------*
FORM iac_check_rename_files USING p_path TYPE string.
DATA: lcl_path TYPE string,
lcl_it_dir TYPE filetable,
lcl_dir LIKE LINE OF lcl_it_dir,
lcl_it_file_table TYPE filetable,
lcl_count TYPE i.
* check whether there are some files
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = p_path
files_only = 'X'
CHANGING
file_table = lcl_it_file_table
count = lcl_count
EXCEPTIONS
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
not_supported_by_gui = 5
OTHERS = 6.
IF lcl_count = 0.
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = p_path
directories_only = 'X'
CHANGING
file_table = lcl_it_dir
count = lcl_count
EXCEPTIONS
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
not_supported_by_gui = 5
OTHERS = 6.
IF sy-subrc <> 0.
EXIT.
ELSE.
LOOP AT lcl_it_dir INTO lcl_dir.
CONCATENATE p_path '\' lcl_dir INTO lcl_path.
PERFORM iac_check_rename_files USING lcl_path.

ENDLOOP.
ENDIF.
ELSE.
PERFORM iac_do_renaming USING lcl_it_file_table
p_path.
ENDIF.

ENDFORM. " iac_check_rename_files


*&---------------------------------------------------------------------*
*& Form iac_do_renaming
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_LT_FILE_TABLE_FORM text
*----------------------------------------------------------------------*
FORM iac_do_renaming USING pt_filetable TYPE filetable
p_path TYPE string.
DATA:
lcl_file LIKE LINE OF pt_filetable,
lcl_source TYPE string,
lcl_dest TYPE string,
lcl_rc TYPE i.

LOOP AT pt_filetable INTO lcl_file.


CONCATENATE p_path '\' lcl_file INTO lcl_source.
CONCATENATE p_path '\' lcl_file INTO lcl_dest.
REPLACE '.html' WITH '.txt' INTO lcl_dest.
IF sy-subrc NE 0.
REPLACE '.htrc' WITH '.txt' INTO lcl_dest.
IF sy-subrc NE 0.
REPLACE '.srvc' WITH '.txt' INTO lcl_dest.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
ENDIF.
ENDIF.
CALL METHOD cl_gui_frontend_services=>file_copy
EXPORTING
SOURCE = lcl_source
DESTINATION = lcl_dest
overwrite = 'X'
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
disk_full = 4
access_denied = 5
file_not_found = 6
destination_exists = 7
unknown_error = 8
path_not_found = 9
disk_write_protect = 10
drive_not_ready = 11
not_supported_by_gui = 12
OTHERS = 13.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
CALL METHOD cl_gui_frontend_services=>file_delete
EXPORTING
filename = lcl_source
CHANGING
rc = lcl_rc
EXCEPTIONS
file_delete_failed = 1
cntl_error = 2
error_no_gui = 3
file_not_found = 4
access_denied = 5
unknown_error = 6
not_supported_by_gui = 7
wrong_parameter = 8
OTHERS = 9.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
ENDLOOP.

ENDFORM. " iac_do_renaming


*&---------------------------------------------------------------------*
*& Form create_html_for_iacs
*&---------------------------------------------------------------------*
FORM create_html_for_iacs .
*Arbeitsbereich fuer Stuecklisten
DATA: lcl_wa_prog_stueckliste TYPE prog_stueckliste.
* Variables for subitem-generation
DATA: lcl_url LIKE wa_html,
lcl_name LIKE wa_html.
READ TABLE it_prog_stueckliste INDEX 1 INTO
lcl_wa_prog_stueckliste.
* Create the item with the subitem
APPEND '<item>' TO it_html.
CONCATENATE '<value>IAC-Service(ITS):'
lcl_wa_prog_stueckliste-name '</value>'
INTO wa_html SEPARATED BY space.
APPEND wa_html TO it_html.

IF p_trkorr IS INITIAL AND p_devc IS INITIAL.


MOVE './' TO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ELSE.
MOVE './' TO lcl_url.
lcl_name = lcl_wa_prog_stueckliste-name.
ENDIF.

PERFORM nav_xml_add_subitem USING lcl_url


lcl_name
'_blank'.
APPEND '</item>' TO it_html.
ENDFORM. " create_html_for_iacs
*&---------------------------------------------------------------------*
*& Form download_iac_template
*&---------------------------------------------------------------------*
FORM download_iac_template USING p_temp_id TYPE c
p_dir TYPE string.
DATA:
lcl_o_service_ref TYPE REF TO if_w3_api_service,
lcl_o_template_ref TYPE REF TO if_w3_api_template,
lcl_wa_template TYPE iacikeyt,
lcl_it_dir_table TYPE filetable,
lcl_dir LIKE LINE OF lcl_it_dir_table,
lcl_tmp_path TYPE string,
lcl_count TYPE i,
lcl_w3path TYPE w3path.
lcl_wa_template-service = p_temp_id(14).
lcl_wa_template-theme = p_temp_id+14(2).
lcl_wa_template-dynpro = p_temp_id+16(4).
lcl_wa_template-modulpool = p_temp_id+20.
lcl_w3path = p_dir.
* load service
CALL METHOD cl_w3_api_factory=>load_service
EXPORTING
p_service_name = lcl_wa_template-service
IMPORTING
p_service = lcl_o_service_ref
EXCEPTIONS
object_not_existing = 1
permission_failure = 2
error_occured = 3.

* get template
CALL METHOD cl_w3_api_factory=>load_template
EXPORTING
p_template_name = lcl_wa_template
IMPORTING
p_template = lcl_o_template_ref
EXCEPTIONS
object_not_existing = 1
permission_failure = 2
error_occured = 3.
CALL METHOD lcl_o_template_ref->if_w3_api_object~publish_local
EXPORTING
p_path = lcl_w3path
EXCEPTIONS
object_invalid = 1
object_changed = 2
action_cancelled = 3
error_occured = 4
name_too_long = 5.
IF sy-subrc <> 0.
*Protokollliste schreiben.
PERFORM write_protocol USING 'E' 'IAC-Template'
p_temp_id lcl_w3path.
ELSE.
*Protokollliste schreiben.
PERFORM write_protocol USING 'N' 'IAC-Template'
p_temp_id lcl_w3path.
ENDIF.

* get all subirectories


CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = p_dir
directories_only = 'X'
CHANGING
file_table = lcl_it_dir_table
count = lcl_count
EXCEPTIONS
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
not_supported_by_gui = 5
OTHERS = 6.
IF sy-subrc <> 0.
EXIT.
ENDIF.
LOOP AT lcl_it_dir_table INTO lcl_dir.
CONCATENATE p_dir '\' lcl_dir INTO lcl_tmp_path.
PERFORM iac_check_rename_files USING lcl_tmp_path.

ENDLOOP.
ENDFORM. " download_iac_template
*&---------------------------------------------------------------------*
*& Form rs_program_index
*&---------------------------------------------------------------------*
* this replaces function module RS_PROGRAM_INDEX for 6.X
* Mainly copied from cl_wb_crossreference=>program_index
*----------------------------------------------------------------------*
FORM rs_program_index USING p_name
CHANGING pt_cross TYPE ANY TABLE.
DATA: lcl_it_include_tab TYPE programt,
lcl_wa_include_tab LIKE LINE OF lcl_it_include_tab,
lcl_with_reserved_includes TYPE char1,
lcl_it_cross TYPE STANDARD TABLE OF cross.
IF p_name+30(1) NE space.
lcl_with_reserved_includes = 'X'.
ENDIF.
CALL FUNCTION 'RS_GET_ALL_INCLUDES'
EXPORTING
program = p_name
with_inactive_incls = 'X'
with_reserved_includes = lcl_with_reserved_includes
TABLES
includetab = lcl_it_include_tab
EXCEPTIONS
OTHERS = 3.
IF sy-subrc NE 0.
EXIT.
ENDIF.
LOOP AT lcl_it_include_tab INTO lcl_wa_include_tab.
SELECT * FROM cross APPENDING TABLE pt_cross
WHERE include = lcl_wa_include_tab.
ENDLOOP.

ENDFORM. " rs_program_index

O_BADIS Badi-Implementation
O_CLASS Classes
O_CMOD Enhancement Project
O_DEVCL Developmentclass
O_DYNP Dynpro
O_FKGRP Functiongroups
O_FUNC Functionmodule
O_IACS IAC-Service(ITS)
O_IDOC IDoc/Enhancement
O_INC Include
O_INTF Interface
O_LAN Documentation Language
O_PROG Online-Program
O_TCODE Transactioncode
O_TRKORR Transport-Request
PFAD Existing path
P_APP1 Data-File auf App-Server
P_APP2 CO-File auf App-Server
P_ASC Asci Mode
P_BASIS Basistype
P_BIN Binary Mode
P_DEVC Selection via Developmentclass
P_DOWN Download vom R/3-Server
P_ENH Enhancement
P_FRONT Verzeichnis WS
P_LOGIC Logical Development
P_NSPACE Namespace
P_OVER Bestehende Dat. übeschr.
P_SINGLE Selction via single Objects
P_TRFIL Handling of Transport Files
P_TRKOR1 Transportauftrag
P_TRKORR Selection via Transportrequest
P_UP Upload zum R/3-Server