Вы находитесь на странице: 1из 54

What is SAP

SAP stands for Systeme, Anwendungen, Produkte in der Datenverarbeitung or in english '
Systems, Applications, and Products in Data Processing'.
SAP is the leading Enterprise Information and Management Package worldwide. Use of this
package makes it possible to track and manage, in real-time, sales, production, finance
accounting and human resources in an enterprise.
SAP is the third-largest software company in the world. Founded in 1972, The company now
employs more than 22,000 people in more than 50 countries. SAP global headquarters are
located in Walldorf, Germany, and the company is listed on several stock exchanges, including
the Frankfurt DAX and the New York Stock Exchange, under the symbol "SAP."
SAP America is a subsidiary of SAP AG, the recognized leader in providing collaborative, interenterprise software and e-business solutions. A truly global software provider, SAP AG has more
than 1000 partners, 22 industry solutions and 10 million users at 30,000 installations around the
world. SAP America has contributed significantly to this leadership position, and it is the foremost
provider of e-business and enterprise software in the United States.

Why use SAP ?


SAP software was developed to be modular, scaleable, open and flexible, allowing companies to
tailor it specifically to their needs. SAP calls this approach to implementing software "configure to
order" because each implementation will be different according to each customer's needs.
But SAP solutions don't stop there. Information integration is a major tenet of the SAP philosophy,
and SAP places great emphasis on the creation of tools that facilitate it. SAP provides integration
tools and methods for linking legacy and distributed systems as well as a host of third party
software solutions, to get your information into the right hands, internally and externally.
Solution from Traditional approach
Traditional Information technology systems used by many business today have been developed
to accomplish some specific task and provide reports and analysis of events that have already
taken place. Examples are accounting general ledger systems. Occasionally, some systems
operate in a "real-time" mode that is, have up to date information in them and can be used to
actually control events. A typical company has many separate systems to manage different
processes like production, sales and accounting. Each of these systems has its own databases
and seldom passes information to other systems in a timely manner.
SAP takes a different approach. There is only one information system in an enterprise, SAP. All
applications access common data. Real events in the business initiate transactions. Accounting is
done automatically by events in sales and production. Sales can see when products can be
delivered. Production schedules are driven by sales. The whole system is designed to be realtime and not historical.
SAP structure embodies what are considered the "best business practices". A company
implementing SAP adapts it operations to it to achieve its efficiencies and power.
The process of adapting procedures to the SAP model involves "Business Process Reengineering" which is a logical analysis of the events and relationships that exist in an
enterprise's operations.
Multiple country implementation

Comprehensive multi-currency translation

Multiple language support


Customized reporting and document generation for individual countries
Multi-company support
Local support in most major industrialized countries
Country specific functionality

Flexibility

Customers can customize business modules to realize best business practices


System provides necessary interfaces to incorporate external software.
Scalability, accommodates acquisitions and growth
System can be configured the way you want to do business in the future
Allows customized screens processing and reports
System runs on multiple hardware platforms

Enterprise-Wide Integration
Enterprise-wide integration is the main functionality of SAP R/3 System. No other application
software offers the breadth of open systems, client/server functionality, functional links between
processes that multiply the power of each person's work. The R/3 System's components are fully
integrated. Once you enter data, it resides in the central database shared by all R/3 components.
Transaction-related process chains trigger the next activity as needed from engineering to
production planning to sales and distribution. The R/3 System's full integration pulls your
enterprise together, promoting data access, flexibility, and productivity.
Real-Time Information
SAP provides up-to-the-minute, real-time information.

Architecture
SAP R/3 system is based on Client/Server architecture that is comprised of three tiers:
Presentation server: Your local PC that has SAPGUI.
Application server: The application server is used to run the business application programs in
the R/3 client/server concept. The application modules are loaded from the data base server to
the application server as required. Thus the application server requires only storage capacity to
accommodate UNIX, Swapping and the SAP runtime environment.
Database server: The data base server stores the SAP application programs and data in the R/3
client/server concept. It also handles the SAP update program and batch jobs.
SAP Application Modules
SAP has several layers. The Basis System is the heart of the data operations and should be not
evident to higher level or managerial users. Other customizing and implementation tools exist
also. The heart of the system from a managers viewpoint is the application modules. These
modules may not all be implemented in a typical company but they are all related and are listed
below:
FI
CO
AM
PS

Financial Accounting
Controlling
Asset Management
Project System

WF
Workflow
IS
Industry Solutions
HR
Human Resources
PM
PlantMaintenance
MM
Materials Management
QM
Quality Management
PP
Production Planning
SD
Sales and Distribution
Financial Accounting -- is designed for automated management and external reporting of
general ledger, accounts receivable, accounts payable and other sub-ledger accounts with a
user defined chart of accounts. As entries are made relating to sales production and payments
journal entries are automatically posted. This connection means that the "books" are designed
to reflect the real situation.
Controlling -- represents the company's flow of cost and revenue. It is a management
instrument for organizational decisions. It too is automatically updated as events occur.
Asset Management--is designed to manage and supervise individual aspects of fixed assets
including purchase and sale of assets, depreciation and investment management.
Project System -- is designed to support the planning, control and monitoring of long-term,
highly complex projects with defined goals.
Workflow -- links the integrated SAP application modules with cross-application technologies,
tools and services
Industry Solutions -- combines the SAP application modules and additional industry-specific
functionality. Special techniques have been developed for industries such as banking, oil and
gas, pharmaceuticals, etc.
Human Resources -- is a complete integrated system for supporting the planning and control
of personnel activities.
Plant Maintenance--In a complex manufacturing process maintenance means more than
sweeping the floors. Equipment must be services and rebuilt. These tasks affect the production
plans.
Materials Management--supports the procurement and inventory functions occurring in dayto-day business operations such as purchasing, inventory management, reorder point
processing, etc.
Quality Management--is a quality control and information system supporting quality planning,
inspection, and control for manufacturing and procurement.
Production Planning--is used to plan and control the manufacturing activities of a company.
This module includes; bills of material, routings, work centers, sales and operations planning,
master production scheduling, material requirements planning, shop floor control, production
orders, product costing, etc
Sales and Distribution--helps to optimize all the tasks and activities carried out in sales,
delivery and billing. Key elements are; pre-sales support, inquiry processing, quotation
processing, sales order processing, delivery processing, billing and sales information system.

SAP Hardware Platforms


The SAP R/2 system that was released in 1979 runs on mainframes like IBM, BS 2000 ( Seimens
machines ) or Amdahl. The next version, SAP R/3 client/server software system has been
designed for open systems like UNIX. SAP has established a partnership with IBM which
provides a wide choice of servers, operating systems and databases for implementing R/3. These
servers provide scalability, performance, high availability and investment protection needed to
support a successful R/3 implementation. Some of IBM's server and database offerings include:
RS/6000 for UNIX , AS/400 Advanced Series for integrated server and database platform, PC
servers for reliable Microsoft NT solutions, S/390 database servers and DB2 family for database
support. IBM Netfinity 7000 and IBM PC Server 330 and 704 provide the reliable foundation you
need for SAP R/3 applications for Microsoft NT. The platforms offered by IBM provide latest
Pentium Pro technology, Ultra fast throughput, Storage flexibility and upgradable system
components.
SAP R/3 runs on a variety of databases such as Oracle, Informix, Online, ADABAS-A, DB2 for
Unix, DB/400, Microsoft SQL Server 6 and on an experimental version on DB2 for MVS.
SAP R/3 is based on various hardware and software architectures. It scales very well on SMP
systems and MPP architectures. The latest version of R 4.1, which is still in the developmental
stage, provides the Internet compatible business application package.

Hardware Partners
Since there are so many different platforms available in today's market, compatibility between
SAP and the customer's platform, Hardware partners play a very important role. Hardware
partners are leading hardware vendors who provide the computing hardware necessary to meet a
customer's system requirements. Working with both SAP and customers, hardware partners
continually develop and optimize products to meet the running business applications with SAP
software. Hardware partners have developed organizations to provide strong SAP support, from
product selection to system set-up, installation and ongoing performance tuning.
Some of the hardware partners are Amdahl, IBM, Bull, NCR, Compaq, NEC, Data General,
Sequent, Dell, Tandem, Digital, Siemens Nixdorf, Fujitsu, Sun, Hewlett-Packard, Sun, Unisys,
Hitachi and Intergraph.

SAP Glossary
GUI (Graphic User Interface)
A graphical interface used by SAP environment as part of the three tiers. Also known as frontend.
IMG (Implementation Management Guide)
It is a hierarchical structure that reflects the R/3 component hierarchy and contains every
configuration activity. Released from version 3.0 onwards.
Instance
It means application server and each one has its own set of work processes.
SysID
A set of three letters or number that identify a system. Some sets are not allowed because they
are used by SAP. They are informed when the system is installed.

ITS (Internet Transaction Server)


It links the R/3 application server with one or more Web servers, thus enabling the R/3 to
communicate with the Internet.
OSS (Online Service System)
SAP's Online Service System offers fast and effective help for R/3 System problems. It is also the
basic element of communications between customers, partners, and SAP.
RFC (Remote Function Call)
A way to implement communication between application programs via Abap/4 function call.
IDoc (Intermediate Document)
An IDoc is a data container for data exchange between SAP systems or between an SAP system
and an external system.
Archiving SAPs terminology for the functionality that purges transactions and master data
from the SAP database. The SAP literature states that archived data can be restored to the
production system. For practical purposes however, this is not recommended.
DART An acronym for Data Archiving and Retention Tool. This is SAP functionality which
allows you to periodically extract and retain data from your R/3 system. The data is extracted into
a sequential file. DART provides tools for viewing the retained data in different ways.

Legal Data As used in this document, this refers to the requirements imposed by the IRS,
State tax authorities and other tax authorities for the long-term retention of business data to
support taxes paid and other legal requirements.
Operational Data As used in this document, this refers to the requests from customers,
vendors or employees for business data.
Management Data As used in this document, this refers to data that is used by
management for business decisions.

ABAP / 4
What is ABAP/4?
Advanced Business Application Programming.ABAP is SAP's fourth generation language. All of R/3's
applications and even parts of its basic system are developed in ABAP. ABAP is used for customization and
modification of SAP applications.
Tools for Abapers.
Transactions (Development and Workbench)
ABAP Keywords
ABAP System fields (Structure SYST)
ABAP Sample Report

ABAP Transactions
SAP 3.0d
Useful Dev. and Workbench Transactions

SCAM CATT Management


SCAT Computer Aided Test Tool
SE09 Workbench Organizer
SE10 Customizing Organizer
SE11 ABAP/4 Dictionary Maintenance
SE12 ABAP/4 Dictionary Display
SE13 Maintain Technical Settings (Tables)
SE14 Utilities for Dictionary Tables
SE15 ABAP/4 Repository Information System
SE16 Data Browser
SE17 General Table Display
SE30 ABAP/4 Runtime Analysis
SE32 ABAP/4 Text Element Maintenance
SE35 ABAP/4 Dialog Modules
SE36 ABAP/4: Logical Databases
SE37 ABAP/4 Function Modules
SE38 ABAP/4 Program Development
SE39 Splitscreen Editor: Program Compare
SE41 Menu Painter
SE43 Maintain Area Menu
SE51 Screen Painter
SE54 Generate View Maintenance Module
SE61 R/3 Documentation
SE62 Industry utilities
SE63 Translation
SE64 Terminology
SE65 R/3 document. short text statistics
SE66 R/3 Documentation Statistics (Test!)
SE68 Translation Administration
SE71 SAPscript layout set
SE72 SAPscript styles
SE73 SAPscript font maintenance (revised)
SE74 SAPscript format conversion
SE75 SAPscript Settings
SE76 SAPscript Translation Layout Sets
SE77 SAPscript Translation Styles
SE80 ABAP/4 Development Workbench
SE81 SAP Application Hierarchy
SE82 Customer Application Hierarchy
SE84 ABAP/4 Repository Information System
SE85 ABAP/4 Dictionary Information System
SE86 ABAP/4 Repository Information System
SE87 Data Modeler Information System
SE88 Development Coordination Info System
SE91 Maintain Messages
SE92 Maintain system log messages
SE93 Maintain Transaction Codes
SEU Object Browser
SHD0 Transaction variant maintenance

