Showing posts with label ABAP Reports. Show all posts
Showing posts with label ABAP Reports. Show all posts

Tuesday, May 6, 2008

SAP ABAP INTERACTIVE REPORTING FAQs

1. What is interactive reporting?

It helps you to create easy-to-read lists. You can display an overview list first that contains general information and provide the user with the possibility of choosing detailed information that you display on further lists.

  1. What are the uses of interactive reporting?

The user can actively control data retrieval and display during the session. Instead of an extensive and detailed list, you create a basic list with condensed information from which the user can switch to detailed displays by positioning the cursor and entering commands. The detailed information appears in secondary lists.

  1. What are the event key words in interactive reporting?

Event Keyword Event

AT LINE-SELECTION Moment at which the user selects a line by double clicking on it or by positioning the cursor on it and pressing F2.

AT USER-COMMAND Moment at which the user presses a function key.

TOP-OF-PAGE DURING Moment during list processing of a

LINE-SELECTION secondary list at which a new page starts.

  1. What is secondary list?

It allows you to enhance the information presented in the basic list. The user can, for example, select a line of the basic list for which he wants to see more detailed information. You display these details on a secondary list. Secondary lists may either overlay the basic list completely or you can display them in an extra window on the screen. The secondary lists can themselves be interactive again.

  1. How to select valid lines for secondary list?

To prevent the user from selecting invalid lines, ABAP/4 offers several possibilities. At the end of the processing block END-OF-SELECTION, delete the contents of one or more fields you previously stored for valid lines using the HIDE statement. At the event AT LINE-SELECTION, check whether the work area is initial or whether the HIDE statement stored field contents there. After processing the secondary list, clear the work area again. This prevents the user from trying to create further secondary lists from the secondary list displayed.

  1. How to create user interfaces for lists?

The R/3 system automatically, generates a graphical user interface (GUI) for your lists that offers the basic functions for list processing, such as saving or printing the list. If you want to include additional functionality, such as pushbuttons, you must define your own interface status. To create a new status, the Development Workbench offers the Menu Painter. With the Menu Painter, you can create menus and application toolbars. And you can assign Function Keys to certain functions. At the beginning of the statement block of AT END-OF-SELECTION, active the status of the basic list using the statement: SET PF-STATUS ‘STATUS’.

  1. What is interactive reporting?

A classical non-interactive report consists of one program that creates a single list. Instead of one extensive and detailed list, with interactive reporting you create basic list from which the user can call detailed information by positioning the cursor and entering commands. Interactive reporting thus reduces information retrieval to the data actually required.

  1. Can we call reports and transactions from interactive reporting lists?

Yes. It also allows you to call transactions or other reports from lists. These programs then use values displayed in the list as input values. The user can, for example, call a transaction from within a list of change the database table whose data is displayed in the list.

  1. What are system fields for secondary lists?

SY-LSIND Index of the list created during the current event (basic list = 0)

SY-LISTI Index of the list level from which the event was triggered.

SY-LILLI Absolute number of the line from which the event was triggered.

SY-LISEL Contents of the line from which the event was triggered.

SY-CUROW Position of the line in the window from which the event was triggered (counting starts with 1)

SY-CUCOL Position of the column in the window from which the event was triggered (counting starts with 2).

SY-CPAGE Page number of the first displayed page of the list from which the event was triggered.

SY-STARO Number of the first line of the first page displayed of the list from which the event was triggered (counting starts with 1). Possibly, a page header occupies this line.

SY-STACO Number of the first column displayed in the list from which the event was triggered (counting starts with 1).

SY-UCOMM Function code that triggered the event.

SY-PFKEY Status of the displayed list.

  1. How to maintain lists?

To return from a high list level to the next-lower level (SY-LSIND), the user chooses Back on a secondary list. The system then releases the currently displayed list and activates the list created one step earlier. The system deletes the contents of the released list. To explicitly specify the list level, into which you want to place output, set the SY-lsind field. The system accepts only index values, which correspond to existing list levels. It then deletes all existing list levels whose index is greater or equal to the index specify. For example, if you set SY-LSIND to 0, the system deletes all secondary lists and overwrites the basic list with the current secondary list.

  1. What are the page headers for secondary lists?

On secondary lists, the system does not display a standard page header and it does not trigger the event. TOP-OF-PAGE. To create page headers for secondary list, you must enhance TOP-OF-PAGE: Syntax TOP-OF-PAGE DURING LINE-SELECTION. The system triggers this event for each secondary list. If you want to create different page headers for different list levels, you must program the processing block of this event accordingly, for example by using system fields such as SY-LSIND or SY-PFKEY in control statements (IF, CASE).

  1. How to use messages in lists?

ABAP/4 allows you to react to incorrect or doubtful user input by displaying messages that influence the program flow depending on how serious the error was. Handling messages is mainly a topic of dialog programming. You store and maintain messages in Table T100. Messages are sorted by language, by a two-character ID, and by a three-digit number. You can assign different message types to each message you output. The influence of a message on the program flow depends on the message type. In our program, use the MESSAGE statement to output messages statically or dynamically and to determine the message type.

Syntax:REPORT MESSAGE-ID .

  1. What are the types of messages?

A message can have five different types. These message types have the following effects during list processing:

.A (=Abend):

.E (=Error) or W (=Warning):

.I (=Information):

.S (=Success):

  1. What are the user interfaces of interactive lists?

