ABAP-Download All Custom (Z) Objects With Respect To DEV Class - Code Gallery - Community Wiki
ABAP-Download All Custom (Z) Objects With Respect To DEV Class - Code Gallery - Community Wiki
Welcome to the new version of SAP Community Wiki: Learn What's New? and what has changed.
Dashboard
Author: Kaleemullah
Submitted: 19/07/2007
The Program Downloads all the custom objects with respect to Development class and Object type at the given work station location. Use full for the Entire Custom Object Analysis.
Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
REPORT zuipzproggdnld NO STANDARD PAGE HEADING MESSAGE-ID 00.
*Table Declarations
TABLES : tadir.
* Type Declarations
TYPES:
BEGIN OF t_tadir,
pgmid LIKE tadir-pgmid, "program id
object LIKE tadir-object, "object TYPE
obj_name LIKE tadir-obj_name, "object name
author LIKE tadir-author, "person responsible
devclass LIKE tadir-devclass, "development class
END OF t_tadir,
BEGIN OF t_tstc,
tcode LIKE tstc-tcode, "Transaction Code
pgmna LIKE tstc-pgmna, "Program Name
END OF t_tstc,
BEGIN OF t_header,
name(80) TYPE c,
END OF t_header,
BEGIN OF t_fintab,
string TYPE string,
END OF t_fintab.
* Table Declarations
DATA:
i_tadir TYPE STANDARD TABLE OF t_tadir,
i_fintab TYPE STANDARD TABLE OF t_fintab,
i_tstc TYPE STANDARD TABLE OF t_tstc,
i_header TYPE STANDARD TABLE OF t_header.
* Work Area Declarations
DATA:
wa_tadir LIKE LINE OF i_tadir,
wa_fintab LIKE LINE OF i_fintab,
wa_tstc LIKE LINE OF i_tstc,
wa_header LIKE LINE OF i_header.
* Global Variable Declarations
DATA:
v_count(5) TYPE n,
v_tab TYPE x VALUE 09.
* Constants Declarations
CONSTANTS: c_r3tr LIKE tadir-pgmid VALUE 'R3TR'.
*&---------------------------------------------------------------------
* Input parameters
*&---------------------------------------------------------------------
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_class LIKE tadir-devclass OBLIGATORY.
SELECT-OPTIONS : s_object FOR tadir-object.
PARAMETERS : p_wsfile LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b1.
*&---------------------------------------------------------------------
* INITIALIZATION
*&---------------------------------------------------------------------
INITIALIZATION.
*&---------------------------------------------------------------------
* AT SELECTION-SCREEN
*&---------------------------------------------------------------------
** Assist file Path for Download
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_wsfile.
PERFORM get_path.
*&--------------------------------------------------------------------
* START-OF-SELECTION.
*&--------------------------------------------------------------------
START-OF-SELECTION.
* Get all Accounting Document Details
PERFORM get_tadir.
*&--------------------------------------------------------------------
* END-OF-SELECTION.
*&--------------------------------------------------------------------
*END-OF-SELECTION.
IF i_tadir[] IS INITIAL.
MESSAGE s208(00) WITH 'No Records Found for the Selection'(003).
ELSE.
* Prepare Download Table
PERFORM fill_download.
** Submit to gui_download.
PERFORM download_csv USING p_wsfile.
ENDIF.
*&---------------------------------------------------------------------
*& Form get_path
*&---------------------------------------------------------------------
* Get The File Path for Download.
*----------------------------------------------------------------------
FORM get_path.
* Provide F4 Help for Download Path Selection
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = 'ZFIPDRDGCSV'
https://wiki.scn.sap.com/wiki/display/Snippets/ABAP-Download+All+Custom+(Z)+Objects+with+respect+to+DEV+Class?original_fqdn=wiki.sdn.sap.com 1/3
2/10/2020 ABAP-Download All Custom (Z) Objects with respect to DEV Class - Code Gallery - Community Wiki
dynpro_number = sy-dynnr
field_name = p_wsfile
CHANGING
file_name = p_wsfile
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE s208(00) WITH 'Given Path Unsucessful'(010).
ENDIF.
ENDFORM. " get_path
*&---------------------------------------------------------------------
*& Form download_csv
*&---------------------------------------------------------------------
* Download To Pipe CSV File
*----------------------------------------------------------------------
FORM download_csv USING v_p_wsfile LIKE rlgrap-filename.
DATA:
v_date LIKE sy-datum,
v_fname TYPE string.
v_date = sy-datum.
https://wiki.scn.sap.com/wiki/display/Snippets/ABAP-Download+All+Custom+(Z)+Objects+with+respect+to+DEV+Class?original_fqdn=wiki.sdn.sap.com 2/3
2/10/2020 ABAP-Download All Custom (Z) Objects with respect to DEV Class - Code Gallery - Community Wiki
'Object Name'
'T.Code'
'Author'
'Development Class'
INTO wa_fintab-string
SEPARATED BY v_tab.
1 Comment
Unknown User (1039ik7yk)
Hi,
I tried to created that program but it gave error at every line that begab by /
I deleted all those characters and them I managed to activated the program.
Now I executed the program and tried to download the code or a Class. In the program selection screen I placed the folowing:
P_CLASS --> Name of the class
S_OBJECT --> CLSD (Class Definition)
P_WSFILE --> the path in my PC where the file should be stored
However, if returns an error message: "No records found for the selection"
What am I doing wrong? Do you know how to solve that?
Thanks very much in advance.
Rgds
Salvador
https://wiki.scn.sap.com/wiki/display/Snippets/ABAP-Download+All+Custom+(Z)+Objects+with+respect+to+DEV+Class?original_fqdn=wiki.sdn.sap.com 3/3