SQ00
SQ01
SQ02
SQ03
SQ07

ABAP/4
ABAP/4
ABAP/4
ABAP/4
ABAP/4

Query:
Query:
Query:
Query:
Query:

Start Queries
Maintain Queries
Maintain Funct. Areas
Maintain User Groups
Language Comparison

ABAP/4 Keywords

Keywords
, [, ], {, }
*, "
**
+, -, *, /
->, =>, ->>, ~, ?=
ABS
ACOS
ADD
ADD-CORRESPONDING
ADJACENT DUPLICATES
AND
ANY TABLE
APPEND
ASIN
ASSIGN
AT
ATAN
AUTHORITY-CHECK
AVG
BACK
BETWEEN
BINARY SEARCH
BIT-NOT
BIT-AND
BIT-OR
BIT-XOR
SET BIT
GET BIT
BLANK LINES
BREAK-POINT
C
CA
CALL
CASE
CATCH
CEIL
CENTERED
CHECK
CHECKBOX
PARAMETERS ... AS CHECKBOX
WRITE ... AS CHECKBOX
CLASS
CLASS-DATA
CLASS-METHODS
CLASS-EVENTS
CLASS-POOL
CLEAR

Description
Syntax conventions, Syntax notation
Comments
Arithm. Operator: Exponentiation
(COMPUTE)
Arithmetical operators (COMPUTE)
Operators in ABAP Objects
Mathematical function: Absolute amount
COMPUTE)
Mathematical function: Cosine arc
(COMPUTE)
Add
Field string addition
Delete duplicates from internal table
(DELETE)
Comparison operator: and
Generic table type for internal tables
Append line to internaltable
Mathematical function: Sine arc (COMPUTE)
Assign field symbol
Event, control break, field group
determination
Mathematical function: Tangent arc
Check authorization
Aggregate expression: Average (SELECT)
Positioning in list
Relational operator: Between
Binary read of internaltable (READ TABLE)
Bit calculation operator: NOT (COMPUTE)
Bit calculation operator: AND (COMPUTE)
Bit calculation operator: OR (COMPUTE)
Bit calculation operator: AND/OR
(COMPUTE)
Set bit of an X field
Read bit of an X field
Switch on blank lines in list
Stop processing in debug mode
Data type for fixed-length character string
Contains any characters -Relational operator
forstring comparison
Call external component
Begin case distinction
Exception handling (catch runtime errors)
Mathematical function: Smallest whole value
Output format: Centered(WRITE)
Check condition
Display as checkbox
on the selection screen
in a list
Definition of a class
Static attributes in classes
Static methods in classes
Static events in classes
Introduction for type Kprograms
Initialize data object

ABAP System Fields


ABAP/4 System fields
ABCDE

Constant: Alphabet (A,B,C,...)

APPLI

SAP applications

BATCH

Background active (X)

BATZD

Background SUBMIT: Daily

BATZM

Background SUBMIT: Monthly

BATZO

Background SUBMIT: Once

BATZS

Background SUBMIT: Immediately

BATZW

Background SUBMIT: Weekly

BINPT

Batch input active (X)

BREP4

Background SUBMIT: Root name of request


report

BSPLD

Background SUBMIT: List output to spool

CALLD

CALL mode active (X)

CALLR

Print: ID for print dialog function

CCURS

Rate specification/result field (CURRENCY


CONVERT)

CCURT

Table rate from currency conversion

CDATE

Date of rate from currency conversion

COLNO

Current column during list creation

CPAGE

Current page number

CPROG

Runtime: Main program

CTABL

Exchange rate table from currency


conversion

CTYPE

Exchange rate type 'M','B','G' from


CURRENCY CONVERSION

CUCOL

Cursor position (column)

CUROW

Cursor position (line)

DATAR

Flag: Data received

DATLO

Local date for user

DATUM

System: Date

DATUT

Global date related to UTC (GMT)

DAYST