If you want the user to communicate with the system during list display, the list must be interactive. You can define specific interactive possibilities in the status of the list’s user interface (GUI). To define the statuses of interfaces in the R/3 system, use the Menu Painter tool. In the Menu Painter, assign function codes to certain interactive functions. After an user action occurs on the completed interface, the ABAP/4 processor checks the function code and, if valid, triggers the corresponding event.

  1. What are the drill-down features provided by ABAP/4 in interactive lists?

ABAP/4 provides some interactive events on lists such as AT LINE-SELECTION (double click) or AT USER-COMMAND (pressing a button). You can use these events to move through layers of information about individual items in a list.

  1. What is meant by stacked list?

A stacked list is nothing but secondary list and is displayed on a full-size screen unless you have specified its coordinates using the window command.

  1. Is the basic list deleted when the new list is created?

No. It is not deleted and you can return back to it using one of the standard navigation functions like clicking on the back button or the cancel button.

  1. What is meant by hotspots?

A Hotspot is a list area where the mouse pointer appears as an upright hand symbol. When a user points to that area (and the hand cursor is active), a single click does the same thing as a double-click. Hotspots are supported from R/3 release 3.0c.

  1. What is the length of function code at user-command?

Each menu function, push button, or function key has an associated function code of length FOUR (for example, FREE), which is available in the system field SYUCOMM after the user action.

  1. Can we create a gui status in a program from the object browser?

Yes. You can create a GUI STATUS in a program using SET PF-STATUS.

  1. In which system field does the name of current gui status is there?

The name of the current GUI STATUS is available in the system field SY-PFKEY.

  1. Can we display a list in a pop-up screen other than full-size stacked list?

Yes, we can display a list in a pop-up screen using the command WINDOW with the additions starting at X1 Y1 and ending at X2 Y2 to set the upper-left and the lower-right corners where x1 y1 and x2 y2 are the coordinates.

  1. What is meant by hide area?

The hide command temporarily stores the contents of the field at the current line in a system-controlled memory called the HIDE AREA. At an interactive event, the contents of the field are restored from the HIDE AREA.

  1. When the get cursor command used in interactive lists?

If the hidden information is not sufficient to uniquely identify the selected line, the command GET CURSOR is used. The GET CURSOR command returns the name of the field at the cursor position in a field specified after the addition field, and the value of the selected field in a field specified after value.

  1. How can you display frames (horizontal and vertical lines) in lists?

You can display tabular lists with horizontal and vertical lines (FRAMES) using the ULINE command and the system field SY-VLINE. The corners arising at the intersection of horizontal and vertical lines are automatically drawn by the system.

  1. What are the events used for page headers and footers?

The events TOP-OF-PAGE and END-OF-PAGE are used for pager headers and footers.

  1. How can you access the function code from menu painter?

From within the program, you can use the SY-UCOMM system field to access the function code. You can define individual interfaces for your report and assign them in the report to any list level. If you do not specify self-defined interfaces in the report but use at least one of the three interactive event keywords. AT LINE-SELECTION, AT PF, OR AT USER-COMMAND in the program, the system automatically uses appropriate predefined standard interfaces. These standard interfaces provide the same functions as the standard list described under the standard list.

  1. How the at-user command serves mainly in lists?

The AT USER-COMMAND event serves mainly to handle own function codes. In this case, you should create an individual interface with the Menu Painter and define such function codes.

  1. How to pass data from list to report?

ABAP/4 provides three ways of passing data:

---Passing data automatically using system fields

---Using statements in the program to fetch data

---Passing list attributes

  1. How can you manipulate the presentation and attributes of interactive lists?

---Scrolling through Interactive Lists.

---Setting the Cursor from within the Program.

---Modifying List Lines.

  1. How to call other programs?

Report Transaction

Call and return SUBMIT AND RETURN CALL TRANSACTION

Call without return SUBMIT LEAVE TO TRANSACTION

You can use these statements in any ABAP/4 program.

  1. What will exactly the hide statement do?

For displaying the details on secondary lists requires that you have previously stored the contents of the selected line from within the program. To do this, ABAP/4 provides the HIDE statement. This statement stores the current field contents for the current list line. When calling a secondary list from a list line for which the HIDE fields are stored, the system fills the stored values back into the variables in the program. In the program code, insert the HIDE statement directly after the WRITE statement for the current line. Interactive lists provide the user with the so-called ‘INTERACTIVE REPORTING’ facility. For background processing the only possible method of picking the relevant data is through ‘NON INTERACTIVE REPORT’ . After starting a background job, there is no way of influencing the program. But whereas for dialog sessions there are no such restrictions.

  1. How many lists can a program can produce?

Each program can produce up to 21 lists: one basic list and 20 secondary lists. If the user creates a list on the next level (that is, SY-LSIND increases), the system stores the previous list and displays the new one. Only one list is active, and that is always the most recently created list.

FALSE.

SAP ABAP REPORTING GENERAL

  1. The system field, which indicates success or failure of a SQL operation, is SY-SUBRC.

  2. What is the syntax for specifying database table name at runtime in SELECT statement.

NAME = ‘SPFL1’.

SELECT * FROM (NAME).

……………….

……………….

ENDSELECT.

  1. How do you read selected lines of database table into an internal table in packages of predefined size.

SELECT * FROM INTO TABLE PACKAGE SIZE.

Where n is variable.

  1. Name the WILDCARD characters which are used for comparisons with character strings & numeric strings. ‘%’ and ‘-‘.

  2. In SELECT statements can you specify a variable in WHERE condition or a part of the condition, if so what is the syntax.

SELECT * FROM

WHERE .
  1. Name the ABAP/4 key words, which are used to change the contents of database table.

UPDATE or MODIFY.

