Download an ABAP program.
Hi,
I think that in SAP there is a trx which allows to download an ABAP program, I tried to execute REPTRAN but this trx doesn't exist!
Regards
Which version of SAP are you working in ?
Program REPTRAN is available in ECC 6.0.
Note:It is program name not transaction code.
Similar Messages
-
How to copy/download all ABAP programs in a text with a single report ?
How to copy/download all ABAP programs in a text format with a single report/TC ?
How to copy/download ABAP source code with all include programs ?....
we need to search & copy all include programs everytime....Hi,
check this link
downloading programs
Regards -
Download/Upload ABAP Programs, screens, texts, etc
Hi Experts,
Is there any standard program or any tool by which we can download/ upload ABAP programs, sapscripts, Screens, text-elements, Webdynpro for ABAP applications to a local file????
The Download to local server option in SE38 just gives a text copy of program without any screens, text eleemnts, etc which is not as per my requirement.
Points will be rewarded.
Regards,
Mansi.use This
REPORT ZDOWNLOAD.
*& Report ZDOWNLAOD
I N F O R M A T I O N *
Module :
FUNCTIONAL :
Developer :
Functional Spec# :
Date Of Creation :
Transport Request# :
Program NAME :
Transaction Code :
DEVELOPMENT CLASS :
DESCRIPTION :
Change History
FUNCTIONAL :
Developer :
Functional Spec# :
Date Of Change :
Transport Request# :
Change DESCRIPTION :
*======================================================================================================================
Direct Download Enterprise version 1.3.1.
THIS SOFTWARE IS FOR PERSONAL USE ONLY.
THIS PROGRAM IS FREEWARE AND IS PROVIDED ON AN AS-IS BASIS WITHOUT WARRANTY OF ANY KIND.
THE PROVIDER SPECIFICALLY DISCLAIMS ANY OTHER WARRANTY, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY
OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL THE PROVIDER BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, SPECIAL OR INCIDENTAL DAMAGES, EVEN IF PROVIDER
HAS BEEN ADVISED BY CLIENT OF THE POSSIBILITY OF SUCH POTENTIAL LOSS OR DAMAGE.
CLIENT AGREES TO HOLD PROVIDER HARMLESS FROM AND AGAINST ANY AND ALL CLAIMS, LOSSES, LIABILITIES AND EXPENSES. BY
INSTALLING OR RUNNING THIS PROGRAM YOU ARE AGREEING TO THE TERMS AND CONDITONS STATED ABOVE.
PROGRAM DESCRIPTION & USE
Allows a user to download programs, Functions, DD definitions, etc to the presentation server. This version searches
recursively for nested includes and function modules, and allows you to download the resulting code as standard text
or HTML web pages within a suitable directory structure.
You can either search by object name, using wildcards if you wish, or a combination of Author and object name. If
you want all objects returned for a particular author then select the author name and choose the most suitable
radiobutton. All objects will be returned if the fields to the right hand side of the radiobutton are left completely
blank.
Compatible with R/3 Enterprise only, for older versions of SAP you will need Direct Download version 5.xx.
This version removes the programming limitations imposed by developing across SAP releases 3 to 4.6.
In order to be able to download files to the SAP server you must first set up a logical filepath within transaction
'FILE', or use an existing one. You must also create a external operating system command in SM69 called ZMKDIR. This
will then be used to create any directories needed on the SAP server
This program is intended to allow a person to keep a visual representation of a program for backup purposes only as
has not been designed to allow programs to be uploaded to SAP systems.
author : E.G.Mellodew
program cont
SAP Tables
TABLES: TRDIR, SEOCLASS, TFDIR, ENLFDIR, DD02L.
Types
text element structure
TYPES: TTEXTTABLE LIKE TEXTPOOL.
GUI titles
TYPES: TGUITITLE LIKE D347T.
Message classes
TYPES: BEGIN OF TMESSAGE,
ARBGB LIKE T100-ARBGB,
STEXT LIKE T100A-STEXT,
MSGNR LIKE T100-MSGNR,
TEXT LIKE T100-TEXT,
END OF TMESSAGE.
Screen flow.
TYPES: BEGIN OF TSCREENFLOW,
SCREEN LIKE D020S-DNUM,
CODE LIKE D022S-LINE,
END OF TSCREENFLOW.
Holds a table\structure definition
TYPES: BEGIN OF TDICTTABLESTRUCTURE,
FIELDNAME LIKE DD03L-FIELDNAME,
POSITION LIKE DD03L-POSITION,
KEYFLAG LIKE DD03L-KEYFLAG,
ROLLNAME LIKE DD03L-ROLLNAME,
DOMNAME LIKE DD03L-DOMNAME,
DATATYPE LIKE DD03L-DATATYPE,
LENG LIKE DD03L-LENG,
DDTEXT LIKE DD04T-DDTEXT,
END OF TDICTTABLESTRUCTURE.
Holds a tables attributes + its definition
TYPES: BEGIN OF TDICTTABLE,
TABLENAME LIKE DD03L-TABNAME,
TABLETITLE LIKE DD02T-DDTEXT,
ISTRUCTURE TYPE TDICTTABLESTRUCTURE OCCURS 0,
END OF TDICTTABLE.
Include program names
TYPES: BEGIN OF TINCLUDE,
INCLUDENAME LIKE TRDIR-NAME,
INCLUDETITLE LIKE TFTIT-STEXT,
END OF TINCLUDE.
Exception class texts
TYPES: BEGIN OF TCONCEPT,
CONSTNAME TYPE STRING,
CONCEPT TYPE SOTR_CONC,
END OF TCONCEPT.
Method
TYPES: BEGIN OF TMETHOD,
CMPNAME LIKE VSEOMETHOD-CMPNAME,
DESCRIPT LIKE VSEOMETHOD-DESCRIPT,
EXPOSURE LIKE VSEOMETHOD-EXPOSURE,
METHODKEY TYPE STRING,
END OF TMETHOD.
Class
TYPES: BEGIN OF TCLASS,
SCANNED(1),
CLSNAME LIKE VSEOCLASS-CLSNAME,
DESCRIPT LIKE VSEOCLASS-DESCRIPT,
MSG_ID LIKE VSEOCLASS-MSG_ID,
EXPOSURE LIKE VSEOCLASS-EXPOSURE,
STATE LIKE VSEOCLASS-STATE,
CLSFINAL LIKE VSEOCLASS-CLSFINAL,
R3RELEASE LIKE VSEOCLASS-R3RELEASE,
IMETHODS TYPE TMETHOD OCCURS 0,
IDICTSTRUCT TYPE TDICTTABLE OCCURS 0,
ITEXTELEMENTS TYPE TTEXTTABLE OCCURS 0,
IMESSAGES TYPE TMESSAGE OCCURS 0,
ICONCEPTS TYPE TCONCEPT OCCURS 0,
TEXTELEMENTKEY TYPE STRING,
PUBLICCLASSKEY TYPE STRING,
PRIVATECLASSKEY TYPE STRING,
PROTECTEDCLASSKEY TYPE STRING,
TYPESCLASSKEY TYPE STRING,
EXCEPTIONCLASS TYPE I,
END OF TCLASS.
function modules
TYPES: BEGIN OF TFUNCTION,
FUNCTIONNAME LIKE TFDIR-FUNCNAME,
FUNCTIONGROUP LIKE ENLFDIR-AREA,
INCLUDENUMBER LIKE TFDIR-INCLUDE,
FUNCTIONMAININCLUDE LIKE TFDIR-FUNCNAME,
FUNCTIONTITLE LIKE TFTIT-STEXT,
TOPINCLUDENAME LIKE TFDIR-FUNCNAME,
PROGNAME LIKE TFDIR-PNAME,
PROGRAMLINKNAME LIKE TFDIR-PNAME,
MESSAGECLASS LIKE T100-ARBGB,
ITEXTELEMENTS TYPE TTEXTTABLE OCCURS 0,
ISELECTIONTEXTS TYPE TTEXTTABLE OCCURS 0,
IMESSAGES TYPE TMESSAGE OCCURS 0,
IINCLUDES TYPE TINCLUDE OCCURS 0,
IDICTSTRUCT TYPE TDICTTABLE OCCURS 0,
IGUITITLE TYPE TGUITITLE OCCURS 0,
ISCREENFLOW TYPE TSCREENFLOW OCCURS 0,
END OF TFUNCTION.
TYPES: BEGIN OF TPROGRAM,
PROGNAME LIKE TRDIR-NAME,
PROGRAMTITLE LIKE TFTIT-STEXT,
SUBC LIKE TRDIR-SUBC,
MESSAGECLASS LIKE T100-ARBGB,
IMESSAGES TYPE TMESSAGE OCCURS 0,
ITEXTELEMENTS TYPE TTEXTTABLE OCCURS 0,
ISELECTIONTEXTS TYPE TTEXTTABLE OCCURS 0,
IGUITITLE TYPE TGUITITLE OCCURS 0,
ISCREENFLOW TYPE TSCREENFLOW OCCURS 0,
IINCLUDES TYPE TINCLUDE OCCURS 0,
IDICTSTRUCT TYPE TDICTTABLE OCCURS 0,
END OF TPROGRAM.
Internal tables
Dictionary object
DATA: IDICTIONARY TYPE STANDARD TABLE OF TDICTTABLE WITH HEADER LINE.
Function modules.
DATA: IFUNCTIONS TYPE STANDARD TABLE OF TFUNCTION WITH HEADER LINE.
Tree display structure.
DATA: ITREEDISPLAY TYPE STANDARD TABLE OF SNODETEXT WITH HEADER LINE.
Message class data
DATA: IMESSAGES TYPE STANDARD TABLE OF TMESSAGE WITH HEADER LINE.
Holds a single message class an all of its messages
DATA: ISINGLEMESSAGECLASS TYPE STANDARD TABLE OF TMESSAGE WITH HEADER LINE.
Holds program related data
DATA: IPROGRAMS TYPE STANDARD TABLE OF TPROGRAM WITH HEADER LINE.
Classes
DATA: ICLASSES TYPE STANDARD TABLE OF TCLASS WITH HEADER LINE.
Table of paths created on the SAP server
DATA: ISERVERPATHS TYPE STANDARD TABLE OF STRING WITH HEADER LINE.
Table prototypes
DATA: DUMIDICTSTRUCTURE TYPE STANDARD TABLE OF TDICTTABLESTRUCTURE.
DATA: DUMITEXTTAB TYPE STANDARD TABLE OF TTEXTTABLE.
DATA: DUMIINCLUDES TYPE STANDARD TABLE OF TINCLUDE.
DATA: DUMIHTML TYPE STANDARD TABLE OF STRING.
DATA: DUMIHEADER TYPE STANDARD TABLE OF STRING .
DATA: DUMISCREEN TYPE STANDARD TABLE OF TSCREENFLOW .
DATA: DUMIGUITITLE TYPE STANDARD TABLE OF TGUITITLE.
DATA: DUMIMETHODS TYPE STANDARD TABLE OF TMETHOD.
DATA: DUMICONCEPTS TYPE STANDARD TABLE OF TCONCEPT.
Global objects
DATA: OBJFILE TYPE REF TO CL_GUI_FRONTEND_SERVICES.
DATA: OBJRUNTIMEERROR TYPE REF TO CX_ROOT.
Constants
CONSTANTS: VERSIONNO TYPE STRING VALUE '1.3.1'.
CONSTANTS: TABLES TYPE STRING VALUE 'TABLES'.
CONSTANTS: TABLE TYPE STRING VALUE 'TABLE'.
CONSTANTS: LIKE TYPE STRING VALUE 'LIKE'.
CONSTANTS: TYPE TYPE STRING VALUE 'TYPE'.
CONSTANTS: TYPEREFTO TYPE STRING VALUE 'TYPE REF TO'.
CONSTANTS: STRUCTURE TYPE STRING VALUE 'STRUCTURE'.
CONSTANTS: LOWSTRUCTURE TYPE STRING VALUE 'structure'.
CONSTANTS: OCCURS TYPE STRING VALUE 'OCCURS'.
CONSTANTS: FUNCTION TYPE STRING VALUE 'FUNCTION'.
CONSTANTS: CALLFUNCTION TYPE STRING VALUE ' CALL FUNCTION'.
CONSTANTS: MESSAGE TYPE STRING VALUE 'MESSAGE'.
CONSTANTS: INCLUDE TYPE STRING VALUE 'INCLUDE'.
CONSTANTS: LOWINCLUDE TYPE STRING VALUE 'include'.
CONSTANTS: DESTINATION TYPE STRING VALUE 'DESTINATION'.
CONSTANTS: IS_TABLE TYPE STRING VALUE 'T'.
CONSTANTS: IS_PROGRAM TYPE STRING VALUE 'P'.
CONSTANTS: IS_SCREEN TYPE STRING VALUE 'S'.
CONSTANTS: IS_GUITITLE TYPE STRING VALUE 'G'.
CONSTANTS: IS_DOCUMENTATION TYPE STRING VALUE 'D'.
CONSTANTS: IS_MESSAGECLASS TYPE STRING VALUE 'MC'.
CONSTANTS: IS_FUNCTION TYPE STRING VALUE 'F'.
CONSTANTS: IS_CLASS TYPE STRING VALUE 'C'.
CONSTANTS: IS_METHOD TYPE STRING VALUE 'M'.
CONSTANTS: ASTERIX TYPE STRING VALUE '*'.
CONSTANTS: COMMA TYPE STRING VALUE ','.
CONSTANTS: PERIOD TYPE STRING VALUE '.'.
CONSTANTS: DASH TYPE STRING VALUE '-'.
CONSTANTS: TRUE TYPE I VALUE 1.
CONSTANTS: FALSE TYPE I VALUE 0.
CONSTANTS: LT TYPE STRING VALUE '<'.
CONSTANTS: GT TYPE STRING VALUE '>'.
CONSTANTS: UNIX TYPE STRING VALUE 'UNIX'.
CONSTANTS: NON_UNIX TYPE STRING VALUE 'not UNIX'.
CONSTANTS: BACKGROUND_COLOUR TYPE STRING VALUE '#FFFFE0'.
CONSTANTS: COLOUR_WHITE TYPE STRING VALUE '#FFFFFF'.
CONSTANTS: COLOUR_BLACK TYPE STRING VALUE '#000000'.
CONSTANTS: COLOUR_YELLOW TYPE STRING VALUE '#FFFF00'.
CONSTANTS: COMMENT_COLOUR TYPE STRING VALUE '#0000FF'.
CONSTANTS: HTMLEXTENSION TYPE STRING VALUE 'html'.
CONSTANTS: TEXTEXTENSION TYPE STRING VALUE 'txt'.
Global variables
DATA: STATUSBARMESSAGE(100).
DATA: FORCEDEXIT TYPE I VALUE 0.
DATA: STARTTIME LIKE SY-UZEIT.
DATA: RUNTIME LIKE SY-UZEIT.
DATA: DOWNLOADFILEEXTENSION TYPE STRING.
DATA: DOWNLOADFOLDER TYPE STRING.
DATA: SERVERSLASHSEPARATOR TYPE STRING.
DATA: FRONTENDSLASHSEPARATOR TYPE STRING.
DATA: SLASHSEPARATORTOUSE TYPE STRING.
DATA: SERVERFILESYSTEM TYPE FILESYS_D.
DATA: SERVERFOLDER TYPE STRING.
DATA: FRONTENDOPSYSTEM TYPE STRING.
DATA: SERVEROPSYSTEM TYPE STRING.
DATA: CUSTOMERNAMESPACE TYPE STRING.
RANGES: SOPROGRAMNAME FOR TRDIR-NAME.
RANGES: SOAUTHOR FOR USR02-BNAME.
RANGES: SOTABLENAMES FOR DD02L-TABNAME.
RANGES: SOFUNCTIONNAME FOR TFDIR-FUNCNAME.
RANGES: SOCLASSNAME FOR VSEOCLASS-CLSNAME.
RANGES: SOFUNCTIONGROUP FOR ENLFDIR-AREA.
FIELD-SYMBOLS: <WADICTSTRUCT> TYPE TDICTTABLE.
Selection screen declaration
Author
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TBLOCK1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(23) TAUTH.
PARAMETERS: PAUTH LIKE USR02-BNAME MEMORY ID MAUTH.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(36) TPMOD.
PARAMETERS: PMOD AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
Local objects
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(36) T$TMP.
PARAMETERS: P$TMP AS CHECKBOX DEFAULT ''.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TBLOCK2.
Tables
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RTABLE RADIOBUTTON GROUP R1.
SELECTION-SCREEN COMMENT 5(15) TRTABLE.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) TPTABLE.
SELECT-OPTIONS: SOTABLE FOR DD02L-TABNAME.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(79) TTNOTE.
SELECTION-SCREEN END OF LINE.
Message classes
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RMESS RADIOBUTTON GROUP R1.
SELECTION-SCREEN COMMENT 5(18) TPMES.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(18) TMNAME.
PARAMETERS: PMNAME LIKE T100-ARBGB MEMORY ID MMNAME.
SELECTION-SCREEN END OF LINE.
Function modules
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RFUNC RADIOBUTTON GROUP R1.
SELECTION-SCREEN COMMENT 5(30) TRFUNC.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) TPFNAME.
SELECT-OPTIONS: SOFNAME FOR TFDIR-FUNCNAME.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) TFGROUP.
SELECT-OPTIONS: SOFGROUP FOR ENLFDIR-AREA.
SELECTION-SCREEN END OF LINE.
Classes
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RCLASS RADIOBUTTON GROUP R1.
SELECTION-SCREEN COMMENT 5(30) TRCLASS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) TPCNAME.
SELECT-OPTIONS: SOCLASS FOR SEOCLASS-CLSNAME.
SELECTION-SCREEN END OF LINE.
Programs / includes
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RPROG RADIOBUTTON GROUP R1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(18) TPROG.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) TRPNAME.
SELECT-OPTIONS: SOPROG FOR TRDIR-NAME.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
Language
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(18) TMLANG.
PARAMETERS: PMLANG LIKE T100-SPRSL DEFAULT 'EN'.
SELECTION-SCREEN END OF LINE.
Package
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(18) TPACK.
PARAMETERS: PPACK LIKE TADIV-DEVCLASS MEMORY ID MPACK.
SELECTION-SCREEN END OF LINE.
Customer objects
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(27) TCUST.
PARAMETERS: PCUST AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN COMMENT 32(25) TNRANGE.
PARAMETERS: PCNAME TYPE NAMESPACE MEMORY ID MNAMESPACE.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK B2.
Additional things to download.
SELECTION-SCREEN: BEGIN OF BLOCK B3 WITH FRAME TITLE TBLOCK3.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPTEXT.
PARAMETERS: PTEXT AS CHECKBOX DEFAULT 'X' MEMORY ID MTEXT.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TMESS.
PARAMETERS: PMESS AS CHECKBOX DEFAULT 'X' MEMORY ID MMESS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPINC.
PARAMETERS: PINC AS CHECKBOX DEFAULT 'X' MEMORY ID MINC.
SELECTION-SCREEN COMMENT 40(20) TRECC.
PARAMETERS: PRECI AS CHECKBOX DEFAULT 'X' MEMORY ID MRECI.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPFUNC.
PARAMETERS: PFUNC AS CHECKBOX DEFAULT 'X' MEMORY ID MFUNC.
SELECTION-SCREEN COMMENT 40(20) TRECF.
PARAMETERS: PRECF AS CHECKBOX DEFAULT 'X' MEMORY ID MRECF.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TDOC.
PARAMETERS: PDOC AS CHECKBOX DEFAULT 'X' MEMORY ID MDOC.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPSCR.
PARAMETERS: PSCR AS CHECKBOX DEFAULT 'X' MEMORY ID MSCR.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPDICT.
PARAMETERS: PDICT AS CHECKBOX DEFAULT 'X' MEMORY ID MDICT.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TSORTT.
PARAMETERS: PSORTT AS CHECKBOX DEFAULT ' ' MEMORY ID MSORTT.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK B3.
File details
SELECTION-SCREEN: BEGIN OF BLOCK B4 WITH FRAME TITLE TBLOCK4.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) TPHTML.
PARAMETERS: PHTML RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) TCOMM.
PARAMETERS: PCOMM AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) TBACK.
PARAMETERS: PBACK AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) TPTXT.
PARAMETERS: PTXT RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
Download to SAP server
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) TSERV.
PARAMETERS: PSERV RADIOBUTTON GROUP G2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 8(20) TSPATH.
PARAMETERS: PLOGICAL LIKE FILENAME-FILEINTERN MEMORY ID MLOGICAL.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN COMMENT /28(60) TSDPATH.
Download to PC
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) TPC.
PARAMETERS: PPC RADIOBUTTON GROUP G2 DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 8(20) TPPATH.
PARAMETERS: PFOLDER LIKE RLGRAP-FILENAME MEMORY ID MFOLDER.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK B4.
Display options
SELECTION-SCREEN: BEGIN OF BLOCK B5 WITH FRAME TITLE TBLOCK5.
Display final report
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TREP.
PARAMETERS: PREP AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
Display progress messages
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPROMESS.
PARAMETERS: PPROMESS AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK B5.
Display a directory picker window
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PFOLDER.
DATA: OBJFILE TYPE REF TO CL_GUI_FRONTEND_SERVICES.
DATA: PICKEDFOLDER TYPE STRING.
DATA: INITIALFOLDER TYPE STRING.
IF SY-BATCH IS INITIAL.
CREATE OBJECT OBJFILE.
IF NOT PFOLDER IS INITIAL.
INITIALFOLDER = PFOLDER.
ELSE.
OBJFILE->GET_TEMP_DIRECTORY( CHANGING TEMP_DIR = INITIALFOLDER
EXCEPTIONS CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3 ).
ENDIF.
OBJFILE->DIRECTORY_BROWSE( EXPORTING INITIAL_FOLDER = INITIALFOLDER
CHANGING SELECTED_FOLDER = PICKEDFOLDER
EXCEPTIONS CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3 ).
IF SY-SUBRC = 0.
PFOLDER = PICKEDFOLDER.
ELSE.
WRITE: / 'An error has occured picking a folder'.
ENDIF.
ENDIF.
AT SELECTION-SCREEN.
CASE 'X'.
WHEN PPC.
IF PFOLDER IS INITIAL.
User must enter a path to save to
MESSAGE E000(OO) WITH 'You must enter a file path'.
ENDIF.
WHEN PSERV.
IF PLOGICAL IS INITIAL.
User must enter a logical path to save to
MESSAGE E000(OO) WITH 'You must enter a logical file name'.
ENDIF.
ENDCASE.
AT SELECTION-SCREEN ON PLOGICAL.
IF NOT PSERV IS INITIAL.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
LOGICAL_FILENAME = PLOGICAL
IMPORTING
FILE_NAME = SERVERFOLDER
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
IF SERVERFOLDER IS INITIAL.
MESSAGE E000(OO) WITH 'No file path returned from logical filename'.
ELSE.
Path to display on the selection screen
TSDPATH = SERVERFOLDER.
Remove the trailing slash off the path as the subroutine buildFilename will add an extra one
SHIFT SERVERFOLDER RIGHT DELETING TRAILING SERVERSLASHSEPARATOR.
SHIFT SERVERFOLDER LEFT DELETING LEADING SPACE.
ENDIF.
ELSE.
MESSAGE E000(OO) WITH 'Logical filename does not exist'.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOPROG-LOW.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'PROG'
OBJECT_NAME = SOPROG-LOW
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOPROG-LOW
EXCEPTIONS
CANCEL = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOPROG-HIGH.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'PROG'
OBJECT_NAME = SOPROG-HIGH
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOPROG-HIGH
EXCEPTIONS
CANCEL = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOCLASS-LOW.
CALL FUNCTION 'F4_DD_ALLTYPES'
EXPORTING
OBJECT = SOCLASS-LOW
SUPPRESS_SELECTION = 'X'
DISPLAY_ONLY = ''
ONLY_TYPES_FOR_CLIFS = 'X'
IMPORTING
RESULT = SOCLASS-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOCLASS-HIGH.
CALL FUNCTION 'F4_DD_ALLTYPES'
EXPORTING
OBJECT = SOCLASS-HIGH
SUPPRESS_SELECTION = 'X'
DISPLAY_ONLY = ''
ONLY_TYPES_FOR_CLIFS = 'X'
IMPORTING
RESULT = SOCLASS-HIGH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFNAME-LOW.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'FUNC'
OBJECT_NAME = SOFNAME-LOW
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOFNAME-LOW
EXCEPTIONS
CANCEL = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFNAME-HIGH.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'FUNC'
OBJECT_NAME = SOFNAME-HIGH
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOFNAME-HIGH
EXCEPTIONS
CANCEL = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFGROUP-LOW.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'FUGR'
OBJECT_NAME = SOFGROUP-LOW
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOFGROUP-LOW
EXCEPTIONS
CANCEL = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFGROUP-HIGH.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'FUGR'
OBJECT_NAME = SOFGROUP-HIGH
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOFGROUP-HIGH
EXCEPTIONS
CANCEL = 1.
initialisation
INITIALIZATION.
Parameter screen texts.
TBLOCK1 = 'Author (Optional)'.
T$TMP = 'Programs only: include local objects'.
TBLOCK2 = 'Objects to download'.
TBLOCK3 = 'Additional downloads for programs, function modules and classes'.
TBLOCK4 = 'Download parameters'.
TBLOCK5 = 'Display options'.
TAUTH = 'Author name'.
TPMOD = 'Include programs modified by author'.
TCUST = 'Only customer objects'.
TNRANGE = 'Alt customer name range'.
TRTABLE = 'Tables / Structures'.
TPTABLE = 'Table name'.
TTNOTE = 'Note: tables are stored under the username of the last person who modified them'.
TRFUNC = 'Function modules'.
TPFNAME = 'Function name'.
TFGROUP = 'Function group'.
TRCLASS = 'Classes'.
TPCNAME = 'Class name'.
TMESS = 'Message class'.
TMNAME = 'Class name'.
TMLANG = 'Language'.
TPROG = 'Programs'.
TRPNAME = 'Program name'.
TPACK = 'Package'.
TPTXT = 'Text document'.
TPHTML = 'HTML document'.
TCOMM = 'Highlight comments'.
TBACK = 'Include background colour'.
TPTEXT = 'Text elements'.
TPINC = 'Include programs'.
TRECC = 'Recursive search'.
TPPATH = 'File path'.
TSPATH = 'Logical file name'.
TPMES = 'Message classes'.
TPFUNC = 'Function modules'.
TDOC = 'Function module documentation'.
TRECF = 'Recursive search'.
TPSCR = 'Screens'.
TPDICT = 'Dictionary structures'.
TSORTT = 'Sort table fields alphabetically'.
TSERV = 'Download to server'.
TPC = 'Download to PC'.
TREP = 'Display download report'.
TPROMESS = 'Display progress messages'.
Determine the frontend operating system type.
IF SY-BATCH IS INITIAL.
PERFORM DETERMINEFRONTENDOPSYSTEM USING FRONTENDSLASHSEPARATOR FRONTENDOPSYSTEM.
ENDIF.
PERFORM DETERMINESERVEROPSYSTEM USING SERVERSLASHSEPARATOR SERVERFILESYSTEM SERVEROPSYSTEM.
Determine if the external command exists. If it doesn't then disable the server input field
PERFORM FINDEXTERNALCOMMAND.
start-of-selection.
START-OF-SELECTION.
PERFORM CHECKCOMBOBOXES.
PERFORM FILLSELECTIONRANGES.
STARTTIME = SY-UZEIT.
Don't display status messages if we are running in the background
IF NOT SY-BATCH IS INITIAL.
PPROMESS = ''.
ENDIF.
Fool the HTML routines to stop them hyperlinking anything with a space in them
IF PCNAME IS INITIAL.
CUSTOMERNAMESPACE = '^'.
ELSE.
CUSTOMERNAMESPACE = PCNAME.
ENDIF.
Determine which operating slash and download directory to use
CASE 'X'.
WHEN PPC.
SLASHSEPARATORTOUSE = FRONTENDSLASHSEPARATOR.
DOWNLOADFOLDER = PFOLDER.
WHEN PSERV.
SLASHSEPARATORTOUSE = SERVERSLASHSEPARATOR.
DOWNLOADFOLDER = SERVERFOLDER.
ENDCASE.
Main program flow.
CASE 'X'.
Select tables
WHEN RTABLE.
PERFORM RETRIEVETABLES USING IDICTIONARY[]
SOTABLENAMES[]
SOAUTHOR[].
Select message classes tables
WHEN RMESS.
PERFORM RETRIEVEMESSAGECLASS USING IMESSAGES[]
SOAUTHOR[] "Author
PMNAME "Message class name
PMLANG "Message class language
PMOD. "Modified by author
Select function modules
WHEN RFUNC.
PERFORM RETRIEVEFUNCTIONS USING SOFUNCTIONNAME[] "Function name
SOFUNCTIONGROUP[] "Function group
IFUNCTIONS[] "Found functions
SOAUTHOR[] "Author
PTEXT "Get text elements
PSCR "Get screens
PCUST "Customer data only
CUSTOMERNAMESPACE. "Customer name range
LOOP AT IFUNCTIONS.
Find Dict structures, messages, functions, includes etc.
PERFORM SCANFORADDITIONALFUNCSTUFF USING IFUNCTIONS[]
PRECI "Search for includes recursively
PRECF "Search for functions recursively
PINC "Search for includes
PFUNC "Search for functions
PDICT "search for dictionary objects
PMESS "Search for messages
PCUST "Customer data only
CUSTOMERNAMESPACE. "Customer name range
ENDLOOP.
Select Classes
WHEN RCLASS.
PERFORM RETRIEVECLASSES USING ICLASSES[]
IFUNCTIONS[]
SOCLASSNAME[] "Class name
SOAUTHOR[] "Author
CUSTOMERNAMESPACE "Customer name range
PMOD "Also modified by author
PCUST "Customer object only
PMESS "Find messages
PTEXT "Text Elements
PDICT "Dictionary structures
PFUNC "Get functions
PINC "Get includes
PRECF "Search recursively for functions
PRECI "Search recursively for includes
'X' "Search recursively for classes
PMLANG. "Language
LOOP AT IFUNCTIONS.
Find Dict structures, messages, functions, includes etc.
PERFORM SCANFORADDITIONALFUNCSTUFF USING IFUNCTIONS[]
PRECI "Search for includes recursively
PRECF "Search for functions recursively
PINC "Search for includes
PFUNC "Search for functions
PDICT "search for dictionary objects
PMESS "Search for messages
PCUST "Customer data only
CUSTOMERNAMESPACE. "Customer name range
ENDLOOP.
Select programs
WHEN RPROG.
PERFORM RETRIEVEPROGRAMS USING IPROGRAMS[]
IFUNCTIONS[]
SOPROGRAMNAME[] "Program name
SOAUTHOR[] "Author
CUSTOMERNAMESPACE "Customer name range
PMOD "Also modified by author
PCUST "Customer object only
PMESS "Find messages
PTEXT "Text Elements
PDICT "Dictionay structures
PFUNC "Get functions
PINC "Get includes
PSCR "Get screens
PRECF "Search recursively for functions
PRECI "Search recursively for includes
P$TMP "local objects
PPACK. "Package
ENDCASE.
end-of-selection
END-OF-SELECTION.
IF FORCEDEXIT = 0.
Set the file extension and output type of the file
IF PTXT IS INITIAL.
DOWNLOADFILEEXTENSION = HTMLEXTENSION.
ELSE.
DOWNLOADFILEEXTENSION = TEXTEXTENSION.
ENDIF.
Decide what to download
CASE 'X'.
Download tables
WHEN RTABLE.
IF NOT ( IDICTIONARY[] IS INITIAL ).
PERFORM DOWNLOADDDSTRUCTURES USING IDICTIONARY[]
DOWNLOADFOLDER
HTMLEXTENSION
SPACE
PSORTT
SLASHSEPARATORTOUSE
PSERV
PPROMESS.
Free up any memory used for caching HTML versions of tables
LOOP AT IDICTIONARY.
FREE MEMORY ID IDICTIONARY-TABLENAME.
ENDLOOP.
Display donwload report
IF NOT PREP IS INITIAL.
GET TIME.
RUNTIME = SY-UZEIT - STARTTIME.
PERFORM FILLTREENODETABLES USING IDICTIONARY[]
ITREEDISPLAY[]
RUNTIME.
ENDIF.
CLEAR IDICTIONARY[].
ENDIF.
Download message class
WHEN RMESS.
IF NOT ( IMESSAGES[] IS INITIAL ).
SORT IMESSAGES ASCENDING BY ARBGB MSGNR.
LOOP AT IMESSAGES.
APPEND IMESSAGES TO ISINGLEMESSAGECLASS.
AT END OF ARBGB.
PERFORM DOWNLOADMESSAGECLASS USING ISINGLEMESSAGECLASS[]
IMESSAGES-ARBGB
DOWNLOADFOLDER
DOWNLOADFILEEXTENSION
PHTML
SPACE
PCOMM
CUSTOMERNAMESPACE
PINC
PDICT
PMESS
SLASHSEPARATORTOUSE
PSERV
PPROMESS.
CLEAR ISINGLEMESSAGECLASS[].
ENDAT.
ENDLOOP.
Display download report
IF NOT PREP IS INITIAL.
GET TIME.
RUNTIME = SY-UZEIT - STARTTIME.
PERFORM FILLTREENODEMESSAGES USING IMESSAGES[]
ITREEDISPLAY[]
RUNTIME.
ENDIF.
CLEAR IMESSAGES[].
ENDIF.
Download functions
WHEN RFUNC.
IF NOT ( IFUNCTIONS[] IS INITIAL ).
PERFORM DOWNLOADFUNCTIONS USING IFUNCTIONS[]
DOWNLOADFOLDER
DOWNLOADFILEEXTENSION
SPACE
PDOC
PHTML
PCOMM
-
Download/upload abap programs
Can anyone help me with a program which downloads and uploads abap programs including source code, includes, gui status and titles as well as the screens onto the local machine and back to SAP server?
Even if you have any partial program, please help.Hello,
please see the below link.
http://www.sap-img.com/abap/download-and-upload-your-abap-program.htm
http://www.guidancetech.com/people/holland/sap/abap/zzbgs106.htm
Hope it will help you,
Cheers,
Regards,
Sujeet -
Dear All,
I want to Download all my ABAP programs in one server and transfer the same in different server as executables.
Kindly help me regarding the same.
Thanks & Regards
AjitabhHi,
I just want to run these programs and show the outputs to the client.
Where you want to upload the programs ? @ OS level to execute as .BAT or .EXE file ? How come ABAP code work from OS level ?
If you want to download and upload within SAP, obvious method Transport should work.
Can you tell me how to Download and Upload All programs in once?
Is there any Standard Program for the same.
I got one standard program for downloading the ABAP programs as:REPTRAN
I want to know the Upload program also.
Can you help me out for this?
*There isn't a standard report provided to upload the downloaded code of report REPTRAN.
steps to upload and download screen.
1. utilities->upload/Download->download - Download
2. utilities->upload/Download->upload - Upload*
Regards,
Arjun -
ABAP Program to Download in XLSX format
We have Excel 2007, I need an ABAP program which downloads data from XLSX format. Not in XLS format. Any FM which converts XLS to XLSX format?
Moderator message: if you have searched and found this thread, please have another search for abap2xlsx.
Message was edited by: Matthew BillinghamHi friend,
Check this simple code...
REPORT zawi_demodownload .
*Types
TYPES: BEGIN OF g_r_mara,
matnr LIKE mara-matnr,
ersda LIKE mara-ersda,
laeda LIKE mara-laeda,
mtart LIKE mara-mtart,
mbrsh LIKE mara-mbrsh,
END OF g_r_mara.
*Data
DATA: g_t_mara TYPE TABLE OF g_r_mara,
filename TYPE string,
s TYPE i.
*Tables
TABLES: mara, sscrfields.
*Selection Screen
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 10(20) name USER-COMMAND ucom.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
name = 'Spread Sheet'.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'UCOM'.
s = 1.
ENDIF.
*Data retrival and populating internal table
IF s = 1.
SELECT matnr ersda laeda mtart mbrsh
INTO CORRESPONDING FIELDS OF TABLE g_t_mara
FROM mara
WHERE matnr IN s_matnr.
filename = 'C:\Testing.xlsx'.
Downloading data from internal table to excel
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = filename
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = g_t_mara.
ENDIF.
Thanks...... -
Is there any way through which I can stop download of my ABAP programs???
Dear all,
I want to know is there any way through which I can stop download of my ABAP programs so that no one can download or copy my programs without my permission.
Thanks in Advance
Sachin GautamHi again,
1. In that case we cannot do much.
2. However,
we can use
the exit
SEUED001
(fm is EXIT_SAPLS38E_001)
to restrict the program
in edit mode,display mode
etc etc.
depending upon the PROGRAM NAME.
I hope that serves your purpose.
regards,
amit m. -
Downloading and Uploading ABAP programs
I need to move a new GUI program (including all screens, include, subroutines, etc.) that was developed on our SAP 4.5 system to our new, upgraded, ECC 6.0 system.
There is an old ABAP program that we use to use called ZSABAPUPDOWNLOAD, but it no longer seem to work between these two SAP versions.
Because of the version differences between these tow systems, our BASIS group does not want us to use a transport to move this code.
Other than completely recreating this program on the ECC60 system, does anyone know of a program (like the old ZSABAPUPDOWNLOAD) or utility that I could use to transfer this program to the new system?welcome to SDN.
is this the program do u have.
if not check it with this.
REPORT ZUPDOWNPROGRAMS LINE-SIZE 132 LINE-COUNT 62 NO STANDARD PAGE HEADING.
This program up / downloads from / to a local dataset
all the components of an ABAP - i.e TEXTS, the entire CUA
including statuses and menus, DYNPROS and source code.
Program documentation and variants are not handled.
INCLUDED programs are automatically handled both on upload
or download. INCLUDE selection can be excluded or generic
e.g only handle INCLUDES starting with ZIN*
INCLUDES within INCLUDES also handled.
The only restriction is on UPLOAD the INCLUDED programs must come
from the same directory as the main program.
On Download of course the ABAP must exist in the library.
Note for LINUX and BATCH users
This program was originally designed as a one off tool for
getting ABAPS etc from a SAP R2 (IBM MVS mainframe system) into
an R3 test system minimising the need for a large amount of
mainframe sysprogs (anybody remember what they were !!) time
and support to say nothing of access problems from TSO /JES2 /
SAP R2. At that time network connections were patchy and the
transport systems largely incompatable and not very reliable.
This program was originally designed as a one off tool for
Must run on Windows front end ---- If you are running SAP with
LINUX on your work station you will have to change the WS_UPLOAD
and WS_DOWNLOAD functions to reflect the Linux file system. The
contents of the data sets themseleves do not need to be changed
Program can easily be modified to run in batch and store
the data on a UNIX host. Change the WS_UPLOAD and WS_DOWNLOAD
to read from and write to UNIX data sets (OPEN FILE etc).
You will also need to modify the parts of the program that get
the DOS directory and display the Windows file paths.
The actual abap data sets do not need to be changed.
Rel 4.0 names can now be up to 40 bytes long
Dynpros and CUA have changed from rel 3.1
Tabstrips now loaded and unloaded in dynpros
Please note restriction on 4.6 systems for users who
have ABAP names which include '/'s in their names.
Rel 4.6b, 4.6c Abap names can include the '/' in their names
e.g /CUST1/CUST2/ORDER
This causes problems when storing to a local file.
a solution is to change the name to %CUST1%CUST2%ORDER i.e / will
be changed to %. On upload the % should be changed back to /
again. This change still needs to be implemented.
If you don't use the / in the abap name then this is not a problem.
If file to be uploaded is in rel 3 format then names are only 8
bytes long.
program uses 3 datasets per abap
1) abapname.eee source, dynpr logic, texts, CUA stuff
2) abapname.hhh dynpr header
3) abapname.fff dynpro fields.
because of varying lengths and contents 3 data sets are used. The
complexity of combining all these to 1 data set would make the
program far too complex.
NOTE: This version of the program can only be used on
release 4.0 or higher. Once an ABAP has been converted
to rel 4.0 it cannot be converted back to rel 3.0
on a release 3/3.1 system. Release 4 CUA tables
are different. Use release 3 version of this program
for releases 3.0 and 3.1. Available on SAPFANS website.
Note that data to be uploaded must have been previously downloaded
by this program (any version since rel 2.0) - except for Initial
Load -- see end of these comments.
Dynpros and CUA statuses have changed since rel 3.1
This program will handle rel 3.1 format on upload but will
download in rel 4.0 format. To upload 3.1 format specify an 'X'
in the rel3 parameter.
If you have downloaded components in rel 4.0 format and you
want to re-load to a 3.1 system you will have to load
the source via standard upload and re-create dynpros and the CUA
manually.
As names can now be longer than 8 characters you can only
use this program if the SAP front end (SAPGUI) supports
long file names (WIN 95/98 or WIN NT). Windows 3.x will not
work as the underlying DOS system cannot handle long file names.
UPLOAD function and DOS directory.
When an ABAP is selected for UPLOAD then the DOS
directory is read into a table. A file called ABAP.BAT is created,
and down loaded to the 'C' drive and executed.
This file executes a DOS DIR command and pipes the output
into a dataset which is then uploaded into an internal
table on SAP.
Note on running DOS commands from ABAP
The first time this procedure is executed you will see a DOS window
which you will have to close manually. To get round this
use windows explorer to select the file ABAP.BAT and then
right mouse click on the file name. Select the
properties window. From this click the CLOSE on EXIT box. This
will then automatically close the DOS function after it has
executed. (Windows restriction).
The DOS function has not been tested using Windows 2000 so
it might not work. OK on W95,W98,WME and Windows NT (No Thanks)
If INCLUDE programs are wanted on UPLOAD only the specified
directory is searched.
Instead of entering path name manually you can click on
the path parameter. Because of Windows restriction you will
have to select ANY file in the relevant directory.
The path will then be copied on to the selection screen.
To do still : Merge 3 files to one and compress output to .ZIP file
fix 4.5 4.6 problem of abaps containing '/' in the name
possibility to automatically up / download referenced
function modules with selection criteria like INCLUDES
To load the ist time into a system.
Create program with ABAP editor and Upload the .EEE file.
Delete ist line (????SRCE) in the ABAP EDITOR --NOT THE DISK FILE
Delete all the source from the line that starts ????TEXT (towards
the end file) till the end so the last line in your source is ENDFORM.
DO NOT ALTER THE DISK FILE. DO THESE CHANGES IN THE ABAP EDITOR.
Save file and execute
Use following parameters (Note the ist time you won't get proper
text on the selection screen).
Function U
Path full dos path containing source e.g c:\abaps\
NOTE YOU MUST ENTER THE FINAL \ as above.
REPID the program name. e.g ZZJIMHXX
note that on the DISK you will see 3 files
ZZJIMHXX.EEE, ZZJIMHXX.FFF, ZZJIMHXX.HHH
just use the name before the dos qualifier - the
program will do the rest
ignore other parameters
The program will then load itself with all the texts etc.
It should now be ready for use.
Macros
DEFINE DEFINE_TABLE.
DATA: &1 LIKE &2 OCCURS &3 WITH HEADER LINE.
END-OF-DEFINITION.
DEFINE CLS.
REFRESH &1.
CLEAR &1.
END-OF-DEFINITION.
DEFINE INIT.
IF &1 NE SPACE.
SEARCH &1 FOR '. .'.
IF SY-SUBRC = 0.
WRITE '*' TO &1+SY-FDPOS(1).
ENDIF.
TRANSLATE &1 USING '*%'.
ELSE.
MOVE '%' TO &1.
ENDIF.
END-OF-DEFINITION.
end of macros
/ SAP standard tables */
TABLES: D020S, "Dynpro header
D020T, "Dynpro title
D021T, "Screen field keyword texts
TRDIR, "Attribute table
TADIR, "Dev. class etc.
EUDB, "CUA data
TSTC, "transaction data
TITLE, "CUA titles
RSMPTEXTS. "Function texts (rel 4.0)
/ Work tables to hold ABAP source etc, and dynpro */
/ contents. */
DATA: BEGIN OF H. "Header
INCLUDE STRUCTURE D020S.
DATA: END OF H.
DATA: BEGIN OF H1 OCCURS 10, "Header
NAME(40) TYPE C, "rel 4
NUMBER(4) TYPE N.
INCLUDE STRUCTURE D020S.
DATA: END OF H1.
DATA: BEGIN OF H2 OCCURS 0, "Rel 3 dynp. header
CNAME(8) TYPE C,
CNUM(4) TYPE C,
NNAME(8) TYPE C,
NNUM(4) TYPE C,
FILL(51) TYPE C,
CDAT(6) TYPE C,
CTIM(6) TYPE C,
END OF H2.
DATA: BEGIN OF F OCCURS 250. "Dynpro Fields
INCLUDE STRUCTURE D021S.
DATA: END OF F.
DATA: BEGIN OF F1 OCCURS 500, "Dynpro Fields
NAME(40) TYPE C, "rel 4
NUMBER(4) TYPE N.
INCLUDE STRUCTURE D021S.
DATA: END OF F1.
DATA: BEGIN OF OLD_F1 OCCURS 0, "Dynpro Fields (rel 3)
NAME(8) TYPE C,
NUMBER(4) TYPE C.
INCLUDE STRUCTURE D021SE_OLD.
DATA: END OF OLD_F1.
DATA: BEGIN OF F2 OCCURS 0, "Dynpro Fields (rel 3)
TFIL(284) TYPE C,
END OF F2.
DATA: BEGIN OF M OCCURS 3. "Match codes (if any)
INCLUDE STRUCTURE D023S.
DATA: END OF M.
DATA: BEGIN OF E OCCURS 0. "Dynpro Logic
INCLUDE STRUCTURE D022S.
DATA: END OF E.
DATA: BEGIN OF E1 OCCURS 0, "Dynpro Logic
NAME(40) TYPE C, "rel 4
NUMBER(4) TYPE N.
INCLUDE STRUCTURE D022S.
DATA: END OF E1.
DATA: BEGIN OF T OCCURS 0, "prog name and dynpro nrs
NAME(40) TYPE C, "rel 4
NUMBER(4) TYPE N,
END OF T.
DATA: BEGIN OF R OCCURS 56, "prog name and language
NAME(40) TYPE C, "rel 4
LANGUAGE(1) TYPE C,
END OF R.
DATA: BEGIN OF S OCCURS 3000,
TXT(180) TYPE C, "rel 4 was 132
END OF S.
DATA: BEGIN OF R1 OCCURS 50, "for include programs
NAME(40) TYPE C, "rel 4
INSTANCE(3) TYPE P,
END OF R1.
DATA: BEGIN OF S1 OCCURS 3000,
TXT(180) TYPE C, " rel 4 was 132
END OF S1.
DATA: BEGIN OF U OCCURS 100, "Text elements
TXT(180) TYPE C, " rel 4 was 132
END OF U.
DATA: BEGIN OF DIR. "ABAP Attributes
INCLUDE STRUCTURE TRDIR.
DATA: END OF DIR.
DATA: BEGIN OF DTXT. "Dynpro field keyword texts
INCLUDE STRUCTURE D021T.
DATA: END OF DTXT.
/ This data contains all the components of the */
/ CUA such as menus, statuses, Pfkeys */
/ As from rel 4.5 Tabstrips are automatically copied as well */
/ The rel3 parameter must be set however to load the */
/ correct version of the CUA tables if uploading rel 3 */
/ data to a rel 4 system. */
/ Rel 4.0B can convert 3.1 and earlier CUA's */
/ This could change later however. */
CUA Tables.
Key of CUA tables in EUDB data set. Name is len 40 in rel 4.0
DATA BEGIN OF EU_KEY.
INCLUDE STRUCTURE RSEU1_KEY.
DATA END OF EU_KEY.
Status
DATA BEGIN OF STA OCCURS 0.
INCLUDE STRUCTURE RSMPE_STAT. " rel 4
DATA END OF STA.
Functions
DATA BEGIN OF FUN OCCURS 0.
INCLUDE STRUCTURE RSMPE_FUNT. "rel 4
DATA END OF FUN.
Menus
DATA BEGIN OF MEN OCCURS 0.
INCLUDE STRUCTURE RSMPE_MEN. "rel 4.0
DATA END OF MEN.
Menus (texts)
DATA BEGIN OF MTX OCCURS 0.
INCLUDE STRUCTURE RSMPE_MNLT. "rel 4.0
DATA END OF MTX.
Action Bar
DATA BEGIN OF ACT OCCURS 0.
INCLUDE STRUCTURE RSMPE_ACT. "rel 4.0
DATA END OF ACT.
Push Buttons
DATA BEGIN OF BUT OCCURS 0.
INCLUDE STRUCTURE RSMPE_BUT. "rel 4.0
DATA END OF BUT.
PF-Keys
DATA BEGIN OF PFK OCCURS 0.
INCLUDE STRUCTURE RSMPE_PFK. "rel 4.0
DATA END OF PFK.
Function sets
DATA BEGIN OF SET OCCURS 0.
INCLUDE STRUCTURE RSMPE_STAF. "rel 4.0
DATA END OF SET.
Documentation
DATA BEGIN OF DOC OCCURS 0.
INCLUDE STRUCTURE RSMPE_ATRT. "rel 4.0
DATA END OF DOC.
Title codes with text
DATA: BEGIN OF TIT OCCURS 0.
INCLUDE STRUCTURE RSMPE_TITT. "rel 4.0
DATA: END OF TIT.
DATA BEGIN OF FTX OCCURS 0. "rel 4.0
INCLUDE STRUCTURE RSMPTEXTS.
DATA END OF FTX.
rel 3.1 CUA components.
Status
DATA BEGIN OF OLD_STA OCCURS 0.
INCLUDE STRUCTURE RSEU1_GEN. " rel 3.1
DATA END OF OLD_STA.
Functions
DATA BEGIN OF OLD_FUN OCCURS 0.
INCLUDE STRUCTURE RSEU1_FUN. "rel 3.1
DATA END OF OLD_FUN.
Menus
DATA BEGIN OF OLD_MEN OCCURS 0.
INCLUDE STRUCTURE RSEU1_MEN. "rel 3.1
DATA END OF OLD_MEN.
Menus (texts)
DATA BEGIN OF OLD_MTX OCCURS 0.
INCLUDE STRUCTURE RSEU1_TXM. "rel 3.1
DATA END OF OLD_MTX.
Action Bar
DATA BEGIN OF OLD_ACT OCCURS 0.
INCLUDE STRUCTURE RSEU1_ACT. "rel 3.1
DATA END OF OLD_ACT.
Push Buttons
DATA BEGIN OF OLD_BUT OCCURS 0.
INCLUDE STRUCTURE RSEU1_BUT. "rel 3.1
DATA END OF OLD_BUT.
PF-Keys
DATA BEGIN OF OLD_PFK OCCURS 0.
INCLUDE STRUCTURE RSEU1_PFK. "rel 3.1
DATA END OF OLD_PFK.
Function sets
DATA BEGIN OF OLD_SET OCCURS 0.
INCLUDE STRUCTURE RSEU1_SET. "rel 3.1
DATA END OF OLD_SET.
Documentation
DATA BEGIN OF OLD_DOC OCCURS 0.
INCLUDE STRUCTURE RSEU1_ETM. "rel 3.1
DATA END OF OLD_DOC.
Title codes with text
DATA: BEGIN OF OLD_TIT OCCURS 0.
INCLUDE STRUCTURE TITLE. "rel 3.1
DATA: END OF OLD_TIT.
dynamic function text
DATA BEGIN OF FDN OCCURS 1.
INCLUDE STRUCTURE RSEU1_FDYN. "not req for rel 4.
DATA END OF FDN.
Icons
DATA BEGIN OF FIN OCCURS 1.
INCLUDE STRUCTURE RSEU1_ICON. "not req for rel 4
DATA END OF FIN.
dynamic menu texts
DATA BEGIN OF MDN OCCURS 1.
INCLUDE STRUCTURE RSEU1_MDYN. "not req for rel 4.
DATA END OF MDN.
Symbol list
DATA BEGIN OF SYM OCCURS 0.
INCLUDE STRUCTURE RSEU1_SYMB.
DATA END OF SYM.
Status Short text
DATA BEGIN OF STX OCCURS 0.
INCLUDE STRUCTURE RSEU1_CTX.
DATA END OF STX.
Attributes for function key settings (menu bars) Rel 3.0
DATA BEGIN OF ATT OCCURS 0.
INCLUDE STRUCTURE RSEU1_HAT.
DATA END OF ATT.
Include-Menus
DATA BEGIN OF INC OCCURS 3.
INCLUDE STRUCTURE RSEU1_INC.
DATA END OF INC.
Last used numbers
DATA BEGIN OF LAST.
INCLUDE STRUCTURE RSEU1_LST.
DATA END OF LAST.
data for call transaction (SE41 to re-generate the CUA)
DATA: BEGIN OF T_BDC_TAB OCCURS 0.
INCLUDE STRUCTURE BDCDATA. "BDC data
DATA: END OF T_BDC_TAB.
DATA: BEGIN OF T_MESSTAB OCCURS 0.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF T_MESSTAB.
/ Program data */
DATA: NUMBER(4) TYPE N,
OLDNUM(4) TYPE N,
FILESIZE TYPE I,
NR_OF_BYTES TYPE I,
I(3) TYPE P,
IX(3) TYPE P,
J(3) TYPE P,
L(3) TYPE P,
CUA-FLAG(1) TYPE C,
CUA_RETURN(10) TYPE C,
DYNPRO_MESSAGE(160) TYPE C,
DYNPRO_LINE TYPE P,
DYNPRO_WORD(30) TYPE C,
NUM(3) TYPE N,
DYNNAME(44) TYPE C,
FN1(128) TYPE C,
FN2(128) TYPE C,
FN3(128) TYPE C,
W_ITERATE(1) TYPE C,
MAIN(1) TYPE C,
FUNC(1) TYPE C,
OLDNAME(40) TYPE C,
OLD-FUNC(8) TYPE C,
NEW-FUNC(8) TYPE C,
FOUND(1) TYPE C,
LANGUAGE LIKE SY-LANGU,
FIRST-TIME(1) TYPE C VALUE 'Y',
OK-CODE(5) TYPE C,
NAME(40) TYPE C, "rel 4
TXLINE(70) TYPE C,
LINE(132) TYPE C.
DATA:
UL_FILE(128) TYPE C,
DL_FILE(128) TYPE C,
DOSLINE(72) TYPE C.
DATA: BEGIN OF DOSDIR OCCURS 0,
TEXT(72),
END OF DOSDIR.
DATA: BEGIN OF I_PROG OCCURS 0,
NAME(40),
END OF I_PROG.
DATA: BEGIN OF I_PROGT OCCURS 0,
NAME(40),
END OF I_PROGT.
DATA: BEGIN OF I_INCLUDE OCCURS 0,
NAME(40),
HANDLED(1) TYPE C,
END OF I_INCLUDE.
DATA: BEGIN OF I_INCL OCCURS 0,
NAME(40),
END OF I_INCL.
DATA: BUFFER(1024).
DATA: WINSYS(3).
DATA: GLOBAL_FILEMASK_MASK(20), GLOBAL_FILEMASK_TEXT(20).
DATA: GLOBAL_FILEMASK_ALL(80).
DATA: T_FILENAME(128),
TMP_FILENAME(128),
T_MODE(1),
FIELDLN TYPE I.
DEFINE_TABLE I_DYNPFIELDS DYNPREAD 0. "dynpro fields to be updated
DATA: I_FLDS LIKE HELP_VALUE OCCURS 0 WITH HEADER LINE.
FIELD-SYMBOLS: <F>.
/ Parameters */
SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS REPID FOR TRDIR-NAME OBLIGATORY .
PARAMETERS:
FUNCTION(1) TYPE C OBLIGATORY, "Function
DSNAME(40) TYPE C, "Data set name
INCLUDES(1) TYPE C DEFAULT 'N', "Resolve Includes
IMASK(40) TYPE C, "Include Mask
CLASS LIKE TRDIR-CLAS,
AUTHOR LIKE TRDIR-CNAM, "Author
APPL LIKE TRDIR-APPL,
PATH(88) TYPE C DEFAULT 'A:\',
REL3(1) TYPE C.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(70) TEXT-004.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(70) TEXT-005.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(70) TEXT-002.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(70) TEXT-003.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK A1.
/ Check users workstation is running WINDOWS, */
/ WINDOWS 95, or WINDOWS NT. OS/2 no good for */
/ this application. */
CALL FUNCTION 'WS_QUERY'
EXPORTING
QUERY = 'WS'
IMPORTING
RETURN = WINSYS.
IF WINSYS(2) NE 'WN'. "Win 3.X no good either
WRITE: / 'Windows NT or Windows 95/98 is required'.
EXIT.
ENDIF.
/ Get names of programs to be handled. */
/ Name can be a single value, many values or ranges */
/ as per standard SELECT-OPTIONS on selection screen */
/ On Download read TRDIR and store program names in a table */
/ as per selection options. */
/ On upload read the specified directory for all files of */
/ type .EEE from specified directory */
/ compare file names with selection criteria */
MOVE FUNCTION TO FUNC.
MOVE 'Y' TO MAIN.
CASE FUNC.
WHEN 'U'. "Upload required
PERFORM READ_DOS_DIRECTORY.
PERFORM GET_RANGE_UL. "Get list of progs to process
WHEN 'D'. "Download required
PERFORM GET_RANGE_DL. "Get list of progs to process
WHEN OTHERS.
WRITE: / 'Function not performed due to user request'.
EXIT.
ENDCASE.
SORT I_PROG.
DELETE ADJACENT DUPLICATES FROM I_PROG.
For download INCLUDE handling can be resolved via function
module call.
All Includes within Includes are also resolved by the function
module call.
Note that this method does not work if program itself is of type
I (it's an include)
In this case we can still search the source.
IF FUNC = 'D'.
IF INCLUDES = 'Y'.
PERFORM GET_INCLUDES_DL.
PERFORM PROCESS_INCLUDES_DL.
ENDIF.
ENDIF.
Program list from selection criteria i.e excluding INCLUDES found
LOOP AT I_PROG.
MOVE I_PROG-NAME TO R1-NAME.
APPEND R1.
DESCRIBE TABLE R1 LINES I.
WHILE I NE 0.
PERFORM EXECUTE-FUNCTION.
ENDWHILE.
REFRESH R1.
ENDLOOP.
We need to check now for INCLUDES on DOWNLOAD when the INCLUDE
program itself is of type I. In this case the function call
will not return the INCLUDES. For example we could be
downloading ZTESTTOP (an Include itself) which as an include
ZTEST01.
The process fortunately is the same as the UPLOAD function
except of course we need to read the library instead of the
DOS directory
process INCLUDE modules for Upload
On upload the procedure is more complex as Includes within
Includes can only be resolved by scanning the code and
searching if the program exists in the directory.
To get all INCLUDES within INCLUDES entries in table I_INCL
that do not exist in I_INCLUDE are copied to table I_INCLUDE
after each entire pass of table i_INCLUDE and table is then
re-looped through. Programs in table I_INCLUDE that have already
been processed have a "Y" indicator set in I_INCLUDE-AVAIL.
if func = 'U'.
IF INCLUDES = 'Y'.
DESCRIBE TABLE I_INCL LINES I.
IF I > 0.
W_ITERATE = 'Y'.
ELSE.
W_ITERATE = ' '.
ENDIF.
WHILE W_ITERATE = 'Y'.
PERFORM PROCESS_INCLUDES_UL.
PERFORM LOOP_THROUGH.
DESCRIBE TABLE I_INCL LINES I.
IF I > 0.
W_ITERATE = 'Y'.
ELSE.
W_ITERATE = ' '.
ENDIF.
ENDWHILE.
endif.
ENDIF.
DESCRIBE TABLE I_INCLUDE LINES I.
IF I > 0.
SKIP 1.
WRITE: / ' Included Programs found'.
SKIP 1.
LOOP AT I_INCLUDE.
WRITE I_INCLUDE-NAME TO LINE(40).
CONDENSE LINE.
WRITE: / LINE(80).
ENDLOOP.
ENDIF.
/ Table R contains ABAP names to up / download. */
/ Loop through table R and perform up / download */
/ for each program. */
/ Table R1 contains INCLUDE names found (if any) */
/ As each */
FORM EXECUTE-FUNCTION.
LOOP AT R1.
MOVE-CORRESPONDING R1 TO R.
APPEND R.
ENDLOOP.
REFRESH R1.
LOOP AT R.
REFRESH : T, E1, H1, F1, S, U.
PERFORM PROCESS.
MOVE 'N' TO MAIN.
ENDLOOP.
REFRESH R.
DESCRIBE TABLE R1 LINES I.
ENDFORM.
/ Build file names for UP/DOWNLOAD */
/ 3 files are generated per ABAP. */
/ 1) ABAP Path\PROGNAME.EEE (ABAP, Attr,Texts) */
/ Logic Path\PROGNAME.EEE (Dynpro Source Logic) */
/ CUA Path\PROGNAME.EEE (CUA components - keys etc) */
/ 2) Header Path\PROGNAME.HHH (Dynpro Header) */
/ 3) Fields Path\PROGNAME.FFF (Dynpro Field definitions )*/
/ ( If alternate file name specified -DSNAME- this will */
/ be used instead. This is only valid for the main program. */
/ INCLUDED programs will have file names as specified */
/ above). */
/ By using this scheme it saves the user from having to */
/ be prompted for 3 file names. */
/ If you want multiple copies / versions on disk either */
/ rename the old versions or specify a different directory in */
/ the path parameter. */
FORM PROCESS.
MOVE PATH TO FN1.
CASE MAIN.
WHEN 'Y'.
IF DSNAME NE SPACE.
WRITE DSNAME TO FN1+66. "rel 4
ELSE.
WRITE R-NAME TO FN1+66. "rel 4
ENDIF.
WHEN OTHERS.
WRITE R-NAME TO FN1+66. "rel 4
ENDCASE.
MOVE FN1 TO FN2.
MOVE FN1 TO FN3.
WRITE '.HHH' TO FN1+124(4). "rel 4
WRITE '.FFF' TO FN2+124(4). "rel 4
WRITE '.EEE' TO FN3+124(4). "rel 4
CONDENSE FN1 NO-GAPS.
CONDENSE FN2 NO-GAPS.
CONDENSE FN3 NO-GAPS.
NAME = R-NAME.
CASE FUNC.
WHEN 'D'.
PERFORM DOWNLOAD_OBJECTS.
CLEAR LINE.
WRITE : 'ABAP : ' TO LINE.
WRITE R-NAME TO LINE+8.
WRITE 'has been unloaded' TO LINE+55.
CONDENSE LINE.
WRITE: / LINE.
DESCRIBE TABLE T LINES I.
IF I = 0.
WRITE: / 'No Dynpros were found for unload function'.
ELSE.
WRITE: / 'The following Dynpros have been unloaded : '.
PERFORM LOOP_THROUGH_T.
ENDIF.
WHEN 'U'.
PERFORM UPLOAD_OBJECTS.
DESCRIBE TABLE T LINES I.
CASE I.
WHEN 0.
WRITE: / 'No Dynpros were found for restore function'.
WHEN OTHERS.
WRITE: / 'The following Dynpros have been restored : '.
PERFORM LOOP_THROUGH_T.
ENDCASE.
IF MAIN EQ 'Y'.
CASE OLDNAME.
WHEN SPACE.
CLEAR LINE.
WRITE : 'ABAP : ' TO LINE.
WRITE R-NAME TO LINE+8.
WRITE 'has been restored' TO LINE+55.
CONDENSE LINE.
WRITE: / LINE.
WHEN OTHERS.
CLEAR LINE.
WRITE : 'ABAP : ' TO LINE.
WRITE R-NAME TO LINE+8.
WRITE 'has been restored - original name :'
TO LINE+55.
WRITE OLDNAME TO LINE+92.
CONDENSE LINE.
WRITE: / LINE.
ENDCASE.
ELSE.
CLEAR LINE.
WRITE : 'ABAP : ' TO LINE.
WRITE R-NAME TO LINE+8.
WRITE 'has been restored' TO LINE+55.
CONDENSE LINE.
WRITE: / LINE.
ENDIF.
ENDCASE.
ENDFORM.
/ print progname + dynpro nrs that have been processed. */
FORM LOOP_THROUGH_T.
LOOP AT T.
CLEAR LINE.
WRITE R-NAME TO LINE.
WRITE T-NUMBER TO LINE+50.
CONDENSE LINE.
WRITE: / LINE.
ENDLOOP.
ENDFORM.
/ Download Objects */
FORM DOWNLOAD_OBJECTS.
PERFORM UNLOAD_ABAP. "ABAP source, texts, attr
SELECT SINGLE * FROM TRDIR
WHERE NAME EQ R-NAME.
IF TRDIR-SUBC = 'I'.
CASE INCLUDES. "Included file wanted
WHEN 'Y'.
PERFORM SCAN4-INCLUDES.
ENDCASE.
ENDIF.
PERFORM UNLOAD_CUA. "CUA stuff
PERFORM DOWNLOAD_DATA. "Download EEE file to PC
PERFORM BUILD_T. "Build table of all dynpros in ABAP
DESCRIBE TABLE T LINES I.
CASE I.
WHEN 0. "if no dynpros exist then cannot download any
PERFORM DOWNLOAD_DATA. "Download EEE file to PC
WHEN OTHERS.
PERFORM UNLOAD_DYNPROS. "Get Raw dynpros from SAP
PERFORM UNLOAD_DYNPRO_COMPONENTS."Convert to table
PERFORM DOWNLOAD_DATA. "Download ABAP etc. to PC
PERFORM DOWNLOAD_BIN_H1. "Download dynpro header
PERFORM DOWNLOAD_BIN_F1. "Download dynpro fields
ENDCASE.
ENDFORM.
/ Split ABAP up into its component parts */
/ A) Program source (72) */
/ B) Texts (132) */
/ C) Attributes (117) */
/ D) CUA stuff (Various) */
FORM UNLOAD_ABAP.
/ Get ABAP language. Only required on download. */
SELECT SINGLE * FROM TRDIR
WHERE NAME EQ R-NAME.
MOVE TRDIR-RLOAD TO R-LANGUAGE.
READ REPORT R-NAME INTO S. "Get source into table S
MOVE '????SRCE' TO S-TXT.
INSERT S INDEX 1.
/ Text elements, Numbered texts, headings, selection texts */
/ Read text elements with logon language. If they don't */
/ exist read with the value taken from TRDIR. */
READ TEXTPOOL R-NAME INTO U LANGUAGE SY-LANGU.
IF SY-SUBRC NE 0.
READ TEXTPOOL R-NAME INTO U LANGUAGE R-LANGUAGE.
ENDIF.
DESCRIBE TABLE U LINES I.
CASE I.
WHEN 0.
WHEN OTHERS.
MOVE '????TEXT' TO S-TXT.
APPEND S.
LOOP AT U.
MOVE U-TXT TO S-TXT.
APPEND S.
DELETE U.
ENDLOOP.
ENDCASE.
/ Retrieve Attributes from TRDIR and add to table S */
/ Change language to logged on language */
MOVE '????ATTR' TO S-TXT.
APPEND S.
SELECT SINGLE * FROM TRDIR
WHERE NAME EQ R-NAME.
MOVE SY-LANGU TO TRDIR-RLOAD.
MOVE-CORRESPONDING TRDIR TO DIR.
MOVE DIR TO S-TXT.
APPEND S.
ENDFORM.
/ retrieve CUA stuff and append to table S. */
FORM UNLOAD_CUA.
MOVE R-NAME TO EU_KEY-NAME. "Program name for CUA
MOVE 'D' TO EU_KEY-SPRSL. "CUA seems to want D as lang
MOVE R-LANGUAGE TO EU_KEY-SPRSL. "Language "rel 2.2
IMPORT STA FUN MEN MTX ACT BUT PFK SET LAST INC STX DOC "rel 2.2
IMPORT STA STX FUN MEN MTX ACT BUT PFK SET LAST INC DOC "rel 3.0
ATT FDN MDN SYM FIN "rel 3.0
FROM DATABASE EUDB(CU) ID EU_KEY.
IF SY-SUBRC NE 0. "No statuses
EXIT.
ENDIF.
read titles in logged on language. If not present use
language from TRDIR.
CASE REL3.
WHEN SPACE. "(rel 4)
SELECT * FROM RSMPTEXTS WHERE PROGNAME EQ R-NAME
AND SPRSL = SY-LANGU.
MOVE-CORRESPONDING RSMPTEXTS TO FTX.
APPEND FTX.
ENDSELECT.
IF SY-SUBRC NE 0.
SELECT * FROM RSMPTEXTS WHERE PROGNAME EQ R-NAME
AND SPRSL = R-LANGUAGE.
MOVE-CORRESPONDING RSMPTEXTS TO FTX.
APPEND FTX.
ENDSELECT.
ENDIF.
DESCRIBE TABLE FTX LINES I.
IF I > 0.
MOVE '????FTXT' TO S-TXT.
APPEND S.
LOOP AT FTX.
MOVE FTX TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
WHEN OTHERS.
SELECT * FROM TITLE WHERE PROGNAME EQ R-NAME
AND DDLANGUAGE EQ SY-LANGU.
MOVE-CORRESPONDING TITLE TO TIT.
APPEND TIT.
ENDSELECT.
IF SY-SUBRC NE 0.
SELECT * FROM TITLE WHERE PROGNAME EQ R-NAME
AND DDLANGUAGE EQ R-LANGUAGE.
MOVE-CORRESPONDING TITLE TO TIT.
APPEND TIT.
ENDSELECT.
ENDIF.
ENDCASE.
DESCRIBE TABLE STA LINES I.
IF I > 0.
MOVE '????STAT' TO S-TXT.
APPEND S.
LOOP AT STA.
MOVE STA TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE FUN LINES I.
IF I > 0.
MOVE '????FUNC' TO S-TXT.
APPEND S.
LOOP AT FUN.
MOVE FUN TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE MEN LINES I.
IF I > 0.
MOVE '????MEN1' TO S-TXT.
APPEND S.
LOOP AT MEN.
MOVE MEN TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE MTX LINES I.
IF I > 0.
MOVE '????MTX1' TO S-TXT.
APPEND S.
LOOP AT MTX.
MOVE MTX TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE ACT LINES I.
IF I > 0.
MOVE '????ACTN' TO S-TXT.
APPEND S.
LOOP AT ACT.
MOVE ACT TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE BUT LINES I.
IF I > 0.
MOVE '????BUTN' TO S-TXT.
APPEND S.
LOOP AT BUT.
MOVE BUT TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE PFK LINES I.
IF I > 0.
MOVE '????PFKY' TO S-TXT.
APPEND S.
LOOP AT PFK.
MOVE PFK TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE SET LINES I.
IF I > 0.
MOVE '????SETS' TO S-TXT.
APPEND S.
LOOP AT SET.
MOVE SET TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
IF LAST NE SPACE.
MOVE '????LIST' TO S-TXT.
APPEND S.
MOVE LAST TO S-TXT.
APPEND S.
ENDIF.
DESCRIBE TABLE INC LINES I.
IF I > 0.
MOVE '????INCL' TO S-TXT.
APPEND S.
LOOP AT INC.
MOVE INC TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE STX LINES I.
IF I > 0.
MOVE '????STXT' TO S-TXT.
APPEND S.
LOOP AT STX.
MOVE STX TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE DOC LINES I.
IF I > 0.
MOVE '????DOCN' TO S-TXT.
APPEND S.
LOOP AT DOC.
MOVE DOC TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE TIT LINES I.
IF I > 0.
MOVE '????TITL' TO S-TXT.
APPEND S.
LOOP AT TIT.
MOVE TIT TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
Next 5 tables are rel 3.0 specific (ATT, FDN, MDN, SYM, FIN)
DESCRIBE TABLE ATT LINES I.
IF I > 0.
MOVE '????VATT' TO S-TXT.
APPEND S.
LOOP AT ATT.
MOVE ATT TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE FDN LINES I.
IF I > 0.
MOVE '????VFDN' TO S-TXT.
APPEND S.
LOOP AT FDN.
MOVE FDN TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE MDN LINES I.
IF I > 0.
MOVE '????VMDN' TO S-TXT.
APPEND S.
LOOP AT MDN.
MOVE MDN TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE SYM LINES I.
IF I > 0.
MOVE '????VSYM' TO S-TXT.
APPEND S.
LOOP AT SYM.
MOVE SYM TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF.
DESCRIBE TABLE FIN LINES I.
IF I > 0.
MOVE '????VFIN' TO S-TXT.
APPEND S.
LOOP AT FIN.
MOVE FIN TO S-TXT.
APPEND S.
ENDLOOP.
ENDIF. -
Hi everyone!
Is there a way in ABAP to output XML files? Pls. send code/ function module if any.
From ABAP programs, we are sure that we can output TEXT files, but how about XML files?
The significance of this question is related
Currently we are using XI to interface SAP and AMS, this question for ABAP to produce XML file arose, if for example, the XI server is down and we have to still send data from one system to another. IDocs can also produce XML files, pls confirm. Earlier however, we have preferred XI rather than IDocs to do this. Anyway, any idea regarding this scenario will be greatly appreciated.
Thanks and God bless!
CelesteHi,
Please check this sample codes from other thread.
1. itab --- > xml
xml ---> itab.
2. This program will do both.
(just copy paste in new program)
3.
REPORT abc.
*-------------- DATA
DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
DATA : BEGIN OF itab OCCURS 0,
a(100) TYPE c,
END OF itab.
DATA: xml_out TYPE string .
DATA : BEGIN OF upl OCCURS 0,
f(255) TYPE c,
END OF upl.
DATA: xmlupl TYPE string .
******************************* FIRST PHASE
******************************* FIRST PHASE
******************************* FIRST PHASE
*------------------ Fetch Data
SELECT * FROM t001 INTO TABLE t001.
*------------------- XML
CALL TRANSFORMATION ('ID')
SOURCE tab = t001[]
RESULT XML xml_out.
CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
EXPORTING
TEXT = xml_out
* IMPORTING
* LENGTH =
TABLES
FTEXT_TAB = itab.
*-------------- Download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filetype = 'BIN'
filename = 'd:xx.xml'
TABLES
data_tab = itab.
******************************* SECOND PHASE
******************************* SECOND PHASE
******************************* SECOND PHASE
BREAK-POINT.
REFRESH t001.
CLEAR t001.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'D:XX.XML'
filetype = 'BIN'
TABLES
data_tab = upl.
LOOP AT upl.
CONCATENATE xmlupl upl-f INTO xmlupl.
ENDLOOP.
*------------------- XML
CALL TRANSFORMATION ('ID')
SOURCE XML xmlupl
RESULT tab = t001[]
BREAK-POINT.
Regards,
Ferry Lianto -
Err with scheduling an abap program using open dataset
issue: have an abap program which uses "open dataset ... for input ..." to read the file.
- with manual ly running it, receive the following message "dataset_not_open".
- with scheduling it, receive same message
attempting to run an abap program as part of a process chain (ie scheduling a background job) in BI.
the abap performs the following fxns:
1) read a file on the server
2) removes delimiter, renames it
3) rewrites the file onto the server
initially used ws_upload for reading and ws_download for writing the file.
- both fxns worked fine if it is run manually --> but failed as a background (part of process chain)
- note 7925 states can't use ws_upload, download for background jobs
-so switched to "open dataset"
Any suggestions as to why the "open dataset" does not work is greatly appreciated it.
B.A.Thank you for all responses. here is more info about the err message:
sy-subrc = 8
'invalid argument'
I looked up the invalid argument in note 99155 --> due to "The destination file is no longer available during repeated file access. " So, the following steps were taken:
- file was regenerated and
- file was placed on the server to be read
have the following code:
OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE encoding default
MESSAGE D_MSG_TEXT.
also have tried the following:
OPEN DATASET d1 for input in text mode encoding default.
open dataset d1 for output in text mode encoding NON-UNICODE..
open dataset d1 for output in text mode encoding utf-8.
none had worked. system --> status shows no unicode.
THanks again for any suggestions. -
BEx Login error - Termination occurred in the ABAP program "CL_GUI_FRONTEND
Dear All,
I am having error when i am trying to login in BEx Analyser / Quary Designer 7.0
i am using the same user ID password as when i used to login to SAP BW through Logon pad.
but still i am having the error "Name or Password is incorrect. (repeat logon)"
I did try RRMX in BW, i got
Runtime Errors RAISE_EXCEPTION
Information on where terminated
Termination occurred in the ABAP program "CL_GUI_FRONTEND_SERVICES======CP" -
in "GUI_DOWNLOAD".
The main program was "RRMX_START_EXCEL ".
In the source code you have the termination point in line 89
of the (Include) program "CL_GUI_FRONTEND_SERVICES======CM012".
the program in the error dump as
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = BIN_FILESIZE
FILENAME = FILENAME
FILETYPE = FILETYPE
APPEND = APPEND
WRITE_FIELD_SEPARATOR = WRITE_FIELD_SEPARATOR
HEADER = HEADER
TRUNC_TRAILING_BLANKS = TRUNC_TRAILING_BLANKS
WRITE_LF = WRITE_LF
COL_SELECT = COL_SELECT
COL_SELECT_MASK = COL_SELECT_MASK
DAT_MODE = DAT_MODE
CONFIRM_OVERWRITE = CONFIRM_OVERWRITE
NO_AUTH_CHECK = NO_AUTH_CHECK
CODEPAGE = CODEPAGE
IGNORE_CERR = IGNORE_CERR
REPLACEMENT = REPLACEMENT
WRITE_BOM = WRITE_BOM
TRUNC_TRAILING_BLANKS_EOL = TRUNC_TRAILING_BLANKS_EOL
WK1_N_FORMAT = WK1_N_FORMAT
WK1_N_SIZE = WK1_N_SIZE
WK1_T_FORMAT = WK1_T_FORMAT
WK1_T_SIZE = WK1_T_SIZE
SHOW_TRANSFER_STATUS = SHOW_TRANSFER_STATUS
IMPORTING
FILELENGTH = FILELENGTH
TABLES
DATA_TAB = DATA_TAB
FIELDNAMES = FIELDNAMES
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.
case sy-subrc.
when 1.
RAISE FILE_WRITE_ERROR.
when 2.
RAISE NO_BATCH.
when 3.
RAISE GUI_REFUSE_FILETRANSFER.
when 4.
RAISE INVALID_TYPE .
when 5.
RAISE NO_AUTHORITY.
when 6.
RAISE UNKNOWN_ERROR.
when 7.
RAISE HEADER_NOT_ALLOWED.
when 8.
RAISE SEPARATOR_NOT_ALLOWED.
when 9.
RAISE FILESIZE_NOT_ALLOWED.
when 10.
RAISE HEADER_TOO_LONG.
when 11.
RAISE DP_ERROR_CREATE.
when 12.
RAISE DP_ERROR_SEND.
when 13.
RAISE DP_ERROR_WRITE.
when 14.
RAISE UNKNOWN_DP_ERROR.
>>>>when 15.
RAISE ACCESS_DENIED.
krishHello,
the same type of problem was solved today this way (it´s due to a local client problem):
Start users local SAP GUI
In the left upper corner of SAP GUI select the menue and -> options.
Delete all cache files of SAP GUI and browse the local SAP GUI download folder of the users workstation. Rename the files in the download/workdir folder for example to *_old.
Logon to SAP system again, run RRMX again -> confirm download of bex config file -> Excel sheet should open now.
Important: also the end user has to configure some excel addin options (bex) otherwise the excel sheet will be blank / empty.
BR,
Alessandro -
Basic Questions of ABAP programming
Hi Experts
I am new for ABAP programming. I wants to know some basic about ABAP. I have done 2 months ABAP course from a institute. They give me training on 4.7 IDES ver. Please give the answers of following questions.
1.Is there big difference between 4.7 and 6.0 Ecc ver in ABAP programming point of view?
2.for Traing purpose Should I install the full verson of SAP or there is any dummy software?
3.SAP Netweaver knowledge is must for ABAP programing?
4. When we install SAP 4.7 IDES version then all the modules will avialable or Only ABAP?
Thanks
Best Regards
JitenderHello,
For your own practice you can download the free version of SAP Netweaver ABAP in the downloads section of SCN. This is only for ABAP development. You wont find many of the stadard tables and functionalities with in it. IDES should be containing all the modules. But again that depends on the licesnse with which you are provided.
Your questions have no relevance from the ABAP technical point of view except the first one which is a basic question and should be asked here as per the forum rules. Thats the reason why you were suggested to read the forum rules.
For any queries of the trial version ABAP have a look at this forum
Vikranth -
ABAP program "SAPLCNTL" in "CHECK_OO": MESSAGE_TYPE_X
Hi,
I have a problem with a program with ALV-list. Sometimes it terminates with a dump. I can not reproduce the dumps and I can not find the reason for it. I do not know, if it only terminates on some clients.
In the program the alv table is refreshed with CL_GUI_ALV_GRID=>REFRESH_TABLE_DISPLAY. After this there is also a statement CALL METHOD cl_gui_cfw=>flush.
Can anyone help?
Kindly regards
Frank
Runtime Error MESSAGE_TYPE_X
Date and Time 11.11.2008 11:24:28
ShrtText
The current application triggered a termination with a short dump.
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
What can you do?
Print out the error message (using the "Print" function)
and make a note of the actions and input that caused the
error.
To resolve the problem, contact your SAP system administrator.
You can use transaction ST22 (ABAP Dump Analysis) to view and administer
termination messages, especially those beyond their normal deletion
date.
is especially useful if you want to keep a particular message.
Error analysis
Short text of error message:
Control Framework: Invalid Processing of ABAP Object Control
Technical information about the message:
Diagnosis
You want to edit a control created with ABAP objects techniques
(class-based Control Framework) using a function module (function
module-based Control Framework). The system does not support this.
The Class ID of the control is SAP.DataProvider.1.
System response
The transaction is terminated.
Procedure
Contact the person responsible for the SAP System.
Message classe...... "DC"
Number.............. 007
Variable 1.......... "SAP.DataProvider.1"
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
Variable 3.......... " "
Variable 4.......... " "
How to correct the error
Probably the only way to eliminate the error is to correct the program.
You may able to find an interim solution to the problem
in the SAP note system. If you have access to the note system yourself,
use the following search criteria:
"MESSAGE_TYPE_X" C
"SAPLCNTL" or "LCNTLF01"
"CHECK_OO"
If you cannot solve the problem yourself and you wish to send
an error message to SAP, include the following documents:
1. A printout of the problem description (short dump)
To obtain this, select in the current display "System->List->
Save->Local File (unconverted)".
2. A suitable printout of the system log
To obtain this, call the system log through transaction SM21.
Limit the time interval to 10 minutes before and 5 minutes
after the short dump. In the display, then select the function
"System->List->Save->Local File (unconverted)".
3. If the programs are your own programs or modified SAP programs,
supply the source code.
To do this, select the Editor function "Further Utilities->
Upload/Download->Download".
4. Details regarding the conditions under which the error occurred
or which actions and input led to the error.
System environment
SAP Release.............. "640"
Application server....... "gl3ap4"
Network address.......... "194.69.46.206"
Operating system......... "AIX"
Release.................. "5.3"
Hardware type............ "00C2809E4C00"
Character length......... 16 Bits
Pointer length........... 64 Bits
Work process number...... 8
Short dump setting....... "full"
Database server.......... "glince215"
Database type............ "ORACLE"
Database name............ "GL3"
Database owner........... "SAPSR3"
Character set............ "C"
SAP kernel............... "640"
Created on............... "Feb 18 2008 23:36:16"
Created in............... "AIX 1 5 00538A4A4C00"
Database version......... "OCI_920 "
Patch level.............. "221"
Patch text............... " "
Supported environment....
Database................. "ORACLE 9.2.0.*.*, ORACLE 10.1.0.*.*, ORACLE
10.2.0.*.*"
SAP database version..... "640"
Operating system......... "AIX 1 5, AIX 2 5, AIX 3 5, AIX 1 6"
Memory usage.............
Roll..................... 16192
EM....................... 16759424
Heap..................... 0
Page..................... 139264
MM Used.................. 4672968
MM Free.................. 3703952
SAP Release.............. "640"
User and Transaction
Client.............. 001
User................ "PB754"
Language key........ "D"
Transaction......... "ZVLA "
Program............. "SAPLCNTL"
Screen.............. "ZTCOCKPT 2000"
Screen line......... 4
Information on where terminated
The termination occurred in the ABAP program "SAPLCNTL" in "CHECK_OO".
The main program was "ZTCOCKPT ".
The termination occurred in line 178 of the source code of the (Include)
program "LCNTLF01"
of the source code of program "LCNTLF01" (when calling the editor 1780).
Source Code Extract
Line SourceCde
148 *---------------------------------------------------------------------*
149 * FORM %_CONTROL_DISPATCH *
150 *---------------------------------------------------------------------*
151 *
152 *---------------------------------------------------------------------*
153 * --> OKCODE *
154 *---------------------------------------------------------------------*
155 FORM %_CONTROL_DISPATCH.
156 * CALL FUNCTION 'CONTROL_DISPATCH'
157 * EXPORTING
158 * FCODE = SY-UCOMM
159 * EXCEPTIONS
160 * CB_NOT_FOUND = 1
161 * OTHERS = 2.
162 ENDFORM.
163
164 FORM REGISTERGLOBALOCXEVENT
165 USING SHELLID TYPE I EVENT TYPE I.
166 CALL METHOD OF CL_GUI_OBJECT=>H_GUI 'RegisterGlobalOCXevent'
167 NO FLUSH
168 EXPORTING #1 = SHELLID
169 #2 = EVENT.
170 ENDFORM.
171
172 form check_OO using p_handle type cntl_handle.
173 * check sy-uname = 'KSCHMIDT'.
174 call method cl_gui_cfw=>get_subscriber_by_id
175 exporting shellid = p_handle-shellid
176 exceptions others = 1.
177 if sy-subrc = 0.
>>>>> message X007 with p_handle-clsid.
179 endif.
180
181 endform.
182
183 form check_oo_2 using p_shellid type i.
184 data l_handle type cntl_handle.
185 * check sy-uname = 'KSCHMIDT'.
186 call method cl_gui_cfw=>get_subscriber_by_id
187 exporting shellid = p_shellid
188 exceptions others = 1.
189 if sy-subrc = 0.
190 call function 'CNTH_HANDLE_BY_SHELLID'
191 exporting shellid = p_shellid
192 importing h_control = l_handle
193 exceptions others = 1.
194 message X007 with l_handle-clsid.
195 endif.
196 endform.
Contents of system fields
Name Val.
SY-SUBRC 0
SY-INDEX 0
SY-TABIX 12
SY-DBCNT 1
SY-FDPOS 1
SY-LSIND 0
SY-PAGNO 0
SY-LINNO 1
SY-COLNO 1
SY-PFKEY STAT2000
SY-UCOMM NSEL
SY-TITLE ZTCOCKPT Cockpit: Transporte Aufträge Lieferungen
SY-MSGTY X
SY-MSGID DC
SY-MSGNO 007
SY-MSGV1 SAP.DataProvider.1
SY-MSGV2
SY-MSGV3
SY-MSGV4
Active Calls/Events
No. Ty. Program Include Line
Name
11 FORM SAPLCNTL LCNTLF01 178
CHECK_OO
10 FUNCTION SAPLCNTL LCNTLU13 16
CONTROL_DESTROY
9 FUNCTION SAPLCNDP LCNDPU07 22
DP_DESTROY
8 FUNCTION SAPLCNDP LCNDPU10 103
DP_CONTROL_ASSIGN_TABLE
7 METHOD CL_GUI_ALV_GRID_BASE==========CP CL_GUI_ALV_GRID_BASE==========CM01U 37
CL_GUI_ALV_GRID_BASE=>SET_TOOLBAR_BUTTONS
6 METHOD CL_GUI_ALV_GRID===============CP CL_GUI_ALV_GRID===============CM01M 52
CL_GUI_ALV_GRID=>SET_TOOLBAR
5 METHOD CL_GUI_ALV_GRID===============CP CL_GUI_ALV_GRID===============CM01P 432
CL_GUI_ALV_GRID=>SOFT_REFRESH_TABLE_DISPLAY
4 METHOD CL_GUI_ALV_GRID===============CP CL_GUI_ALV_GRID===============CM00T 116
CL_GUI_ALV_GRID=>REFRESH_TABLE_DISPLAY
3 MODULE (PBO) ZTCOCKPT ZTCOCKPT 652
PBO_ALV_2000
2 FORM ZTCOCKPT ZTCOCKPT 167
ALVAUSGABE
1 EVENT ZTCOCKPT ZTCOCKPT_INC 213
START-OF-SELECTION
Chosen variables
Name
Val.
No. 11 Ty. FORM
Name CHECK_OO
SY-REPID
SAPLCNTL
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
5454445422222222222222222222222222222222
310C3E4C00000000000000000000000000000000
%_VIASELSCR
0
4
P_HANDLE-SHELLID
128
0008
0000
BS_CENTER
768
0000
0030
%_DUMMY$$
0000
0000
2222
0000
FONT_ITALIC
1
0000
0001
SY-SUBRC
0
0000
0000
SY-XFORM
XAB_READ
000000000000000000000000000000
000000000000000000000000000000
544554442222222222222222222222
812F25140000000000000000000000
SY-MSGID
DC
00000000000000000000
00000000000000000000
44222222222222222222
43000000000000000000
SS_SIMPLE
11
0000
000B
SS_BLACKRECT
4
0000
0004
SPACE
0
0
2
0
SY-MSGNO
007
000
000
333
007
SY-MSGV1
SAP.DataProvider.1
00000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000
54524676576766672322222222222222222222222222222222
310E414102F69452E100000000000000000000000000000000
P_HANDLE-CLSID
SAP.DataProvider.1
0000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000
5452467657676667232222222222222222222222222222222222222222222222222222
310E414102F69452E10000000000000000000000000000000000000000000000000000
SY-MSGV2
00000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000
22222222222222222222222222222222222222222222222222
00000000000000000000000000000000000000000000000000
SY-MSGV3
00000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000
22222222222222222222222222222222222222222222222222
00000000000000000000000000000000000000000000000000
SY-MSGV4
00000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000
22222222222222222222222222222222222222222222222222
00000000000000000000000000000000000000000000000000
No. 10 Ty. FUNCTION
Name CONTROL_DESTROY
NO_FLUSH
X
0
0
5
8
H_CONTROL
OBJHOLE2## 7263 ####
00000000FF000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000FF000000000000000000000000000000000000000000000000000000000000000000000000000000000000
44444443FF222222222222222222222222222222222223333222222222222222222222222222222222222222080022
F2A8FC52FF000000000000000000000000000000000007263000000000000000000000000000000000000000000A00
BS_DEFPUSHBUTTON
1
0000
0001
BS_LEFT
256
0000
0010
THIS_DUMMY_VALUE
0
0000
0000
BS_PUSHBUTTON
0
0000
0000
H_CONTROL-OBJ+16(4)
-1
FFFF
FFFF
SYST-REPID
SAPLCNTL
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
5454445422222222222222222222222222222222
310C3E4C00000000000000000000000000000000
H_CONTROL-HANDLE_TYPE
NO_OC
0000000000
0000000000
4454422222
EFFF300000
CNTL_TYPE_OCX
OCX
0000000000
0000000000
4452222222
F380000000
CNTL_TRUE
1
0000
0001
IS_ITSAC_767A497173BF11D28BB
0
0
2
0
AC_EXPORTS_4E238C5273BF11D28BB
Table[initial]
AC_EXPO_WA_4E238C5273BF11D28BB
000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
2222222222222222222222222222222233333333322222222222222222222222222222222222222222222222222222
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
No. 9 Ty. FUNCTION
Name DP_DESTROY
H_DP
OBJHOLE2## 7263 ####
00000000FF000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000FF000000000000000000000000000000000000000000000000000000000000000000000000000000000000
44444443FF222222222222222222222222222222222223333222222222222222222222222222222222222222080022
F2A8FC52FF000000000000000000000000000000000007263000000000000000000000000000000000000000000A00
G_STRETCH_UNICODE_COLS_VALID
X
0
0
5
8
%_DUMMY$$
0000
0000
2222
0000
SY-SUBRC
0
0000
0000
SYST-REPID
SAPLCNDP
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
5454444522222222222222222222222222222222
310C3E4000000000000000000000000000000000Hi Frank,
I doubt it is related to function 'LVC_FIELDCATALOG_MERGE' since the current SAP help documentation talks about using this function for the purpose that I'm sure you are using it. The short dump states that the problem is caused by the use of an "old" function-module-based control framework function combined with the class-based OO CFW.
Diagnosis
You want to edit a control created with ABAP objects techniques
(class-based Control Framework) using a function module (function
module-based Control Framework). The system does not support this.
If you look at the call sequence in the short dump, function module 'CONTROL_DESTROY' is being called (which then calls function 'CHECK_OO' from which the error is sent). Function module 'CONTROL_DESTROY' is in function group CNTL which is part of the "old" function-module-based CFW.
Since the 'CONTROL_DESTROY' function is ultimately called as a result of your Z-program legitimately calling the standard SAP method CL_GUI_ALV_GRID=>REFRESH_TABLE_DISPLAY, I'd say you might want to consider opening a customer message with SAP providing as much detail and background as possible. But before you bother to do that (or while you are waiting to hear back from SAP) you may want to double-check your Z-program to make sure you aren't calling some other function modules from function groups CNTL or CNT0 (the "old" CFW function modules).
I've included just the call sequence from your short dump here for easier reference. Notice the order of the calls from 1 to 11, ending with functions 'CONTROL_DESTROY' and 'CHECK_OO'. I think 'CONTROL_DESTROY' may be causing the problem (??):
Active Calls/Events
No. Ty. Program Include Line
Name
11 FORM SAPLCNTL LCNTLF01 178
CHECK_OO
10 FUNCTION SAPLCNTL LCNTLU13 16
CONTROL_DESTROY
9 FUNCTION SAPLCNDP LCNDPU07 22
DP_DESTROY
8 FUNCTION SAPLCNDP LCNDPU10 103
DP_CONTROL_ASSIGN_TABLE
7 METHOD CL_GUI_ALV_GRID_BASE==========CP CL_GUI_ALV_GRID_BASE==========CM01U 37
CL_GUI_ALV_GRID_BASE=>SET_TOOLBAR_BUTTONS
6 METHOD CL_GUI_ALV_GRID===============CP CL_GUI_ALV_GRID===============CM01M 52
CL_GUI_ALV_GRID=>SET_TOOLBAR
5 METHOD CL_GUI_ALV_GRID===============CP CL_GUI_ALV_GRID===============CM01P 432
CL_GUI_ALV_GRID=>SOFT_REFRESH_TABLE_DISPLAY
4 METHOD CL_GUI_ALV_GRID===============CP CL_GUI_ALV_GRID===============CM00T 116
CL_GUI_ALV_GRID=>REFRESH_TABLE_DISPLAY
3 MODULE (PBO) ZTCOCKPT ZTCOCKPT 652
PBO_ALV_2000
2 FORM ZTCOCKPT ZTCOCKPT 167
ALVAUSGABE
1 EVENT ZTCOCKPT ZTCOCKPT_INC 213
START-OF-SELECTION
Regards,
Jamie
P.S. Please report back here if you find a solution (or if SAP finds one as a result of your customer message). -
Urgent: call ABAP program from BSP
hi BSP experts,
We just want to trigger an ABAP program to say "Hello World" in BSP and see the wording "Hello World" on web browser when running it from BSP. One BSP expert Raj gave the answer by using the following in BSP:
oninitialization:
submit ('z_program_name') and return exporting list to memory.
call function 'LIST_FROM_MEMORY'
tables
listobject = listobject.
call function 'WWW_HTML_FROM_LISTOBJECT'
exporting
report_name = 'z_program_name'
tables
html = html
listobject = listobject.
clear output_str.
loop at html into html_wa.
concatenate output_str html_wa into output_str.
endloop.
layout code:
<htmlb:content design="design2003">
<htmlb:page title = " ">
<htmlb:form>
<%= output_str %>
</htmlb:form>
</htmlb:page>
</htmlb:content>
We put the above in our BSP and then activate them, but get the following error:
Field "LISTOBJECT" is unknown. It's neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement."DATA" statement.
And the error stopps here:
submit ('z_program_name') and return exporting list to memory.
call function 'LIST_FROM_MEMORY'
tables
listobject = listobject.
Any idea?
We will give you reward points!hi Tanguy,
Eventually, I have figured it out on how to make the code works by showing "Hello World!" on web browser. But actually we would like to run another ABAP program which open a new container on users' machines, download an Excel template stored on server to the opened container on users' machinese, and then dump SAP table data to the opened excel template. This program works very well through SAP GUI, but users would like to run it on web that we tried to run this program in BSP, but it doesn't work with your code! Any idea?
Thanks alot! -
How to filter results of mara without writing abap program
I am running SE16 in SAP ECC searchig MARA table. I want to query such
As ERSDA > u201801/03/2011u2019 OR LEADA > u201801/302/2011u2019, Through form interface, it seems
I can only specify AND for two fields and not OR. Is there a way to specify the complex filter
Without writing ABAP program.
Thanks.Hello,
For simple single table reporting as this just use transaction code SE16 or SE16N. Filter your results as you would in any standard report selection screen using the search bubble option on the selected fields. After inputting the table select "Settings --> Fields For Selection" at the selection screen from the toolbar to add fields for the search. You may then download the results from "System --> List --> Save --> Local File" (Spreadsheet).
Regards,
sifter
Maybe you are looking for
-
Is there a way to get footnotes in Pages to flow across different pages?
Hello, Currently, I am finding that my document has a lot of white space wherever I have a footnote of more than ten lines or so. As a result, my document looks awkward and has large gaping sections on pages where there is very little main body but a
-
30 GB Video Ipod, having a problem
Hello there, My video iPod has been giving me a few problems. One day it tells me to connect to computer to restore it, okay I do that (connect not restore), then when the iPod loads in iTunes it says 'itunes has detected an ipod that appears to be c
-
Spry region drop-down list problems in IE
Can someone please help me determine the reason that IE does not display the correct item in a spry region drop-down list when first opening the site. You can see the problem at http://www.minursemap.org/agedistnurse.html. The initial item in the d
-
Restart JDBCSystemResource in WLST
I posted this question in the JDBC forum, but I realize it might me more appropriate here. I'm trying to change the database connection for all existing JDBC Data Sources in WLST (Weblogic Server 10.3.4), to make it connect to a different database wh
-
Smartforms - template printing on the wrong page
Greetings, everyone. I've been searching the SAP library and the forum, but haven't come across a solution. I created a form in Smartforms, with two pages defined: "first_page" (with the "main" window, 15 cm high, and some secondary windows), and "ot