Summertime active ? ('daylight saving


time')

DBCNT

Number of elements in edited dataset with


DB operations

DBNAM

Logical database for ABAP/4 program

DBSYS

System: Database system

DCSYS

System: Dialog system

DSNAM

Runtime: Name of dataset for spool output

DYNGR

Screen group of current screen

DYNNR

Number of current screen

FDAYW

Factory calendar weekday

FDPOS

Location of a string

FMKEY

Current function code menu

HOST

Host

INDEX

Number of loop passes

LANGU

SAP logon language key

LDBPG

Program: ABAP/4 database program for


SY-DBNAM

LILLI

Number of current list line

LINCT

Number of list lines

LINNO

Current line for list creation

LINSZ

Line size of list

LISEL

Interact.: Selected line

LISTI

Number of current list line

LOCDB

Local database exists

LOCOP

Local database operation

LOOPC

Number of LOOP lines at screen step loop

LSIND

Number of secondary list

LSTAT

Interact.: Status information for each list


level

MACDB

Program: Name of file for matchcode


access

MACOL

Number of columns from SET MARGIN

MANDT

Client number from SAP logon

MARKY

Current line character for MARK

MAROW

No. of lines from SET MARGIN statement

MODNO

Number of alternative modi

MSGID

Message ID

MSGLI

Interact.: Message line (line 23)

MSGNO

Message number

MSGTY

Message type (E,I.W,...)

MSGV1

Message variable

MSGV2

Message variable

MSGV3

Message variable

MSGV4

Message variable

OPSYS

System: Operating system

PAART

Print: Format

PAGCT

Page size of list from REPORT statement

PAGNO

Runtime: Current page in list

PDEST

Print: Output device

PEXPI

Print: Spool retention period

PFKEY

Runtime: Current F key status

PLIST

Print: Name of spool request (list name)

PRABT

Print: Department on cover sheet

PRBIG

Print: Selection cover sheet

PRCOP

Print: Number of copies

PRDSN

Print: Name of spool dataset

PREFX

ABAP/4 prefix for background jobs

PRIMM

Print: Print immediately

PRNEW

Print: New spool request (list)

PRREC

Print: Recipient

PRREL

Print: Delete after printing

PRTXT

Print: Text for cover sheet

REPID

Program: Name of ABAP/4 program

RTITL

Print: Report title of program to be printed

SAPRL

System: SAP Release

SCOLS

Columns on screen

SLSET

Name of selection set

SPONO

Runtime: Spool number for list output

SPONR
SROWS
STACO
STARO
STEPL
SUBRC
SUBTY
SYSID
TABIX
TCODE
TFDSN
TFILL
TIMLO
TIMUT
TITLE
TLENG
TMAXL
TNAME
TOCCU
TPAGI
TSTLO
TSTUT
TTABC
TTABI
TVAR0
TVAR1

Runtime: Spool number from TRANSFER statement


Lines on screen
Interact.: List displayed from column
Interact.: Page displayed from line
Number of LOOP line at screen step
Return value after specific ABAP/4 statements
ABAP/4: Call type for SUBMIT
System: SAP System ID
Runtime: Current line of an internal table
Session: Current transaction code
Runtime: Dataset for data extracts
Current number of entries in internal table
Local time for user
Global time related to UTC (GMT)
Title of ABAP/4 program
Line width of an internal table
Maximum number of entries in internal table (?)
Name of internal table after an access (?)
OCCURS parameter with internal tables
Flag indicating roll-out of internal table to paging area (?)
Timestamp (date and time) for user
Timestamp (date and time) related to UTC (GMT)
Number of line last read in an internal table (?)
Offset of internal table in roll area (?)
Runtime: Text variable for ABAP/4 text elements
Runtime: Text variable for ABAP/4 text elements
Usefull Tansactions List (by Prabha Jha)

OSS1

SAP Online Service System

OY19

Compare Tables

S001

ABAP Development Workbench

S002

System Administration.

SA38

Execute a program.

SCAT

Computer Aided Test Tool

SCU0

Compare Tables

SE01

Old Transport & Corrections screen

SE09

Workbench Organizer

SE10

Customizing Organizer

SE10

Customizing organizer requests for user (To release for


transport enter user name, press Enter. Select changed object
and select ReleaseSE10 New Transport & Correction screen

SE11

ABAP/4 Dictionary Maintenance SE12 ABAP/4 Dictionary Display


SE13 Maintain Technical Settings (Tables)

SE11

ABAP/4 Dictionary.

SE12

Dictionary: Initial Screen enter object name

SE13

Access tables in ABAP/4 Dictionary.

SE14

ABAP/4 Dictionary: Database Utility.

SE14

Utilities for Dictionary Tables

SE15

ABAP/4 Repository Information System

SE15

ABAP/4 Repository Information System.

SE16

Data Browser

SE16

Data Browser: Initial Screen.

SE16

Display table contents

SE17

General Table Display

SE30

ABAP/4 Runtime Analysis

SE30

ABAP/4 Runtime Analysis: Initial Screen.

ABAP/4 Sample Reports


List Program

It's the first formatted list

report zbctcb98 no standard page heading line-size 90 line-count 120.


parameters: column type i default 40.
data: num2 type i value 2.
data: counter type i value 1.
check column ge 0 and column le 40.
do.
write: /2(4) counter, 15 'example', 23(4) num2,
o

at column 'hello world' intensified off.


add 1 to counter.
check counter eq 161.
exit.
enddo.
top-of-page.
write: /2 'Page:', 8(4) sy-pagno, 40 'Third Example', 70 sy-datum.
uline.
write: /2 'Counter', 15 'Text', 23 'Number',

at column 'Introduction' intensified off.


uline.
Try out the SHOW SY command in the editor command line. The SHOW
command describes the fields of database tables, views and structures. With
the SHOW SY command you can see the fields of the SYSTEM structure.
These fields are updated at run time. In this example we used the fields sypagno and sy-datum.

Tips and Tricks for ABAP

Reporting

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.

How do I add a pushbutton on the application toolbar of report selection screen?


How do I indicate progress while executing a program?
How do I pop-up my own selection selection values for a select-option ?
How do I let user display program documentation while on a selection screen?
How do I get report program name text?
How do I protect certain field on selection screen?
How do I get the address of a company given company code?
How do I read an EXCEL file for upload. How do I download to an EXCEL file?
How do I add a selection screen parameter to get a local file name with pull down?
How do I read a file on my C:\ drive and/or a file residing on UNIX sub-directory?
How do I print standard header and footer on all pages of a report? Do you have code for
standard header & footer function module?
How do I print selection screen values on a report?
How do I show valid month and their description as the pull-down option on a month
seletion field?
What are the various ways you can make the user execute a report program
There are flat files residing on UNIX sub-directory. How can a report program list all these
files for the user to select one of them.
How do I let user to decide the format of the report?

Dialog Programming/Table Control

1.
2.
3.
4.

How do I hide a column in a table control at runtime?


How do I change attributes of an item in a screen and in a table control at runtime?
How do I go to a transaction by double clicking on a field in the screen?
How do I know that user has changed something on a dialog screen?

ABAP/4 General

1.
2.
3.
4.
5.

6.
7.
8.
9.
10.
11.

How do I send mail to a user(s) from an ABAP/4 program without using SAP Office?
How do I capture the screen sequence and values of a transaction for data transfer?
How do I copy and paste from one session to another?
How do I register a function module as RFC enabled?
One of my custom table has more than million records and I need to access only few
thousand. When I do SELECT * from Ztable WHERE code like P%, I get short dump
because the system reads the entire Ztable to specifically select the once I require.
Meanwhile the system gets time out eventually giving a short dump. How do I handle this
scenerio.
I am editing a program and get logged out by the system. The next time I login and try to
edit the same program, I get a message you are already editing this program. How can I
cancel the session which is still active before I got logged out.
What are the various ways UPDATE table will update all the records instead of one
record.
How do I download text elements of a report program?
How do you write an ABAP program to find out menu path for a particualar transaction
screen.
How can you view the entire program which will also expand all includes, function
modules, subroutines & subprograms.
How do I change value of a field in debug mode?

SAP General

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

How do I get back to SAP screens I was working on if SAP was terminated?
How do I assign a CTS number to a local private object ($TMP)?
How do I view an ABAP dump happened in the SAP system?
How do I set my user information in SAP?
How do I reset my password?
How do I kill a long running job in SAP?
How do I compare two tables between two systems?
How do I compare two versions of program?
How do I find the program name if I know the transaction code?
How do I find user exit in a standard SAP program for me to include enhancement.
I added new entries to an existing table and assigned the changes to a transport number.
If I want to transport the entire table (definition and data), what are the steps involved.
12. How do I list files residing on a Unix directory?
13. How do I view SAP settings?
Reporting
How do I add a pushbutton on the application toolbar of report selection screen?
Add the following code in appropriate events mentioned to display one button with label
'my_button' (You could have up to 5 buttons on the selection screen). Upon pressing the button,
form 'f_my_button' get executed.
tables sscrfields.

"Fields on selection screens

selection-screen function key 1. "button on the application toolbar


initialization.
* Populating button text
move 'my_button' to sscrfields-functxt_01.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_my_button.
How do I indicate progress while executing a program?
use function 'PROGRESS_INDICATOR'
How do I pop-up my own selection values for a select-option/parameters?
- Help View
- code example
How do I let user display program documentation while on a selection screen?
step 1:
Create program documentation using the Documentation option on the SE38 screen.
Documentation suggestions:
Description : Lists and describes processing steps done in the
program.
Precondition: Lists any input and processing that is necessary
before executing the program.
Select Options: List all the selection options and values expected
Output:
Lists any output from the program.
SAP function: List of sap functions used by the program.
Transactions called: List of sap transactions called in the program.
Programs called: Lists all programs called by the abap program.

step 2:
Add the following code in approprate sections/events:

tables sscrfields.

"Fields on selection screens

selection-screen function key 1. "button on the application toolbar


initialization.
* Populating button text
write icon_display_note as icon to sscrfields-functxt_01.
concatenate sscrfields-functxt_01 'Help' into sscrfields-functxt_01.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_pgm_help.
endif.
form f_pgm_help.
data: begin of help_infos.
include structure help_info.
data: end of help_infos.
data: begin of dynpselect occurs 0.
include structure dselc.
data: end of dynpselect.
data: begin of dynpvaluetab occurs 0.
include structure dval.
data: end of dynpvaluetab.
clear help_infos.
help_infos-call
= 'D'.
help_infos-spras = sy-langu.
help_infos-docuid = 'RE'.
help_infos-report = sy-repid.
help_infos-title = sy-title.
call function 'HELP_START'
exporting
help_infos = help_infos
tables
dynpselect = dynpselect
dynpvaluetab = dynpvaluetab.
endform.
" F_PGM_HELP

How do I get report program name text


Use command READ TEXT-POOL. example code
How do I protect certain field on selection screen.
(This is to make the field output only)
parameter: p_parm1(2) default 'MY'.
at selection-screen output.
loop at screen.
if screen-name = 'P_PARM1'.
screen-output = 1.
modify screen.
exit.
endif.
endloop.
How do I get the address of a company given company code.
How do I read an EXCEL file for upload. How do I download to an EXCEL file.
How do I add a selection screen parameter to get a local file name with pull down?

parameters: p_infile like ibipparms-path default 'C:\'.


* Executes the pull-down to search C:\ drive for input file
at selection-screen on value-request for p_infile.
call function 'F4_FILENAME'
"allows user to select path/file
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
field_name = 'p_infile'
importing
file_name = p_infile.
if sy-subrc ne 0.
write: / 'Error'.
endif.
How do I read a file on my C:\ drive and/or a file residing on UNIX sub-directory.
How do I print standard header and footer on all pages of a report? Do you have code for
standard header & footer function module?
How do I print selection screen values on a report?
How do I show valid month and their description as the pull-down option on a month seletion
field?
What are the various ways you can make the user execute a report program
There are flat files residing on UNIX sub-directory. How can a report program list all these files for
the user to select one of them.
How do I let user to decide the format of the report?
Dialog Programming/Table Control
How do I hide a column in a table control at runtime? (by Manoj Nair)
1. define group name(s) for the columns to be hidden
2. Add the following code...
(define)
controls tbl_ctrl type tableview ...
wa like tbl_ctrl-cols.
loop at tbl_ctrl-cols into wa.
if wa-screen-group1 = <group defined for the column>
wa-invisible = 1.
modify tbl_ctrl-cols from wa
endif
endloop
How do I change attributes of an item in a screen and in a table control at runtime?
add the following code in PBO
loop at screen.
if screen-name = 'NAME_OF_FIELD_HERE_IN_CAPS'.
set attributes of screen such as REQUIRED, INPUT, OUTPUT, INTENSIFIED, INVISIBLE,
ACTIVE, DISPLAY_3D, VALUE_HELP to 1(ON) or 0(OFF)
e.g. screen-output = 1.
modify screen.
endif.
endloop
if the field is part of a table control, put the above code within the the loop...endloop of the table
control in PBO

How do I go to a transaction by double clicking on a field in the screen?


Define ok_code for function key <F2>
In Screen PAI when ok_code has the value defined (user has double clicked on the screen)
method 1: if parameter id is available for the field(s) to be populated
set parameter id 'XXX' field field_name_on_screen
call transaction 'TCODE' and skip first screen.
method 2:
1. fill bdc_table (data bdc_table like bdcdata occurs 0 with header line.) with screen info
2. use command
call transaction 'XK03' using bdc_table ...
How do I know that user has changed something on a dialog screen?
Check sy-datar, It is 'X' when there was a change
SAP General
How do I get back to SAP screens I was working on if SAP was terminated?
When you log back in, after entering appropriate values, select User->Copy session (instead on
pressing 'Enter')
How do I assign a CTS number of a local private object ($TMP)?
Run tcode SE80
Select 'Local priv objects' and click on 'Display'.
Select the item you want to reassign and click on it
Now select Development Object->Reassign or (Ctrl + F7)
How do I view an ABAP dump happened in the SAP system?
Use path
Tools->Administration->Monitoring->Dump Analysis
How do I set my user information in SAP?
Run transaction code SU51 or (System->User profile->User address)
How do I reset my password?
You can reset your own password at anytime (but not more than once a day) if you know the
current password. Passwords must be at least 6 characters and can not contain the first letters
of your user id.
1. At the SAP R/3 logon screen enter your user-id and current password.
2. Click the New password button.
3. The SAP R/3 new password dialog box will be displayed.
4. Type the password you wish to have in the New password field.
5. Repeat typing the same password in the Repeat password field.
6. Click the Confirm button
How do I kill a long running job in SAP?
.a.Open a new SAP session.
b.In the new session, from the SAP R/3 screen, follow
the menu path:
Tools>>Administration
(new screen) Monitoring >>System monitoring>>User overview
Fastpath:
/nsm04
Result: the "Overview of Users" screen appears. This is a list of the jobs currently
running.
c.Find your username in the list and click on it

d.Click on the Sessions button .


Result: the Overview of Sessions screen appears.
e.Click on the End session button .
How do I compare two tables between two systems?
The contents of a table between two systems can be checked through the transaction OY19
How do I view SAP settings?
Use transaction code SE38
Enter Program name RSPARAM and execute
ABAP/4 General
How do I send mail to a user(s) from an ABAP/4 program without using SAP Office?
Use, So_object_send function module.
How do I capture the screen sequence and values of a transaction for data transfer?
Use transaction 'SHDB' to record any SAP transaction.
How do I copy and paste from one session to another?

1. Click on the area and press CTRL+Y. Using your mouse highlite the are and press
CTRL+C. Go do desired targer location; insert necessary number of blank lines and
press CTRL+V to paste.
2. Use xx to mark and copy. Use x to paste......
How do I register a function module as RFC enabled?
In the function module Administration screen (transaction code SE37), set the field REMOTE
CALL.
Reporting

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.

How do I add a pushbutton on the application toolbar of report selection screen?


How do I indicate progress while executing a program?
How do I pop-up my own selection selection values for a select-option ?
How do I let user display program documentation while on a selection screen?
How do I get report program name text?
How do I protect certain field on selection screen?
How do I get the address of a company given company code?
How do I read an EXCEL file for upload. How do I download to an EXCEL file?
How do I add a selection screen parameter to get a local file name with pull down?
How do I read a file on my C:\ drive and/or a file residing on UNIX sub-directory?
How do I print standard header and footer on all pages of a report? Do you have code for
standard header & footer function module?
How do I print selection screen values on a report?
How do I show valid month and their description as the pull-down option on a month
seletion field?
What are the various ways you can make the user execute a report program
There are flat files residing on UNIX sub-directory. How can a report program list all these
files for the user to select one of them.
How do I let user to decide the format of the report?

Dialog Programming/Table Control

1.
2.
3.
4.

How do I hide a column in a table control at runtime?


How do I change attributes of an item in a screen and in a table control at runtime?
How do I go to a transaction by double clicking on a field in the screen?
How do I know that user has changed something on a dialog screen?

ABAP/4 General

1.
2.
3.
4.
5.

6.
7.
8.
9.
10.
11.

How do I send mail to a user(s) from an ABAP/4 program without using SAP Office?
How do I capture the screen sequence and values of a transaction for data transfer?
How do I copy and paste from one session to another?
How do I register a function module as RFC enabled?
One of my custom table has more than million records and I need to access only few
thousand. When I do SELECT * from Ztable WHERE code like P%, I get short dump
because the system reads the entire Ztable to specifically select the once I require.
Meanwhile the system gets time out eventually giving a short dump. How do I handle this
scenerio.
I am editing a program and get logged out by the system. The next time I login and try to
edit the same program, I get a message you are already editing this program. How can I
cancel the session which is still active before I got logged out.
What are the various ways UPDATE table will update all the records instead of one
record.
How do I download text elements of a report program?
How do you write an ABAP program to find out menu path for a particualar transaction
screen.
How can you view the entire program which will also expand all includes, function
modules, subroutines & subprograms.
How do I change value of a field in debug mode?

SAP General

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

How do I get back to SAP screens I was working on if SAP was terminated?
How do I assign a CTS number to a local private object ($TMP)?
How do I view an ABAP dump happened in the SAP system?
How do I set my user information in SAP?
How do I reset my password?
How do I kill a long running job in SAP?
How do I compare two tables between two systems?
How do I compare two versions of program?
How do I find the program name if I know the transaction code?
How do I find user exit in a standard SAP program for me to include enhancement.
I added new entries to an existing table and assigned the changes to a transport number.
If I want to transport the entire table (definition and data), what are the steps involved.
12. How do I list files residing on a Unix directory?
13. How do I view SAP settings?
Reporting
How do I add a pushbutton on the application toolbar of report selection screen?
Add the following code in appropriate events mentioned to display one button with label
'my_button' (You could have up to 5 buttons on the selection screen). Upon pressing the button,
form 'f_my_button' get executed.
tables sscrfields.

"Fields on selection screens

selection-screen function key 1. "button on the application toolbar

initialization.
* Populating button text
move 'my_button' to sscrfields-functxt_01.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_my_button.
How do I indicate progress while executing a program?
use function 'PROGRESS_INDICATOR'
How do I pop-up my own selection values for a select-option/parameters?
- Help View
- code example
How do I let user display program documentation while on a selection screen?
step 1:
Create program documentation using the Documentation option on the SE38 screen.
Documentation suggestions:
Description : Lists and describes processing steps done in the
program.
Precondition: Lists any input and processing that is necessary
before executing the program.
Select Options: List all the selection options and values expected
Output:
Lists any output from the program.
SAP function: List of sap functions used by the program.
Transactions called: List of sap transactions called in the program.
Programs called: Lists all programs called by the abap program.
step 2:
Add the following code in approprate sections/events:
tables sscrfields.

"Fields on selection screens

selection-screen function key 1. "button on the application toolbar


initialization.
* Populating button text
write icon_display_note as icon to sscrfields-functxt_01.
concatenate sscrfields-functxt_01 'Help' into sscrfields-functxt_01.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_pgm_help.
endif.
form f_pgm_help.
data: begin of help_infos.
include structure help_info.
data: end of help_infos.
data: begin of dynpselect occurs 0.
include structure dselc.
data: end of dynpselect.
data: begin of dynpvaluetab occurs 0.
include structure dval.
data: end of dynpvaluetab.
clear help_infos.
help_infos-call
= 'D'.
help_infos-spras = sy-langu.
help_infos-docuid = 'RE'.
help_infos-report = sy-repid.

help_infos-title = sy-title.
call function 'HELP_START'
exporting
help_infos = help_infos
tables
dynpselect = dynpselect
dynpvaluetab = dynpvaluetab.
endform.
" F_PGM_HELP

How do I get report program name text


Use command READ TEXT-POOL. example code
How do I protect certain field on selection screen.
(This is to make the field output only)
parameter: p_parm1(2) default 'MY'.
at selection-screen output.
loop at screen.
if screen-name = 'P_PARM1'.
screen-output = 1.
modify screen.
exit.
endif.
endloop.
How do I get the address of a company given company code.
How do I read an EXCEL file for upload. How do I download to an EXCEL file.
How do I add a selection screen parameter to get a local file name with pull down?
parameters: p_infile like ibipparms-path default 'C:\'.
* Executes the pull-down to search C:\ drive for input file
at selection-screen on value-request for p_infile.
call function 'F4_FILENAME'
"allows user to select path/file
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
field_name = 'p_infile'
importing
file_name = p_infile.
if sy-subrc ne 0.
write: / 'Error'.
endif.
How do I read a file on my C:\ drive and/or a file residing on UNIX sub-directory.
How do I print standard header and footer on all pages of a report? Do you have code for
standard header & footer function module?
How do I print selection screen values on a report?
How do I show valid month and their description as the pull-down option on a month seletion
field?
What are the various ways you can make the user execute a report program
There are flat files residing on UNIX sub-directory. How can a report program list all these files for
the user to select one of them.
How do I let user to decide the format of the report?
Dialog Programming/Table Control
How do I hide a column in a table control at runtime? (by Manoj Nair)

1. define group name(s) for the columns to be hidden


2. Add the following code...
(define)
controls tbl_ctrl type tableview ...
wa like tbl_ctrl-cols.
loop at tbl_ctrl-cols into wa.
if wa-screen-group1 = <group defined for the column>
wa-invisible = 1.
modify tbl_ctrl-cols from wa
endif
endloop
How do I change attributes of an item in a screen and in a table control at runtime?
add the following code in PBO
loop at screen.
if screen-name = 'NAME_OF_FIELD_HERE_IN_CAPS'.
set attributes of screen such as REQUIRED, INPUT, OUTPUT, INTENSIFIED, INVISIBLE,
ACTIVE, DISPLAY_3D, VALUE_HELP to 1(ON) or 0(OFF)
e.g. screen-output = 1.
modify screen.
endif.
endloop
if the field is part of a table control, put the above code within the the loop...endloop of the table
control in PBO
How do I go to a transaction by double clicking on a field in the screen?
Define ok_code for function key <F2>
In Screen PAI when ok_code has the value defined (user has double clicked on the screen)
method 1: if parameter id is available for the field(s) to be populated
set parameter id 'XXX' field field_name_on_screen
call transaction 'TCODE' and skip first screen.
method 2:
1. fill bdc_table (data bdc_table like bdcdata occurs 0 with header line.) with screen info
2. use command
call transaction 'XK03' using bdc_table ...
How do I know that user has changed something on a dialog screen?
Check sy-datar, It is 'X' when there was a change
SAP General
How do I get back to SAP screens I was working on if SAP was terminated?
When you log back in, after entering appropriate values, select User->Copy session (instead on
pressing 'Enter')
How do I assign a CTS number of a local private object ($TMP)?
Run tcode SE80
Select 'Local priv objects' and click on 'Display'.
Select the item you want to reassign and click on it
Now select Development Object->Reassign or (Ctrl + F7)

How do I view an ABAP dump happened in the SAP system?


Use path
Tools->Administration->Monitoring->Dump Analysis
How do I set my user information in SAP?
Run transaction code SU51 or (System->User profile->User address)
How do I reset my password?
You can reset your own password at anytime (but not more than once a day) if you know the
current password. Passwords must be at least 6 characters and can not contain the first letters
of your user id.
1. At the SAP R/3 logon screen enter your user-id and current password.
2. Click the New password button.
3. The SAP R/3 new password dialog box will be displayed.
4. Type the password you wish to have in the New password field.
5. Repeat typing the same password in the Repeat password field.
6. Click the Confirm button
How do I kill a long running job in SAP?
.a.Open a new SAP session.
b.In the new session, from the SAP R/3 screen, follow
the menu path:
Tools>>Administration
(new screen) Monitoring >>System monitoring>>User overview
Fastpath:
/nsm04
Result: the "Overview of Users" screen appears. This is a list of the jobs currently
running.
c.Find your username in the list and click on it
d.Click on the Sessions button .
Result: the Overview of Sessions screen appears.
e.Click on the End session button .
How do I compare two tables between two systems?
The contents of a table between two systems can be checked through the transaction OY19
How do I view SAP settings?
Use transaction code SE38
Enter Program name RSPARAM and execute
ABAP/4 General
How do I send mail to a user(s) from an ABAP/4 program without using SAP Office?
Use, So_object_send function module.
How do I capture the screen sequence and values of a transaction for data transfer?
Use transaction 'SHDB' to record any SAP transaction.
How do I copy and paste from one session to another?

1. Click on the area and press CTRL+Y. Using your mouse highlite the are and press
CTRL+C. Go do desired targer location; insert necessary number of blank lines and
press CTRL+V to paste.
2. Use xx to mark and copy. Use x to paste......

How do I register a function module as RFC enabled?


In the function module Administration screen (transaction code SE37), set the field REMOTE
CALL.
Dialog Programming/Table Control

1.
2.
3.
4.

How do I hide a column in a table control at runtime?


How do I change attributes of an item in a screen and in a table control at runtime?
How do I go to a transaction by double clicking on a field in the screen?
How do I know that user has changed something on a dialog screen?

ABAP/4 General

1.
2.
3.
4.
5.

6.
7.
8.
9.
10.
11.

How do I send mail to a user(s) from an ABAP/4 program without using SAP Office?
How do I capture the screen sequence and values of a transaction for data transfer?
How do I copy and paste from one session to another?
How do I register a function module as RFC enabled?
One of my custom table has more than million records and I need to access only few
thousand. When I do SELECT * from Ztable WHERE code like P%, I get short dump
because the system reads the entire Ztable to specifically select the once I require.
Meanwhile the system gets time out eventually giving a short dump. How do I handle this
scenerio.
I am editing a program and get logged out by the system. The next time I login and try to
edit the same program, I get a message you are already editing this program. How can I
cancel the session which is still active before I got logged out.
What are the various ways UPDATE table will update all the records instead of one
record.
How do I download text elements of a report program?
How do you write an ABAP program to find out menu path for a particualar transaction
screen.
How can you view the entire program which will also expand all includes, function
modules, subroutines & subprograms.
How do I change value of a field in debug mode?

SAP General

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

How do I get back to SAP screens I was working on if SAP was terminated?
How do I assign a CTS number to a local private object ($TMP)?
How do I view an ABAP dump happened in the SAP system?
How do I set my user information in SAP?
How do I reset my password?
How do I kill a long running job in SAP?
How do I compare two tables between two systems?
How do I compare two versions of program?
How do I find the program name if I know the transaction code?
How do I find user exit in a standard SAP program for me to include enhancement.
I added new entries to an existing table and assigned the changes to a transport number.
If I want to transport the entire table (definition and data), what are the steps involved.
12. How do I list files residing on a Unix directory?
13. How do I view SAP settings?
Reporting
How do I add a pushbutton on the application toolbar of report selection screen?
Add the following code in appropriate events mentioned to display one button with label
'my_button' (You could have up to 5 buttons on the selection screen). Upon pressing the button,
form 'f_my_button' get executed.

tables sscrfields.

"Fields on selection screens

selection-screen function key 1. "button on the application toolbar


initialization.
* Populating button text
move 'my_button' to sscrfields-functxt_01.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_my_button.
How do I indicate progress while executing a program?
use function 'PROGRESS_INDICATOR'
How do I pop-up my own selection values for a select-option/parameters?
- Help View
- code example
How do I let user display program documentation while on a selection screen?
step 1:
Create program documentation using the Documentation option on the SE38 screen.
Documentation suggestions:
Description : Lists and describes processing steps done in the
program.
Precondition: Lists any input and processing that is necessary
before executing the program.
Select Options: List all the selection options and values expected
Output:
Lists any output from the program.
SAP function: List of sap functions used by the program.
Transactions called: List of sap transactions called in the program.
Programs called: Lists all programs called by the abap program.
step 2:
Add the following code in approprate sections/events:
tables sscrfields.

"Fields on selection screens

selection-screen function key 1. "button on the application toolbar


initialization.
* Populating button text
write icon_display_note as icon to sscrfields-functxt_01.
concatenate sscrfields-functxt_01 'Help' into sscrfields-functxt_01.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_pgm_help.
endif.
form f_pgm_help.
data: begin of help_infos.
include structure help_info.
data: end of help_infos.
data: begin of dynpselect occurs 0.
include structure dselc.
data: end of dynpselect.
data: begin of dynpvaluetab occurs 0.
include structure dval.
data: end of dynpvaluetab.

clear help_infos.
help_infos-call
= 'D'.
help_infos-spras = sy-langu.
help_infos-docuid = 'RE'.
help_infos-report = sy-repid.
help_infos-title = sy-title.
call function 'HELP_START'
exporting
help_infos = help_infos
tables
dynpselect = dynpselect
dynpvaluetab = dynpvaluetab.
endform.
" F_PGM_HELP

How do I get report program name text


Use command READ TEXT-POOL. example code
How do I protect certain field on selection screen.
(This is to make the field output only)
parameter: p_parm1(2) default 'MY'.
at selection-screen output.
loop at screen.
if screen-name = 'P_PARM1'.
screen-output = 1.
modify screen.
exit.
endif.
endloop.
How do I get the address of a company given company code.
How do I read an EXCEL file for upload. How do I download to an EXCEL file.
How do I add a selection screen parameter to get a local file name with pull down?
parameters: p_infile like ibipparms-path default 'C:\'.
* Executes the pull-down to search C:\ drive for input file
at selection-screen on value-request for p_infile.
call function 'F4_FILENAME'
"allows user to select path/file
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
field_name = 'p_infile'
importing
file_name = p_infile.
if sy-subrc ne 0.
write: / 'Error'.
endif.
How do I read a file on my C:\ drive and/or a file residing on UNIX sub-directory.
How do I print standard header and footer on all pages of a report? Do you have code for
standard header & footer function module?
How do I print selection screen values on a report?
How do I show valid month and their description as the pull-down option on a month seletion
field?
What are the various ways you can make the user execute a report program
There are flat files residing on UNIX sub-directory. How can a report program list all these files for

the user to select one of them.


How do I let user to decide the format of the report?
Dialog Programming/Table Control
How do I hide a column in a table control at runtime? (by Manoj Nair)
1. define group name(s) for the columns to be hidden
2. Add the following code...
(define)
controls tbl_ctrl type tableview ...
wa like tbl_ctrl-cols.
loop at tbl_ctrl-cols into wa.
if wa-screen-group1 = <group defined for the column>
wa-invisible = 1.
modify tbl_ctrl-cols from wa
endif
endloop
How do I change attributes of an item in a screen and in a table control at runtime?
add the following code in PBO
loop at screen.
if screen-name = 'NAME_OF_FIELD_HERE_IN_CAPS'.
set attributes of screen such as REQUIRED, INPUT, OUTPUT, INTENSIFIED, INVISIBLE,
ACTIVE, DISPLAY_3D, VALUE_HELP to 1(ON) or 0(OFF)
e.g. screen-output = 1.
modify screen.
endif.
endloop
if the field is part of a table control, put the above code within the the loop...endloop of the table
control in PBO
How do I go to a transaction by double clicking on a field in the screen?
Define ok_code for function key <F2>
In Screen PAI when ok_code has the value defined (user has double clicked on the screen)
method 1: if parameter id is available for the field(s) to be populated
set parameter id 'XXX' field field_name_on_screen
call transaction 'TCODE' and skip first screen.
method 2:
1. fill bdc_table (data bdc_table like bdcdata occurs 0 with header line.) with screen info
2. use command
call transaction 'XK03' using bdc_table ...
How do I know that user has changed something on a dialog screen?
Check sy-datar, It is 'X' when there was a change
SAP General
How do I get back to SAP screens I was working on if SAP was terminated?
When you log back in, after entering appropriate values, select User->Copy session (instead on
pressing 'Enter')
How do I assign a CTS number of a local private object ($TMP)?
Run tcode SE80
Select 'Local priv objects' and click on 'Display'.

Select the item you want to reassign and click on it


Now select Development Object->Reassign or (Ctrl + F7)
How do I view an ABAP dump happened in the SAP system?
Use path
Tools->Administration->Monitoring->Dump Analysis
How do I set my user information in SAP?
Run transaction code SU51 or (System->User profile->User address)
How do I reset my password?
You can reset your own password at anytime (but not more than once a day) if you know the
current password. Passwords must be at least 6 characters and can not contain the first letters
of your user id.
1. At the SAP R/3 logon screen enter your user-id and current password.
2. Click the New password button.
3. The SAP R/3 new password dialog box will be displayed.
4. Type the password you wish to have in the New password field.
5. Repeat typing the same password in the Repeat password field.
6. Click the Confirm button
How do I kill a long running job in SAP?
.a.Open a new SAP session.
b.In the new session, from the SAP R/3 screen, follow
the menu path:
Tools>>Administration
(new screen) Monitoring >>System monitoring>>User overview
Fastpath:
/nsm04
Result: the "Overview of Users" screen appears. This is a list of the jobs currently
running.
c.Find your username in the list and click on it
d.Click on the Sessions button .
Result: the Overview of Sessions screen appears.
e.Click on the End session button .
How do I compare two tables between two systems?
The contents of a table between two systems can be checked through the transaction OY19
How do I view SAP settings?
Use transaction code SE38
Enter Program name RSPARAM and execute
ABAP/4 General
How do I send mail to a user(s) from an ABAP/4 program without using SAP Office?
Use, So_object_send function module.
How do I capture the screen sequence and values of a transaction for data transfer?
Use transaction 'SHDB' to record any SAP transaction.
How do I copy and paste from one session to another?

1. Click on the area and press CTRL+Y. Using your mouse highlite the are and press
CTRL+C. Go do desired targer location; insert necessary number of blank lines and
press CTRL+V to paste.

2. Use xx to mark and copy. Use x to paste......


How do I register a function module as RFC enabled?
In the function module Administration screen (transaction code SE37), set the field REMOTE
CALL.
SAP General

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

How do I get back to SAP screens I was working on if SAP was terminated?
How do I assign a CTS number to a local private object ($TMP)?
How do I view an ABAP dump happened in the SAP system?
How do I set my user information in SAP?
How do I reset my password?
How do I kill a long running job in SAP?
How do I compare two tables between two systems?
How do I compare two versions of program?
How do I find the program name if I know the transaction code?
How do I find user exit in a standard SAP program for me to include enhancement.
I added new entries to an existing table and assigned the changes to a transport number.
If I want to transport the entire table (definition and data), what are the steps involved.
12. How do I list files residing on a Unix directory?
13. How do I view SAP settings?
Reporting
How do I add a pushbutton on the application toolbar of report selection screen?
Add the following code in appropriate events mentioned to display one button with label
'my_button' (You could have up to 5 buttons on the selection screen). Upon pressing the button,
form 'f_my_button' get executed.
tables sscrfields.

"Fields on selection screens

selection-screen function key 1. "button on the application toolbar


initialization.
* Populating button text
move 'my_button' to sscrfields-functxt_01.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_my_button.
How do I indicate progress while executing a program?
use function 'PROGRESS_INDICATOR'
How do I pop-up my own selection values for a select-option/parameters?
- Help View
- code example
How do I let user display program documentation while on a selection screen?
step 1:
Create program documentation using the Documentation option on the SE38 screen.
Documentation suggestions:
Description : Lists and describes processing steps done in the
program.
Precondition: Lists any input and processing that is necessary
before executing the program.
Select Options: List all the selection options and values expected
Output:
Lists any output from the program.
SAP function: List of sap functions used by the program.

Transactions called: List of sap transactions called in the program.


Programs called: Lists all programs called by the abap program.
step 2:
Add the following code in approprate sections/events:
tables sscrfields.

"Fields on selection screens

selection-screen function key 1. "button on the application toolbar


initialization.
* Populating button text
write icon_display_note as icon to sscrfields-functxt_01.
concatenate sscrfields-functxt_01 'Help' into sscrfields-functxt_01.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_pgm_help.
endif.
form f_pgm_help.
data: begin of help_infos.
include structure help_info.
data: end of help_infos.
data: begin of dynpselect occurs 0.
include structure dselc.
data: end of dynpselect.
data: begin of dynpvaluetab occurs 0.
include structure dval.
data: end of dynpvaluetab.
clear help_infos.
help_infos-call
= 'D'.
help_infos-spras = sy-langu.
help_infos-docuid = 'RE'.
help_infos-report = sy-repid.
help_infos-title = sy-title.
call function 'HELP_START'
exporting
help_infos = help_infos
tables
dynpselect = dynpselect
dynpvaluetab = dynpvaluetab.
endform.
" F_PGM_HELP

How do I get report program name text


Use command READ TEXT-POOL. example code
How do I protect certain field on selection screen.
(This is to make the field output only)
parameter: p_parm1(2) default 'MY'.
at selection-screen output.
loop at screen.
if screen-name = 'P_PARM1'.
screen-output = 1.
modify screen.
exit.

endif.
endloop.
How do I get the address of a company given company code.
How do I read an EXCEL file for upload. How do I download to an EXCEL file.
How do I add a selection screen parameter to get a local file name with pull down?
parameters: p_infile like ibipparms-path default 'C:\'.
* Executes the pull-down to search C:\ drive for input file
at selection-screen on value-request for p_infile.
call function 'F4_FILENAME'
"allows user to select path/file
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
field_name = 'p_infile'
importing
file_name = p_infile.
if sy-subrc ne 0.
write: / 'Error'.
endif.
How do I read a file on my C:\ drive and/or a file residing on UNIX sub-directory.
How do I print standard header and footer on all pages of a report? Do you have code for
standard header & footer function module?
How do I print selection screen values on a report?
How do I show valid month and their description as the pull-down option on a month seletion
field?
What are the various ways you can make the user execute a report program
There are flat files residing on UNIX sub-directory. How can a report program list all these files for
the user to select one of them.
How do I let user to decide the format of the report?
Dialog Programming/Table Control
How do I hide a column in a table control at runtime? (by Manoj Nair)
1. define group name(s) for the columns to be hidden
2. Add the following code...
(define)
controls tbl_ctrl type tableview ...
wa like tbl_ctrl-cols.
loop at tbl_ctrl-cols into wa.
if wa-screen-group1 = <group defined for the column>
wa-invisible = 1.
modify tbl_ctrl-cols from wa
endif
endloop
How do I change attributes of an item in a screen and in a table control at runtime?
add the following code in PBO
loop at screen.
if screen-name = 'NAME_OF_FIELD_HERE_IN_CAPS'.
set attributes of screen such as REQUIRED, INPUT, OUTPUT, INTENSIFIED, INVISIBLE,
ACTIVE, DISPLAY_3D, VALUE_HELP to 1(ON) or 0(OFF)
e.g. screen-output = 1.
modify screen.

endif.
endloop
if the field is part of a table control, put the above code within the the loop...endloop of the table
control in PBO
How do I go to a transaction by double clicking on a field in the screen?
Define ok_code for function key <F2>
In Screen PAI when ok_code has the value defined (user has double clicked on the screen)
method 1: if parameter id is available for the field(s) to be populated
set parameter id 'XXX' field field_name_on_screen
call transaction 'TCODE' and skip first screen.
method 2:
1. fill bdc_table (data bdc_table like bdcdata occurs 0 with header line.) with screen info
2. use command
call transaction 'XK03' using bdc_table ...
How do I know that user has changed something on a dialog screen?
Check sy-datar, It is 'X' when there was a change
SAP General
How do I get back to SAP screens I was working on if SAP was terminated?
When you log back in, after entering appropriate values, select User->Copy session (instead on
pressing 'Enter')
How do I assign a CTS number of a local private object ($TMP)?
Run tcode SE80
Select 'Local priv objects' and click on 'Display'.
Select the item you want to reassign and click on it
Now select Development Object->Reassign or (Ctrl + F7)
How do I view an ABAP dump happened in the SAP system?
Use path
Tools->Administration->Monitoring->Dump Analysis
How do I set my user information in SAP?
Run transaction code SU51 or (System->User profile->User address)
How do I reset my password?
You can reset your own password at anytime (but not more than once a day) if you know the
current password. Passwords must be at least 6 characters and can not contain the first letters
of your user id.
1. At the SAP R/3 logon screen enter your user-id and current password.
2. Click the New password button.
3. The SAP R/3 new password dialog box will be displayed.
4. Type the password you wish to have in the New password field.
5. Repeat typing the same password in the Repeat password field.
6. Click the Confirm button
How do I kill a long running job in SAP?
.a.Open a new SAP session.
b.In the new session, from the SAP R/3 screen, follow
the menu path:

Tools>>Administration
(new screen) Monitoring >>System monitoring>>User overview
Fastpath:
/nsm04
Result: the "Overview of Users" screen appears. This is a list of the jobs currently
running.
c.Find your username in the list and click on it
d.Click on the Sessions button .
Result: the Overview of Sessions screen appears.
e.Click on the End session button .
How do I compare two tables between two systems?
The contents of a table between two systems can be checked through the transaction OY19
How do I view SAP settings?
Use transaction code SE38
Enter Program name RSPARAM and execute
ABAP/4 General
How do I send mail to a user(s) from an ABAP/4 program without using SAP Office?
Use, So_object_send function module.
How do I capture the screen sequence and values of a transaction for data transfer?
Use transaction 'SHDB' to record any SAP transaction.
How do I copy and paste from one session to another?

1. Click on the area and press CTRL+Y. Using your mouse highlite the are and press
CTRL+C. Go do desired targer location; insert necessary number of blank lines and
press CTRL+V to paste.
2. Use xx to mark and copy. Use x to paste......
How do I register a function module as RFC enabled?
In the function module Administration screen (transaction code SE37), set the field REMOTE
CALL.

How to get Developer key


Procedure explains how to obtain a developer key:
a) Log into OSS.
b) Click on the Registration button and then click the Register Developer
button.
c) Select appropriate customer installation.
d) Enter the user ID in the user box,.
e) Click on the Register button.