7. How to specify a client for database table processing.

TABLES SPFLI.

SELECT * FROM SPFLI CLIENT SPECIFIED WHERE MANDT BETWEEN ‘001’ AND ‘003’.

……..

ENDSELECT.

  1. How do you write a DATA object from ABAP/4 program to ABAP/4 memory and restore the same from memory to program.

EXPORT [FROM ][FROM ]…. TO MEMORY ID .

The ID , which can be up to 32 characters long, identifies the data in memory.

  1. What are DATA CLUSTERS?

You can group any complex internal data objects of an ABAP/4 program together in data clusters and store them temporarily in ABAP/4 memory or for longer periods in databases. You can store data clusters in special databases of the ABAP/4 Dictionary. These databases are known as ABAP/4 cluster databases and have a predefined structure. Storing a data cluster is specific to ABAP/4. Although you can also access cluster databases using SQL statements, only ABAP/4 statements are able to decode the structure of the stored data cluster.

  1. Statements used to delete data objects in ABAP/4 memory FREE MEMORY [ID ].

  2. How will you create a file on application server.

Open dataset for output.

  1. ABAP/4 statement for opening a file on application server for reading Open dataset for input.

  2. How will you transfer data into a file in application server?

Data fname(60) value ‘mYFILE’.

Data num type i.

Open dataset fname for output.

Do 10 times.

Num = Num +1.

Transfer num to fname.

Enddo.

…….etc.

  1. Name the function modules to write data from an Internal Table to the Presentation Server.

DOWNLOAD and WS_DOWNLOAD.

  1. Name the function module that can be used to give information about files on Presentation Server and about its Operating System.

WS_QUERY.

  1. Name the ABAP/4 key word, which is used to clear the Headerline of an Internal Table.

CLEAR.

  1. Name the function modules to read data from Presentation Server into an Internal Table.

UPLOAD and WS_UPLOAD.

  1. Name the ABAP/4 keywords to initialize an Internal Table with and without headerline.

REFRESH .

  1. How to determine the attributes of an internal table?

DESCRIBE TABLE [LINES ] [OCCURS ].

  1. Name the ABAP/4 key word for searching a string in an Internal Table.

SEARCH FOR .

The different options () for the search in an internal table are:

ABBREVIATED

Searches tablefor a word containing the character string specified in , where other characters might separate the characters. The first letter of the word and the string must be the same.

STARTING AT

Searches table for , starting at line . <\lin1> can be a variable.

ENDING AT

Searches table for upto line. can be a variable.

AND MARK

If the search string is found, all the characters in the search string (and all the characters in between when using ABBREVIATED) are converted to upper case.

  1. What are the different attributes that can be assigned to a variant?

The different attributes that can be assigned to a variant are….

Description

Enter a short, meaningful description of the variant. This may be upto 30 characters long.

Background only

Specify whether you want to use the variant in background processing only, or in online environment as well.

Protected variant.

Mark the field if you want to protect your variant against being changed by other users.

Do not display variant.

Mark this field if you want the variant name to be displayed in the catalog only, but not in the F4 value list.

For the selections you cover in a variant, you can enter the following attributes:

Type

The system displays whether the field is a parameter or a select option.

Protected

Mark this field for each field on the selection screen you want to protect from being overwritten. Values that you mark this way are displayed to the users, but they cannot change them, that are they are not ready to accept input.

Invisible

If you mark this column, the system will not display the corresponding field on the selection screen the user sees when starting the report program.

Variable

Mark this column if you want to set the value for this field at runtime.

  1. Is it possible to create new dynamic programs during runtime of an ABAP/4 program? If so how?

To create new dynamic programs during the runtime of an ABAP/4 program, you must use an internal table. For this purpose, you should create this internal table with one character type column and a line width of 72. You can use any method you like from Filling Internal Tables to write the code of your new program into the internal table. Especially, you can use internal fields in which contents are dependent on the flow of the program that you use to create a new one, to influence the coding of the new program dynamically. The following example shows how to proceed in principal:

DATA CODE (72) OCCURS 10.

APPEND ‘REPORT ZDYN1.’

TO CODE.

APPEND ‘WRITE/”Hello, I am dynamically created!”.’

TO CODE.

Two lines of a very simple program are written into the internal table CODE.

In the next step you have to put the new module, in the above example it is a report, into the library. For this purpose you can use the following statement:

Syntax

INSERT REPORT FROM .

The program is inserted in your present development class in the R/3 Repository. If a program with this name does not already exists, it is newly created with the following attributes:

Title: none,

Type: 1 (Reporting),

Application: S (Basis).

You can specify the name of the program explicitly within single quotation marks or you can write the name of a character field, which contains the program name. The name of the program must not necessarily be the same as given in the coding, but it is recommended to do so. is the internal table containing the source code. For the above example you could write:

INSERT REPORT ‘ZDYN1’ FROM CODE.

Or

DATA REP (8).

REP = ‘ZDYN1’

INSERT REPORT REP FROM CODE.

  1. Data types can be elementary or structured (T/F).

TRUE.

  1. The amount of memory associated with a data type is ZERO.

  2. Data objects are the physical units a program uses at runtime. (T/F).

TRUE.

  1. The data object does not occupy any space in memory. (T/F)

FALSE.

  1. What are the three hierarchical levels of data types and objects?

Program-independent data, defined in the ABAP/4 Dictionary.

Internal data used globally in one program.

Data used locally in a procedure (subroutine, function module)

  1. How would you find the attributes of a data type or data object?

DESCRIBE FIELD [LENGTH [COMPONENTS ]]

