Backup ABAP Programs
Hi Everyone,
I need your help.
I am working on a tool that can backup the ABAP source codes and tables.
I am using the READ REPORT to get the source code and store the result in a text file,
my question is, if I want to give this tool to a client , what kind of authorization a user need to be able
to run the tool and backup all the ABAP programs of the SAP system ?
Can any ABAP developer use the "READ REPORT" and read the source code written by
other ABAP developer ?
Thanks
REPORT zdownload.
TABLES: trdir.
SELECT-OPTIONS name FOR trdir-name NO INTERVALS.
PARAMETERS: path TYPE c LENGTH 50 DEFAULT 'C:\USERS\SCHWAB\PROGRAMS'.
START-OF-SELECTION.
LOOP AT name.
PERFORM download_program USING name-low.
ENDLOOP.
FORM download_program
FORM download_program USING value(i_name) LIKE trdir-name.
DATA: BEGIN OF lt_data_tab OCCURS 0,
line(72),
END OF lt_data_tab,
l_filename TYPE string.
CONCATENATE path '\' i_name '.TXT' INTO l_filename.
READ REPORT i_name INTO lt_data_tab.
IF lines( lt_data_tab ) = 0.
MESSAGE e001(uc) WITH TEXT-TK0.
ENDIF.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = l_filename
CHANGING
data_tab = lt_data_tab[]
EXCEPTIONS
OTHERS = 0.
IF sy-subrc <> 0.
MESSAGE e001(uc) WITH TEXT-K01.
ENDIF.
ENDFORM. "download_program
AT SELECTION-SCREEN ON name.
check name-low <> space.
SELECT SINGLE * FROM trdir WHERE name = name-low.
IF sy-subrc <> 0.
MESSAGE e001(uc) WITH TEXT-K02.
ENDIF.
Similar Messages
-
Hi all,
We have a sandbox that is refreshed monthly, I had an abap program which I forgot to backup from that sandox system, and it got refreshed. Is there a way to get the program back? Is there a local version stored locally in temp files?
I have searched a lot and did not find a solution to my problem.
I'll appreciate any help.
Thanks.Thanks for the help I guess
Only the database has been refreshed but I have access to the server's file system, but I dont know which directory to look for the programs. Do you have any tips? -
Call ABAP program from Unix script passing dynamic filename
Hi,
Does anyone know if it is possible to call an ABAP program from a Unix script passing a dynamic filename to the ABAP program?
We are receiving a file from an external company and on receipt of the file want to call an ABAP program passing the filename. The filename is made up of File ID, Date and Time which we need to read in the ABAP program. We usually use Events to trigger a program which is fine when the filename if static however since this filename will be dynamic we cannot do this. In addition we cannot just rename the file to a static name in the Unix script as we need to know the value of the date and time from the file ID in the ABAP program. I can change the ABAP program to check our /in directory for a Filename that starts with the fixed File ID however I thought there must be a better way of doing this. We want the external company to put this information in a file header record but they don't want to change the file contents. Any ideas would be appreciated.
Thanks,
Sinead.You could follow the following method
1.Let the external file reside in the SAP application layer in a defined path e.g. /usr/sap/tmp/interface/working/
2.Write an ABAP program which will include the following steps:-
i) read all files in the file path using function module EPS_GET_DIRECTORY_LISTING
ii) Read the data from files existing in the directory using OPEN_DATASET statement
iii) After the files have been read move the files to another directory e.g. /usr/sap/tmp/interface/backup/ or you can delete the file.
3.Schedule this program to be executed depending on the frequency of the external file being generated. -
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
-
Where does ABAP programs , BAPI's etc., get saved?
Hi friends
We have an ERP server (ECC) and have created lots of database tables, functions, Abap programs etc.,
For some reason our ERP software is corrupted. However, the SQL database looks ok.
So here is what we want to do.
Since the SQL database is good, So we would like to backup the SQL database first.
We have a ghost image of the server that was done some 2 months back. So we would like to install the ghost image of the server from 2 months back. This will bring the server back to working condition but without data.
Then recover the SQL database which we backed up before installing the ghost.
By doing this, will we be able to get back all the tables, data elements, BAPIs, functions, ABAP programs etc.,
Please let us know.
I will really appreciate it.
Thanks
Ram(subfolders COFILE and DATA of DIR_TRANS contain the transport requests once they are released, and they must exist in your system, check via AL11 to get the actual name on server, e.g. /usr/sap/trans/cofiles.)
Program sources are stored in a cluster like (comrpessed) table (tables REPOSRC and REPOTEXT and for older versions tables D010S, D010SINF, D010T, D010TINF) and so not easily downloadable.
You can create a report that read thru the abap program header table (TRDIR or via TADIR ) and execute the [READ REPORT|http://help.sap.com/abapdocu_70/en/ABAPREAD_REPORT.htm] statement to load source into an internal table, then you can download it
Check sample at wiki like [Download given set of programs into a folder on presentation server|http://wiki.sdn.sap.com/wiki/display/Snippets/Downloadgivensetofprogramsintoafolderonpresentationserver]
Regards,
Raymond -
How to backup ABAP code and dynpros?
Hey,
I wrote a program with dynpro (no web dynpro), modules and includes. I would like to save these objects. How to do this? I don't want to transport them to another system directly, but save them as file so that I have a backup.
I figure out that I have to use another ABAP program for doing this, but couldn't find a working link to such a backup program.
Thanks
chrisHi
i think this code might help u plzz reward if it helpful..
Program Name: Backup Program Creation: 11/21/2007*
SAP Name : ycl_generate_backup Application: SD *
Author : Contextlabs ABAP Team Type: 1 *
Description : This program will Creates Files in Presentation layer *
with the name of program and this program is used to *
Back the Programs That are Created or Changed Today *
Inputs: *
Tables: *
REPOSRC - Report Source Code * *
Outputs: File Names *
Ammendments: *
Programmer Date Req. # Action *
================ ========== ====== ==============================*
REPORT ycl_generate_backup.
Parameters Declaration *
PARAMETERS: p_file(500)
DEFAULT 'D:\Backup Programs\Timesheet\Timesheet_20080108'
OBLIGATORY. " File Name
Constants Declaration *
CONSTANTS: c_txt(6) VALUE '.txt'. " Store EXtension of file name
Data Declaration *
DATA w_file TYPE string.
Field Strings Declaration *
DATA: fs_prog TYPE progname.
Internal tables Declaration *
DATA: t_prog TYPE progname OCCURS 10,
t_code(150) OCCURS 10.
Satrt of Selection *
START-OF-SELECTION.
w_file = p_file.
PERFORM read_programs. " Read Programs
PERFORM download_programs. " Download Programs
*& Form read_programs
text
FORM read_programs.
SELECT PROGNAME
FROM REPOSRC
INTO TABLE T_PROG
WHERE UDAT EQ sy-datum
AND UNAM EQ 'CLUSER03'.
fs_prog = 'zcl_Datadec'.
APPEND fs_prog TO t_prog.
fs_prog = 'zcl_Tabcontrol'.
APPEND fs_prog TO t_prog.
fs_prog = 'zcl_startofsel'.
APPEND fs_prog TO t_prog.
fs_prog = 'zcl_Subroutines'.
APPEND fs_prog TO t_prog.
fs_prog = 'ZCL_TIMESHEET'.
APPEND fs_prog TO t_prog.
fs_prog = 'zcl_Modules_100'.
append fs_prog to t_prog.
ENDFORM. " Read_programs
*& Form Download_programs
Download all our programs
FORM download_programs .
LOOP AT t_prog INTO fs_prog.
READ REPORT fs_prog INTO t_code.
CONCATENATE w_file
fs_prog
c_txt
INTO w_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = w_file
TABLES
data_tab = t_code
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.
WRITE: / text-000.
ULINE.
WRITE: / fs_prog.
ELSE.
WRITE: / text-001.
ULINE.
WRITE: / w_file.
ENDIF. " IF SY-SUBRC <> 0.
ENDLOOP. " LOOP AT T_PROG
ENDFORM. " Download_programs
plzz dont forget to reward
further if u have any quiries my mail id [email protected] -
Want to Take Backup Of Programs Done in ECC6 IDES Server
Hi Experts,
Want to Take Backup Of Programs Done in ECC6 IDES Server like, Fico related Company Code,Configuration.... Abap Realted Programs....I Did my Practice in client 800 in IDES ECC6.
My Moto, Here is to Format the old server and Install new server, where as I can Move the same Fico related Company Code,Configuration.... Abap Realted Programs. from old server Backup to the new Freshly installed server.
I tried to move through request, but here only Abap programs are only Possible .
Please Suggest me the Path To proceed...
Thanks In Advance...
Amit.If you planing to build the same system.. why you trying to uninstall & install..
anyways you can do a client export & then restore of that 800 client.
or DB backup & restore iis more recommended.
Make sure you arnot changing any drives are file system , it makes the process would be smooth for DB restore & Backup.
-rahul -
Which SAP table stores the ABAP program Source Code
Hi All,
Which SAP table stores the ABAP source code .
Is it possible to retrieve the abap program code from database table
wherein it is stored .
Scenario :
In our project SAP got decommissioned and SAP database is migrated to Oracle . As SAP is decomissioned , we are not able to access the SAP frontend . But we need a program code to service a request . Is it possible to retrieve the program code from the database
which is migrated to oracle .
Thanks
ShikhaThis is an interesting question as the answer is may be different depending on your version. For example, in new releases the table REPOSRC appears to hold a compress version of the course code in the DATA field, but you would need to be able to decompress it if trying to read this directly out of the DB. I would assume that it uses gZip to do the compression, and there are ABAP utilities built in to do the compress/decompress. Of course you can always read the source code by using the READ REPORT statement in any release, but of course this will not help you if you can not log on to your system. Basically, if you system is corrupt for some reason, the best option is to restore from a backup.
REgards,
Rich Heilman -
Is it possible to call ms-dos command in abap program?
Hi,
is it possible to call ms-dos command in abap program?
Thanks.Hi Cemil,
You probably have your answer here:
[Re: DOS/Windows command in app server;
You create your external command with SM69 (you can test it with SM49).
Then you call this command with function module "SXPG_COMMAND_EXECUTE".
(See function group SXPT for all the calls to external commands).
Regards,
Thomas -
Can we use is null in our select statement in ABAP program
hi,
I want to use 'is nul' or 'not null' in select statement of my ABAP program for any field. I have written below query but I am getting sy-subrc = 4 and getting no data. Can anyone resolve this.Hi,
I think you've posted your question on the wrong forum. This is the SAP Business One development forum which is not part of ERP and doesn't include any ABAP or Netweaver programming.
For a list of forums please see here:
http://forums.sdn.sap.com/index.jspa
Kind Regards,
Owen -
How to upload Excel file in BI using function module in abap program
How to upload Excel file in BI using function module in abap program?
Hi Anuj,
To upload the file , you can try a standard program "RSEPSFTP" .
while you execute the program , a selection screen appears in which the inputs should be give as
RFC destination - The target server name
FTP command- PUT
local file - your file name
local directory - path of your local file
remote file - your target file name
remote directory - where it has to be stored
Hope this is useful for you
Thanks & regards
Anju -
How to get a parameter from BPC and use it in ABAP program
Hello gurus!
I got a problem...
SAP BPC will send parameters such as year, division, category, company code and so on via script logic to SAP BW.
I need to get these parameters from BPC and use them in a ABAP program as a filter.
This ABAP program will do several routines and return new values to BPC. It must be made on ABAP and I need to filter data to avoid performance issues.
Does anybody knows how to do it? or have a example of it?
Thank you in advance.
Regards,
Rubens KumoriHello, I'm looking for a suggest.
I need to pass two parameters (users can input them in a data manager package in bpc) to a BAdI.
In this BAdI I write a code that store those parameters in a InfoObject.
The problem is:
- one parameter is for CATEGORY value. CATEGORY is a dimension of the application and I read the value with a code like this:
READ TABLE it_cv INTO l_s_it_cv
WITH TABLE KEY dim_upper_case = 'C_CATEGORY'.
- other parameter is a generic DATE. this parameter is not a dimension of the application and I don't know how I can retrieve this value in BAdI.
READ TABLE it_cv INTO l_s_it_cv
WITH TABLE KEY dim_upper_case = '.....'.
The data manager dynamic script is:
PROMPT(SELECTINPUT,,,,"%CATEGORY_DIM%")
PROMPT(TEXT,%SELECTED_DAY%,"Write the date (format YYYYMMDD)",)
I also have a dynamic constant that assign the name %CATEGORY_DIM% to "C_CATEGORY" value.
Can anyone help me?
thanks a lot
Edited by: Luca Novali on Feb 13, 2012 3:49 PM -
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 -
How To Call a Broadcasting Template within an ABAP program
I was wondering if anyone knew how to call the Broadcast template via an ABAP program so it will execute? The scenario that I have is we are doing validations via BW. We put the data (for conversion reasons) through validation rules and then load a data target. From this, there are 2 situations that could occur:
1) There are errors
2) There are not any errors
If #1 is true, then I would like to execute the Query Broadcasting Template that I have created. If #2 is true, then I would like to execute another process via the ABAP program. In the past, I was successful using exception reporting via reporting agent, since I was able to call that program but the report did not look good at all. Please let me know if there is a program that I could call in order to execute this broadcast that I have set up.
Best Regards,
TimHello,
although this is an old threat, but do you have any hints on how to dynamically change the template when broadcasting?
kind regards
Murat -
Sometimes RSCRM ABAP program is taking much time
Hi,
I am working in SAP BW 3.1 system. We have one RSCRM Abap program to send the data to Data stage team.
We kept this process in process chain. Some times it takes much time. If i cancel that job and repeat this process it will complete in few minutes.
Please suggest me what would be the reason.
ThanksYou may want to take a look at the following OSS Notes:
[OSS Note 605213 - RSCRM: Performance|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=605213]
[OSS Note 989461 - RSCRM:code for improving performance in VALUES_READ|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=989461]
[OSS Note 1137302 - RSCRM: Memory usage optimization|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1137302]
Maybe you are looking for
-
Why is my Time Sheet not working on Android Readers?
I have a Time Sheet with Javascript that adds the times up, and it works perfect with the PC version of Adobe Reader, but when I try to use it on a nexus 7 tablet the calculations don't work. I have tried the official Adobe Reader for Android as well
-
Calendar 'Categories' from Outlook
Is it possible to utilize the 'Categorize' function from Outlook 2007 on the iPhone? Calendar items appear on the iPhone, but do not have the category tag/color.
-
Mail doesn't have number next to dock icon anymore?
Also it doesn't show if an email has an attachment or not.. just wondering if anyone else is missing these elements?
-
Why my browser want to download JRE?
Applets dont work with SDK? I think it is not possible, but my applet doesn't work, browser starts downloading JRE and want to install it. Appletviewer doesn't work too. I've tried 2 options in htmlconverter use any wersion of java 1.4 or higher and
-
Retention Policy Tag on Outlook 2010/Exchange 2010 SP3
While I still wanted to have the Retention Policies and Tags applied to mailboxes, would I just be able to "HIDE" or "SUPPRESS" the Tip that the Outlook 2010 client shows on the read-pane like... Retention Policy: xx Days Retention Inbox (xx days) Ex