f) Copy the KEY (by highlighting and using ctrl/c for copy and ctrl/v for paste)
and email the user of his key. The ctrl/c, ctrl/v ensures that the complete key
is copied since it is a very long number.
g) Click the Cancel button when done or click the Register button to register
another developer.
h) Click the green ' ' to exit.

Logical filename and Path


What is the use of Logical filename and its object.
The logical filename should be defined in the transaction FILE. It is mapped to a
physical directory. The Logical filename allows setting the name of the file at its level or
allows the developer to build himself the filename (through the variables <PARAM_1>
and <PARAM_2>.
Create Logical file name object using transaction SE24.

BACKGROUND PROCESSING IN SAP R/3

1.

What the scheduler can do

Many steps within a job : A job can consist of many steps, each running a different
program. Each step waits for the previous step to run before it starts.
Periodic jobs: A job can be scheduled to run every minute, hour, day, month, or any
other specified time frame.
Dependent jobs: A jobs can be scheduled to wait for another job to finish before it
executes.

2. What the scheduler cannot do

3.

Periodic dependent jobs: If you have a job that runs every night and another that
depends on it, the dependent job will run the first time, but not again after that.
Continuing a job that has crashed: If a job crashes on step 1, the whole job stops,
and there is no way to continue processing.
Re-running from certain job steps: If your job crashes at step 2, there is no facility to
re-run, without changing the job and removing step 1 so it does not run again.
Waiting for a Batch Input Session: If you run a job which runs RSBDCSUB, the
second step will not wait for the batch input session to process, as it is executing in a
separate job.
Suggested methods for processing

4.

Using a self-scheduling job: A program can be set up to re-schedule itself in a job


after a specified time. This is more flexible than a periodic job.
Jobs that create other jobs: An alternative to dependent jobs, is to run a program in
the first job which will create the next job.
Jobs that wait for other jobs: You can write a custom program that waits for a
specified job, and runs a batch input session. Use this as a step in your job after a
batch input session has run.
System messaging

5.

Information and Success messages: Write the message text to the job log. Program
and job continues as normal.
Error and Abend messages: Write the message text to the job log. Stop the current
program from running. Cancel the entire job. -> any dependent programs must be
scheduled in a different job
Suggested methods for error handling & reprocessing

If subsequent steps in a job are not dependent on the first one finishing successfully,
the first program should be set up to crash using a success message followed by the
STOP statement.
Before every error message, call a routine which notifies the Operations Center of
error type, severity, action, etc.

BATCH INPUT Object


1.

(for ver 4X)

What is the use of Batch Input object ?

Batch Input is a SAP functionality that allows automating input of data via SAP transactions,
commonly known as BDC (Batch Data Commands). BDC works in the following ways:

the transaction is called directly within the calling program


the scenario is included in a session that could be launched afterwards.

In most companies, programs that handle Batch Input are duplicating the functions that builds
this scenario, creates the session or calls the transactions.
Therefore, create a custome Abap Object, eg. Z_BATCHINPUT. This object should have all
the needed functions and makes some basic checks (e.g. that the program is not creating two
sessions at the same time). The main advantages of using an object are :

Code is no more duplicated throughout all of the BI programs


Way to submit the sessions becomes standardized.

The object class Z_BATCHINPUT should be created (and/or transported) into all target systems.
It uses basically all the datatypes available for the BDC functions. It calls the following functions :

BDC_OPEN_GROUP : Opens a session group

BDC_CLOSE_GROUP : Closes a session

BDC_INSERT : Insert a BDC scenario in the session

The ABAP statement "CALL TRANSACTION" is also called to run directly a transaction
from its BDC table.

It runs the program RSBDCSUB in order to launch automatically the session. The session
management is done through the transaction code SM35.
The object itself is maintanable through the transaction SE24.

Function of the object Z_BATCHINPUT


The above object should allow to handle three kinds of Batch Input behaviour :
1. Building a BDC table and calling a transaction
2. Building a session and a set of BDC scenarios and keeping the session
available in SM35,
3. Building a session and lauching the transaction right after closing the session.
To achieve these operations, the object Z_BATCHINPUT should offer a set of methods :

Method

Description
Opens a session

OPEN_SESSION

Closes a session

Parameters
SUBRC (Return Code 0 OK)
SESSIONNAME (Session to be created)
None

CLOSE_SESSION
RESET_BDCDATA

Resets the BDC Internal


Table...
Handles a new screen

BDC_DYNPRO
BDC_FIELD
CONSTRUCTOR

RUN_SESSION
CALL_TRANSACTION

Puts a value on the


screen
Constructor - Initializes
NO_DATA
Launches a session with
RSBDCBTC
Calls a transaction with
the current BDC Data

None. Normally, for internal purpose


PROGNAME (Name of the program)
DYNPRONR (Screen Number)
FIELDNAME (Name of the field)
FIELDVALUE (Value to be passed)
NODATA (No data character). The
constructor is called automatically when
the object is created.
None
MODE (Display Mode)
UPDATE (Update Mode)

BDC_INSERT

Inserts the BDC scenario


in the session

TCODE (Transaction to be called)


TCODE (Transaction to be called)

To complete the different scenarii explained above, some sequences should be followed :

1)