[OUTPUT-LENGTH ] [DECIMALS ]

[EDIT MASK ].

  1. The components of a field string cannot have different data types. (T/F).

FALSE.

  1. Field strings are also called as Record or Structures.

  2. If a field string is aligned (Left, centered, right justified etc.), the filler fields are also added to the length of the type C field. (T/F).

TRUE.

  1. You cannot assign a local data object defined in a subroutine or function module to a field group. (T/F)

TRUE.

  1. Field group reserves storage space for the fields, and does not contain pointers to existing fields (T/F).

False.

  1. Defining a field group as ‘HEADER’ is optional (T/F)

FALSE.

  1. How would you define a field symbol?

FIELD-SYMBOLS.

  1. Which function module would you use to check the user’s authorization to access files before opening a file?

AUTHORITY_CHECK_DATASET

37. Name the function module used to convert logical file names to physical file names in ABAP/4 programs.

FILE_GET_NAME.

  1. Parameters, which are defined during the definition of a subroutine with the FORM statement, are called Formal Parameters.

  2. Parameters which are specified during the call of a subroutine with the PERFORM statement are called Actual Parameters.

  3. In subroutines internal tables that are passed by TABLES, are always called by value and result. (T/F)

FALSE. They are called by reference.

SAP REPORTS FAQ


  1. In the statement Write:/15(10) Ofal-lifnr. what do the number 15 and 10 stand for

15 stand for the offset on the screen and 10 stands for the field length displayed.

3. Specify the default alignment for the following field types:

‘D’ – Left, ‘F’-Right, ‘N’-Left, ‘I’-Right, ‘T’-Left.

  1. If s_time has the value ‘123456’ how would you get an output of 12:34:56 with a single ‘Write:’ statement.

Write:s_time using edit mask’--:--:--‘.

  1. In order to suppress the leading zeroes of a number field the keywords used are NO-ZERO.

  2. The total no of date formats that can be used to display a date during output is MM/DD/YY, DD/MM/YY, DD/MM/YYYY, MM/DD/YYYY, MMDDYY, DDMMYY, YYMMDD.

  3. The UNDER Command allows for vertical alignment of fields one below the other.

  4. In order to concatenate strings only for output purposes the command NO-GAP can be used in conjunction with the ‘Write’ statement.

  5. The no of decimal places for output can be defines within a write statement. (T/F).

TRUE. Write:/ decimals 2.

  1. Data can be moved from one field to another using a ‘Write:’ Statement and stored in the desired format. (T/F).

TRUE. Write: Date_1 to Date_2 format DD/MM/YY.

  1. In the statement Write:/15(10) lfa1-lifnr. The values 15 and 11 can also be defined by variables (T/F). False.

  2. Differentiate between the following two statements if any.

ULINE.

Write: sy-uline.

No-difference. Except that uline is used outside the ‘Write’ Statement.

  1. In order to skip a single line the number of lines need not be given as an assignment (T/F)

TRUE.

  1. The “SKIP TO LINE line number” is dependent on the LINE-COUNT statement included in the report statement of the program.

  2. In order to skip columns the command used is POSITION .

  3. In order to have boldfaced text as output the command used is Write:INTENSIFIED.

  4. Background and foreground colors can be interchanged using the command Format Inverse.

  5. In order to restore the system defaults for all changes made with the format statement is Format Reset.

  6. Like ULINE the statement VLINE is used to insert vertical lines. (T/F).

False.

20. Suppressing the number signs (+/-) is carried out using the addition NO-SIGNS to the Write statement. (T/F). False.

  1. If SY-UZEIT has the value 6:34:45 it can be displayed as 063445 using No Edit Mask.

  2. If the variable “Text” has the value ‘ABCDEF’ the output for the statement “Write:/Text+2(3)” will be “CDE”

  3. The fields specified by select-options and parameters statement cannot be grouped together in the selection screen. (T/F). False.

  4. When calling an external report the parameters or select-options specified in the external report cannot be called. (T/F)

FALSE.

  1. Selection Texts in the text elements of the program helps in changing the displayed names of variables in the parameters statement.

  2. Type F datatype cannot be used to define parameters.

27. Rounding off of values can be carried out using the write statement. (T/F). TRUE

  1. How would you define the exponents for a type ‘f’ field?

Exponent .

  1. How would you format the output as left, centered or right-justified using the write statement.

Left-justified, Centered, Right-justified.

  1. If the same formatting options were used for a WRITE statement that follows the FORMAT statement, which settings would take precedence.

The settings in the Write Statement.

  1. For each new event, the system resets all formatting options to their default values (T/F)

TRUE.

  1. All formatting options have the default value OFF. (T/F).

TRUE.

  1. How would you set the formatting options statically and dynamically within a report? Statically: FORMAT [ON|OFF]….

Dynamically: FORMAT = =….

  1. The page footer is defined using the statement END-OF-PAGE.

  2. The processing block following END-OF-PAGE is processed only if you reserve lines for the footer in the LINE-COUNT option of the REPORT statement. (T/F)

TRUE.

  1. To execute a page break under the condition that less than a certain number of lines is left on a page is achieved by RESERVE n lines.

  2. The RESERVE statement only takes effect if output is written to the subsequent page. No blank pages are created and it defines a block of lines that must be output as a whole. (T/F). TRUE.

  3. To set the next output line to the first line of a block of lines defined with the RESERVE statement the statement BACK is used.

  4. What is the limit for the length of a page if the page length is not specified in the report statement. 60,000 lines.

  5. How would you start the printing process from within the program while creating a list?

NEW-PAGE PRINT ON.

  1. You can change the width of pages within list levels triggered by page breaks. (T/F).

FALSE.

  1. Hotspots are special areas of an output list used to trigger events. (T/F) TRUE.

  2. To designate fields as hotspots at runtime, use FORMAT HOTSPOT = .

  3. Horizontal lines created with ULINE and blank lines created with SKIP can be formatted as hotspots. (T/F). FALSE.

  4. How would you suppress the display of a parameter on the selection screen?

Parameters

………..No-Display.

  1. Can you assign a matchcode object to a parameter? If so how?

Yes. PARAMETERS

……..MATCHCODE OBJECT ……..

  1. For each SELECT-OPTIONS statement, the system creates a selection table. (T/F)

TRUE.

  1. To position a set of parameters or comments on a single line on the selection screen, you must declare the elements in a block enclosed by

SELECTION-SCREEN BEGIN OF LINE.

……..

SELECTION-SCREEN END OF LINE.

  1. How can Symbols or R/3 icons be output on the screen?

WRITE AS SYMBOL.

WRITE AS ICON.

  1. In the standard setting, you cannot create empty lines with the WRITE statement alone. (T/F). TRUE.

Friday, December 28, 2007

24 Column Account Managers Report

24 Column Account Managers Report

sap ABAP report on Column Account Managers Report

24 Column Account Managers Report

sap ABAP report on Detail Transaction Report (DTR) Quick Reference

sap ABAP report on Detail Transaction Report (DTR) Quick Reference

sap ABAP report on Summary Statement Quick Reference

sap ABAP report on Summary Statement Quick Reference

free download book on abap reporting on all modules

free download book on abap reporting on all modules

ABAP REPORTS

REKH0004 SAP demo program that shows how to do 2D, 3D, and 4D graphics.
RGUGBR00 Substitution/Validation utility
RHGEN00 Regen PD and PA inconsistencies
RHGRENZ0 Delimit IT1000 and related 1001s. Program will delete any 1001 infotypes whose start date is after the delimit date.
RHGRENZ1 Extend the end date on delimited records. Very useful when you delimit a bunch of records incorrectly, and need to change the end date.
RHGRENZ2 Delimit IT1001 only.
RKCTSEAR Search source code for up to two strings. Also see RSRSCAN1 and RPR_ABAP_SOURCE_SCAN.
RPDTRA00 List all HR transactions.
RPR_ABAP_SOURCE_SCAN Search ABAP code for a string. Has many more options for selecting the ABAPs to search than RSRSCAN1 or RKCTSEAR.
RPUAUD00 HR Report to list all logged changes for an employee. Uses the PCL4 Audit Cluster.
RPUAUDDL HR Report to delete audit data from the PCL4 Audit Cluster.
RPUDELPN Delete all info for an employee number, including cluster data and infotypes
RPUP1D00/10 View/Delete data from PCL1 Cluster
RPUP2D00/10 View/Delete data from PCL2 Cluster
RPUP3D00/10 View/Delete data from PCL3 Cluster
RPUP4D00/10 View/Delete data from PCL4 Cluster
RSABAPIV Mass print/display of ABAP/4 help text
RSAVGL00 Table adjustment across clients
RSBDCBTC Submit a BDC job with an internal batch number and wait for the end of the batch input session.
RSBDCDRU Prints the contents of a Batch Input session. No options for error transactions only.
RSBDCOS0 Execute UNIX commands. Looks similar to the old SAPMSOS0 program that disappeared in 3.0
RSBDCSUB Release batch input sessions automatically
RSBTCDEL Clean the old background job records
RSSDOCTB R/3 Table Manual - prints a list of all fields in the selected tables with the field name and the field documentation.
RSCLTCOP Copy tables across clients
RSDBCREO Clean batch input session log
RSINCL00 Extended program list
RSNASTED Process message control output for entries in the NAST table
RSORAREL Get the Oracle Release
RSPARAM Display all instance parameters
RSPO0041 Removing old spooling objects
RSRSCAN1 Search source code for a given string. Will also search includes. Also see RKCTSEAR and RPR_ABAP_SOURCE_SCAN.
RSSNAPDL Clean the old ABAP error dumps
RSTBSERV Compare a contents of a table between clients
RSTXFCON Converts SAPScript page formats
RSTXSCRP Save a SAPScript layout set to disk, and load it back into SAP.
RSTXSCRP Transport SAPscript files across systems
RSTXSCRP Upload and download SAPScript layout sets
RSTXTPDF4 Pass the spool number of a report's output to this program to have the output converted to PDF format.
RSTXTRAN Add standard texts to a transport so they can be moved between systems.
RSUSR003 Check the passwords of users SAP* and DDIC in all clients
RSUSR006 List users last login
RSWBO052 Change development class of a sapscript (provided by Alan Cecchini)
RSWBO060 put objects into a request and transport it to any other system

Report YRS_DOWNLOAD_TRANSPORT_REQUEST

*======================================================================*

* Initial idea and first release by Igor Yaskevitch (IBS), 2003 *

* Enhancements by Sergey Korolev, 2005 (Added F4 value *

* requests, authority checks, TMS function usage) *

*----------------------------------------------------------------------*

* Function : This is a utility tool for downloading binary *

* files of transport request to a Client PC *

*======================================================================*

REPORT yrs_download_transport_request.

PARAMETERS:

p_reqest TYPE trkorr OBLIGATORY,

p_folder(255) TYPE c LOWER CASE, p_sepr OBLIGATORY.

DATA:

folder TYPE string,