Building a BDC table and calling a transaction :

the object batch input should be created (CREATE OBJECT =>


method CONSTRUCTOR)
the method RESET_BDCDATA could be called (if the object has
already been used)

several methods BDC_DYNPRO and BDC_FIELD could be called

then, at the last, the method CALL_TRANSACTION should be called.

2) Building a session and a set of BDC scenarios and keeping the session available in
SM35 :

the object batch input should be created (CREATE OBJECT =>


method CONSTRUCTOR)
the method RESET_BDCDATA could be called (if the object has
already been used),

several methods BDC_DYNPRO and BDC_FIELD could be called

then, at the last, the method BDC_INSERT should be called.

At the end, the method CLOSE_SESSION MUST be called.

3) Building a session and lauching the transaction right after closing the session.

The previous steps should be followed (the ones explained for the
session),
At the end, the method RUN_SESSION should be called (after the
CLOSE_SESSION).

Path
The Batch Input is described in the Help-On-Line (4.5B) under the following items :
R/3 Library -> BC Basis Components -> ABAP Workbench (BC-DWB) -> BC Basis
Programming Interfaces -> Data Transfer
R/3 Library -> BC Basis Components -> Kernel Components (BC-KRN) -> BC System Service ->
Managing Batch Input Sessions

Download ABAP source code