retval LIKE TABLE OF ddshretval WITH HEADER LINE,

fldvalue LIKE help_info-fldvalue,

transdir TYPE text255,

filename(255),

trfile(20) TYPE c,

datatab TYPE TABLE OF text8192 WITH HEADER LINE,

len TYPE i,

flen TYPE i.

TYPE-POOLS: sabc, stms, trwbo.

INITIALIZATION.

CONCATENATE sy-sysid 'K*' INTO p_reqest.

IF sy-opsys = 'Windows NT'.

p_sepr = '\'.

ELSE.

p_sepr = '/'.

ENDIF.

* CALL FUNCTION 'WSAF_BUILD_SEPARATOR'

* IMPORTING

* separator = p_sepr

* EXCEPTIONS

* separator_not_maintained = 1

* wrong_call = 2

* wsaf_config_not_maintained = 3

* OTHERS = 4.

*

* IF sy-subrc NE 0.

* MESSAGE s001(00)

* WITH

* 'Unable to find out the separator symbol for the system.'(011).

* ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_reqest.

DATA:

tt_system TYPE TABLE OF tmscsys WITH HEADER LINE,

es_selected_request TYPE trwbo_request_header,

es_selected_task TYPE trwbo_request_header,

iv_organizer_type TYPE trwbo_calling_organizer,

is_selection TYPE trwbo_selection.

iv_organizer_type = 'W'. is_selection-reqstatus = 'R'.

CALL FUNCTION 'TR_PRESENT_REQUESTS_SEL_POPUP'

EXPORTING

iv_organizer_type = iv_organizer_type

is_selection = is_selection

IMPORTING

es_selected_request = es_selected_request

es_selected_task = es_selected_task.

p_reqest = es_selected_request-trkorr.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.

DATA: title TYPE string.

title = 'Select target folder'(005).

CALL METHOD cl_gui_frontend_services=>directory_browse

EXPORTING

window_title = title

CHANGING

selected_folder = folder

EXCEPTIONS

cntl_error = 1

error_no_gui = 2

OTHERS = 3.

CALL FUNCTION 'CONTROL_FLUSH'

EXCEPTIONS

cntl_system_error = 1

cntl_error = 2

OTHERS = 3.

p_folder = folder.

AT SELECTION-SCREEN ON p_reqest.

DATA: request_info TYPE stms_wbo_request,

request_infos TYPE stms_wbo_requests.

REFRESH request_infos.

CALL FUNCTION 'TMS_MGR_READ_TRANSPORT_REQUEST'

EXPORTING

iv_request = p_reqest

iv_header_only = 'X'

IMPORTING

et_request_infos = request_infos

EXCEPTIONS

read_config_failed = 1

table_of_requests_is_empty = 2

system_not_available = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CLEAR request_info.

READ TABLE request_infos INTO request_info INDEX 1.

IF sy-subrc NE 0

OR request_info-e070-trkorr IS INITIAL.

MESSAGE e398(00) WITH 'Request'(006) p_reqest 'not found'(007).

ELSEIF request_info-e070-trstatus NE 'R'.

MESSAGE e398(00)

WITH 'You must release request'(008)

request_info-e070-trkorr

'before downloading'(009).

ENDIF.

START-OF-SELECTION.

folder = p_folder.

CONCATENATE p_reqest+3(7) '.' p_reqest(3) INTO trfile.

CALL FUNCTION 'RSPO_R_SAPGPARAM'

EXPORTING

name = 'DIR_TRANS'

IMPORTING

value = transdir

EXCEPTIONS

error = 0

OTHERS = 0.

PERFORM copy_file USING 'cofiles' trfile.

trfile(1) = 'R'.

PERFORM copy_file USING 'data' trfile.

trfile(1) = 'D'.

PERFORM copy_file USING 'data' trfile.

*---------------------------------------------------------------------*

* FORM copy_file *

*---------------------------------------------------------------------*

* --> SUBDIR * * --> FNAME *

*---------------------------------------------------------------------*

FORM copy_file USING subdir fname.

DATA:

auth_filename TYPE authb-filename,

gui_filename TYPE string.

CONCATENATE transdir subdir fname

INTO filename

SEPARATED BY p_sepr.

REFRESH datatab.

CLEAR flen.

auth_filename = filename.

CALL FUNCTION 'AUTHORITY_CHECK_DATASET'

EXPORTING

activity = sabc_act_read

filename = auth_filename

EXCEPTIONS

no_authority = 1

activity_unknown = 2

OTHERS = 3.

IF sy-subrc <> 0.

FORMAT COLOR COL_NEGATIVE.

WRITE: / 'Read access denied. File'(001),

filename.

FORMAT COLOR OFF. EXIT.

ENDIF.

OPEN DATASET filename FOR INPUT IN BINARY MODE.

IF sy-subrc NE 0.

FORMAT COLOR COL_TOTAL.

WRITE: / 'File open error'(010), filename.

FORMAT COLOR OFF. EXIT.

ENDIF.

DO.

CLEAR len.

READ DATASET filename INTO datatab LENGTH len.

flen = flen + len.

IF len > 0. APPEND datatab. ENDIF.

IF sy-subrc NE 0.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET filename.

CONCATENATE p_folder '\' fname INTO gui_filename.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

bin_filesize = flen

filename = gui_filename

filetype = 'BIN'

CHANGING

data_tab = datatab[]

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 = 24.

IF sy-subrc = 0.

WRITE: / 'File'(002), filename, 'downloaded. Length'(003), flen.

ELSE.

FORMAT COLOR COL_NEGATIVE.

WRITE: / 'File download error. Filename:'(004), filename.

FORMAT COLOR OFF.

ENDIF.

ENDFORM. "copy_file

Report YRS_UPLOAD_TRANSPORT_REQUEST

======================================================================*

* Initial idea and first release by Igor Yaskevitch (IBS), 2003 *

* Enhancements by Sergei Korolev, 2005 (added import queue *

* manipulations, authority checking, minor interface improvements) *

*----------------------------------------------------------------------*

* Function : This is a utility tool for uploading binary *

* files of a transport request from a Client PC, *

* adding to an import queue and importing into the *

* system. *

*======================================================================*

REPORT yrs_upload_transport_request.

TYPE-POOLS: abap, sabc, stms.

CONSTANTS: gc_tp_fillclient LIKE stpa-command VALUE 'FILLCLIENT'.

DATA:

lt_request TYPE stms_tr_requests,

lt_tp_maintain TYPE stms_tp_maintains.

DATA:

sl TYPE i,

l_datafile(255) TYPE c,

datafiles TYPE i,

ret TYPE i,

ans TYPE c.

DATA:

et_request_infos TYPE stms_wbo_requests,

request_info TYPE stms_wbo_request,

system TYPE tmscsys-sysnam,

request LIKE e070-trkorr.

DATA:

folder TYPE string,

retval LIKE TABLE OF ddshretval WITH HEADER LINE,

fldvalue LIKE help_info-fldvalue,

transdir TYPE text255,

filename LIKE authb-filename,

trfile(20) TYPE c.

DATA:

BEGIN OF datatab OCCURS 0,

buf(8192) TYPE c,

END OF datatab.

DATA: len TYPE i,

flen TYPE i.

SELECTION-SCREEN COMMENT /1(79) comm_sel.

PARAMETERS:

p_cofile(255) TYPE c LOWER CASE OBLIGATORY.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE bl_title.

PARAMETERS:

p_addque AS CHECKBOX DEFAULT 'X',

p_tarcli LIKE tmsbuffer-tarcli

DEFAULT sy-mandt

MATCHCODE OBJECT h_t000,

p_sepr OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b01.

INITIALIZATION.

bl_title = 'Import queue parameters'(b01).

comm_sel = 'Select co-file. Filename must start with ''K''.'(001).

IF sy-opsys = 'Windows NT'.

p_sepr = '\'.

ELSE.

p_sepr = '/'.

ENDIF.

** CALL FUNCTION 'WSAF_BUILD_SEPARATOR'

** IMPORTING

** separator = p_sepr

** EXCEPTIONS

** separator_not_maintained = 1

** wrong_call = 2

** wsaf_config_not_maintained = 3

** OTHERS = 4.

* IF sy-subrc NE 0.

* MESSAGE s001(00) WITH 'Unable to find out the separator symbol for the system.'(008).

* ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cofile.

DATA:

file TYPE file_table,

rc TYPE i,

title TYPE string,

file_table TYPE filetable,

file_filter TYPE string VALUE 'CO-files (K*.*)K*.*'.

title = 'Select CO-file'(006).

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

window_title = title

file_filter = file_filter

CHANGING

file_table = file_table

rc = rc

EXCEPTIONS

file_open_dialog_failed = 1

cntl_error = 2

error_no_gui = 3

not_supported_by_gui = 4

OTHERS = 5.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

READ TABLE file_table INTO file INDEX 1.

p_cofile = file.

AT SELECTION-SCREEN.

DATA:

file TYPE string.

sl = STRLEN( p_cofile ).

IF sl < 11.
MESSAGE e001(00) WITH 'Invalid co-file name format. File name format must be KNNNNNNN.SSS'(009).
ENDIF.
sl = sl - 11.
IF p_cofile+sl(1) NE 'K'.
MESSAGE e001(00) WITH 'Invalid co-file name format. File name format must be KNNNNNNN.SSS'(009).
ENDIF. sl = sl + 1.
IF NOT p_cofile+sl(6) CO '0123456789'.
MESSAGE e001(00) WITH 'Invalid co-file name format. File name format must be KNNNNNNN.SSS'(009).
ENDIF.
sl = sl + 6.
IF p_cofile+sl(1) NE '.'.
MESSAGE e001(00) WITH 'Invalid co-file name format. File name format must be KNNNNNNN.SSS'(009).
ENDIF.
sl = sl - 7.
CLEAR datafiles.
l_datafile = p_cofile.
l_datafile+sl(1) = 'R'.
file = l_datafile.
IF cl_gui_frontend_services=>file_exist( file = file ) = 'X'.

ADD 1 TO datafiles.

ENDIF.

l_datafile+sl(1) = 'D'.

file = l_datafile.

IF cl_gui_frontend_services=>file_exist( file = file ) = 'X'.

ADD 1 TO datafiles.

ENDIF.

sl = sl + 8.

request = p_cofile+sl(3).

sl = sl - 8.

CONCATENATE request p_cofile+sl(7) INTO request.

TRANSLATE request TO UPPER CASE.

IF datafiles = 0.

MESSAGE e398(00)

WITH 'Corresponding data-files of transport request'(010)

request

'not found.'(011).

ELSE.

MESSAGE s398(00)

WITH datafiles

'data-files have been found for transport request'(012)

request.

ENDIF.

START-OF-SELECTION.

DATA:

parameter TYPE spar,

parameters TYPE TABLE OF spar.

CALL FUNCTION 'RSPO_R_SAPGPARAM'

EXPORTING

name = 'DIR_TRANS'

IMPORTING

value = transdir

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