Program name

Program function

Author

Date Added

Z_SEND_EMAIL_to_Users
Send email to users
Version: 4.0 & above

REPORT Z_SEND_EMAIL_to_Users.
TABLES: USR02.
DATA: C(15).
DATA: SENT LIKE SONV-FLAG.
DATA: EMAIL_ID LIKE SOFOLENTI1-OBJECT_ID.
DATA: BEGIN OF EMAIL_DATA.
INCLUDE STRUCTURE SODOCCHGI1.
DATA: END OF EMAIL_DATA.
DATA: BEGIN OF EMAIL_SEND OCCURS 10.
INCLUDE STRUCTURE SOMLRECI1.
DATA: END OF EMAIL_SEND.
DATA: BEGIN OF EMAIL_TEXT OCCURS 10.
INCLUDE STRUCTURE SOLISTI1.
DATA: END OF EMAIL_TEXT.
****************************************************
PARAMETERS: ALL__CLI RADIOBUTTON GROUP RADI.
PARAMETERS: THIS_CLI RADIOBUTTON GROUP RADI.
PARAMETERS: SELECT__ RADIOBUTTON GROUP RADI.
SELECT-OPTIONS SEND_TO FOR C NO INTERVALS.
SELECTION-SCREEN SKIP.
PARAMETERS: SUBJECT(30).
SELECTION-SCREEN SKIP.
SELECTION-SCREEN COMMENT /1(20) TEXT-999.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L1(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L2(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L3(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L4(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L5(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L6(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L7(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L8(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L9(84).
SELECTION-SCREEN END OF LINE.
***********************************************

EMAIL_TEXT-LINE = L1.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L2.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L3.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L4.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L5.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L6.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L7.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L8.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L9.
APPEND EMAIL_TEXT.
EMAIL_DATA-OBJ_NAME = 'MESSAGE'.
EMAIL_DATA-OBJ_DESCR = SUBJECT.
EMAIL_DATA-OBJ_LANGU = 'E'.
EMAIL_DATA-SENSITIVTY = 'P'.
EMAIL_DATA-OBJ_PRIO = '1'.
EMAIL_DATA-NO_CHANGE = 'X'.
EMAIL_DATA-PRIORITY = '1'.
IF SELECT__ = 'X'.
LOOP AT SEND_TO.
EMAIL_SEND-RECEIVER = SEND_TO-LOW.
EMAIL_SEND-REC_TYPE = 'U'.
EMAIL_SEND-EXPRESS = 'X'.
APPEND EMAIL_SEND.
ENDLOOP.
ELSEIF THIS_CLI = 'X'.
SELECT * FROM USR02.
IF USR02-USTYP = 'A' AND USR02-BNAME NE 'SAP*'
AND USR02-BNAME NE 'DDIC'.
EMAIL_SEND-RECEIVER = USR02-BNAME.
EMAIL_SEND-REC_TYPE = 'U'.
EMAIL_SEND-EXPRESS = 'X'.
APPEND EMAIL_SEND.
ENDIF.
ENDSELECT.
ELSEIF ALL__CLI = 'X'.
SELECT * FROM USR02 CLIENT SPECIFIED.
IF USR02-USTYP = 'A' AND USR02-BNAME NE 'SAP*'
AND USR02-BNAME NE 'DDIC'.
EMAIL_SEND-RECEIVER = USR02-BNAME.
EMAIL_SEND-REC_TYPE = 'U'.
EMAIL_SEND-EXPRESS = 'X'.
APPEND EMAIL_SEND.
ENDIF.
ENDSELECT.

ENDIF.
WRITE:/ 'End of program'.
*****************************************************
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = EMAIL_DATA
DOCUMENT_TYPE = 'RAW'
PUT_IN_OUTBOX = 'X'
IMPORTING
SENT_TO_ALL = SENT
NEW_OBJECT_ID = EMAIL_ID
TABLES
OBJECT_CONTENT = EMAIL_TEXT
RECEIVERS = EMAIL_SEND
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.

Creating Extract Dataset

Q.Write a program that lists the Vendors and their Accounting documents. Create
extract dataset from KDF logical database. Loop through the dataset to create the
required report. Don't list those vendors which has no documents.
Creating Extract Dataset
Your code should be like this.
report zfwr0001 no standard page heading.
tables: lfa1, bsik.
field-groups: header, item1, item2.
insert lfa1-lifnr bsik-belnr into header.
insert lfa1-land1 lfa1-name1 into item1.
insert bsik-belnr bsik-budat into item2.
start-of-selection.
get lfa1.
....extract item1.
get bsik.
....extract item2.
end-of-selection.
loop.
....at item1 with item2.
........skip.
........write:/ 'Vendor number:', 28 'Name:', 56 'City:'.
........write: 16 lfa1-lifnr, 33(20) lfa1-name1, 62(20) lfa1-ort01.
........write:/ 'Document no.', 15 'Date'.
....endat.
....at item2.
........write:/ bsik-belnr, 13 bsik-budat.
....endat.
endloop.
Additional task:
Don't forget to set the Logical database to KDF on the "Program Attributes"
screen.
Result:
Vendor number: 100124 Name:Coca Cola City: New York
Document no. Date
1800000316 01/08/1997
Vendor number: 100126 Name: Universal Studios City: Los Angeles
Document no. Date
1800000109 12/02/1996
1800000341 01/10/1997
1800000321 01/14/1997

Download ABAP source code

Program name

Program function

Z_Display_menupath
Version: 4.0 & above

Display Menupath

Author

Date Added

REPORT Z_Display_menupath NO STANDARD PAGE HEADING.


TABLES: SMENCUSNEW, SMENENTT, TSTC.
DATA: BEGIN OF ITAB OCCURS 10.
INCLUDE STRUCTURE SMENCUSNEW.
DATA: END OF ITAB.
DATA: BEGIN OF STACK OCCURS 10,
ID(5) TYPE N,
END OF STACK.
DATA: I TYPE I.
PARAMETERS: TRANS LIKE TSTC-TCODE.
* Get the id of our transaction
SELECT * FROM SMENCUSNEW WHERE REPORT = TRANS AND CUSTOMIZED = 'S'.
MOVE-CORRESPONDING SMENCUSNEW TO ITAB.
APPEND ITAB.
ENDSELECT.
* Our transaction is not in smencusnew
IF SY-SUBRC <> 0.
WRITE: / TRANS COLOR 5.
SKIP.
WRITE: / 'Not in the profile generator''s table'.
EXIT.
ENDIF.
* Get the parent id that links us to the root with the fewest levels
SORT ITAB BY MENU_LEVEL.
READ TABLE ITAB INDEX 1.
STACK = ITAB-OBJECT_ID. APPEND STACK.
STACK = ITAB-PARENT_ID. APPEND STACK.
* Search for the grandparets ...
DO.
CLEAR ITAB. REFRESH ITAB.
SELECT * FROM SMENCUSNEW WHERE OBJECT_ID = STACK-ID AND
CUSTOMIZED = 'S'.
MOVE-CORRESPONDING SMENCUSNEW TO ITAB.
APPEND ITAB.
ENDSELECT.
SORT ITAB BY MENU_LEVEL.
READ TABLE ITAB INDEX 1.
IF ITAB-PARENT_ID = '00001'. EXIT. ENDIF.
STACK = ITAB-PARENT_ID. APPEND STACK.
ENDDO.
* Display the result
WRITE: / TRANS COLOR 5.HIDE TRANS. CLEAR TRANS.
WRITE: ' <<<< Doubleclick to see the transaction'.
SKIP.

WRITE: /(30) 'Main Menu' COLOR 2.


SORT STACK.
LOOP AT STACK.
I = I + 3.
SELECT SINGLE * FROM SMENENTT WHERE SPRAS = 'E' AND OBJECT_ID =
STACK.
WRITE: /I(30) SMENENTT-TEXT COLOR 2.
ENDLOOP.
* Display the transaction when the user doubleclick on trans
AT LINE-SELECTION.
IF NOT TRANS IS INITIAL.
SELECT SINGLE * FROM TSTC WHERE TCODE = TRANS.
CALL TRANSACTION TRANS.
ENDIF.
CLEAR TRANS.
Note: Comments by : Jarboe, John A

ABAP List Viewer (ALV)

(by Viren Shah)

Program name

Program function

Author

Z_abap_list_viewer
Version: 4.0 & above

List of materials inventory - using


ALV
Module:

Viren Shah

Date Added

REPORT Z_LIST_MATERIALS.
TYPE-POOLS: SLIS.
TABLES:MARC, MARD, VBAP, LIPS, EKPO, VBFA, EKBE, MARM, VBBE, MARA, MBEW.
SELECTION-SCREEN BEGIN OF BLOCK SEL WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_WERKS FOR MARC-WERKS, " Plant
S_MATNR FOR MARC-MATNR, " Material
S_MTART FOR MARA-MTART. " Material Type
SELECTION-SCREEN END OF BLOCK SEL.
PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT. " ALV Variant
CONSTANTS: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE
'TOP_OF_PAGE'.
DATA: BEGIN OF INV OCCURS 100,
WERKS LIKE MARD-WERKS, " Plant
MATNR LIKE MARD-MATNR, " Material
MTART LIKE MARA-MTART, " Material Type
STPRS LIKE MBEW-STPRS, " Standard Price
AVAIL LIKE MARD-LABST, " Available

LABST LIKE MARD-LABST, " Unrestricted use


INSME LIKE MARD-INSME, " Quality Inspection
RETME LIKE MARD-RETME, " Returns
TRANS LIKE MARC-UMLMC, " Stock in transit (calculated)
UMLMC LIKE MARC-UMLMC, " Stock Transfer (plant)
UMLME LIKE MARD-UMLME, " Transfer (SLoc)
WESBS LIKE EKBE-WESBS, " GR Blocked Stock
TRAME LIKE MARC-TRAME, " Stock in transit
SPEME LIKE MARD-SPEME, " Blocked
KWMENG LIKE VBAP-KWMENG, " Sales orders
LFIMG LIKE LIPS-LFIMG, " Scheduled for Delivery
MENGE LIKE EKPO-MENGE, " Open Purch. Orders
VALUE LIKE MBEW-SALK3, " Stock Value (Calculated)
MEINS LIKE MARA-MEINS, " Unit of measure
END OF INV.
DATA: FIELDTAB TYPE SLIS_T_FIELDCAT_ALV,
HEADING TYPE SLIS_T_LISTHEADER,
LAYOUT TYPE SLIS_LAYOUT_ALV,
EVENTS TYPE SLIS_T_EVENT,
REPNAME LIKE SY-REPID,
F2CODE LIKE SY-UCOMM VALUE '&ETA',
G_SAVE(1) TYPE C,
G_EXIT(1) TYPE C,
G_VARIANT LIKE DISVARIANT,
GX_VARIANT LIKE DISVARIANT.
INITIALIZATION.
REPNAME = SY-REPID.
PERFORM INITIALIZE_FIELDCAT USING FIELDTAB[].
PERFORM BUILD_EVENTTAB USING EVENTS[].
PERFORM BUILD_COMMENT USING HEADING[].
PERFORM INITIALIZE_VARIANT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
PERFORM F4_FOR_VARIANT.
AT SELECTION-SCREEN.
PERFORM PAI_OF_SELECTION_SCREEN.
START-OF-SELECTION.
PERFORM GET_MARD.
PERFORM GET_UNIT_OF_MEASURE.
PERFORM GET_MARC.
PERFORM GET_EKPO.
PERFORM GET_LIPS.
PERFORM GET_VBAP.
PERFORM GET_OPEN.
PERFORM GET_PRICE.
END-OF-SELECTION.
PERFORM BUILD_LAYOUT USING LAYOUT.
PERFORM WRITE_OUTPUT.

*&---------------------------------------------------------------------*
*&
Form INITIALIZE_FIELDCAT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->P_FIELDTAB[] text
*
*----------------------------------------------------------------------*
FORM INITIALIZE_FIELDCAT USING P_FIELDTAB TYPE SLIS_T_FIELDCAT_ALV.
DATA: L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
* fixed columns (obligatory)
CLEAR L_FIELDCAT.
L_FIELDCAT-TABNAME = 'INV'.
L_FIELDCAT-FIX_COLUMN = 'X'.
L_FIELDCAT-NO_OUT = 'O'.
L_FIELDCAT-FIELDNAME = 'WERKS'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'MATNR'.
APPEND L_FIELDCAT TO P_FIELDTAB.
* totalized columns
CLEAR L_FIELDCAT.
L_FIELDCAT-TABNAME = 'INV'.
L_FIELDCAT-SP_GROUP = 'A'.
L_FIELDCAT-DO_SUM = 'X'.
L_FIELDCAT-FIELDNAME = 'LABST'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'INSME'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'RETME'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'UMLME'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'WESBS'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'SPEME'.
APPEND L_FIELDCAT TO P_FIELDTAB.
* columns with different description
L_FIELDCAT-FIELDNAME = 'KWMENG'.
L_FIELDCAT-SELTEXT_M = 'Sales Orders'.
L_FIELDCAT-SELTEXT_S = 'Sales Or'.
L_FIELDCAT-SELTEXT_L = 'Sales Orders Qty'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'LFIMG'.
L_FIELDCAT-SELTEXT_M = 'Sched. Delivery'.
L_FIELDCAT-SELTEXT_S = 'Schd. Del'.
L_FIELDCAT-SELTEXT_L = 'Scheduled for Delivery'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'TRANS'.
L_FIELDCAT-SELTEXT_M = 'Stk. in transit'.
L_FIELDCAT-SELTEXT_S = 'Stk. trns'.
L_FIELDCAT-SELTEXT_L = 'Stock in transit (sum)'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'AVAIL'.
L_FIELDCAT-SELTEXT_M = 'Available'.
L_FIELDCAT-SELTEXT_S = 'Avail.'.
L_FIELDCAT-SELTEXT_L = 'Stock Available'.

APPEND L_FIELDCAT TO P_FIELDTAB.


L_FIELDCAT-FIELDNAME = 'MENGE'.
L_FIELDCAT-SELTEXT_M = 'Open Orders'.
L_FIELDCAT-SELTEXT_S = 'Open Ord'.
L_FIELDCAT-SELTEXT_L = 'Open Purchase Orders'.
APPEND L_FIELDCAT TO P_FIELDTAB.
* columns not displayed
CLEAR L_FIELDCAT.
L_FIELDCAT-TABNAME = 'INV'.
L_FIELDCAT-SP_GROUP = 'A'.
L_FIELDCAT-NO_OUT = 'X'.
L_FIELDCAT-FIELDNAME = 'MEINS'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'UMLMC'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'TRAME'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'STPRS'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'VALUE'.
APPEND L_FIELDCAT TO P_FIELDTAB.
ENDFORM.
" INITIALIZE_FIELDCAT
*&---------------------------------------------------------------------*
*&
Form BUILD_EVENTTAB
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->P_EVENTS[] text
*
*----------------------------------------------------------------------*
FORM BUILD_EVENTTAB USING P_EVENTS TYPE SLIS_T_EVENT.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = P_EVENTS.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
ENDFORM.
" BUILD_EVENTTAB
*&---------------------------------------------------------------------*
*&
Form BUILD_COMMENT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->P_HEADING[] text
*
*----------------------------------------------------------------------*
FORM BUILD_COMMENT USING P_HEADING TYPE SLIS_T_LISTHEADER.
DATA: HLINE TYPE SLIS_LISTHEADER,
TEXT(60) TYPE C,

SEP(20) TYPE C.
CLEAR: HLINE, TEXT.
HLINE-TYP = 'H'.
WRITE: TEXT-101 TO TEXT+23.
HLINE-INFO = TEXT.
APPEND HLINE TO P_HEADING.
CLEAR TEXT.
WRITE: 'User: ' TO TEXT,
SY-UNAME TO TEXT+6,
'Date: ' TO TEXT+25,
SY-DATUM TO TEXT+31,
'Page: ' TO TEXT+50,
SY-PAGNO TO TEXT+56.
HLINE-INFO = TEXT.
APPEND HLINE TO P_HEADING.

ENDFORM.

" BUILD_COMMENT

*---------------------------------------------------------------------*
*
FORM TOP_OF_PAGE
*
*---------------------------------------------------------------------*
*
........
*
*---------------------------------------------------------------------*
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADING.
ENDFORM.
*&---------------------------------------------------------------------*
*&
Form INITIALIZE_VARIANT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM INITIALIZE_VARIANT.
G_SAVE = 'A'.
CLEAR G_VARIANT.
G_VARIANT-REPORT = REPNAME.
GX_VARIANT = G_VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = G_SAVE
CHANGING
CS_VARIANT = GX_VARIANT
EXCEPTIONS
NOT_FOUND = 2.
IF SY-SUBRC = 0.
P_VARI = GX_VARIANT-VARIANT.
ENDIF.
ENDFORM.
" INITIALIZE_VARIANT
*&---------------------------------------------------------------------*
*&
Form F4_FOR_VARIANT
*&---------------------------------------------------------------------*
*
text

*----------------------------------------------------------------------*
FORM F4_FOR_VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
IS_VARIANT = G_VARIANT
I_SAVE = G_SAVE
IMPORTING
E_EXIT = G_EXIT
ES_VARIANT = GX_VARIANT
EXCEPTIONS
NOT_FOUND = 2.
IF SY-SUBRC = 2.
MESSAGE ID SY-MSGID TYPE 'S'
NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
IF G_EXIT = SPACE.
P_VARI = GX_VARIANT-VARIANT.
ENDIF.
ENDIF.
ENDFORM.
" F4_FOR_VARIANT
*&---------------------------------------------------------------------*
*&
Form PAI_OF_SELECTION_SCREEN
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM PAI_OF_SELECTION_SCREEN.
*
IF NOT P_VARI IS INITIAL.
MOVE G_VARIANT TO GX_VARIANT.
MOVE P_VARI TO GX_VARIANT-VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
I_SAVE = G_SAVE
CHANGING
CS_VARIANT = GX_VARIANT.
G_VARIANT = GX_VARIANT.
ELSE.
PERFORM INITIALIZE_VARIANT.
ENDIF.
ENDFORM.
" PAI_OF_SELECTION_SCREEN
*&---------------------------------------------------------------------*
*&
Form GET_MARD
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_MARD.
SELECT MATNR WERKS LABST INSME RETME UMLME SPEME
FROM MARD
INTO CORRESPONDING FIELDS OF INV
WHERE MATNR IN S_MATNR
AND WERKS IN S_WERKS.
COLLECT INV.
ENDSELECT.

PERFORM FILTER_BY_MATERIAL_TYPE.
ENDFORM.
" GET_MARD
*&---------------------------------------------------------------------*
*&
Form FILTER_BY_MATERIAL_TYPE
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM FILTER_BY_MATERIAL_TYPE.
LOOP AT INV.
CLEAR INV-MTART.
SELECT SINGLE MTART
INTO INV-MTART
FROM MARA
WHERE MATNR EQ INV-MATNR
AND MTART IN S_MTART.
IF SY-SUBRC EQ 0.
MODIFY INV.
ELSE.
DELETE INV.
ENDIF.
ENDLOOP.
ENDFORM.
" FILTER_BY_MATERIAL_TYPE
*&---------------------------------------------------------------------*
*&
Form GET_MARC
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_MARC.
LOOP AT INV.
SELECT SINGLE UMLMC TRAME
FROM MARC
INTO CORRESPONDING FIELDS OF INV
WHERE MATNR EQ INV-MATNR
AND WERKS EQ INV-WERKS.
IF SY-SUBRC EQ 0.
INV-TRANS = INV-UMLMC + INV-TRAME.
MODIFY INV.
ENDIF.
ENDLOOP.
ENDFORM.
" GET_MARC
*&---------------------------------------------------------------------*
*&
Form GET_EKPO
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_EKPO.
DATA: WESBS LIKE INV-WESBS,
SHKZG LIKE EKBE-SHKZG,
MEINS LIKE EKPO-MEINS,
LMEIN LIKE EKPO-LMEIN.
LOOP AT INV.
CLEAR: WESBS, SHKZG, MEINS, LMEIN.
SELECT Y~WESBS Y~SHKZG X~MEINS X~LMEIN
INTO (WESBS, SHKZG, MEINS, LMEIN)

FROM EKPO AS X JOIN EKBE AS Y


ON X~EBELN = Y~EBELN
AND X~EBELP = Y~EBELP
WHERE X~MATNR EQ INV-MATNR
AND X~WERKS EQ INV-WERKS
AND X~LOEKZ NE 'L'.
IF SHKZG EQ 'H'.
MULTIPLY WESBS BY -1.
ENDIF.
IF MEINS NE LMEIN.
PERFORM CONVERT_UNIT_OF_MEASURE CHANGING INV-MATNR MEINS
WESBS.
ENDIF.
ADD WESBS TO INV-WESBS.
ENDSELECT.
MODIFY INV.
ENDLOOP.
ENDFORM.
" GET_EKPO
*&---------------------------------------------------------------------*
*&
Form GET_LIPS
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_LIPS.
DATA: LFIMG LIKE INV-LFIMG.
LOOP AT INV.
CLEAR: LFIMG, INV-LFIMG.
SELECT OMENG
INTO LFIMG
FROM VBBE
WHERE MATNR EQ INV-MATNR
AND WERKS EQ INV-WERKS
AND VBTYP EQ 'J'.
ADD LFIMG TO INV-LFIMG.
ENDSELECT.
MODIFY INV.
ENDLOOP.
ENDFORM.
" GET_LIPS
*&---------------------------------------------------------------------*
*&
Form GET_VBAP
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_VBAP.
DATA: KWMENG LIKE INV-KWMENG.
LOOP AT INV.
CLEAR: KWMENG, INV-KWMENG.
SELECT OMENG
INTO KWMENG
FROM VBBE
WHERE MATNR EQ INV-MATNR
AND WERKS EQ INV-WERKS
AND VBTYP EQ 'C'.
ADD KWMENG TO INV-KWMENG.
ENDSELECT.
INV-AVAIL = INV-LABST - INV-INSME - INV-KWMENG - INV-LFIMG.

MODIFY INV.
ENDLOOP.
ENDFORM.

" GET_VBAP

*&---------------------------------------------------------------------*
*&
Form GET_UNIT_OF_MEASURE
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
FORM GET_UNIT_OF_MEASURE.
LOOP AT INV.
SELECT SINGLE MEINS
FROM MARA
INTO INV-MEINS
WHERE MATNR EQ INV-MATNR.
MODIFY INV.
ENDLOOP.
ENDFORM.
" GET_UNIT_OF_MEASURE
*&---------------------------------------------------------------------*
*&
Form GET_OPEN
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_OPEN.
DATA: BEGIN OF XTAB OCCURS 10,
" Open orders table
WERKS LIKE EKPO-WERKS,
LGORT LIKE EKPO-LGORT,
MATNR LIKE EKPO-MATNR,
MENGE LIKE EKPO-MENGE,
MENGK LIKE EKPO-MENGE,
END OF XTAB.
RANGES: L_WERKS FOR MARD-WERKS.
LOOP AT INV.
REFRESH XTAB.
CLEAR: XTAB, L_WERKS.
MOVE INV-WERKS TO L_WERKS-LOW.
CALL FUNCTION 'MB_ADD_PURCHASE_ORDER_QUANTITY'
EXPORTING
X_MATNR = INV-MATNR
X_MEINS = INV-MEINS
X_ELIKZ = SPACE
X_LOEKZ = SPACE
TABLES
XTAB = XTAB
XWERKS = L_WERKS.
MOVE XTAB-MENGE TO INV-MENGE.
MODIFY INV.
ENDLOOP.
ENDFORM.
" GET_OPEN
*&---------------------------------------------------------------------*

*&
Form GET_PRICE
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_PRICE.
LOOP AT INV.
SELECT SINGLE STPRS
FROM MBEW
INTO INV-STPRS
WHERE MATNR EQ INV-MATNR
AND BWKEY EQ INV-WERKS
AND BWTAR EQ SPACE.
IF SY-SUBRC EQ 0.
INV-VALUE = INV-STPRS *
( INV-LABST + INV-INSME + INV-TRANS + INV-SPEME ).
MODIFY INV.
ENDIF.
ENDLOOP.
ENDFORM.
" GET_PRICE
*---------------------------------------------------------------------*
*
FORM CONVERT_UNIT_OF_MEASURE
*
*---------------------------------------------------------------------*
*
text
*
*---------------------------------------------------------------------*
* --> P_MATNR
*
* --> P_VRKME
*
* --> P_QUANT
*
*---------------------------------------------------------------------*
FORM CONVERT_UNIT_OF_MEASURE USING P_MATNR P_VRKME P_QUANT.
DATA: UMREZ LIKE MARM-UMREZ,
UMREN LIKE MARM-UMREN.
SELECT SINGLE UMREZ UMREN
INTO (UMREZ, UMREN)
FROM MARM
WHERE MATNR EQ P_MATNR
AND MEINH EQ P_VRKME.
IF SY-SUBRC EQ 0.
COMPUTE P_QUANT = ( P_QUANT * UMREZ ) / UMREN.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*&
Form BUILD_LAYOUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->P_LAYOUT text
*
*----------------------------------------------------------------------*
FORM BUILD_LAYOUT USING P_LAYOUT TYPE SLIS_LAYOUT_ALV.
P_LAYOUT-F2CODE
= F2CODE.
P_LAYOUT-ZEBRA
= 'X'.
P_LAYOUT-DETAIL_POPUP = 'X'.
ENDFORM.
" BUILD_LAYOUT
*&---------------------------------------------------------------------*

*&
Form WRITE_OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM WRITE_OUTPUT.
SORT INV BY WERKS MATNR.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = REPNAME
I_INTERNAL_TABNAME = 'INV'
I_INCLNAME
= REPNAME
CHANGING
CT_FIELDCAT
= FIELDTAB.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_FIELDCATALOG_MERGE'.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPNAME
I_STRUCTURE_NAME = 'INV'
IS_LAYOUT
= LAYOUT
IT_FIELDCAT
= FIELDTAB
I_DEFAULT
= 'A'
I_SAVE
= G_SAVE
IS_VARIANT
= G_VARIANT
IT_EVENTS
= EVENTS[]
TABLES
T_OUTTAB
= INV.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_LIST_DISPLAY'.
ENDIF.
ENDFORM.
" WRITE_OUTPUT

Вам также может понравиться