filename = p_cofile+sl(11).

TRANSLATE filename TO UPPER CASE.

CONCATENATE transdir 'cofiles' filename

INTO filename

SEPARATED BY p_sepr.

OPEN DATASET filename FOR INPUT IN BINARY MODE.

ret = sy-subrc.

CLOSE DATASET filename.

IF NOT ret = 0.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

text_question = 'Copy all files?'(a03)

IMPORTING

answer = ans

EXCEPTIONS

text_not_found = 1

OTHERS = 2.

ELSE.

parameter-param = 'FILE'.

parameter-value = filename.

APPEND parameter TO parameters.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

text_question = 'File ''&FILE&'' already exists. Rewrite?'(a04)

IMPORTING

answer = ans

TABLES

parameter = parameters

EXCEPTIONS

text_not_found = 1

OTHERS = 2.

ENDIF.

CHECK ans = '1'.

trfile = p_cofile+sl(11).

TRANSLATE trfile TO UPPER CASE.

PERFORM copy_file USING 'cofiles' trfile p_cofile.

trfile(1) = 'R'.

l_datafile+sl(1) = 'R'.

PERFORM copy_file USING 'data' trfile l_datafile.

IF datafiles > 1.

trfile(1) = 'D'.

l_datafile+sl(1) = 'D'.

PERFORM copy_file USING 'data' trfile l_datafile.

ENDIF.

IF p_addque = 'X'.

system = sy-sysid.

DO 1 TIMES.

* Check authority to add request to the import queue

CALL FUNCTION 'TR_AUTHORITY_CHECK_ADMIN'

EXPORTING

iv_adminfunction = 'TADD'

EXCEPTIONS

e_no_authority = 1

e_invalid_user = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

EXIT.

ENDIF.

CALL FUNCTION 'TMS_UI_APPEND_TR_REQUEST'

EXPORTING

iv_system = system

iv_request = request

iv_expert_mode = 'X'

iv_ctc_active = 'X'

EXCEPTIONS

cancelled_by_user = 1

append_request_failed = 2

OTHERS = 3.

CHECK sy-subrc = 0.

CALL FUNCTION 'TMS_MGR_READ_TRANSPORT_REQUEST'

EXPORTING

iv_request = request

iv_target_system = system

IMPORTING

et_request_infos = et_request_infos

EXCEPTIONS

read_config_failed = 1

table_of_requests_is_empty = 2

system_not_available = 3

OTHERS = 4.

CLEAR request_info.

READ TABLE et_request_infos INTO request_info INDEX 1.

IF request_info-e070-korrdev = 'CUST'

AND NOT p_tarcli IS INITIAL.

CALL FUNCTION 'TMS_MGR_MAINTAIN_TR_QUEUE'

EXPORTING

iv_command = gc_tp_fillclient

iv_system = system

iv_request = request

iv_tarcli = p_tarcli

iv_monitor = 'X'

iv_verbose = 'X'

IMPORTING

et_tp_maintains = lt_tp_maintain

EXCEPTIONS

read_config_failed = 1

table_of_requests_is_empty = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

EXIT.

ENDIF.

ENDIF.

* Check authority to start request import

CALL FUNCTION 'TR_AUTHORITY_CHECK_ADMIN'

EXPORTING

iv_adminfunction = 'IMPS'

EXCEPTIONS

e_no_authority = 1

e_invalid_user = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

EXIT.

ENDIF.

CALL FUNCTION 'TMS_UI_IMPORT_TR_REQUEST'

EXPORTING

iv_system = system

iv_request = request

iv_tarcli = p_tarcli

iv_some_active = space

EXCEPTIONS

cancelled_by_user = 1

import_request_denied = 2

import_request_failed = 3

OTHERS = 4.

ENDDO.

ENDIF.

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

*& Form copy_file

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

* text

*---------------------------------------------------------------------*

* -->SUBDIR text

* -->FNAME text

* -->SOURCE_FILEtext

*---------------------------------------------------------------------*

FORM copy_file USING subdir fname source_file.

DATA: l_filename TYPE string.

l_filename = source_file.

CONCATENATE transdir subdir fname

INTO filename

SEPARATED BY p_sepr.

REFRESH datatab.

CLEAR flen.

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

filename = l_filename

filetype = 'BIN'

IMPORTING

filelength = flen

CHANGING

data_tab = datatab[]

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

not_supported_by_gui = 17

error_no_gui = 18

OTHERS = 19.

IF sy-subrc NE 0.

WRITE: / 'Error uploading file'(003), l_filename.

EXIT.

ENDIF.

CALL FUNCTION 'AUTHORITY_CHECK_DATASET'

EXPORTING

activity = sabc_act_write

filename = filename

EXCEPTIONS

no_authority = 1

activity_unknown = 2

OTHERS = 3.

IF sy-subrc <> 0.

FORMAT COLOR COL_NEGATIVE.

WRITE: / 'Write access denied. File'(013), filename.

FORMAT COLOR OFF.

EXIT.

ENDIF.

OPEN DATASET filename FOR OUTPUT IN BINARY MODE.

IF sy-subrc NE 0.

WRITE: / 'File open error'(004), trfile.

EXIT.

ENDIF.

LOOP AT datatab.

IF flen < 8192.

len = flen.

ELSE.

len = 8192.

ENDIF.

TRANSFER datatab-buf TO filename LENGTH len.

flen = flen - len.

ENDLOOP.

CLOSE DATASET filename.

WRITE: / 'File'(005), trfile, 'uploaded'(007).

ENDFORM. "copy_file

Blog Archive