Beruflich Dokumente
Kultur Dokumente
This article will help you understand the basics of ALE and
IDocs via a simple do-it-yourself example. We will create a custom IDoc in one SAP
system and then post some business data through it to another SAP system. Business
data will be picked up from custom data dictionary tables.
The messages that are exchanged are in the form of IDocs or Intermediate
Documents. IDocs act like a container or envelope for the application data. An
IDOC is created as a result of execution of an Outbound ALE. In an Inbound ALE
an IDOC serves as an input to create application document. In the SAP system
IDocs are stored in the database tables. They can be used for SAP to SAP and SAP
to non-SAP process communication as long as the participating processes can
understand the syntax and semantics of the data. Complete documentation on
IDOC is obtained by using transaction WE60.
Every IDoc has exactly one control record along with a number of data records and
status records. Control record has the details of sender/receiver and other control
information. Data records contain the actual business data to be exchanged while
the status records are attached to IDoc throughout the process as the IDoc moves
from one step to other.
The Scenario
• Go to WE81
• Create a new Message type ZRZSO_MT
• Save the object
• Go to WE82 and create new entry
• Assign the message type ZRZSO_MT to the basic type ZRZORDER
• Also specify the Release Version
• Save the object
Thus we have defined the IDoc structure which will hold the data to be transferred.
In the next part of the article we will understand the outbound settings, i.e. the
settings to be done in the source system.
Archive for the ‘ABAP’ Category
Here are some of the questions which you must know, when you say that you are
good in Object Oriented Programming in SAP ABAP.
1. Priniples of oops?
2. What is difference between procedural & OO Programming?
3. What is class?
4. What is object?
5. Can we instantiate a class within implementation of other class?
6. What is deferred key word ?
7. How we can refer to a class without defining it?
8. Can we put non declarative statement e.g. START-OF-SELECTION within a
class
9. What is static attribute & method?
Continue Reading …
Need more info? Download the 40 Page document on working with BAPI’s ->
Working with BAPI\'s (71)
Customizing Data refers to the customized information for a particular Client. This
includes data such as payment terms, discounts, pricing, tolerance limits, etc., which
you do not normally change on a day-to-day basis.
Master Data is the control information required to decide how transaction data gets
posted into various accounts (such as customers, vendors, GL, etc.). The master data
is usually shared across modules (for example, customer master records are
common both to FI and SD in SAP) obviating the need for defining it in various
application areas. The master data remains in the system for fairly a long period.
Archive for the ‘ABAP’ Category
The Modification Assistant is the tool that offers you support when making
modifications to the standard, by branching to a special modification mode
whenever you are modifying objects from the standard in an ABAP workbench
editor. Originals are initially protected in this mode and can only be changed with
the help of the additional pushbuttons that are placed at your disposal. All changes
that you make to the system are logged with the help of the Modification Assistant.
This provides you with a detailed overview of modifications that is easy to read and
that dramatically reduces the amount of effort needed to upgrade your system.
• ABAP Editor
• Class Builder
• Screen Painter
• Menu Painter
• Text Element maintenance
• Function Builder
• ABAP Dictionary
If an object can be edited using the Modification Assistant, a dialogue box appears
the first time that you attempt to edit that object informing you that editing
functions are limited in modification mode. This dialogue box appears exactly once
per user for each of the various kinds of transport objects.
Screen Painter is an ABAP Workbench tool used to create or modify the screens for
your transactions. The screen painter allows you to make modifications to screen
attributes, the flow control logic, or the layout.
Menu Painter is a tool used to design the interface components. Status, Menu Bars,
Menu Lists, F-key settings, Functions, and Titles are the components of Menu
Painter.
SAPscript is the SAP Systems own text-processing system which is used to generate
documents containing logos, tables and other objects and which look like a pre-
printed documents. SAPscript is tightly integrated and used for many text-
processing tasks. SAP Standard Styles and Layout Sets are always held in Client
000.
Layout Sets are used for the Page Layout of SAPscript documents. A layout set has
the following elements:
ABAP Query (also known as an SAP Query or Query) is a powerful tool used to
generate simple reports without any coding. Typically, an ABAP query is created
first by defining a User Group and a Functional Group. The functional group can
either be created with reference to a logical table or a database table. Once the
functional group is defined, the user group is assigned to the functional group. The
last step is to create the query on the functional group that is generated.
An ABAP Query can be used to create the following three types of reports:
• Basic Lists: Reports with basic formatting without any calculated fields.
• Statistics: Reports with statistical functions such as average, percentages, etc.
• Ranked Lists: Ranked lists are used for analytical purposes.
DynPro in SAP refers to Dynamic Programming relating to the screens and flow
logic, which controls the processing and display of these screens. On a broader scale,
a screen is also referred to as a DynPro.
Archive for the ‘ABAP’ Category
What is an RFC?
Written by admin on Apr 5th, 2010 | Filed under: ABAP
Internal Tables are standard data type objects which exist only during the Runtime
of an ABAP program. They are used to perform table calculations on subsets of
database tables and for re-organizing the contents of database tables according to a
user’s need. Internal tables fulfill the need for arrays in ABAP.
A Drill-Down Report, also called an Interactive Report, is a report with more detail.
Imagine that you are looking at a Balance Sheet, presented as a drill-down report.
The topmost list, also known as the Basic List, contains the top-level information
such as current assets, fixed assets, etc., under the grouping assets on one side of the
Balance Sheet. The drill-down functionality helps you select a line item from the
Basic List (e.g., fixed assets) and drill-down further to a detailed list (secondary list)
which displays various components of the fixed assets such as land, buildings,
machinery, etc. You may drill-down even further by double clicking the building
line, which will bring up the next detailed list and so on.
You will be able to create a drill-down report with a maximum drill level of 20; that
is, including the Basic List you will have a total of 21 levels in a single drill-down
report.
1. If a table does not have MANDT as part of the primary key, it is ____.
A: A structure
B: Invalid
C: Client-independent
D: Not mandatory
A: CALL FUNCTION
B: CALL SCREEN
C: CALL TRANSACTION
D: CALL PROGRAM
3. Name the type of ABAP Dictionary table that has these characteristics:
A: Pooled
B: Cluster
C: Transparent
D: View
A: Program execution.
B: END-OF-EVENT.
C: Another event keyword.
D: END-EVENT.
A: SY-DATUM
B: SY-DATE
C: SY-DATID
D: SY-SDATE
7. You may change the following data object as shown below so that it equals 3.14.
A: True
B: False
8. The SAP service that ensures data integrity by handling locking is called:
A: Update
B: Dialog
C: Enqueue/Dequeue
D: Spool
9. Which of these sentences most accurately describes the GET VBAK LATE.
event?
A: This event is processed before the second time the GET VBAK event is
processed.
B: This event is processed after all occurrences of the GET VBAK event are
completed.
C: This event will only be processed after the user has selected a basic list row.
D: This event is only processed if no records are selected from table VBAK.
10. Which of the following is not a true statement in regard to a hashed internal
table type?
A: NATIVE SQL_ENDNATIVE.
B: DB SQL_ENDDB.
C: SELECT_ENDSELECT.
D: EXEC SQL_ENDEXEC.
12. To measure how long a block of code runs, use the ABAP statement:
A: GET TIME .
B: SET TIME FIELD .
C: GET RUN TIME FIELD .
D: SET CURSOR FIELD .
13. When a secondary list is being processed, the data of the basic list is available by
default.
A: True
B: False
14. Given:
A: Output of only those itab rows with a qty field less than 10
B: Output of the first 10 itab rows with a qty field greater than 10
C: A syntax error
D: None of the above
A: True
B: False
17. After adding rows to an internal table with COLLECT, you should avoid adding
more rows with APPEND.
A: True
B: False
18. Which of the following is not a component of control break processing when
looping at an internal table?
A: AT START OF
B: AT FIRST
C: AT LAST
D: AT NEW
19. A dictionary table is made available for use within an ABAP program via the
TABLES statement.
A: True
B: False
20. Which of the following would be best for hiding further selection criteria until a
function is chosen?
A: AT NEW SELECTION-SCREEN
B: SELECTION-SCREEN AT LINE-SELECTION
C: SUBMIT SELECTION-SCREEN
D: CALL SELECTION-SCREEN
21. What must you code in the flow logic to prevent a module from being called
unless a field contains a non-initial value (as determined by its data type)?
A: ON INPUT
B: CHAIN
C: FIELD
D: ON REQUEST
A: screen painter
B: ABAP report
C: menu painter status
D: ABAP Dictionary
23. In regard to a function group, which of the following is NOT a true statement?
24. In regard to SET PF-STATUS, you can deactivate unwanted function codes by
using ____.
A: EXCLUDING
B: IMMEDIATELY
C: WITHOUT
D: HIDE
25. In regard to data transported in PAI when the FIELD statement is used, which
of the following is NOT a true statement?
26. The order in which an event appears in the ABAP code determines when the
event is processed.
A: True
B: False
A: SSMMHH
B: HHMMSS
C: MMHHSS
D: HHSSMM
28. Which of the following is NOT a component of the default standard ABAP
report header?
29. Assuming a pushbutton with function code ‘FUNC’ is available in the toolbar of
a list report, what event is processed when the button is clicked?
A: AT USER-COMMAND.
B: AT PFn.
C: AT SELECTION-SCREEN.
D: END-OF-SELECTION.
30. In regard to field selection, what option of the SELECT statement is required?
report zjgtest1
write: /1 ‘Ready_’.
PARAMETER: test.
INITIALIZATION.
write: /1 ‘Set_’.
START-OF-SELECTION.
write: /1 ‘GO!!’.
32. To declare a selection criterion that does not appear on the selection screen, use:
A: NO-DISPLAY
B: INVISIBLE
C: MODIF ID
D: OBLIGATORY
33. An internal table that is nested within another internal table should not contain
a header line.
A: True
B: False
LOOP AT itab.
SY-TABIX = 2.
WRITE itab-letter.
EXIT.
ENDLOOP.
A: A
B: A B C D
C: B
D: B C D
35. To select all database entries for a certain WHERE clause into an internal table
in one step, use
A: 0
B: 4
C: 8
D: Null
37. This selection screen syntax forces the user to input a value:
A: REQUIRED-ENTRY
B: OBLIGATORY
C: DEFAULT
D: SELECTION-SCREEN EXCLUDE
38. If the following code results in a syntax error, the remedy is:
DATA: itab TYPE SORTED TABLE OF rec_type WITH UNIQUE KEY field1
WITH HEADER LINE.
SORT itab.
LOOP AT itab.
write: /1 itab-field1, itab-field2.
ENDLOOP.
40. When modifying an internal table within LOOP AT itab. _ ENDLOOP. you
must include an index number.
A: True
B: False
41. To allow the user to enter values on the screen for a list field, use:
A: OPEN LINE.
B: SET CURSOR FIELD.
C: WRITE fld AS INPUT FIELD.
D: FORMAT INPUT ON.
A: Linked
B: Authorized
C: Released
D: Active
43. To include a field on your screen that is not in the ABAP Dictionary, which
include program should contain the data declaration for the field?
44. If a table contains many duplicate values for a field, minimize the number of
records returned by using this SELECT statement addition.
A: MIN
B: ORDER BY
C: DISTINCT
D: DELETE
45. The system internal table used for dynamic screen modification is named:
A: ITAB
B: SCREEN
C: MODTAB
D: SMOD
46. Within the source code of a function module, errors are handled via the
keyword:
A: EXCEPTION
B: RAISE
C: STOP
D: ABEND
A: SY-CUCOL
B: SY-LILLI
C: SY-CUROW
D: SY-LISEL
A: P
B: C
C: N
D: D
50. Which of the following describes the internal representation of a type D data
object?
A: DDMMYYYY
B: YYYYDDMM
C: MMDDYYYY
D: YYYYMMDD
A: SE11
B: SE38
C: SE36
D: SE16
A: True
B: False
56. The complete technical definition of a table field is determined by the field’s:
A: Domain
B: Field name
C: Data type
D: Data element
SELECT fld6 fld3 fld2 fld1 FROM tab1 INTO CORRESPONDING FIELDS OF
TABLE itab
WHERE fld3 = pfld3.
59. The ABAP statement below indicates that the program should continue with the
next line of code if the internal table itab:
A: Contains no rows
B: Contains at least one row
C: Has a header line
D: Has an empty header line
FREE itab.
WRITE: /1 itab-fval.
A: 2
B: 0
C: blank
D: 1
61. To allow the user to enter a range of values on a selection screen, use the ABAP
keyword:
A: DATA.
B: RANGES.
C: PARAMETERS.
D: SELECT-OPTIONS.
62. If an internal table is declared without a header line, what else must you declare
to work with the table’s rows?
63. Assuming an internal table contains 2000 entries, how many entries will it have
after the following line of code is executed?
A: UPDATE
B: MODIFY
C: ERASE
D: DELETE
65. All of the following may be performed using SET CURSOR except:
A: True
B: False
A: True
B: False
69. To save information on a list line for use after the line is selected, use this
keyword.
A: APPEND
B: EXPORT
C: WRITE
D: HIDE
A: AT EXIT-COMMAND
B: ON INPUT
C: ON REQUEST
D: LEAVE TO SCREEN 0.
A: SY-MSGTY
B: SY-MSGNO
C: SY-MSGV1
D: SY-MSGWA
REPORT ZLISTTST.
START-OF-SELECTION.
WRITE: text-001.
FORMAT HOTSPOT ON.
WRITE: text-002.
FORMAT HOTSPOT OFF.
AT LINE-SELECTION.
WRITE / text-003.
73. The ____ type of ABAP Dictionary view consists of one or more transparent
tables and may be accessed by an ABAP program using Open SQL.
A: Database view
B: Projection view
C: Help view
D: Entity view
A: MOVE
B: WRITE
C: ASSIGN
D: VALUE
report zabaprg.
DATA: char_field type C.
WRITE char_field.
A: ABAP data
B: A
C: Nothing, there is a syntax error
D: None of the above
A: TOP-OF-PAGE.
B: END-OF-SELECTION.
C: NEW-PAGE.
D: END-OF-PAGE.
A: True
B: False
A: True
B: False
79. Assuming tab1-fld7 is not a key field, how can you prevent reading all the table
rows?
SELECT fld1 fld2 fld3 FROM tab1 INTO (fld4, fld5, fld6)
WHERE fld7 = pfld7.
WRITE: /1 fld4, fld5, fld6.
ENDSELECT.
80. Which of the following is NOT a required attribute when creating an ABAP
program?
A: Application
B: Title
C: Status
D: Type
81. When creating a transparent table in the ABAP Dictionary, which step
automatically creates the table in the underlying database?
A: Adding technical settings to the table
B: Checking the table syntax
C: Saving the table
D: Activating the table
A: INCLUDE program
B: Online program
C: Module pool
D: Function group
E: Subroutine pool
84. Which keyword adds rows to an internal table while accumulating numeric
values?
A: INSERT
B: APPEND
C: COLLECT
D: GROUP
85. Assuming itab has a header line, what will be output by the following code?
87. Which statement will sort the data of an internal table with fields FRUIT, QTY,
and PRICE so that it appears as follows?
Apples 12 22.50
Apples 9 18.25
Oranges 15 17.35
Bananas 20 10.20
Bananas 15 6.89
Bananas 5 2.75
A: APPEND
B: MODIFY
C: ADD
D: INSERT
90. Which Open SQL statement should not be used with cluster databases?
A: UPDATE
B: MODIFY
C: DELETE
D: INSERT
91. To include a field on your screen that is not in the ABAP Dictionary, which
include program should contain the data declaration for the field?
A: PBO module include program
B: TOP include program
C: PAI module include program
D: Subroutine include program
92. This flow logic statement is used to make multiple fields open for input after an
error or warning message.
A: GROUP
B: FIELD-GROUP
C: CHAIN
D: LOOP AT SCREEN
93. Given:
A: Formal
B: Actual
C: Static
D: Value
Archive for the ‘ABAP’ Category
The memory area of each main session has an area called ABAP Memory, which the
programs in the internal session can access with EXPORT TO MEMORY and
IMPORT FROM MEMORY. Data in the ABAP Memory is conserved through a
sequence of program calls. To transfer data to a called program, it can be placed in
the ABAP Memory with the EXPORT statement before the program is called. The
internal session of the called program then replaces the internal session of the
calling program and the data can be read from the ABAP Memory with the
IMPORT statement. Data can be passed in exactly the same way when the system
returns to the calling program.
The SAP Memory is a memory area to which all sessions of a SAP logon have
common access. In ABAP programs, the SET PARAMETER and GET
PARAMETER commands can be used to access the so-called SPA/GPA parameters
stored in the SAP Memory. Input fields on screens can be linked to this type of
parameter and default entries thereby established.
Comments (0) Get FREE daily updates by RSS or e-mail
From a user perspective there are two ways of starting programs: direct execution
using the program name for executable programs, or selecting a transaction code
for module pools. These two ways of calling programs can also be performed in
ABAP programs that are already running. We have mentioned the relevant
SUBMIT statement for executable programs. The corresponding statements for
transactions are LEAVE TO TRANSACTION and CALL TRANSACTION. We
can distinguish program calls from other ABAP programs by whether the calling
program is being canceled completely or whether the called program is embedded in
the calling program.
Module pools are executed in a very different manner than executable programs.
Executing a module pool does not start a process in the runtime environment that
sends events to the ABAP program in a specified sequence. Neither can module
pools be started by entering their name or using SUBMIT. Transaction code To
start a module pool you need to create at least one screen and define a transaction
code, which is linked to one of the module pool screens. This screen then becomes
the initial screen of a transaction with the ability to call other screens of the module
pool.
Screens in SAP
Written by jimstex on May 27th, 2009 | Filed under: ABAP
General screens
General screens or simply screens consist of the actual layout and a flow logic. The
German term for a general screen is Dynpro, meaning dynamic program. The
screen flow logic is a program layer that handles screen events and lies between the
actual ABAP application program and the runtime environment. The layout and
flow logic of a screen program are created with the Screen Painter tool.
Selection screens
Selection screens are special screens that are created through ABAP statements and
not the Screen Painter. The flow logic of selection screens is embedded in the
runtime environment; the screen events are converted to selection screen events.
Classical lists
Classical lists, previously known simply as lists, are screens with a special layout
that has a single output area that can be filled with formatted contents using ABAP
statements. As with selection screens, the screen flow logic is embedded in the
runtime environment and its events are forwarded to the ABAP program as list
events.
Type groups
Type groups or pools are introduced with the TYPE-POOL statement. They cannot
contain their own screens or processing blocks. They contain the definitions of
global data types, which can be made visible in any ABAP program by the TYPE-
POOLS statement. They are created with the ABAP Dictionary tool.
If you like this post, you may as well like these too:
Till some time back, SAP was deep into its not-so-friendly interface and
architecture, which it inherited from the IBM Mainframe based parent system. But
now it has come up with truly platform independent business object interfaces using
BAPIs. Business Objects and BAPIs provide an object-oriented view of SAP’s
business functionality.
BAPIs are implemented using Remotely callable Function modules. These RFCs are
assigned as a callable method of a Business Object in the Business Object
Repository (BOR). All BAPIs are independent of the screen and hence can work in
the background without user intervention. BAPI supports both inbound and
outbound processing. Since it follows object-oriented approach, SAP has positioned
itself to support interfacing through BAPIs in the future.
Check if the table meets the criteria for table buffering. When applying the table
buffering check if the table is frequently read, should be relatively small and
deferred visibility of changes is acceptable.
Do not apply table buffering for tables which are changed heavily or if the contents
of the table must be always up-to-date.
Ensure that you use the correct SELECT STATEMENT. Here are some of the
statements which bypass the table buffer.
Wrong
zcarr = xcarr.
Wrong
Right
UPDATE sflight
SET seatsocc = 1
WHERE carrid = 'LH ' AND
connid = '0300' AND
fldate = '20021204'.
Avoid the ORDER BY clause if the desired sorting doesn’t correspond to the index
used.
Wrong
Right
If you like this post, you may as well like these too:
1. Rules for Better SQL Programming # Tip 1 Always try to keep the hit list small by
using the where clause were ever required or by describing the full search condition in the
where clause. Select Query #1...
2. Rules for Better SQL Programming # Tip 2 Tip #2 : Minimize the Amount of
Transferred Data Minimize the amount of data transferred between the database and the
application server. Wrong SELECT * FROM sflight INTO xflight WHERE...
3. Rules for Better SQL Programming # Tip 3 Tip #3: Keep the number of round trips
between the database and the application server small. Use high-speed array operations with
UPDATE, INSERT, DELETE, MODIFY. Wrong LOOP AT itab INTO...
4. Rules for Better SQL Programming # Tip 4 Tip #4: Keep the Cost of the Search
Down Specify the WHERE clause to keep the number of searches down and create suitable
indices if necessary. Wrong SELECT bookid FROM...
Table buffering is used to increase performance when reading data from database
table. Data from a buffered table is read from a local buffer on the application
server thus reducing database access.
There are three different types of table buffering that can be used in SAP:
1. Full Buffering : All Records of the table are loaded into the buffer when a
record in the table is accessed.
2. Generic Buffering: All Records with the same key fields are loaded into the
buffer when a record in the table is accessed.
3. Single Record Buffering: The specific record that was accessed is loaded into
the buffer.
A Domain describes the value range of a field and is assigned to a data element. All
fields that use the data element will have the value range of the domain. The value
range is defined by specifying the type and length of the domain. Fixed value
intervals can also be defined for the domain and are automatically used as check
values on screen entries.
A Data element describes the business meaning of a domain. Information about the
meaning of a field such as its label is assigned to the data element and is accessible
from all screen fields that use the data element.
The First data transport occurs after all the PBO Modules have been executed and
prior to a screen being displayed. The system will transport the contents of the
ABAP work area in the program into the corresponding screen fields.
The Second data transport trigger is done once all the data entry is completed by
the user and before the first PAI Module is executed. The system will copy the
contents of the screen fields back to the corresponding ABAP work area in the
program.
The Select Single Statement is used to ensure that only one row is read from the
Database. The Search is terminated as soon as the that row is found with the
required criteria. Select Single will definetly produce better performance then
SELECT … UP TO 1 ROWS … END SELECT when you have something is search
for in the where clause.
As you know, you can lock/unlock transaction codes via SM01. But, how do you go
about viewing the transactions that are locked in the system? You need to look in
field CINFO of the table TSTC.
Within SAP, you can either SE11 or SE16 to browse the table contents. Make sure
you enter ‘A0′ as the “Hex01 data element for SYST” starting value and ‘A9′ as the
ending value. This will list all the transactions locked in the system.
• Home
• Beginners
• FAQs
• Online Store
• Archives
• RSS
• EMAIL
• What is RSS?
Recent Posts
Hi Guest!
You can contribute to ERP Database on any topic. ERP Database might be the right
place for your Ideas/Opinions to reach a larger audience.
In this exercise you will learn about logging onto the SAP system and you will also
use a BAPI and create a sales order in SAP. All without logging onto SAP. This Step
by Step guide on BAPI Exercise from sappoint will take you through all the steps.
• SQL Interface
• String manipulation
• Internal Tables
• Internal tables vs Field group
• Typing
• If, Case,
• Field Conversion
• Modularization
o Subroutines
o Function Modules
• Tools
o Static Analysis (Extended program check)
o Dynamic Analysis
o Database Access
• Getting the data / Data table identification
o F1-F9 / Technical info
o Runtime analysis
o Debug
o SE38
o Sql trace
o Logical database
o Function modules
• List of important tables & Function Modules
1. Synchronous RFC call: The calling program stops until the function module
executes on the target server and returns results.
2. Asynchronous RFC call: The calling program runs in parallel with the
function module on the target server. The target system must be available.
3. Transactional RFC call(tRFC): Several function modules are grouped into a
transaction. They are processed in the target system in the sequence in which
they are called.
What is ABAP?
Written by admin on Apr 8th, 2008 | Filed under: ABAP, Beginners, SAP
General
We already talked about SAP and ERP. Here is some little
information on ABAP and how it relates to SAP.
What is ABAP?
The ABAP Programming language was originally invented by SAP for developers to
develop SAP R/3 and is primarily used to develop custom functionality on SAP like
Creating Reports, Smart forms… etc.
We have various types of ABAP Programs like Reports, BDC, Subroutine Pools,
Function Modules, Includes, Type Pools, Class Pools, Interface Pools & Classes.
ABAP Workbench
This Workbench contains different tools for editing repository objects. These tools
allow to develop and complete almost everything and some of the objects include
ABAP Editor, ABAP Dictionary, Screen and Menu Painter, Function Builder and
Class Builder.
Data Types
What is a Client?
Written by admin on Sep 11th, 2008 | Filed under: ABAP
Each client has it’s own data environment. The client concept allows for the joint
operation of several enterprises in one system that are independent of each other in
business terms.
During each user session, a client is chosen from the main login screen in order to
specify which environment a user will access.
In order to load the data into the SAP system we have many techniques in use which
will get the job done. Majorly we have three techniques through which you can get
the data transfer done. These are Batch Input, Direct Input and BAPI’s.
1. Batch Input , also known as Batch Data Communication (BDC) : This approach
is used extensively in ABAP programming and remains a popular choice when no
other method exists. The online transaction processes is simulated and the data
transfer is done exactly as it is done online. A batch input session is created using
SHDB containing all of the data and screens and then processed. Well, if you make
any changes to the screen then you will have add these screens in the program or
else the BDC will fail.
2. Direct Input : The data in the input file is transferred directly to the SAP
database. No screens are involved. This methods used function modules to
accomplish the task. Well, not everything can be accomplished through this method.
Interface
Written by admin on Sep 9th, 2008 | Filed under: ABAP
An interface can be implemented publicly. The methods defined in the interface are
implemented in the class. All methods that are defined in the interfaces must be
present in the implementing class.
An interface can be accessed using an object reference as long as that objects class
implements the interface. This is done using the interface resolution operator ‘~’:
<object_name>-><interface_name>~<method_name>.
Quick checklist which you must know before your start with the program
development. Ask these questions before you go to SE38.
Garbage Collector
Written by admin on Sep 8th, 2008 | Filed under: ABAP
The Garbage Collector removes objects from memory that no longer have a
reference pointing to it. The garbage collector is a automatic system routine that will
delete the object from memory and release the memory.
Redefined Method
Written by admin on Sep 5th, 2008 | Filed under: ABAP
The Redefined method will have the same name and interface, but will have a new
implementation.
Redefined methods cannot be defined as final methods in the super class. Defining a
method as final indicates that the method cannot be overridden or redefined.
There is a very easy way to find out all the tables related to a given transaction.
Suppose you want to know the list of tables used when you create Sales Order or
Purchase Order. How can we achive it? How to we track the list of all the tables use
by SAP?
There is a very easy trick which will help you achieve that? It’s SQL trace. just start
ST05 and and start the SQL trace and go to any transaction and do any activity and
let the document get saved. Now again go to SQL trace screen and stop the SQL
trace and then click on display SQL trace that’s it. It will show you the list of all the
tables which have been accessed or updated.
A static method which is also called as class method can be called using the class and
does not require an Instance. Static methods are called using the following syntax:
CALL METHOD class_name=>instance_method_name
Class Methods are similar to instance methods but can only use static components.
Objects are instances of the class that are created by an ABAP Program at run time.
Abstraction
Abstraction refers to the ability to reflect the real world processes as realistically as
possible through programming. These processes can be a business or a technical
nature.
Encapsulation
Implementation details are hidden behind well-defined an documented interfaces.
They ensure that the abstract representation of a object is used only in accordance
with its spefication.
Inheritance
New abstractions i.e. classes are derived from existing ones. They inherit all the
attributes and methods of the higher class and can expand and specialize them.
Polymorphism
Different objects can present the same interface to the outside. A user only needs to
know the interface and need not know every minute details of the classes.
An Elementary Search help defines the flow of a standard input help. It is composed
of a selection method that defines where to get the data that will make up the hit list,
An interface consisting of search help parameters that define the exchange of data
between the screen and the selection method and a dialog type that controls how the
hit list will be displayed.
SAP Report Painter (PDF Download) is the main tool for defining reports in the
information system in controlling module.
All of the controlling reports (Cost center accounting, internal orders and profit
center accounting) are created using report painter. You can also create reports in
FI. With Report Painter you can define reports quickly and easily across rows and
columns. You can use standard reports delivered by SAP as a base, copy them and
do minor modifications, so as to suit your requirement. Very often it is felt that the
standard reports delivered by SAP do not meet the user’s requirement. Therefore
you need to create new reports.
Thus in FI you can upload the following master data through this: Vendors,
Customers, General Ledger, Asset master, Bank Master. You can upload
Transaction balance through this i.e. an FI document.
In CO you can upload the following master data: Cost element, Cost center, Profit
center, Activity types, Internal orders, Statistical key figures.
In other modules likewise you can upload other sets of master data.
This guide on LSMW covers the creation of a Vendor master data with accounting
view.
Dialog Programming / Module Pool
Written by admin on Aug 8th, 2008 | Filed under: ABAP
A Module Pool also called as Dialog Program is a ABAP Program of type “M” that
requires at least one transaction code in order to be executed. The transaction code
usually starts a screen and it’s associated flow logic.
Status Icons - Used in screens to indicate visually about the status of the program.
It’s a type of screen element and use the function module ‘ICON_CREATE’ to play
around with it.
Context menu – Content Menu can be created statiscally using SE41 or dynamically
using the class CL_CTMENU.
Screen keywords – Here are some screen keywords which you need to understand.
PROCESS,MODULE,FIELD,ON,LOOP,ENDLOOP,CHAIN,ENDCHAIN,CALL.
GUI Status and Title – Check the syntax for SET PF-STATUS and SET
TITLEBAR ‘XXXX’.
Step loops – This helps in displaying tabular data on the screen,
ALV Grid
Written by admin on Aug 7th, 2008 | Filed under: ABAP
There are two things which you need to basically understand when working with the
ALV Grid.
2. CL_GUI_ALV_GRID class is required to create the ALV Grid Control and place
this GRID in the above container.
You will need to create a reference variable to instantiate the class objects. Here is a
PDF Guide on ALV Grid control teaching you to learn everything about the ALV
Grid Control.
Standard tables have an internal index by default. Records can be accessed by using
the index number or with the any key. The response time always depends on the
volume of data in the standard internal table.
Sorted tables also has an internal index but it is pre-sorted by the key. They also
have an internal index. Records can be accessed by using the index number or with
the any key. The system uses binary search by default to retrieve the data faster.
Hashed tables have no Internal index and should be accessed by a key which must
be specified as unique. The response time totally depends on the Hash Algorithm.
Enhancement Framework
Written by admin on Aug 5th, 2008 | Filed under: ABAP
Learn the future of how ABAP systems can be enhanced using the new
‘Enhancement Framework’ available in SAP NetWeaver 2004s (and thus, mySAP
ERP 2005 and mySAP Business Suite 2005 applications).
Update (Feb 26, 2009) : More Information about enhancement framework can be
found here.
LSMW – Legacy System Migration Workbench
The Legacy System Migration Workbench is an SAP-based tool that supports You
when transferring data from non-SAP systems (“Legacy Systems”) to SAP systems1
once or periodically. The tool supports conversion of data of the legacy system in a
convenient way. The data can then be imported into the SAP system via batch input,
direct input, BAPIs or IDocs. Furthermore, the LSM Workbench provides a
recording function that allows to generate a “data migration object” in an entry or
change transaction.
Performace Tuning
Written by admin on Jun 30th, 2008 | Filed under: ABAP
Well, I know we have already talked about finding user exits in the program and
also we have a program to find out the user exits in a given Program/Transaction.
But, how many times have you searched in SPRO for the user exits. Just go to
SPRO –> SAP Reference IMG –> Find (user exits). You will be amazed with the list
of other places containing user exits.
There are 2 statements which allow to write ICON’s on the report output. We need
to have INCLUDE <ICON> or INCLUDE<LIST> statement in the program.
Eg: WRITE <ICON-NAME> as ICON. ” will give the desired icon on the list
output.
What is BADI?
Written by admin on Jun 13th, 2008 | Filed under: ABAP, Tips & Tricks
BADI stands for Business Add-in. BADI’s are an enhancement concept which uses
ABAP objects. Totally a object oriented method to enhance classes, interfaces,
methods.
You need to first define a BADI to enhance a SAP application program. The
developer needs to create an interface for the BADI. An Adapter class is created
from this that will implement the interface. Developers need to create an instance of
the adaptor class in the SAP Application program and create method calls as
required.
Modification Assistant
Written by admin on Jun 6th, 2008 | Filed under: ABAP, Tips & Tricks
The Modification assistant is a tool used to simplify the upgrade process as it relates
to modifications. The Modification assistant can be triggered through the ABAP
Editor and it will assist in logging modifications for any changes that are made to
the system.
The Modification assistant provides support for modification made through the
ABAP Editor, Screen Painter, Menu Painter, Text Element maintenance, Function
Builder and ABAP Dictionary.
Comments (0) Get FREE daily updates by RSS or e-mail
Quick Viewer is a comprehensive tool for defining reports in different forms such as
basic lists, statistics, or ranked lists. The Quick viewer is basically used for
generating basic lists and is very userful for beginners who was to analyze data
between two or more different tables.
Here is a PDF file to teach you step by steps instructions for Quick Viewer.
COPYRIGHT: ERPDB.INFO
Function Module exits exist in some SAP application programs to allow a customer
to add some functionality to the SAP Program. Search the SAP application program
for the search string “CALL CUSTOMER” to check if any function module exists.
Authorization Object
Written by admin on May 29th, 2008 | Filed under: ABAP, ABAP Keywords
ABAP Memory
Written by admin on May 27th, 2008 | Filed under: ABAP
Ever thought as to how to exchange the data between programs? well, that’s why we
have ABAP Memory for.
EXPORT TO MEMORY ID <memory_id_ name> will copy the data to ABAP Memory
and IMPORT FROM MEMORY ID <memory_id_ name> will copy the data from ABAP
Memory. One import thing to note is that the data declarations and data types
should be declared in both the programs and both of them must contain the same
data type otherwise it will not work.
Lock Objects
Written by admin on May 23rd, 2008 | Filed under: ABAP
Lock objects are a mechanism to control as to how the update takes place when
more than one user is updating the data in the same table.
To create lock objects you will need two function modules.
1. ENQUEUE_<LOCK_OBJECT_NAME>
This function module is used to generate a lock entry in the table making it only
accessible to only one user. Incase, for any reason if the lock object function module
is not able to lock the table. It will reflect in the return code.
2. DEQUEUE_<LOCK_OBJECT_NAME>
Now, If you want to end up having different programs trying to update the same
database table. To avoid problems code your database updates between 1 & 2.
Types of Lock
Shared Lock : Is a read only lock that prevents the data from being changed when
another user is reading it.
Exclusive Lock: Is a write lock that prevents data from being changed when another
user is updating it.
ABAP HR Programming
Written by admin on May 21st, 2008 | Filed under: ABAP
Course Outline:
Overview
Data definitions also called as meta data are managed and created in ABAP
Dictionary. It allows to maintain a huge volume of data without data redundancy.
The ABAP Dictionary describes the logical structure of all the dictionary objects
used in Application development. It also provides you with the flexibility of
accessing the data on the screen and allows you to maintain manage and create
without any programmers intervention.
The data dictionaries can be categorized into the following. Continue Reading …
Overview
Data definitions also called as meta data are managed and created in ABAP
Dictionary. It allows to maintain a huge volume of data without data redundancy.
The ABAP Dictionary describes the logical structure of all the dictionary objects
used in Application development. It also provides you with the flexibility of
accessing the data on the screen and allows you to maintain manage and create
without any programmers intervention.
• Database table
• Views
• Data types
• Domain
• Search Help
• Lock Objects
Database tables:
Tables can be defined independently in the database in the ABAP Dictionary. The
fields of the table are defined together with their data types and lengths.
A table definition has following components:
Table fields
Foreign keys
Technical settings
Indexes
Views
A View is a logical representation of tables. This is just a way of organizing the data
by combining more than one table by comparing the common fields which is called
a join.
Data types:
It’s an attribute to tell as to what kind of data is it going to hold like numbers,
characters, integers etc. A data type can be an elementary data type or a reference
data type.
Domain:
A domain contains the technical attributes of the data type. Like the length, the
actual data type ( like char, integer), The output characteristics and the value range
which tells us as to what kind of data can be accepted as a valid input.
Search Help:
A search help is simply what you see in SAP when you key in the F4 button. It
provides you with the list/range of values.
A search help can be categorised into three types:
Elementary Search help
Collective Search Help
Append Search Help
Lock Object:
A lock object is virtual link of an sap table which is used to synchronize the data
when more than one user attempts to write to the Database table. These lock objects
are called and handled inside the program based on requirement.
Okay, enough of theory… Lets get into practicals, Here is a step by step guide to
teach you in creating Data dictionary and Search help.
Copyright: SAP Database : SAP Certification, Ebooks, PDF, Articles, News
!!!! DO NOT COPY !!!!
ALV (ABAP List Viewer) Programs are very easy to write when you know few basic
facts about them. There are many Functions modules provided by SAP to handle
different tasks. Just go to SE37 and use *REUSE*ALV* and this would display all
the function modules related to ALV. Now to analyze and explain ALV, lets use the
simple ALV Grid function module ‘REUSE_ALV_GRID_DISPLAY’ as an
example.
Typically, all the ALV Reporting ends up into two different Categories.
First thing to do is decide all the fields you want to display in the grid. Make a list
and fill all these reporting fields in the internal table IT_FIELDCAT. You need to
add these field to get the minimal working; col_pos,
fieldname,tabname,seltext_m,outputlen & key.
Now,keep filling all the data into the intenal table IT_FIELDCAT.
Now comes the actual part of calling all the relevant function modules.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = ‘SET_PF_STATUS’ “PF Status
i_callback_user_command = ‘USER_COMMAND’ “Create a routine
USER_COMMAND
i_grid_title = gv_grid_title “Title
it_fieldcat = it_alv_catalog “Created Above
it_events = it_alv_event “Created Above
TABLES
t_outtab = gt_output. “Internal Table with actual data
• One of our Authors Swarna writes a lot of programs using ALVs. Refer his
Posts for some examples on ALV.
• I found a page on web with lots of ALV Programs.
• SAP has included its own demo examples. Refer the below programs for
more examples on ALV.
BCALV_FULLSCREEN_DEMO
BCALV_FULLSCREEN_DEMO_CLASSIC
BCALV_GRID_DEMO
BCALV_TREE_DEMO
BCALV_TREE_SIMPLE_DEMO
A Presentation Overview on
Covering :
Here is a Complete Guide of all the training manuals for SAP ABAP freshers. This
is a organized set of all the documents which you need to learn from start to finish.
The ABAP Tutorials are categorised sequentially from start to finish.
1. ABAP Programming
2. Dictionary
3. Internal Tables
4. ALV Grid Control
5. SAP List Viewer
6. Screen and Menu Painter
7. BDC Concepts
8. BDC Files
9. BDC Recording
10. BAPI Introduction & Programming
11. Object Oriented Programming
12. SAP Scripts/SmartForms
13. Enhancements
14. ALE Introduction/Programming/Steps
15. EDI & IDOC
16. IDOC Book
17. LSMW Introduction & Steps
18. Transport Management Systems
19. Workflow
Contains :
This article speaks about the upgrade from 4.6C to SAP ERP 6.0 from the View
point of ABAP Development team. Talks on tasks and challenges the developers
face, showing program changes needs to be made and also show some of the new
ABAP Features.
Take some time and have a look at the ABAP Knowledge corner provided by
Richard Harper. Has a lots of Information about Programming Techniques, Tips &
Tricks, Performance Issues and other interesting stuff.
ALV Programs
Written by admin on Apr 2nd, 2008 | Filed under: ABAP, ABAP Programs
ALV (ABAP List Viewer) Programs are very easy to write when you know few basic
facts about them. There are many Functions modules provided by SAP to handle
different tasks. Just go to SE37 and use *REUSE*ALV* and this would display all
the function modules related to ALV. Now to analyze and explain ALV, lets use the
simple ALV Grid function module ‘REUSE_ALV_GRID_DISPLAY’ as an
example.
Typically, all the ALV Reporting ends up into two different Categories.
Continue Reading …
• SE38
• SE80
• SE37
• SE11
• SE24
Continue Reading …
• SE38
• SE80
• SE37
• SE11
• SE24
• Inspection
• Creating Set of objects
• Check variant
Inspection
Object Set
Using sets of objects, you can group several single objects together for an inspection.
Sets of objects include, for example, programs, function groups, classes, or DDIC
objects. There are global and local sets of objects. Global sets of objects are visible
for all users while local objects are only visible for a single user.
Check variant
When you execute an inspection using the Code Inspector, the system checks the
individual objects of a defined set of objects for certain attributes using the check
variant. There are global and local check variants. Global check variants are
available for all users. In contrast to the global check variants, local check variants
are visible only for one user.
Elements of the code inspector:
Normal Syntax check : This is the check we all perform normally in the ABAP
workbench. This is our CTRL + F2 check in the ABAP editor.
Program generation :
This check is very similar to the other two checks but also generates the byte code of
the program. This is useful for removing inconsistencies which occur during an
upgrade.
Security checks
It checks :
The performance checks are carried out to check the following conditions :
1. Database accesses that will lead to high runtimes because of the WHERE clause
does not use an existing database index.
2. Select statements which use bypass buffer increasing database access.
3. CHECK statements inside SELECT and ENDSELECT loops.
4. Nested loops in internal tables.
5. Nested Selects.
Search operations
The code inspector offers search operations for use in ABAP programs
1. Search for tokens(words)
2. Search for complete statements
Copyright : ERPDB : This article can be reproduced as long as this line stays.
If you like this post, you may as well like these too:
1. Transaction Code to Access Other Transaction Code with Values Many times
in SAP, you may come across situations where in the users wants to have a separate
transaction codes for some of the tables which can be easily maintained...
Archive for the ‘ABAP’ Category
ABAP Basics
• ABAP Overview
• Data Dictionary
• Reports
• Modularisation and BDC
• SAP Scripts
• Module Programming
Advanced Topics
• ABAP Query
• ALE, IDOCS
• Badi
• Logical Database
• LSMW
• ABAP Code Optimisation
• RFC’s & BAPI’s
• SAP Workflow
User Exits
• Field Exits
• Function Exits
• Menu Exits
• Screen Exits
• Text Enhancements
• User Exits
OOABAP
• Events
• Inheritance
• Interfaces
• Object Oriented ABAP – Overview
• Simple Classes and Sub Classes
Comments (0) Get FREE daily updates by RSS or e-mail
SAP’s NetWeaver push and SOA (service-oriented architecture) strategy have left
ABAP developers confused about their future. In this podcast we talk with
SearchSAP.com careers expert, and president of jonerp.com, Jon Reed and Thomas
Jung, a NetWeaver product manager with SAP Labs, about how developers can
enhance their skills to keep up.
Source: SearchSAP
One of the readers send me these documents which are available on the esnips
folder. Just visit the below link.
http://www.esnips.com/web/sivaabap
REPORT zinfotype .
TYPE-POOLS : slis.
INITIALIZATION.
START-OF-SELECTION.
SELECT itext
infty
sprsl
FROM t582s
INTO CORRESPONDING FIELDS OF TABLE it_ittext
FOR ALL ENTRIES IN it_table
WHERE infty = it_table-infty
AND sprsl = 'E'.
ENDIF.
wa_output-infty = wa_table-infty.
wa_output-pnnnn = wa_table-pnnnn.
* For texts
READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty.
wa_output-itext = wa_ittext-itext.
ENDLOOP.
*On this statement double click it takes you to the screen painter
SE51.Enter the attributes
*Create a Custom container and name it CC_CONT and OK code as OK_CODE.
*Save check and Activate the scren painter.
*NOw a normal screen witn number 600 is created which holds the ALV
grid.
* PBO of the actual screen , Here we can give a title and customized
menuss
*&---------------------------------------------------------------------*
*& Module STATUS_0600 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0600 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '1'.
lv_fldcat-fieldname = 'INFTY'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 8.
lv_fldcat-scrtext_m = 'Infotype'.
lv_fldcat-icon = 'X'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '2'.
lv_fldcat-fieldname = 'PNNNN'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Structure'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '3'.
lv_fldcat-fieldname = 'ITEXT'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 60.
lv_fldcat-scrtext_m = 'Description'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
ENDFORM. " alv_build_fieldcat
*&---------------------------------------------------------------------*
*& Form alv_report_layout
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_IT_LAYOUT text
*----------------------------------------------------------------------*
FORM alv_report_layout.
it_layout-cwidth_opt = 'X'.
it_layout-zebra = 'X'.
ENDFORM. " alv_report_layout
* PAI module of the screen created. In case we use an interactive ALV or
*for additional functionalities we can create OK codes and based on the
user command
*we can do the coding.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0600 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0600 INPUT.
Maintenance Views
Maintenance views are used to view and/or modifi tables. A tranaction code can be
generated for the maintenance view.
Usefull transactioncodes:
Follow these steps to create a maintenance view and generate a transaction code for
it:
Type in Table/View name, Authorization Group, the name of the function module
for the screen code. Select one or 2 step screen maintenance:
Create tranaction code to call the view
Goto transaction SE93 and craete a new transaction. Select transaction type
Tranaaction with parameters
In the transaction select transaction SM30 Maintain Table Views and insert the
paramerts UPDATE and VIEWNAME in the default values part. Note that the
value for VIEWNAME should be the name of the maintenance view created above.
The value of UPDATE shoul be X.
Comments (0) Get FREE daily updates by RSS or e-mail
Gentran IDoc Data Definition File Generation Tool – Gentran’s mapping tool maps
1 structure to another structure. Typically, 1 structure is an EDI standard which is
provided by Sterling Commerce. In this case we assume the other structure to be
SAP’s Idoc structure.
1 click abap tool – This is a tool for quickly selecting last objects used for editing
purposes. Very useful for developers to quickly access their common objects.
EDI Utilities – Contains Workflow Utilities Differences in SWETYPV entries across
environments & Send email to managers of agents who are no longer there.
Contains EDI Utilities Send Email when IDoc hasn’t changed status for a period.
Update IDOC Status, Analyze EDPAR.
Find PO in IDOC – Find Inbound Idocs for a particular PO number.
IDOC Excel Upload – Changing an Idoc’s status with an Excel upload.
Source : ERPGenie.com
Archive for the ‘ABAP’ Category
• Append Structures
• Customizing INCLUDES
Advantages:
Here is a set of two documents with question and answers for TAW10. It will
definitely help you to improve your ABAP skills.
You usually get these dumps in ST22 with the runtime error as
CONVT_CODEPAGE and it says that the character set conversion is not possible.
So, how to we get rid of these errors?
These errors are caused when you try to download the file with some special
characters in the unicode system. When SAP system is not able to convert the
special characters, it ends up with this system dump.
Just add the clause IGNORE CONVERSION ERRORS when you try to open the
dataset and all these special characters which cannot be converted into a specific
code page will be skipped. You can also add the clause REPLACEMENT
CHARACTER space, with this addition, all the special non convertible characters
will simply be replaced with space.
BAL_* – All function modules used for SAP’s application logging can be found
here.
BAL_* – All function modules used for SAP’s application logging can be found
here.
FTP_DISCONNECT – Close the connection (and log off) the FTP server
RZL_READ_DIR – If the server name is left blank, it reads a directory from local
presentation server, otherwise it reads the directory of the remote server
SCROLLING_IN_TABLE -If you are coding a module pool and using a table-
control, you can use this function SCROLLING_IN_TABLE to handle any
scrolling. (provided by Paul Kjaer)
SXPG_CALL_SYSTEM – you can check the user’s authorization for the specified
command and run the command. The command runs on the host system on which
the function module is executed. The function module is RFC-capable. It can
therefore be run on the host system at which a user happens to be active or on
another designated host system at which an R/3 server is active.
UPLOAD_FILES – Will load one or more files from app or presentation server
WRITE_LIST -Useful for writing out the list contents that result from the function
LIST_FROM_MEMORY.
WS_DOWNLOAD – Save Internal Table as File on the Presentation Server
WS_UPLOAD – Load Files from the Presentation Server to Internal ABAP Tables
If you like this post, you may as well like these too:
1. SAP Function Modules SAP Function modules are procedures that are defined in
function groups (special ABAP programs with type F) and can be called from any ABAP
program. Function groups act as containers...
2. Tips : Function Modules Amount and Currency Date and Time Files Mail and SAP
Office Name and Address Messages and Pop-up Screens Reports and Dynpros System
( Logs, Directories, etc) Texts Others...
3. SAP Modules Briefed Here is a brief overview of most of the modules and there
processes in SAP. This should give you a brief outline of what each module is about and
also...
4. What is a Function Group A Function Group is an ABAP program that contains
function modules. Function modules that work with the same data objects can be combined
to form the function group. Each function...
5. SAP General Topics Contains PDF files on the below topics : DBA Cockpit for Oracle
Knowledge Providor SAP Benchmark Tools and Standard Application Benchmarks
Gartner’s Research on SAP’s Enterprise Search Strategy Quickly Access...
Lock objects
Lock objects are created in SE11. The name must start with E.
E. g.: EZHRACTIVITY_DEL
When the lock object is activated 2 function modules are created for
enqueueing and dequeueing the object. They re named ENQUEUE<name> and
DEQUEUE<name>
Example:
ENQUEUE_EZHRACTIVITY_DEL
DEQUEUE_EZHRACTIVITY_DEL
Parameters
Parameter X_<field> that defines the lock behavior when the initial
value is passed exists for every lock field <field>. If the initial
value is assigned to <field> and X_<field>, then a generic lock is
initialized with respect to <field>. If <field> is assigned the initial
value and X_<field> is defined as X, the lock is set with exactly the
initial value of <field>.
Parameter _SCOPE controls how the lock or lock release is passed to the
update program You have the following options:
• _SCOPE = 1: Locks or lock releases are not passed to the
update program. The lock is removed when the transaction is ended.
• _SCOPE = 2: The lock or lock release is passed to the update
program. The update program is responsible for removing the lock. The
interactive program with which the lock was requested no longer has an
influence on the lock behavior. This is the standard setting for the
ENQUEUE function module.
• _SCOPE = 3: The lock or lock release is also passed to the
update program. The lock must be removed in both the interactive
program and in the update program. This is the standard setting for the
DEQUEUE function module.
parameter _WAIT. This parameter determines the lock behavior when there
is a lock conflict.
You have the following options:
• Initial Value: If a lock attempt fails because there is a
competing lock, the exception FOREIGN_LOCK is triggered.
• X: If a lock attempt fails because there is a competing lock,
the lock attempt is repeated after waiting for a certain time. The
exception FOREIGN_LOCK is triggered only if a certain time limit has
elapsed since the first lock attempt. The waiting time and the time
limit are defined by profile parameters.
CALL FUNCTION 'DEQUEUE_EZHRACTIVITY_DEL'
* EXPORTING
* MODE_ZHR_ACTIVITY_DEL = 'E'
* MANDT = SY-MANDT
* PERNR =
* LDATE =
* X_PERNR = ' '
* X_LDATE = ' '
* _SCOPE = '3'
* _SYNCHRON = ' '
* _COLLECT = ' '
.
Inputparametre:
Returparametre:
field-symbols: <f>
data: txt(500) type c.
STANDARD table
Key access to a standard table uses a linear search. This means that the time
required for a search is in linear relation to the number of table entries.
SORTED table
Key access to a sorted table uses a binary key. If the key is not unique, the system
takes the entry with the lowest index. The runtime required for key access is
logarithmically related to the number of table entries.
HASHED table
Defines the table as one that is managed with an internal hash procedure
You can only access a hashed table using the generic key operations or other generic
operations ( SORT, LOOP, and so on). Explicit or implicit index operations (such as
LOOP ... FROM oe INSERT itab within a LOOP) are not allowed.
INDEX table
Index table is only used to specify the type of generic parameters in a FORM or
FUNCTION. That means that you can't create a table of type INDEX.
Any table is only used to specify the type of generic parameters in a FORM or
FUNCTION. That means that you can't create a table of type ANY.
If you don't need to know the number of entries in the table, but only wants to know
if there are any entries at all
use:
if itab[] is initial.........
itab2[] = itab2[]
Delete lines
Deleting a single line
refresh itab.
If you also want to free the mamory taken up by the table, use FREE instead of
REFRESH
Deleting a subset
Remember that you can also use wildcards. E.g. if you want to delete all name
statinmg with 'A':
To delete all duplicate entries from a sorted internal table (e.g. just after SORT),
you can use the
statement.
You can use the COMPARING adition to limit the fields that are used to test for
duplicate entries e.g.
SORT i_tab by matnr werks logort.
DELETE ADJACENT DUPLICATES FROM itab COMPARING matnr werks.
All duplicates withe same combination of matnr and werks will be deleted.
Note: You can only use COLLECT if all of the tables non-key fields are numeric
( Type I, P, F)
The collect command summarizes all numerical fields (Type I, P, F) that are not
part of the key into an internal table. The level of summarization is determined by
the table key which can be both numerical and non numerical. After using the
COLLECT command you will have a table with unique keys
Example:
REPORT zcollect.
TYPES:
BEGIN OF t_mytype,
key_c(10) TYPE c,
key_n(10) TYPE n,
key_i TYPE i,
number TYPE i,
END OF t_mytype.
DATA:
CLEAR wa_mytable.
wa_mytable-key_c = '10'.
wa_mytable-key_n = '25'.
wa_mytable-key_i = 5.
wa_mytable-number = 400.
CLEAR wa_mytable.
wa_mytable-key_c = '10'.
wa_mytable-key_n = '25'.
wa_mytable-key_i = 5.
wa_mytable-number = 500.
CLEAR wa_mytable.
wa_mytable-key_c = '11'.
wa_mytable-key_n = '30'.
wa_mytable-key_i = 6.
wa_mytable-number = 200.
CLEAR wa_mytable.
wa_mytable-key_c = '11'.
wa_mytable-key_n = '30'.
wa_mytable-key_i = 6.
wa_mytable-number = 900.
CLEAR wa_mytable.
wa_mytable-key_c = '11'.
wa_mytable-key_n = '30'.
wa_mytable-key_i = 7.
wa_mytable-number = 100.
END-OF-SELECTION.
WRITE: / wa_mytable-key_c,
wa_mytable-key_n,
wa_mytable-key_i,
wa_mytable-number.
ENDLOOP.
Result:
10 0000000025 5 900
11 0000000030 6 1.100
11 0000000030 7 100
If you remove key_i from the table key the result will be:
10 0000000025 10 900
11 0000000030 19 1.200
Adding Records to a Database Table
Add a single record to a database table
Example:
tables: mytable.
mytable-number = 1.
mytable-name = 'John'.
insert into mytable values mytable.
If you add accepting duplicate keys you can test if the table was successfully
updated, else a runtime error wil be generated.
Note: accepting duplicate keys does not mean that duplicate keys will be accepted,
only that it is possible to test on sy-subrc if you have tried to insert records with
duplicate keys. All remaining records will be inserted.
After you have inserted the recors the variable sy-dbcnt contains the number of
records that were inserted.
or
customer-customerno = '155151'.
delete cutsomer.
Dynamic SQL
• Dynamic where clause
• Using a dynamic table name
• Dynamic retrieval and writing of data
• Dynamic SELECT
* Build the where clause. Will look like this when finished
* WHERE ZAFSTMD02 = 'X' AND rbusa = '5145'
* With a constant, result: ZAFSTMD01 = 'X'
concatenate 'ZAFSTMD' zcostcheck-zmaaned ' = ''X''' into
where_clause.
* Select
select * from zcostfreq
where (where_tab).
endselect.
Note that you can combine static and dynamic where clauses:
This report prints the number og entries in a table. The table name is specified by a
parameter.
data:
l_count type i.
parameters:
p_tab type tabname.
start-of-selection.
select count(*) from (p_tab) into l_count.
write: / 'Number of entries in table ', p_tab, l_count.
In this example, data is retrieved from the table selected on the selection screen, and
the contents of the table is written to the screen.
DATA:
* Create variable that can contain referecene to any data
dataref TYPE REF TO data.
FIELD-SYMBOLS:
<row> TYPE ANY,
<component> TYPE ANY.
PARAMETERS:
p_tab TYPE tabname.
START-OF-SELECTION.
* Create a workarea for the tabel selected on the selection screen
SELECT *
FROM (p_tab) UP TO 10 ROWS
INTO <row>.
NEW-LINE.
DO.
* Write all the fields in the record
ASSIGN COMPONENT sy-index
OF STRUCTURE <row>
TO <component>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
WRITE <component>.
ENDDO.
ENDSELECT.
Dynamic SELECT
TYPES:
BEGIN OF st_bseg,
bukrs LIKE bseg-bukrs,
belnr LIKE bseg-belnr,
dmbtr LIKE bseg-dmbtr,
END OF st_bseg.
DATA:
sel_list TYPE STANDARD TABLE OF edpline,
li_bseg TYPE STANDARD TABLE OF st_bseg,
l_bseg TYPE st_bseg.
START-OF-SELECTION.
APPEND 'bukrs belnr dmbtr' TO sel_list.
SELECT (sel_list)
FROM bseg UP TO 100 ROWS
INTO TABLE li_bseg.
ENDLOOP.
* Read records from the database table where name is space, into an internal table
select * from personal into table itab
where name = space.
* Modify records in the database table. Only records with the same key values as
then
* internal table is modified
MODIFY personel from table itab.
Updating a single entry
In this example the entry with the key value Customerno = 1 is changed.
table customer.
customer-customerno = 1.
customer-customnavme = 'John'.
UPDATE customer.
if sy-subrc <> 0.
..... No entry with the customerno = 1, add error handling
endif.
endselect.
You must specify the full primarykey in the where clause to get a correct result.
tables: zsd00004.
data l_custname like like zsd00004-zcustname.
This could improve effciency for database tables with many entries and many fields.
Tables: zsd00003.
zsd00003-zprogram = g_screen0100-zprogram.
zsd00003-zstep = g_screen0100-zstep.
zsd00003-zenhed = g_screen0100-zenhed.
IF sy-subrc = 4.
This statement updates the fields zlogdato and zlogtid for the records that
satisfies the where clause.
start-of-selection.
select matnr
appending corresponding fields of table i_material
from mara.
end-of-selection.
loop at i_material.
write: / i_material-matnr, i_material-maktx.
endloop.
INNER JOIN
One or more lines from vbap is selected for each line in vbak.
The left outer join read lines from the left-handed table EVEN if there is
no corresponding line in the right hand table.
If vbap does not contain any lines that meets the condition, a single line
where the values from vbap is filled with null values.
Example 1
Example 2
Example:
* Selection table
DATA: BEGIN OF it_select_fkart OCCURS 0,
sign(1),
option(2),
low LIKE zsd00010-fkart,
high LIKE zsd00010-fkart,
END OF it_select_fkart.
* Build selection table
SELECT * FROM zsd00010
WHERE zaftaletype = '0/0'.
CLEAR it_select_fkart.
it_select_fkart-sign = 'I'.
it_select_fkart-option = 'EQ'.
it_select_fkart-low = zsd00010-fkart.
* it_select_fkart-high = . "Optional
APPEND it_select_fkart.
ENDSELECT.
* Select statement
SELECT vbeln
zuonr
kunag
fkart
fkdat
INTO CORRESPONDING FIELDS OF TABLE i_indlaes_vbrk
FROM vbrk
WHERE kunag IN s_kunag AND
fkart IN it_select_fkart.
endselect.
Conv
The exampel below read 50 records at a time from VBAK into an internal table,
and selects the corresponding entries from vbap into an internal table. Then the two
internal tables can be processed, and the next 50 records from VBAk can be read.
remeber to reinitialize tha tables before the next read.
REPORT z_test .
TYPES:
BEGIN OF t_vbak,
vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
END OF t_vbak,
BEGIN OF t_vbap,
posnr LIKE vbap-posnr,
matnr LIKE vbap-matnr,
meins LIKE vbap-meins,
END OF t_vbap,
BEGIN OF t_report,
vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
posnr LIKE vbap-posnr,
matnr LIKE vbap-matnr,
meins LIKE vbap-meins,
END OF t_report.
DATA:
li_vbak TYPE t_vbak OCCURS 0,
l_vbak TYPE t_vbak,
li_vbap TYPE t_vbap OCCURS 0,
l_vbap TYPE t_vbap,
li_report TYPE t_report OCCURS 0,
l_report TYPE t_report.
START-OF-SELECTION.
* Now you have the two internal tables li_vbak and liÆ_vbap filled with data.
* Do something with the data - remember to reinitialize internal tables
ENDIF.
ENDSELECT.
1. Writing to a flatfile
2. Reading a file
3. Authority check
Writing to a flatfile
Note: If the path is not inlcuded in the file name, the file is
ENDIF.
IF sy-subrc <> 0.
ENDIF.
ENDLOOP.
Reading a file
DATA: g_delimiter(1) TYPE c VALUE '¤',
IF sy-subrc <> 0.
write 'Error'.
EXIT.
ENDIF.
DO.
IF sy-subrc <> 0.
EXIT.
ELSE.
CLEAR wa_document.
wa_document-bukrs
wa_document-gjahr
wa_document-belnr.
ENDIF.
ENDDO.
Authority check
You can use the function module below to check for the necessary authorization. If
the default value for the PROGRAM parameters is the current program .
CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
EXPORTING
* PROGRAM =
activity = 'WRITE'
filename = dsn
EXCEPTIONS
no_authority = 1
activity_unknown = 2
OTHERS = 3
- Module pool = M
- Application = Z
When you create a screen, SAP automathic creates a field with the type
OK. The function code of the psuhbutton will be placed here when you
push the button. However you have to supply the name of the OK field
( In this example: OK_CODE ).
You must also create a global variable in the program, to store the
value of the OK field ( See below ).
ok_code(4),
* Temporary store the value of the OK code
save_ok_code(4).
ENDIF.
ENDMODULE.
CASE save_ok_code.
WHEN '0010'.
* Afstemninger
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
PERFORM my_list.
WHEN '0020'.
CALL TRANSACTION 'ZCO1'.
WHEN 'RETU'.
LEAVE TO SCREEN '0000'.
ENDCASE.
ENDMODULE.
AT USER-COMMAND.
* Here you can catch when the user psuh a button on the menu bar or
presses a function key
CASE sy-ucomm.
WHEN 'OPRT'.
PERFORM something.
ENDCASE.
dyfields-fieldname = 'PDPLA-VON_DATE'.
dyfields-fieldvalue = l_datestr.
APPEND dyfields.
Dear &NAME&
REPORT Z_HENRIKF_SCRIPT_FORM .
tables scustom.
form get_name tables in_tab structure itcsy
out_tab structure itcsy.
if sy-subrc = 0.
read table out_tab index 1.
move 'NAME' to out_tab-name.
move scustom-name to out_tab-value.
modify out_tab index sy-tabix.
else.
read table out_tab index 1.
move 'No name' to out_tab-value.
modify out_tab index sy-tabix.
endif.
** You could also fill the ouput parameter table this way
* READ TABLE out_par WITH KEY 'NAME1'.
* out_par-value = l_name1.
* MODIFY out_par INDEX sy-tabix.
endform.
Note: If you use more than one parameter you must use Using or
Changing before every parameter !
1. General Structure
2. Examples of function calls
1. OPEN FORM
2. START_FORM
3. WRITE_FORM
4. END_FORM
5. CLOSE_FORM
General Structure
The print program is used to print forms. The program retieves the necesary data
from datbase tables, defines the order of in which text elements are printed, chooses
a form for printing and selects an output device and print options.
* Open form printing - Must be called before working with any of the other form
function modules.
Must be ended with function module CLOSE FORM
call function 'OPEN_FORM'.....
*To begin several indentical forms containing different data within a single spool
request, begin each form using START_FORM, and end it using END_FORM
call funtion 'START_FORM'.....
* Ends form
call funtion 'END_FORM'.....
OPEN FORM
OPTIONS-TDDEST = '*'.
OPTIONS-TDIMMED = '*'.
OPTIONS-TDDELETE = '*'.
OPTIONS-TDNEWID = 'X'.
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
EXCEPTIONS
CANCELED =1
DEVICE =2
FORM =3
OPTIONS =4
UNCLOSED =5
MAIL_OPTIONS =6
ARCHIVE_ERROR =7
INVALID_FAX_NUMBER =8
MORE_PARAMS_NEEDED_IN_BATCH = 9
OTHERS = 10
.
IF sy-subrc <> 0.
...............................
ENDIF.
START_FORM
* LANGUAGE =''
* STARTPAGE =''
* PROGRAM =''
* MAIL_APPL_OBJECT =
* IMPORTING
* LANGUAGE =
* EXCEPTIONS
FORM =1
FORMAT =2
UNENDED =3
UNOPENED =4
UNUSED =5
OTHERS =6
WRITE_FORM
TYPE =3
UNOPENED =4
UNSTARTED =5
WINDOW =6
BAD_PAGEFORMAT_FOR_PRINT = 7
OTHERS =8
.
Parameters
Note: To write lines to the main window, you can also use the
WRITE_FORM_LINES function module.
Examples
Form layout of MAIN window
/E INTRODUCTION
* Dear Customer
...........................
/E ITEM_HEADER
IH Carrier, Departure
/E ITEM_LINE
IL &SBOOK-CARRID&, &SPFLI-DEPTIME&
/E CLOSING_REMARK
Writing introduction
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS =8
.
Set column headings into TOP area of main window for subsequent pages
LOOP AT .....
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_LINE'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8.
ENDLOOP.
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS =8
END_FORM
* IMPORTING
* RESULT =
EXCEPTIONS
* UNOPENED =1
* BAD_PAGEFORMAT_FOR_PRINT = 2
OTHERS =3
CLOSE_FORM
* Structure for Print options (return values) - Pages selected for printing, Number
of copies etc.
DATA BEGIN OF RESULT.
INCLUDE STRUCTURE ITCPP.
DATA END OF RESULT.
* RDI_RESULT =
* TABLES
* OTFDATA =
* EXCEPTIONS
* UNOPENED =1
* BAD_PAGEFORMAT_FOR_PRINT = 2
* SEND_ERROR =3
* OTHERS =4
.
Howver you are not always allowed to use this functionallity to copy forms, so
instead you can use transaction SCC1 Copy as per Transport Request
Here you use the transport where the form is placed to copy the form
How to change the original language for a form and optionally delete the form that
previously was in the original language:
You have a form in languages EN and ZH. The original language is EN. You want
to change the original language to ZH and delete the EN form
Standard Texts
Overview
Creating a standard text
Copying Standard texts between clients
Transporting a standard text
Using a standard text in a SapScript form
Overview
Standard texts are fixed texts that can be included in scripts. A standard text can be
maintained in severaæ languages.
Texts are stored in tables STXH & STXL (header and item).
Choose language
The standard texts that satisfies the criterias on the selection scren are shown. marj
the texts that you want to transport:
Press enter
I SE71 create a Character Format for then new font (Use the Character Format
button)
Now use the Character Format (In this case CI) to format the word(s) in the script
using the following syntax:
&VBDPR-FKIMG& <CI>&VBDPR-VRKME(C)&</>,,&komvd-kbetr&
Report
Code
REPORT zform_texts LINE-SIZE 260.
************************************************************************
* Date : 2006-05-30
************************************************************************
* Change log:
*
************************************************************************
TYPES:
BEGIN OF t_texts,
END OF t_texts.
DATA:
test(7) TYPE c,
startpos TYPE i,
endpos TYPE i,
len TYPE i,
*******************************************************
*******************************************************
PARAMETERS:
START-OF-SELECTION.
IF plang2 IS INITIAL.
plang2 = plang.
ENDIF.
PERFORM read_form_source.
PERFORM extract_texts_from_source.
END-OF-SELECTION.
PERFORM alv_setup.
PERFORM display_alv.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM read_form_source.
DATA:
form = pform.
EXPORTING
client = sy-mandt
id = 'TXT '
language = plang
name = form
object = 'FORM'
* ARCHIVE_HANDLE = 0
* IMPORTING
* HEADER =
TABLES
lines = it_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8
IF sy-subrc <> 0.
ENDIF.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM extract_texts_from_source.
startpos = 8.
endpos = sy-fdpos.
IF endpos > 8.
CLEAR wa_texts.
PERFORM read_standard_texts
USING wa_texts-tdname
plang
CHANGING wa_texts-tdline.
PERFORM read_standard_texts
USING wa_texts-tdname
plang2
CHANGING wa_texts-tdline2.
ENDIF.
ENDIF.
ENDLOOP.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM read_standard_texts
USING p_tdname
p_language
CHANGING p_tdline.
EXPORTING
client = sy-mandt
id = 'ST '
language = p_language
name = name
object = 'TEXT'
* ARCHIVE_HANDLE = 0
* IMPORTING
* HEADER =
TABLES
lines = it_line
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8
IF sy-subrc <> 0.
ELSE.
READ TABLE it_line INDEX 1
INTO wa_line.
IF sy-subrc = 0.
ENDIF.
ENDIF.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM alv_setup.
CLEAR l_wa.
REFRESH alv_fieldcat.
l_wa-key = 'X'.
l_wa-fieldname = 'TDNAME'.
l_wa-key = ''.
l_wa-fieldname = 'TDLINE'.
l_wa-seltext_s = tmp.
l_wa-seltext_m = tmp.
l_wa-seltext_l = tmp.
l_wa-key = ''.
l_wa-fieldname = 'TDLINE2'.
l_wa-seltext_s = tmp.
l_wa-seltext_m = tmp.
l_wa-seltext_l = tmp.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_alv.
gd_repid = sy-repid.
alv_layout-colwidth_optimize = 'X'.
alv_layout-zebra = 'X'.
alv_layout-no_min_linesize = 'X'.
EXPORTING
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = alv_layout
it_fieldcat = alv_fieldcat
* i_grid_title = text-005
TABLES
t_outtab = it_texts
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " display_alv
*---------------------------------------------------------------------*
* FORM top_of_page *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM top_of_page.
l_tmp(50) TYPE c.
* Title
wa_header-typ = 'H'.
wa_header-info = l_tmp.
CLEAR wa_header.
EXPORTING
it_list_commentary = t_header.
ENDFORM.
Transaction: WE30
Note: Same idoc can exist in different versions e.g. ORDERS01, ORDERS02…..
The difference between versions is that tehre are more segments in newer versions.
3. WE81: Create message type
Transaction WE80
3. BD59 Create the field that we will use to filter the idoc in the distribution model
We will use plant (WERKS) and material type (MTKLAS) to filter the idocs:
Note: You can take a look at the standard message type MATMAS to find ALE
object type and Segm. type
Press select the new model and press button Add message type to add the new
message type and the sender and receiver systems
5. BD60 To be able to use changepointers for the new message type, it must have a
reference to the original message type MATMAS. You make this referecne in BD60.
6. BD52 In this transaction you set up the fields that triggers a change. Note that it is
not possible to copy the fields from and existing message type (For example from
MATMAS). However, you can use an existing message type in BD52 to find out
Object and table name for the fields.
In the example below we only wants to trigger a change pointer when the material
text changes.
7. You should now be ready to test that the change pointer works for the new
transaction.
• Make a change to the material text for a material in plant 1002 of material
type HALB or ROH
• Run transaction BD21 or ABAP program RBDMIDOC for message type
ZMATMAS_SIMATIC
• Check that an outboudn IDOC has been created (Transaction WE02)
REPORT zhr_permitted_act_to_scanners.
TABLES: zhr_aktivititer.
TYPES:
BEGIN OF t_activities,
orgeh LIKE zhr_aktivititer-orgeh,
actid LIKE zhr_aktivititer-actid,
descr LIKE zhr_aktivititer-descr,
posid LIKE prps-posid,
post1 LIKE prps-post1,
END OF t_activities.
DATA:
gt_activities TYPE STANDARD TABLE OF t_activities,
wa_activities TYPE t_activities,
* Number of idoc created
g_num_of_idocs TYPE i,
* IDOC control record
g_idoc_control LIKE edidc,
* Return data from MASTER_IDOC_DISTRIBUTE
gt_comm_idocs TYPE STANDARD TABLE OF edidc,
wa_comm_idocs TYPE edidc,
* IDOC data record
gt_idoc_data TYPE STANDARD TABLE OF edidd,
wa_idoc_data TYPE edidd,
* Structure for idoc segment Z!ACTIV
g_z1activ LIKE z1activ.
*----------------------------------------------------------------------
--------
* SELECTION SCREEN
*----------------------------------------------------------------------
--------
* Data selection
SELECT-OPTIONS:
s_orgeh FOR zhr_aktivititer-orgeh.
PARAMETERS:
p_date LIKE sy-datum DEFAULT sy-datum OBLIGATORY.
SELECTION-SCREEN END OF BLOCK SELECTION.
* Communication parameters
SELECTION-SCREEN BEGIN OF BLOCK COMMUNICATION WITH FRAME TITLE text-002.
PARAMETERS:
p_idoctp LIKE edidc-idoctp OBLIGATORY DEFAULT 'ZHRACT01', "Idoc type
p_mestyp LIKE edidc-mestyp OBLIGATORY DEFAULT 'ZHRACT01', "Message
type
p_rcvpor LIKE edidc-rcvpor OBLIGATORY DEFAULT 'SAPUXI', "Receiver
port
p_rcvprt LIKE edidc-rcvprt OBLIGATORY DEFAULT 'LS', "Receiver
partner type
p_rcvprn LIKE edidc-rcvprn OBLIGATORY DEFAULT 'UXICLNT100'.
"Receiver partner
SELECTION-SCREEN END OF BLOCK COMMUNICATION.
* Output
SELECTION-SCREEN BEGIN OF BLOCK OUTPUT WITH FRAME TITLE text-010.
PARAMETERS:
p_idoc AS CHECKBOX, "Create
idoc
p_report AS CHECKBOX. "Show
report
SELECTION-SCREEN END OF BLOCK OUTPUT.
*----------------------------------------------------------------------
--------
* SELECTION SCREEN OUTPUT
*----------------------------------------------------------------------
--------
AT SELECTION-SCREEN OUTPUT.
* Protect parameters for idoc type and message type
LOOP AT SCREEN.
IF screen-name = 'P_IDOCTP' OR screen-name = 'P_MESTYP'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*----------------------------------------------------------------------
--------
* START OF SELECTION
*----------------------------------------------------------------------
--------
START-OF-SELECTION.
PERFORM read_data.
*----------------------------------------------------------------------
--------
* END OF SELECTION
*----------------------------------------------------------------------
--------
END-OF-SELECTION.
PERFORM create_control_record.
PERFORM create_data_records.
IF p_idoc = 'X'.
PERFORM distribute_idoc.
ENDIF.
IF p_report = 'X'.
PERFORM show_report.
ENDIF.
*&---------------------------------------------------------------------*
*& Form read_data
*&---------------------------------------------------------------------*
* Read activities from ZHR_AKTIVITITER and the corresponding
* WSB-elements and texts from PRPS
*----------------------------------------------------------------------*
FORM read_data.
REFRESH gt_activities.
SELECT zhr_aktivititer~orgeh
zhr_aktivititer~actid
zhr_aktivititer~descr
prps~posid
prps~post1
INTO CORRESPONDING FIELDS OF TABLE gt_activities
FROM zhr_aktivititer LEFT OUTER JOIN prps
ON prps~pspnr = zhr_aktivititer~pspnr
WHERE zhr_aktivititer~orgeh IN s_orgeh AND
zhr_aktivititer~begda <= p_date AND
zhr_aktivititer~endda >= p_date.
g_idoc_control-mestyp = p_mestyp.
g_idoc_control-idoctp = p_idoctp.
g_idoc_control-rcvpor = p_rcvpor.
g_idoc_control-rcvprt = p_rcvprt.
g_idoc_control-rcvprn = p_rcvprn.
REFRESH gt_idoc_data.
CLEAR:
wa_activities,
l_old_orgeh.
wa_idoc_data-segnam = 'Z1ACTIV'.
g_z1activ-orgeh = wa_activities-orgeh.
g_z1activ-actid = wa_activities-actid.
g_z1activ-descr = wa_activities-descr.
g_z1activ-posid = wa_activities-posid.
g_z1activ-post1 = wa_activities-post1.
REFRESH gt_comm_idocs.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
COMMIT WORK.
ENDIF.
* Generated IDOCs
WRITE : / text-003 COLOR COL_HEADING INTENSIFIED ON.
LOOP AT gt_comm_idocs INTO wa_comm_idocs.
WRITE : / wa_comm_idocs-docnum.
ENDLOOP.
SKIP 2.
ENDIF.
CLEAR t_itab_edids40.
t_itab_edids40-docnum = t_docnum.
t_itab_edids40-status = '51'.
t_itab_edids40-repid = sy-repid.
t_itab_edids40-tabnam = 'EDI_DS'.
t_itab_edids40-mandt = sy-mandt.
t_itab_edids40-stamqu = 'SAP'.
t_itab_edids40-stamid = 'B1'.
t_itab_edids40-stamno = '999'.
t_itab_edids40-stapa1 = 'Sold to changed to '.
t_itab_edids40-stapa2 = t_new_kunnr.
t_itab_edids40-logdat = sy-datum.
t_itab_edids40-logtim = sy-uzeit.
APPEND t_itab_edids40.
If not done allready, activate change pointers generally (Transaction BD61) and for
the message type ( Transaction BD50 )
Go to transaction SM59, select R/3 Connections create RFC destination that points
to client 200:
Create port
Go to transaction WE21 and create port for client 200. The port should point to the
RFC destination created above
Create partner profile
As in the sender system a RFC destination, port and partner profile should be
created in the receiver system cielnt 200. In the partner profile add message type
MATMAS:
Set up distribution model
In client C30 set up distribution model to distribute MATMAS idocs to client 200
Go to trsnaction BD64
Press the Add message type button and fill out the dialog box:
• In the sender system client 030 go to trsnaction MM02 and change a material
• In sender system client 030 Go to transaction BD21 and select message type
MATMAS and execute the program
• In the sender system client 030 go to transaction WE02 and check that an
outbound idoc of basis type MATMAS03 and message type MATMAS has
been sent without errors
• In the receiver system client 200 go to transaction WE02 and check that an
inbound idoc of basis type MATMAS03 and message type MATMAS has
been received without errors
• In the receiver system client 200 go to transaction MM02 and check that the
material has been changed
The step to distribute material master idocs to other systems using change pointers
are:
Posting programs have a standard interface for there input, output and table
parameters (See example below).
FUNCTION zidoc_input_zprocord .
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD
*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC
*" EXPORTING
*" VALUE(WORKFLOW_RESULT) LIKE BDWF_PARAM-RESULT
*" VALUE(APPLICATION_VARIABLE) LIKE BDWF_PARAM-APPL_VAR
*" VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK
*" VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS
*" TABLES
*" IDOC_CONTRL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_STATUS STRUCTURE BDIDOCSTAT
*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
*" SERIALIZATION_INFO STRUCTURE BDI_SER
*" EXCEPTIONS
*" WRONG_FUNCTION_CALLED
*" OTHERS
*"----------------------------------------------------------------------
DATA:
it_edidd TYPE STANDARD TABLE OF edidd,
wa_z1procord LIKE z1procord,
l_return TYPE string,
* lt_return TYPE STANDARD TABLE OF string,
l_subrc LIKE sy-subrc,
l_posting_error(1) TYPE c,
l_posting_ok(1) TYPE c.
in_update_task = ''.
*----------------------------------------------------------------------
* Loop through all Idocs
*----------------------------------------------------------------------
LOOP AT idoc_contrl.
*----------------------------------------------------------------------
* Select segments belonging to the Idoc
*----------------------------------------------------------------------
REFRESH: it_edidd.
LOOP AT idoc_data WHERE docnum = idoc_contrl-docnum.
APPEND idoc_data TO it_edidd.
ENDLOOP.
*----------------------------------------------------------------------
* Loop through the segments
*----------------------------------------------------------------------
REFRESH idoc_status.
CLEAR:
l_posting_error,
l_posting_ok.
CLEAR l_subrc.
PERFORM call_transaction
USING wa_z1procord
CHANGING l_subrc
l_return.
IF l_subrc = 0.
l_posting_ok = 'X'.
ELSE.
l_posting_error = 'X'.
* APPEND l_return TO lt_return.
ENDIF.
ENDCASE.
ENDLOOP.
*----------------------------------------------------------------------
* Set Idoc status code
*----------------------------------------------------------------------
CLEAR idoc_status.
idoc_status-docnum = idoc_contrl-docnum.
IF l_posting_ok = 'X' AND l_posting_error IS INITIAL.
* Application document posted
idoc_status-status = '53'.
ELSEIF l_posting_error = 'X' AND l_posting_ok IS INITIAL.
* Error: Application document not posted
idoc_status-status = '51'.
idoc_status-msgty = 'E'.
idoc_status-msgid = 'ZPP_SIMATIC_INTERFAC'.
idoc_status-msgno = '11'.
* idoc_status-msgv1 = l_return.
ENDIF.
APPEND idoc_status.
ENDLOOP.
ENDFUNCTION.
If not done allready, activate change pointers generally (Transaction BD61) and for
the message type ( Transaction BD50 )
Go to transaction SM59, select R/3 Connections create RFC destination that points
to client 200:
Create port
Go to transaction WE21 and create port for client 200. The port should point to the
RFC destination created above
As in the sender system a RFC destination, port and partner profile should be
created in the receiver system cielnt 200. In the partner profile add message type
MATMAS:
Set up distribution model
In client C30 set up distribution model to distribute MATMAS idocs to client 200
Go to trsnaction BD64
Press the Add message type button and fill out the dialog box:
• In the sender system client 030 go to trsnaction MM02 and change a material
• In sender system client 030 Go to transaction BD21 and select message type
MATMAS and execute the program
• In the sender system client 030 go to transaction WE02 and check that an
outbound idoc of basis type MATMAS03 and message type MATMAS has
been sent without errors
• In the receiver system client 200 go to transaction WE02 and check that an
inbound idoc of basis type MATMAS03 and message type MATMAS has
been received without errors
• In the receiver system client 200 go to transaction MM02 and check that the
material has been changed
Maintain object type for message type (BD59) Client independentThe ALE objects
are used to create links between IDocs and applications objects, to control the
serialisation, to filter messages in the customer model and to use listings. For our
own message type and IDoc you must maintain object types for the links.
If you want to check the serialisation for the message type, then you must maintain
object types for the serialisation. If no serialisation object has been maintained for a
given message type, then the serialisation will not be checked for this message
type.To add an object type to our message type, follow these next few steps:
• Enter transaction BD59 (ALE -> Extensions -> ALE object maintenance ->
Maintain object types)3
• Type in your message type ZINVRV and press enter
• Click on New entries
• Enter your object type, LIFNR (We need to use the vendor as a filter object),
the segment name where LIFNR resides, Z1INVRV, a number 1 for the
sequence followed by the actual field name LIFNR
• Save and exit
• You have now created an object that we’ll use as a filter object in the
customer model to direct the flow of messages to the various logical systems
based on the vendors in the filter of the message type ZINVRV.
We now need to add our new message type to the distribution model.
Configuring the Distribution Model. This task is performed on your ALE reference
client.
RSNAST00 Processes messages that has not bees sendt (processing <>
immediate)
RSNASTED Program, som kaldes fra Output Message Control ved
"udskrift" af ordrer m.v. Indeholder 2 entry points:
EDI_PROCESSING og ALE_PROCESSING. Herfra kaldes
det function module, som er tildelt via partner profilen og
process koden.
RBDMIDOC Generates IDOC's from change pointers (You can also use
transaction BD21)
RSEOUT00 Processes outbound IDOC's with status 30, ( IDOC's mass
processing)
RBDAPP01 Processes inbound IDOC's.
RSECHK07 Check if partner profiler is valid
Usefull tables
Table Discription
NAST Message Status
EDIDC Control information for an IDOC
EDID4 Data Records from 4.0 onwards
EDIDS Status of an IDOC
t_object-objkey = itab_data-objky.
t_object-objtype = 'VBRK'.
CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
EXPORTING
object = t_object
TABLES
roles = t_roles
EXCEPTIONS
internal_error = 1
no_logsys = 2
OTHERS = 3.
*** STEP 3 - Update IDoc status - If you wish to send additional status
messages through
REFRESH: itab_edids.
itab_edids-status = c_idoc_status_ok.
itab_edids-msgty = c_info_msg.
itab_edids-msgid = c_msgid.
itab_edids-msgno = c_msgno.
itab_edids-msgv1 = itab_edidc-docnum.
itab_edids-msgv2 = s_edidc-sndprn.
FUNCTION Z_IDOC_INBOUND_ASYNCHRONOUS.
*"---------------------------------------------------------------------
-
*"*"Local interface:
*" TABLES
*" IDOC_CONTROL_REC_40 STRUCTURE EDI_DC40
*" IDOC_DATA_REC_40 STRUCTURE EDI_DD40
*"---------------------------------------------------------------------
-
loop at idoc_control_rec_40
where mestyp = 'DELINS'.
loop at IDOC_DATA_REC_40
where docnum = idoc_control_rec_40-docnum and
segnam = 'E1EDP16'.
move IDOC_DATA_REC_40-sdata to e1edp16.
IF not E1EDP16-PRGRS CA 'DWMI'.
delete IDOC_DATA_REC_40.
ENDIF.
endloop.
endloop.
ENDFUNCTION.
Tip: You can use the BAPi explorer to get a step by step instuction/checklist in how
to create a BAPI. In the BAPI explorer select the Project tab.
BAPI Conventions
Methods
Parameters
Standardized BAPIs
Standardized Parameters
Important things to remember..
BAPI/ALE Integration
Methods
Parameters
• If standardized parameters are used, you have to use the names specified for
standardized parameters.
• BAPI parameter names should be as meaningful as possible. Poorly chosen
names include abbreviations and technical names (e.g. "flag", table names,
etc.).
The parameter and field names must be in English with a maximum of 30
characters.
• The components of a parameter name in the BOR are separated by upper
and lower case letters to make them easier to read. Example:
CompanyCodeDetail
• Values that belong to each other semantically should be grouped together in
one structured parameter, instead of using several scalar parameters.
• For ISO-relevant fields (country, language, unit of measure, currency),
additional fields for ISO codes are provided.
• Unit of measure fields must accompany all quantity fields and currency
identifiers must accompany currency amount fields.
Standardized BAPIs
Some BAPIs provide basic functions and can be used for most SAP business object
types. These BAPIs should be implemented the same for all business object types.
Standardized BAPIs are easier to use and prevent users having to deal with a
number of different BAPIs. Whenever possible, a standardized BAPI must be used
in preference to an individual BAPI.
The following BAPIs of the same object type have to be programmed so that they
can be called several times within one transaction. For example, if, after sales order
1 has been created, a second sales order 2 is created in the same transaction, the
second BAPI call must not affect the consistency of the sales order 2. After
completing the transaction with a COMMIT WORK, both the orders are saved
consistently in the database.
The BAPIs listed above for creating and changing data can also be used for mass
processing. For more information see BAPIs for Mass Data Transfer [Extern]
Standardized Parameters
There are some parameters that can be created for various BAPIs because they
contain the same or the equivalent data in all BAPIs. They should be implemented
the same in all BAPIs.
BAPI/ALE Integration
When you use the BAPIs for asynchronous messagning, the application in the sendig
systen calls the generated ALE IDoc interface isntead of the BAPI.
Tip: You can use the BAPi explorer to get a step by step instuction/checklist in how
to create a BAPI. In the BAPI explorer select the Project tab.
In this step a structures for the parameters and tables of the function module used
for the BAPI are defined.
ZBAPISTAT:
Important note:
You will have to define a structure for every parameter in the BAPI. You cannot use
the same structures used in existing applications because BAPI structures are frozen
when BAPIs are released and then there are restrictions on changing them.
ZBAPI_ORDER_STATUS_IMPORT
ZBAPISTAT
STEP 2 - Write Function Module
Important notes:
Attributes
Import Parameters
Export Parameters
Tables
Code
Notes:
INCLUDE LZBAPISTATUSUXX
*****************************************************************
* THIS FILE IS GENERATED BY THE FUNCTION LIBRARY. *
* NEVER CHANGE IT MANUALLY, PLEASE! *
*****************************************************************
INCLUDE LZBAPISTATUSU02.
"Z_BAPI_GET_ORDER_SYSTEM_STATUS
DATA:
* Declarations for TABLE parameter
T_BAPISTAT like ZBAPISTAT occurs 0,
G_BAPISTAT like ZBAPISTAT,
* Table for object texts
t_tj02t type type_tj02t occurs 0,
g_tj02t type type_tj02t.
***INCLUDE LZBAPISTATUSF01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form SET_RETURN_MESSAGE
*&---------------------------------------------------------------------*
* This routine is used for setting the BAPI return message.
*
* The routine is a standard routine for BAPIs that handles the message
* structure for the BAPIRETURN structure. It has been copied from the
* BAPI Company Code Getlist
*----------------------------------------------------------------------*
* -->P_MESSAGE text
* <--P_RETURN text
*----------------------------------------------------------------------*
form SET_RETURN_MESSAGE USING VALUE(P_MESSAGE) LIKE MESSAGE
CHANGING P_RETURN LIKE BAPIRETURN.
FUNCTION Z_BAPI_GET_ORDER_STATUS
FUNCTION z_bapi_get_order_system_status.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(I_AUFNR) TYPE AUFNR
*" VALUE(I_SPRAS) TYPE SPRAS DEFAULT SY-LANGU
*" VALUE(I_EXCLUDEINACTIVE) TYPE CHAR1 OPTIONAL
*" EXPORTING
*" VALUE(RETURN) TYPE BAPIRETURN
*" TABLES
*" T_BAPISTAT STRUCTURE ZBAPISTAT
*"----------------------------------------------------------------------
**
*"Local interface:
*" IMPORTING
*" VALUE(I_AUFNR) TYPE AUFNR
*" VALUE(I_SPRAS) TYPE SPRAS DEFAULT SY-LANGU
*" VALUE(I_EXCLUDEINACTIVE) TYPE CHAR1 OPTIONAL
*" EXPORTING
*" VALUE(RETURN) TYPE BAPIRET2
*" TABLES
*" T_BAPISTAT STRUCTURE ZBAPISTAT
*"----------------------------------------------------------------------
DATA:
l_aufnr LIKE afko-aufnr,
l_objnr LIKE jest-objnr.
********************************************
* Check if order exists
********************************************
SELECT SINGLE aufnr
FROM afko
INTO l_aufnr
WHERE aufnr = BAPI_ORDER_STATUS_IMPORT-orderid.
IF sy-subrc NE 0.
CLEAR message.
message-msgty = 'E'.
message-msgid = 'Z3'.
message-msgno = '000'.
message-msgv1 = BAPI_ORDER_STATUS_IMPORT-orderid.
PERFORM set_return_message USING message
CHANGING return.
IF 1 = 2.
* The only reason to include this statement, that will obviously
* never execute, is that it will create a referecence so that you
* can find out where a particular message is being used. This
* functionality is used by the BAPIs programmed by SAP
MESSAGE e000(z3).
ENDIF.
ENDIF.
CHECK return IS INITIAL.
********************************************
* Read order status
********************************************
CONCATENATE 'OR' BAPI_ORDER_STATUS_IMPORT-orderid INTO l_objnr.
IF BAPI_ORDER_STATUS_IMPORT-i_excludeinactive = 'X'.
SELECT objnr stat inact
FROM jest
INTO TABLE t_bapistat
WHERE objnr = l_objnr AND
inact <> 'X'.
ELSE.
SELECT objnr stat inact
FROM jest
INTO TABLE t_bapistat
WHERE objnr = l_objnr.
ENDIF.
IF sy-subrc <> 0.
* No object status found
CLEAR message.
message-msgty = 'E'.
message-msgid = 'Z3'.
message-msgno = '001'.
message-msgv1 = BAPI_ORDER_STATUS_IMPORT-orderid.
PERFORM set_return_message USING message
CHANGING return.
IF 1 = 2.
MESSAGE e001(z3).
ENDIF.
ENDIF.
CHECK return IS INITIAL.
********************************************
* Read order status texts
********************************************
SELECT istat txt04 txt30
FROM tj02t
INTO TABLE t_tj02t
FOR ALL ENTRIES IN t_bapistat
WHERE istat = t_bapistat-stat AND
spras = BAPI_ORDER_STATUS_IMPORT-i_spras.
ENDLOOP.
ENDFUNCTION.
You can either create the new Object type as a subtype of an existing business object
or create a new business object from scratch. In this example it would be obvious to
create the Object type as a subtype of BUS2005 Production order. However, to
illustrate how to create a new Object type from scratch, we will do this.
In the Object/Interface type field write the name of the new Business Object:
ZORDERSTAT. Press enter and fill in the additional fields necessary to create the
object type.
Supertype: Not relevant because we are creating our object from scratch
Program. This is the name of the program where the wizard generates code for the
Object type, NOT the function module we craeted earlier. The program name must
not be the name of an existinbg program.
Press enter and create the new business object. Note that when you create the
business object a standard interface, an attribute ObjectType and the methods
ExistenceCheck and Display are automatically generated. These cannot be
changed !
The next step is to add the Z_BAPI_GET_ORDER_STATUS method to the
business object. Select Utillities -> API methods -> Add method and write the name of
the functionmodule in the dialogbox. Next the dialogbox show below will be shown.
This is the start screen of the BAPI wizard. Proceed with wizard by pressing the
button.
After you have finished the wizard, tyou will notice that the ZGetOrderStatus has
been added to the business object:
You can doubleclick on the method to see its properties. To use the business object
you must change the Object type status to Implemented. Use menu Edit->Change
releases status->Object type->To implemented. No you can test thge object (Press
F8).
Note that the BAPI wizard has added a wrapper class for the function module so it
can be sued as method in the business object. Choose menu Goto->Program to
display the program:
• Release the business object type (in the BOR ObjectType -> Change release
status to -> Implemented ).
• Release the BAPI as a method in the BOR (Release the methods you has
created - Set the cursor on the method then
Edit -> Change release status -> Object type component -> To released )
• For potential write BAPIs: Release the IDoc and its segments
Recording
With the recording function SAP automatically cazn genererate the BDC table.
• Find the transaction code for the screen that you wan't to record
• Open transaction SM35 - Batch Input
• Push the button Recording
• In the Recording screen, enter then name you want to give the recording,
anmd push the Create button
• You will now be prompted for the transaction code. Enter the transaction
code. Push the enter button. You are now in the screen where you enter the
transactions.
• Enter transactions as normal, and leave the transaction when finished.
• You will now hen se an overview of the recording.
• Save the recording.
• Go back
• Push the Overview ( Mountain) button, to se the recording.
• You can know generate a program (push the Generate program button ) or
create a session ( Push the Create session button ).
• If you have created a session, go back to the initial screen of SM35 and push
the Overview button.
• Select your batch input session, and process it either in back- or
foreground.
REFRESH bdc_tab.
* Insert fields
* Call the transaction. Messages from Call Transaction are stored in the
IF sy-subrc = 0.
* was created
LOOP AT messtab.
w_transportorderno = messtab-msgv1.
ENDIF.
ENDLOOP.
ELSE.
PERFORM open_group.
PERFORM close_group.
ENDIF.
ENDFORM.
Here are the strandard forms used for call transaction and batch input
*******************************************************************
*******************************************************************
CLEAR bdc_tab.
bdc_tab-program = program.
bdc_tab-dynpro = dynpro.
bdc_tab-dynbegin = 'X'.
APPEND bdc_tab.
ENDFORM.
*******************************************************************
*******************************************************************
CLEAR bdc_tab.
bdc_tab-fnam = fnam.
bdc_tab-fval = fval.
APPEND bdc_tab.
ENDFORM.
*******************************************************************
* Opens group
*******************************************************************
FORM open_group.
EXPORTING
client = sy-mandt
* DEST = FILLER8
group = 'ZSM02'
* HOLDDATE = FILLER8
keep = 'X'
user = sy-uname
* RECORD = FILLER1
* IMPORTING
* QID =
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
OTHERS = 11.
ENDFORM.
*******************************************************************
* Closes group
*******************************************************************
FORM close_group.
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
ENDFORM.
*******************************************************************
* BDC_INSERT
*******************************************************************
EXPORTING
tcode = tcode
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
TABLES
dynprotab = bdc_tab
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
OTHERS = 7.
ENDFORM.
FORM Create_Transaction.
* Table for messages from call transaction. The table is automatically
filled with messags from call transaction.
DATA BEGIN OF messtab OCCURS 10.
REFRESH bdc_tab.
* Insert fields
PERFORM bdc_field USING 'LTAK-BWLVS' w_screen1000-io_bwls.
IF sy-subrc = 0.
* Call transaction successfull, get the number of the Transfer Order
that
* was created
LOOP AT messtab.
IF messtab-dynumb = '0104' AND messtab-msgnr = '016'.
w_transportorderno = messtab-msgv1.
ENDIF.
ENDLOOP.
ELSE.
* Call transaction failed, create a batch input session instead.
PERFORM open_group.
ENDFORM.
Here are the strandard forms used for call transaction and batch input
*******************************************************************
* Starts a new screen
*******************************************************************
FORM bdc_newdynpro USING program dynpro.
CLEAR bdc_tab.
bdc_tab-program = program.
bdc_tab-dynpro = dynpro.
bdc_tab-dynbegin = 'X'.
APPEND bdc_tab.
ENDFORM.
*******************************************************************
* Inserts a field in bdc_tab
*******************************************************************
FORM bdc_field USING fnam fval.
CLEAR bdc_tab.
bdc_tab-fnam = fnam.
bdc_tab-fval = fval.
APPEND bdc_tab.
ENDFORM.
*******************************************************************
* Opens group
*******************************************************************
FORM open_group.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
* DEST = FILLER8
group = 'ZSM02'
* HOLDDATE = FILLER8
keep = 'X'
user = sy-uname
* RECORD = FILLER1
* IMPORTING
* QID =
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
OTHERS = 11.
ENDFORM.
*******************************************************************
* Closes group
*******************************************************************
FORM close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
ENDFORM.
*******************************************************************
* BDC_INSERT
*******************************************************************
FORM bdc_insert USING tcode.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = tcode
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
TABLES
dynprotab = bdc_tab
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
OTHERS = 7.
ENDFORM.
1. Amount
2. Quantities
3. Dates
Amount
The problem with formating of amount arises beceause the decimal point and
thouasnd seperators depends on the user settings.
Use the subroutines below to format the amount correctly.
p_amount = '5.000,25'.
PERFORM format_amount
USING p_amount
CHANGING l_formatted_amount.
CHANGING p_formatted_amount.
l_decimal_point(1) TYPE c.
PERFORM get_seperators
CHANGING l_thousand_sep
l_decimal_point.
IF p_formatted_amount CA l_decimal_point.
ENDIF.
DO 5 TIMES.
ENDDO.
FORM get_seperators
CHANGING p_thousand_sep
p_decimal_point.
l_amount_string(15) TYPE c.
l_amount = '1.00'.
IF l_amount_string CS ','.
p_thousand_sep = '.'.
p_decimal_point = ','.
ELSE.
p_thousand_sep = ','.
p_decimal_point = '.'.
ENDIF.
ENDFORM.
Quantities
perform format_quantity using MyGsmng
changing menge_string.
changing p_gsmng_string.
into p_gsmng_string.
l_amount_string(15) type c.
l_amount = '1.00'.
if l_amount_string cs ','.
p_sep = '.'.
else.
p_sep = ','.
endif.
Dates
CALL FUNCTION
'DATUMSAUFBEREITUNG'
EXPORTING
idate = MyDate
IMPORTING
tdat8 = MyDateString
EXCEPTIONS
datfm_ungueltig = 1
datum_ungueltig = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF. Getting messages from call
transaction
types tt_errtab TYPE STANDARD TABLE OF BDCMSGCOLL.
However the message text is not stored in the table. You have to use
the
fields MSGID and MSGNR in the
table to find the message text. The easiest way is to use MESSAGE ...
INTO:
One transaction
PERFORM open_group.
PERFORM bdc_insert USING 'VD02'.
PERFORM close_group.
REFRESH bdc_tab.
ENDLOOP.
More transactions
PERFORM open_group.
'RF02D-VKORG' 'NVE',
'RF02D-VTWEG' '01',
'RF02D-SPART' '01',
'RF02D-D0320' 'X',
'BDC_OKCODE' '/00'.
PERFORM bdc_newdynpro USING 'SAPMF02D' '0320'.
ENDLOOP.
PERFORM close_group.
*
The other thing to remember is that the batch input uses the user's
default profile as the date it expects. Make sure the BATCHUSER format
*
You can get the appropriate date format by calling the function module
DATUMSAUFBEREITUNG.
Make sure that the user who process the session has the same date
format.
BADI
SE18 Initial Definition maintenance Screens
SE19 Initial Implementation maintenance Screens
In SE18 you define your badi (If it is not a standard BADI), and in SE19 you
implement the badi. A badi can (If it is defined as Multiple use) have multiple
implementations.
1. What is a BTE
2. How does it work
3. How to find a BTE
4. Implementing a BTE
What is a BTE
• Publish & Subscribe interfaces. Can not update data. Posiible to have
multiple implementations
• Process interfaces. Can update date. Only one active implementation
Implementing a BTE
Example:
Save
1. Find the development class for the TCode..u can find it by executing the Tcode
..then go to System on Menu Bar and click on Status.. a pop up will open up double
click on the TCode ..u will get the development class.
2. Now run the Transaction SMOD ..on the menu bar select Uitilies..then click on
find and then type the development class in the specified input field of development
class.
3. Execute (F8).
You will find all the User Exit for the TCode.
Regards,
Yahoo Group Member.
http://www.sapgenie.com/abap/code/abap26.htm
Selection Text: P_TCODE: Transaction Code to Search
Text Symbols: 001 - Enter the Transaction Code that you want to search through for
a User Exit
*&---------------------------------------------------------------------*
*& Tables
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Variables
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Selection Screen Parameters
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
*&---------------------------------------------------------------------*
*& Start of main program
*&---------------------------------------------------------------------*
START-OF-SELECTION.
IF sy-subrc NE 0.
SELECT SINGLE * FROM trdir
WHERE name = tstc-pgmna.
IF trdir-subc EQ 'F'.
SELECT SINGLE * FROM tfdir
WHERE pname = tstc-pgmna.
LOOP AT jtab.
SELECT SINGLE * FROM modsapt
WHERE sprsl = sy-langu AND
name = jtab-obj_name.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WRITE:/1 sy-vline,
2 jtab-obj_name HOTSPOT ON,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
ENDLOOP.
WRITE:/(95) sy-uline.
DESCRIBE TABLE jtab.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No of Exits:' , sy-tfill.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'No User Exit exists'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'Transaction Code Does Not Exist'.
ENDIF.
* Take the user to SMOD for the Exit that was selected.
AT LINE-SELECTION.
GET CURSOR FIELD field1.
CHECK field1(4) EQ 'JTAB'.
SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
1. How do you call SAP script in reports & reports in SAP script?
2. What is different between SAP script & reports?
3. What is stack?
4. What is the defination of ALE RFC?
5. Why is BAPI required? How about BDC?
6. What happens if I use control break statement in between select &
endselect?
7. What is lock Object
8. SAP Versions
9. SAP Platforms
10. SAP Processes
11. SAP Modules
12. SAP Table Name Standard
13. SAP Vendors
14. SAP Certification
15. What is SQL Trace, how would you carry out performance
analysis of ABAP code using SQL Trace? Give the steps?
16. What are the transactions we should use in BDC? How do we use
it?
17. How would you use BDC program to transfer material master
record using MM01 transaction? Give me steps.
18. Could we use ME21N transaction, and XK01 transaction, either
which one of the transaction, or could we use both the transactions for
creating purchase information.
19. What is the name of the standard report that gives the deatails of
Customer and sales amount?
20. How can we use XD02 transaction to change the customer data for
updating KNA1 table? Give the steps.
21. How the transaction ME21N is used for to upload the purchase
order in BDC?
22. How many transaction we can used in BDC at a time?
23. How the data get updated in BDC using transaction.
24. Why BAPI need then BDC?
25. What happen if I use controll break statement in between select &
endselect?
26. What is lock Object?
27. Select option works like _____________ on Selection Screen?
28. Which sysgtem variable have current value during execution?
29. What is the main point while using controll bareak in internal
table?
30. Waht is Field sysmbol?
31. Smartform uses wisely then selection screen, why?
32. Which one is not an exit comand? (Exit, cencle, stop, back)
33. Which component gives you better visibility? (pritty Printer)
34. Explain about roll area, Dispatcher, ABAP-Processor.
35. What is the final entry in BDC Table?
36. How can I get output on same page?
37. Why is Transaction Varient needed?
38. If I have table control, what is the same code in PBO and PAI?
39. Who takes care of passing the data to the application server?
Transactions: ABAP
Written by admin on Jan 12th, 2008 | Filed under: ABAP, Transactions
A
ADD for single fields
Adds two single fields.
Syntax
ADD TO .
The contents of are added to the contents of and the results are stored in . This is
equivalent to: = + .
More…
ADD for field sequences
Adds sequences of fields in storage.
Syntax
ADD THEN UNTIL GIVING .
ADD THEN UNTIL ACCORDING TO GIVING .
ADD THEN UNTIL TO .
ADD FROM TO GIVING .
If , ,…, is a sequence of fields with the same distance to one another and if they have
the same type and length, these fields are added and the result is stored in .
Different variants allow you to limit fields to a subsequence, to include in the sum,
and to perform the operation on a sequence of fields that directly follow one
another.
ADD-CORRESPONDING
Adds subfields of structures.
Syntax
ADD-CORRESPONDING TO .
All the subfields of the structures and having the same name are added and the
results are stored in .
ALIASES
Defines class-specific alias names for an interface component in ABAP objects.
Syntax
ALIASES FOR .
is defined within a class or interface as synonymous with the interface component .
APPEND
Appends a line or multiple lines to the end of an index table.
Syntax
APPEND |LINES OF TO
[ASSIGNING | REFERENCE INTO ].
A line or multiple lines of an internal table are appended to index table . If you use
ASSIGNING or INTO REFERENCE, field symbol refers to the appended line or
the relevant data reference is stored in after the statement.
ASSIGN
Assigns a field to a field symbol.
Syntax
ASSIGN [INCREMENT ] TO
[CASTING [TYPE |LIKE ] [DECIMALS ]] [RANGE ].
Data object is assigned to field symbol . now points to the data object. After the
addition INCREMENT , the storage area that is offset times by a length of starting
with is assigned to the field symbol. Pointed brackets are part of the syntax for field
symbol names. The CASTING addition permits you to cast data objects when
assigning field symbols. The RANGE addition defines the storage area in which
either offset/length accesses or the INCREMENT addition are allowed. In Unicode
programs, standard access is only allowed within the field limits of , but this can be
extended with RANGE. In non-Unicode programs, standard access is possible up to
the boundary of the data segment and can be limited with RANGE.
Syntax
ASSIGN ->* TO [CASTING ... ].
Dereferencing of the data reference in . The data object to which the data reference
refers is assigned to field symbol .
AUTHORITY-CHECK
Checks user authorization.
Syntax
AUTHORITY-CHECK OBJECT ID FIELD
ID FIELD
…
ID FIELD .
There is a check if the program user has all the authorizations defined in
authorization object . ,…, are the authorization fields of the authorization object. ,…
, …, are data objects of the program. The value of the data objects is checked
against the authorization fields.
B
BACK
Relative position of the output in a list.
Syntax
BACK.
Positions the list output either in the first column of the first line following the page
header of the current page or in connection with RESERVE in the first column of
the first line of a line block.
BREAK-POINT
Calls the Debugger.
Syntax
BREAK-POINT.
Interrupts execution of the program and goes to debugging mode. Is used as a test
help. Normal program processing is interrupted when this statement is reached and
the system goes to a debugger.
C
CALL CUSTOMER-FUNCTION
Calls the customer function modules.
Syntax
CALL CUSTOMER-FUNCTION …
Similar to CALL FUNCTION. The function modules must be programmed and
activated within the customer’s modification concept.
CALL FUNCTION
Calls the function modules.
Syntax
CALL FUNCTION [EXPORTING ... fi = a i... ]
[IMPORTING ... fi = a i... ]
[CHANGING ... fi = a i... ]
[TABLES ... fi = a i... ]
[EXCEPTIONS... ei = r i... ]
[DESTINATION ]
[IN UPDATE TASK]
[STARTING NEW TASK]
[IN BACKGOUND TASK].
The program calls either a function module in the same R/3 System, or one from an
external system, depending on the variant of the statement you use. You can call
update modules when processing transactions. You can also call functions
asynchronously. The other additions are used to specify actual parameters for the
parameter interface for the function module, , and to handle exceptions.
CALL DIALOG
Calls a dialog module.
Syntax
CALL DIALOG [AND SKIP FIRST SCREEN]
[EXPORTING... fi = a i... ]
[IMPORTING... fi = a i... ]
[USING itab].
Calls the dialog module . A dialog module is an ABAP program with a sequence of
screens. It does not have to be started using a transaction code, or run in the same
SAP LUW, like the calling program. The additions are used to skip the initial screen
in the sequence and specify actual parameters for the parameter interface of the
dialog module.
CALL METHOD
Calls a method in ABAP Objects.
Syntax
CALL METHOD [EXPORTING ... =.... ]
[IMPORTING ... =.... ]
[CHANGING ... =.... ]
[RECEIVING r = h ]
[EXCEPTIONS... = r i... ]
[PARAMETER-TABLE ]
[EXCEPTION-TABLE ].
[CALL METHOD]( … ).
Calls a method . The additions are used to specify actual parameters for the
parameter interface for the function module and to handle exceptions. The last two
additions pass parameters dynamically in a dynamic method call. Alternatively, if
the method is called statically, the parameters can be specified using parenthesis
notation (as you can when specifying parameters in a CALL METHOD statement).
You can also use functional methods with this syntax in operand positions.
CALL METHOD OF
Calls a method in OLE2 Automation.
Syntax
CALL METHOD OF .
Calls the method, , of the OLE2 Automation Object, .
CALL SCREEN
Calls a screen sequence.
Syntax
CALL SCREEN
[STARTING AT ]
[ENDING AT ].
Calls the sequence of screens that begins with the screen . All the screens in the
screen sequence belong to the current ABAP program. The screen sequence ends
when the program reaches the screen numbered 0. The additions let you call a single
screen in a new window.
CALL SELECTION-SCREEN
Calls a selection screen.
Syntax
CALL SELECTION-SCREEN
[STARTING AT ]
[ENDING AT ].
Calls a selection screen defined in an ABAP program. The selection screen is
processed in the program in the AT SELECTION-SCREEN event. The additions let
you call a selection screen in a new window.
CALL TRANSACTION
Call a transaction.
Syntax
CALL TRANSACTION
[AND SKIP FIRST SCREEN]
[USING ].
Calls the transaction after having received data from the calling program. At the
end of the transaction that has been called, the system returns to the statement
following the call in the calling report. The additions are used to skip the initial
screen in the sequence or to pass a batch input table to the transaction.
CASE
Conditional branch.
Syntax
CASE .
Opens a CASE control structure that ends with an ENDCASE statement. The
CASE control structure allows you to control which statement blocks (introduced
by WHEN) are processed, based on the contents of a data object.
CATCH
Catches a class-based exception.
CATCH … [INTO ].
You can only use this statement in a TRY-ENDTRY block, where you define a
handler for one or more class-based exceptions. You can use INTO to place a
reference to the exception object into the reference variable .
CATCH SYSTEM-EXCEPTIONS
Catches a catchable runtime error.
Syntax
CATCH SYSTEM-EXCEPTIONS = … = .
Introduces a CATCH area, which ends with an ENDCATCH statement. If a
catchable runtime error , occurs between CATCH and ENDCATCH, the current
processing block is interrupted. The system jumps to the appropriate ENDCATCH
statement and fills SY-SUBRC with .
CHECK
Conditionally leaves a loop or processing block.
Syntax
CHECK .
If the logical expression is true, the system continues with the next statement. If it is
false, processing within the loop is interrupted at the current loop pass, and the next
loop pass is performed. Otherwise the system leaves the current processing block. In
conjunction with selection tables, and inside GET events, you can use an extra
variant of the CHECK statement.
CLASS Declaration
Declares a class in ABAP Objects.
Syntax
CLASS DEFINITION [PUBLIC]
[INHERITING FROM ]
[ABSTRACT]
[FINAL]
[CREATE PUBLIC|PROTECTED|PRIVATE]
[FRIENDS ...]
[DEFERRED]
[LOAD].
Introduces the declaration part of a class, . The declaration part ends with
ENDCLASS and contains the declaration of all the components of the class. The
PUBLIC addition is generated only by the Class Builder. It defines a global class in
the Class Library. The INHERITING FROM addition lets you derive the class, ,
from a superclass, . The ABSTRACT addition defines an abstract class, which
cannot be instantiated. The FINAL addition defines a class that cannot have any
subclasses. The CREATE addition specifies who can instantiate the class. FRIENDS
allows you to specify other classes or interfaces, that can access the private
components of the class and instantiate objects of the class, independently of the
CREATE addition. The DEFERRED addition makes the class known to the
program before it is declared. The LOAD addition loads a class explicitly from the
Class Library.
CLASS – Implementation
Implements a class in ABAP Objects.
Syntax
CLASS IMPLEMENTATION.
Introduces the implementation part of a class, . The implementation part ends with
ENDCLASS and contains the implementation of all the components of the class.
CLASS-DATA
Declares static attributes of a class or interface.
Syntax
CLASS-DATA …
Like DATA. However, the attribute is declared as a static attribute. Static attributes
are not instance-specific. Their content is shared by all instances.
CLASS-METHODS
Declares static methods of a class or interface.
Syntax
CLASS-METHODS …
Like METHODS, except that the method is declared as a static method. A static
method can access static attributes and can only trigger static events.
CLASS-EVENTS
Declares static events of a class or interface.
Syntax
CLASS-EVENTS …
Like EVENTS, except that the event is declared as a static attribute. Static events
are the only type of event that can be triggered in a static method.
CLEANUP
Tidies up after class-based exceptions.
CLEANUP.
Can only be used within a TRY-ENDTRY block, where it defines a control block. If
a class-based exception is not caught with a CATCH statement, the system executes
the statements between CLEANUP and ENDTRY, before passing the exception
along the call hierarchy.
CLEAR
Sets a variable to its initial value.
Syntax
CLEAR .
The variable , which can have any data type, is set to an initial value appropriate to
its type.
CLOSE DATASET
Closes a file.
Syntax
CLOSE DATASET .
Closes a file opened with OPEN DATASET on the application server.
CLOSE CURSOR
Closes a database cursor.
Syntax
CLOSE CURSOR .
Closes a cursor opened with OPEN CURSOR.
COLLECT
Aggregates lines and then adds them to an internal table.
Syntax
COLLECT INTO
[ASSIGNING | REFERENCE INTO ].
The system checks whether there is already a table entry that matches the key. If
there is no corresponding entry already in the table, the COLLECT statement has
the same effect as INSERT. If an entry with the same key already exists, the
COLLECT statement does not append a new line, but adds the contents of the
numeric fields in the work area to the contents of the fields in the existing entry. If
you use ASSIGNING or INTO REFERENCE, field symbol refers to the inserted
line or the relevant data reference is stored in after the statement.
COMMIT
Closes a SAP LUW.
Syntax
COMMIT WORK [AND WAIT]
Writes all the database changes and releases all the database locks. Triggers
updating. The AND WAIT addition forces the program to wait until the system has
finished updating the database. Otherwise, updating is asynchronous.
COMMUNICATION
Enables two programs to communicate with each other.
Syntax
COMMUNICATION INIT DESTINATION ID [additions].
COMMUNICATION ALLOCATE ID [additions].
COMMUNICATION ACCEPT ID [additions].
COMMUNICATION SEND ID BUFFER [additions].
COMMUNICATION RECEIVE ID [additions].
COMMUNICATION DEALLOCATE ID [additions].
The statement initializes, creates, and accepts communication between two
programs; lets these two programs send and receive data; and then closes the
connection.
COMPUTE
Performs numeric operations.
Syntax
COMPUTE = .
The result of the mathematical operation specified in is assigned to the field . The
keyword COMPUTE is optional.
CONDENSE
Removes spaces from a string
Syntax
CONDENSE [NO-GAPS].
This statement removes any leading blanks from the field and replaces other
sequences of blanks by exactly one blank. If the addition NO-GAPS is specified, all
blanks are removed.
CONSTANTS
Declares constant data objects.
Syntax
CONSTANTS … VALUE [ | IS INITIAL]…
The syntax is similar to DATA, except that the VALUE addition is required, and
that internal tables and deep structures cannot be declared as constants The start
value specified in the VALUE addition cannot be changed during the execution of
the program.
CONTINUE
Ends a loop pass.
Syntax
CONTINUE.
Only possible within loops. This statement terminates the current loop pass and
starts the next
CONTEXTS
Declares a context.
Syntax
CONTEXTS .
Generates an implicit data type CONTEXT_, which you can use to create context
instances
CONTROLS
Defines a control.
Syntax
CONTROLS TYPE .
Defines an ABAP runtime object . This displays data in a particular format on a
screen, depending on the type Currently, may be a table control or tabstrip control
CREATE DATA
Creates a dynamic data object.
Syntax
CREATE DATA TYPE |LIKE .
CREATE DATA TYPE LINE OF |LIKE LINE OF .
CREATE DATA TYPE REF TO DATA|.
CREATE DATA TYPE TYPE|LIKE OF WITH .
If is a data reference variable, a data object of the specified type is created. The
reference in points to this object. You can omit the TYPE declaration in fully-typed
reference variables.
D
DATA with Reference to Known Data Types
Declares variables with a previously-declared data type
Syntax
DATA … [TYPE |LIKE ]… [VALUE ].
Declares a variable with the fully-defined data type or the same data type as another
data object . The data type can be D, F, I, T, a type defined locally in the program
using the TYPES statement, or a type from the ABAP Dictionary. The data object is
a data object or line of an internal table that has already been defined. The VALUE
addition specifies a starting value.
DEFINE
Defines a macro.
Syntax
DEFINE .
Introduces the definition of the macro . Each macro must consist of complete ABAP
statement and be concluded with the END-OF-DEFINITION statement.
DEMAND
Retrieves values from a context instance.
Syntax
DEMAND = … = FROM CONTEXT
[MESSAGES INTO ].
Fills the fields with the values from the context instance . You can handle these
messages in your programs by using the MESSAGES addition.
DESCRIBE DISTANCE
Gets the distance between two fields.
Syntax
DESCRIBE DISTANCE BETWEEN AND INTO [IN BYTE|CHARACTER
MODE].
Writes the number of bytes between data objects and into the variable . The length
of the first field in memory is always included. In Unicode programs, you must
specify either the IN BYTE MODE or IN CHARACTER MODE addition. In non-
Unicode programs, the distance is returned in bytes.
DESCRIBE FIELD
Describes the attributes of a field.
Syntax
DESCRIBE FIELD [LENGTH [IN BYTE|CHARACTER MODE]]
[TYPE [COMPONENTS ]]
[OUTPUT-LENGTH ] [DECIMALS ]
[EDIT MASK ] [HELP-ID ].
The attributes of the data object specified by the parameters of the statement are
written to the variables following the parameters. You can use any number of the
additions in the same statement. In Unicode programs, you must specify either the
IN BYTE MODE or IN CHARACTER MODE addition for LENGTH. In non-
Unicode programs, the length is returned in bytes.
DESCRIBE LIST
Describes the attributes of a list.
Syntax
DESCRIBE LIST NUMBER OF LINES [INDEX ].
DESCRIBE LIST NUMBER OF PAGES [INDEX ].
DESCRIBE LIST LINE PAGE [INDEX ].
DESCRIBE LIST PAGE [INDEX ]…
Depending on the variant of the statement that you use, writes the number of lines,
number of pages, a line of a list on a given page, or various attributes of a page to
variables.
DESCRIBE TABLE
Describes the attributes of an internal table.
Syntax
DESCRIBE TABLE [LINES ] [OCCURS] [KIND ].
Depending on the additions you use, writes the number of lines occupied, the value
specified for the INITIAL SIZE of the table, or the table type into a corresponding
variable.
DIVIDE
Divides one field by another.
Syntax
DIVIDE BY .
Divides the content of by , and places the result in . This is equivalent to: n=n/m.
DIVIDE-CORRESPONDING
Divides matching components of structures.
Syntax
DIVIDE-CORRESPONDING BY .
All the identically-named subfields of the structures and are divided and the results
are stored these subfields of .
DO
Introduces a loop.
Syntax
DO [ TIMES] [VARYING FROM NEXT ].
Introduces a statement block that ends with ENDDO. If you omit the TIMES
addition, the statement block is repeated until it reaches a termination statement
such as EXIT or CHECK. Use the TIMES addition to restrict the number of loop
passes to . The VARYING addition allows you to process fields the same distance
apart in memory.
E
EDITOR-CALL
Loads an ABAP program or internal table into a text editor.
Syntax
EDITOR-CALL FOR …
EDITOR-CALL FOR REPORT …
Loads the internal table or the program into a text editor, where you can edit it
using standard editor functions.
ELSE
Introduces a statement block in an IF control structure.
Syntax
ELSE.
If the logical expression in an IF statement is false, ELSE introduces the statement
block to be executed instead.
ELSEIF
Introduces a statement block in an IF control structure.
Syntax
ELSEIF .
If the logical expression in an IF statement is false and is true, ELSE introduces the
statement block to be executed instead.
END-OF-DEFINITION
Closes a macro definition.
Syntax
END-OF-DEFINITION.
This statement concludes a macro definition introduced with DEFINITION.
END-OF-PAGE
Event keywords for defining event blocks for list events.
Syntax
END-OF-PAGE.
Whenever the page footer is reached while a list is being created, the runtime
environment triggers the END-OF-PAGE event, and the corresponding event block
is executed.
END-OF-SELECTION
Event keywords for defining event blocks for reporting events.
Syntax
END-OF-SELECTION.
Once a logical database has read all of the required lines and passed them to the
executable program, the runtime environment triggers the END-OF-SELECTION
event, and the corresponding event block is executed.
ENDAT
Closes a statement block in control level processing.
Syntax
ENDAT.
This statement concludes a control level processing block introduced with AT.
ENDCASE
Closes a CASE control structure.
Syntax
ENDCASE.
This statement concludes a control structure introduced with CASE.
ENDCATCH
Closes a CATCH area.
Syntax
ENDCATCH.
This statement concludes an exception handling block introduced with CATCH
SYSTEM-EXCEPTIONS.
ENDCLASS
Closes a class definition.
Syntax
ENDCLASS.
This statement concludes a class declaration or implementation introduced with
CLASS.
ENDDO
Closes a DO loop.
Syntax
ENDDO.
This statement concludes a loop introduced with DO.
ENDEXEC
Closes a Native SQL statement.
Syntax
ENDEXEC.
This statement ends a Native SQL statement introduced with EXEC SQL.
ENDFORM
Closes a subroutine.
Syntax
ENDFORM.
This statement concludes a subroutine definition introduced with FORM.
ENDFUNCTION
Closes a function module.
Syntax
ENDFUNCTION.
This statement concludes a function module introduced with FUNCTION.
ENDIF
Closes an IF control structure.
Syntax
ENDIF.
This statement concludes a control structure introduced with IF.
ENDINTERFACE
Closes a interface definition.
Syntax
ENDINTERFACE.
This statement concludes an interface definition introduced with INTERFACE.
ENDLOOP
Closes a LOOP.
Syntax
ENDLOOP.
This statement concludes a loop introduced with LOOP.
ENDMETHOD
Closes a method.
Syntax
ENDMETHOD.
This statement concludes a method implementation introduced with METHOD.
ENDMODULE
Closes a dialog module.
Syntax
ENDMODULE.
This statement concludes a dialog module introduced with MODULE.
ENDON
Closes a conditional statement block.
Syntax
ENDON.
This statement ends a conditional statement block introduced with ON CHANGE.
ENDPROVIDE
Closes a PROVIDE loop.
Syntax
ENDPROVIDE.
This statement concludes a loop introduced with PROVIDE.
ENDSELECT
Closes a SELECT loop.
Syntax
ENDSELECT.
This statement concludes a loop introduced with SELECT.
ENDTRY
Closes a TRY area.
Syntax
ENDTRY.
This statement concludes a control structure introduced with TRY.
ENDWHILE
Closes a WHILE loop.
Syntax
ENDWHILE.
This statement concludes a loop introduced with WHILE.
EVENTS
Defines events in classes or interfaces.
Syntax
EVENTS EXPORTING.. VALUE() TYPE type [OPTIONAL]…
The event can be declared in the declaration part of a class or within an interface
definition, and may have EXPORTING parameters that are passed to the event
handler. The parameters are always passed by value.
EXEC SQL
Introduces a Native SQL statement.
Syntax
EXEC SQL [PERFORMING
].
Between EXEC SQL and the ENDEXEC statement, you can include a database-
specific Native SQL statement. The PERFORMING addition allows you to pass a
multiple-line selection line by line to a subroutine.
EXIT
Leaves a loop or processing block.
Syntax
EXIT.
Within a loop: The entire loop is terminated, and processing continues with the first
statement following the loop. Outside a loop: Terminates the current processing
block. In a reporting event: Jumps directly to the output list.
EXPORT
Exports data clusters.
Syntax
EXPORT… [FROM ]… | ()
TO MEMORY
| DATABASE () ID()
| SHARED BUFFER () ID().
The data objects or , or the data objects in the internal table are stored as a data
cluster in the cross-program ABAP memory of the current internal session, in a
cluster database table , or in the cross-transaction application buffer of the table .
EXTRACT
Creates an extract dataset and adds lines to it.
Syntax
EXTRACT .
With the first EXTRACT statement of a program, the system creates the extract
dataset and adds the first extract record. In each subsequent EXTRACT statement,
the new extract record is added to the dataset. Each extract record contains exactly
those fields that are contained in the field group , plus the fields of the field group
HEADER (if one exists).
F
FETCH
Uses a cursor to read entries from a database table.
Syntax
FETCH NEXT CURSOR INTO .
If the cursor is linked with a selection in a database table, FETCH writes the next
line of the selection into the flat target area .
FIELD-GROUPS
Declares a field group for an extract dataset.
Syntax
FIELD-GROUPS .
This statement defines a field group . Field groups define the line structure of an
extract dataset. You can also define a special field group called HEADER: When
filling the extract dataset, the system automatically prefixes any other field groups
with this field group.
FIELD-SYMBOLS
Declares field symbols.
Syntax
FIELD-SYMBOLS [|STRUCTURE DEFAULT ].
Field symbols are placeholders or symbolic names for other fields. Pointed brackets
are part of the syntax for field symbol names. The addition allows you to specify the
type of a field symbol. The STRUCTURE addition forces a structured view of the
data objects that you assign to the field symbol.
FIND
Searches for patterns.
Syntax
FIND
. The SECTION OFFSET LENGTH OF addition tells the system to search only
from the position in the length . IGNORING CASE or RESPECTING CASE
(default) specifies whether the search is to be case-sensitive. In Unicode programs,
you must specify whether the statement is a character or byte operation, using the
IN BYTE MODE or IN CHARACTER MODE (default) additions. The MATCH
OFFSET and MATCH LENGTH additions set the offset of the first occurrence and
length of the search string in the fields
and .
FORM
Defines a subroutine.
Syntax
FORM [USING ... [VALUE(] [)] [TYPE |LIKE ]… ]
[CHANGING... [VALUE(] [)] [TYPE |LIKE ]… ].
Introduces a subroutine
. The USING and CHANGING additions define the subroutine’s parameter
interface. The subroutine end with ENDFORM.
FORMAT
Sets formatting options for list output.
Syntax
FORMAT… [ON|OFF]…
The formatting options (such as color) set in the FORMAT statement, apply to all
subsequent output until they are turned off using the OFF option.
FREE
Release space in memory.
Syntax
FREE .
FREE MEMORY ID().
FREE OBJECT .
This statement deletes an internal table, a data cluster in ABAP memory, or an
external object in OLE2 Automation, depending on the variant of the statement
used.
FUNCTION
Defines a function module.
Syntax
FUNCTION .
Introduces the function module . This statement is not entered in the ABAP Editor,
but is automatically generated by the Function Builder in the ABAP Workbench.
The function module definition ends with the ENDFUNCTION statement
FUNCTION-POOL
Introduces a function group.
Syntax
FUNCTION-POOL.
The first statement in a function group. This statement is not entered in the ABAP
Editor, but is automatically generated by the Function Builder in the ABAP
Workbench. A function group is an ABAP program that contains function modules.
G
GET
Event keyword for defining event blocks for reporting events.
Syntax
GET [FIELDS ...].
Only occurs in executable programs. When the logical database has passed a line of
the node to the program, the runtime environment triggers the GET event, and the
corresponding event block is executed. You can use the FIELDS option to specify
explicitly the columns of a node that the logical database should read.
GET BIT
Reads an individual bit.
Syntax
GET BIT OF INTO .
Reads the bit at position of the hexadecimal field into the field .
GET CURSOR
Gets the cursor position on a screen or in an interactive list event.
Syntax
GET CURSOR FIELD [OFFSET ] [LINE ]
[VALUE ] [LENGTH ].
GET CURSOR LINE [OFFSET ] [VALUE ] [LENGTH ].
At a user action on a list or screen, the statement writes the position, value, and
displayed length of a field or line into the corresponding variables.
GET DATASET
Syntax
GET DATASET [POSITIONS ]
[ATTRIBUTE ].
Gets the attributes of a file opened using OPEN DATASET. The POSITIONS
additions writes the current read/write position to the field . The ATTRIBUTE
addition writes the attributes to a structure, , of the type DSET_ATTRIBUTES.
GET PARAMETER
Gets an SPA/GPA parameters
Syntax
GET PARAMETER ID FIELD .
Writes the value of the SPA/GPA parameter from the user-specific SAP memory
into the variable .
GET PF-STATUS
Gets the current GUI status.
Syntax
GET PF-STATUS [PROGRAM ] [EXCLUDING ].
Returns the name of the current GUI status (the same as SY-PFKEY) into the
variable . The PROGRAM addition writes the name of the ABAP program to which
the status belongs into the variable . The EXCLUDING addition returns a list of all
currently inactive function codes into the internal table .
GET PROPERTY
Gets a property of an OLE2 Automation object.
Syntax
GET PROPERTY OF
=.
Writes the property
GET REFERENCE
Gets a data reference.
Syntax
GET REFERENCE OF INTO .
Writes a data reference to an existing data object to the data reference variable .
GET TIME
Synchronizes the time.
Syntax
GET TIME [FIELD ].
Refreshes the system fields SY-UZEIT, SY-DATUM, SY-TIMLO, SY-DATLO, and
SY-ZONLO. The FIELD addition fills the variable with the current time.
H
HIDE
Stores information about list lines.
Syntax
HIDE .
While the list is being created, this statement stores the contents of the field and the
current line number in the internal HIDE area When the cursor is positioned on a
line in an interactive list event, the stored value is returned to the field .
I
IF
Conditional branch.
Introduces a new branch.
Syntax
IF .
Opens an IF control structure that ends with an ENDIF statement. The system
evaluates the logical expression , and processes different statement blocks depending
on the result.
IMPORT
Imports data clusters.
Syntax
IMPORT… [TO ]… | ()
FROM MEMORY
| DATABASE () ID()
| SHARED BUFFER () ID().
The data objects or , or the data objects in the internal table are read from data
clusters, either in the cross-program ABAP memory of the current internal session;
in a cluster database table ; or in the cross-transaction application buffer of the
table and written to the variables and .
IMPORT DIRECTORY
Creates the directory of a data cluster from a cluster database.
Syntax
IMPORT DIRECTORY INTO
FROM DATABASE ()
Id .
Writes a directory of the data objects belonging to a data cluster in the cluster
database to the internal table .
In the third variant, the table contains a directory of the objects stored using
EXPORT TO DATABASE.
INCLUDE
Inserts an include program in another program.
Syntax
INCLUDE .
Has the same effect as copying the source code of the include program into the
program. Include programs are not loaded at runtime, but are expanded when the
program is generated. Include programs must have the program type I.
INCLUDE TYPE|STRUCTURE
Includes a structure within another.
Syntax
INCLUDE TYPE |STRUCTURE [AS [RENAMING WITH SUFFIX ]].
Within a structure declared using TYPES|DATA BEGIN OF, copies a structured
datatype , or a structure already available as a data object, as part of the structure
declaration. The AS addition lets you address the individual components using the
name . The RENAMING addition lets you append a suffix, , to , so that you can
copy the same structure several times.
INITIALIZATION
Event keywords for defining event blocks for reporting events.
Syntax
INITIALIZATION.
Only occurs in executable programs. The ABAP runtime environment triggers the
INITIALIZATION event before the selection screen is processed, at which point the
corresponding event block is processed.
Inserts a line or a set of lines from the internal table into the internal table before
the line with the index . If is an index table, you can use the FROM and TO
additions to restrict the lines inserted. If you omit the INDEX addition, you can only
use the statement within a LOOP. A new line containing values is inserted before
the current line. If you use ASSIGNING or INTO REFERENCE, field symbol refers
to the inserted line or the relevant data reference is stored in after the statement.
INSERT for Programs
Inserts ABAP programs into the program library.
Syntax
INSERT REPORT FROM .
The lines of the internal table are added to the program library as the program .
INTERFACE
Declares a interface in ABAP Objects.
Syntax
INTERFACE [DEFERRED]
[LOAD].
Introduces an interface . The definition ends with ENDINTERFACE and contains
the declaration of all the components of the interface. The DEFERRED addition
makes the interface known to the program before it is defined. The LOAD addition
loads an interface explicitly from the Class Library.
INTERFACES
Implementation or nesting of an interface in ABAP Objects.
Syntax
INTERFACES
[ABSTRACT|FINAL METHODS | ALL METHODS ABSTRACT|FINAL ]
[DATA VALUES = = ...]
.
Used in a class declaration: This statement adds the components of the interface to
the existing class definition. Used in an interface definition: Forms a compound
interface. Use the additions to characterize methods in interfaces as abstract or
final. Their attributes can be filled with initial values.
L
LEAVE for Screens
Leaves a screen.
Syntax
LEAVE SCREEN.
Stops processing the current screen and calls the subsequent screen. The next screen
can either be defined statically in the screen attributes or set dynamically using the
SET SCREEN statement.
Syntax
LEAVE TO SCREEN .
Stops processing the current screen and calls the dynamically-defined subsequent
screen *.
LOAD-OF-PROGRAM
Event keywords for defining event blocks for a program constructor.
Syntax
LOAD-OF-PROGRAM.
When an ABAP program is loaded in an internal session, the runtime environment
triggers the LOAD-OF-PROGRAM event, and the corresponding event block is
executed.
LOCAL
Protects global data against changes.
Syntax
LOCAL .
Only occurs in subroutines. When the subroutine starts, the value of is stored
temporarily, and restored to the variable at the end of the subroutine.
M
MESSAGE
Displays a message.
Syntax
MESSAGE [WITH ... ] [RAISING ].
MESSAGE ID TYPE NUMBER .
MESSAGE ().
Displays the message of message class as message type . The message type specifies
how the message is displayed, and how the program reacts. The WITH addition
allows you to fill placeholders in the message text. The RAISING addition in
function modules and methods allows you to terminate the procedure and trigger
the exception .
MESSAGE TYPE
This variant display a string, , directly as a message of the type .
METHOD
Introduces the implementation of a method in a class.
Syntax
METHOD .
Only occurs in the implementation part of classes. Introduces a statement block that
ends with ENDMETHOD. You do not have to specify any interface parameters,
since these are defined in the method declaration.
METHODS
Declares methods in classes and interfaces.
Syntax
METHODS [FOR EVENT OF ]
IMPORTING… [VALUE(][)] TYPE [OPTIONAL]…
EXPORTING… [VALUE(][)] TYPE [OPTIONAL]…
CHANGING … [VALUE(][)] TYPE [OPTIONAL]…
RETURNING VALUE()
EXCEPTIONS … …
[ABSTRACT]
[FINAL]
[REDEFINITION].
You declare a method in the definition part of a class or in the definition of an
interface: The IMPORTING, EXPORTING, CHANGING, RETURNING, and
EXCEPTIONS additions define the parameter interface and exceptions of the
method. The ABSTRACT addition defines an abstract class, which cannot be
implemented in the same class. The function of a non-abstract method must be
implemented using METHOD. The FINAL addition prevents you from redefining
the method in subclasses. The REDEFINITION addition redefines a method of a
superclass. The FOR EVENT addition declares an event handler method for the
event of a class or interface.
Copies the work area into the line of the internal table with the same table key as . If
you use ASSIGNING or INTO REFERENCE, field symbol refers to the modified
line or the relevant data reference is stored in after the statement. You can use the
TRANSPORTING addition to specify the exact components that you want to
change.
MODIFY FROM TRANSPORTING … WHERE .
Copies the work area into the line of the internal table for which the logical
expression is true. In each comparison of the logical expression, the first operand
must be a component of the line structure.
]
|CURRENT LINE
LINE FORMAT …
FIELD VALUE [FROM ] [FROM ]…
FIELD FORMAT .
Changes either line on the current or specified list (or page), or the last line to be
chosen. The exact nature of the change is specified in the additions
MODIFY SCREEN
Changes the SCREEN table.
Syntax
MODIFY SCREEN…
Like changing an internal table. The system table SCREEN contains the names and
attributes of all of the fields on the current screen.
MODULE
Introduces a dialog module.
Syntax
MODULE OUTPUT |[INPUT].
Introduces the dialog module . The OUTPUT and INPUT additions designate the
module as a PBO or PAI module respectively. Each dialog module ends with
ENDMODULE.
MOVE
Assigns values.
Syntax
MOVE TO .
Assigns the contents of the data object to the variable , with automatic type
conversion if necessary. Equivalent to = .
MOVE-CORRESPONDING
Assigns values between identically-named components of structures.
Syntax
MOVE-CORRESPONDING TO .
Moves the contents of the components of structure to the components of that have
identical names.
MULTIPLY
Multiplies two single fields.
Syntax
MULTIPLY BY .
Multiplies the content of by , and stores the result in . This is equivalent to: m=m*n.
MULTIPLY-CORRESPONDING
Multiplies components of structures.
Syntax
MULTIPLY-CORRESPONDING BY .
All the identically-named subfields of the structures and are multiplied and the
results are stored these subfields of .
N
NEW-LINE
Inserts a line break in a list.
Syntax
NEW-LINE [NO-SCROLLING|SCROLLING].
Positions the list display after the page header. The NO-SCROLLING addition
prevents the new line from scrolling horizontally. SCROLLING resets the NO-
SCROLLING addition.
NEW-PAGE
Inserts a page break in a list.
Syntax
NEW-PAGE [NO-TITLE|WITH-TITLE]
[NO-HEADING|WITH-HEADING]
[LINE-COUNT]
[LINE-SIZE]
[PRINT ON|OFF].
Generates a new page and positions the list output after the page header. The
additions control how the page header is displayed, the length and width of the
page, and the print output.
NODES
Declares an interface work area.
Syntax
NODES .
Declares a variable with the same data type and the same name as a data type from
the ABAP Dictionary. Structures in main programs and subroutines declared using
NODES use a common data area. This statement is used in conjunction with logical
databases.
O
ON CHANGE
Introduces a new branch.
Syntax
ON CHANGE OF [OR OR ...].
Opens an ON control structure, which ends with ENDON. The statement block is
executed whenever the contents of the field or one of the other fields has changed
since the statement was last executed.
OPEN CURSOR
Opens a database cursor.
Syntax
OPEN CURSOR [WITH HOLD] FOR SELECT
FROM
[WHERE ]
[GROUP BY ]
[HAVING ]
[ORDER BY ].
Opens a cursor with type CURSOR for a SELECT statement. You can use all the
clauses of the SELECT statement apart from the INTO clause. The INTO clause is
set in the FETCH statement. If you use the WITH HOLD addition, the cursor is not
closed when a database commit occurs.
OPEN DATASET
Opens a file.
Syntax
OPEN DATASET
[FOR INPUT|OUTPUT|APPENDING|UPDATE]
[IN BINARY MODE
|IN TEXT MODE [ENCODING (DEFAULT|UTF-8|NON-UNICODE)]
|IN LEGACY BINARY MODE [(BIG|LITTLE) ENDIAN] [CODE PAGE ]
|IN LEGACY TEXT MODE [(BIG|LITTLE) ENDIAN] [CODE PAGE ]]
[REPLACEMENT CHARACTER ]
[IGNORING CONVERSION ERRORS]
[AT POSITION ]
[TYPE ]
[MESSAGE ]
[FILTER ].
Opens a file on the application server. The additions after FOR specify how the file
is read or written. The MODE additions specifies how content is interpreted (as
characters or in binary form). The ENCODING addition specifies the character
representation in the file. The LEGACY MODE allows you to read files that were
written before Release 6.10. REPLACEMENT CHARACTERS and CONVERSION
ERRORS are used to handle errors during character set conversion. AT POSITION
specifies the position in the file. MESSAGE specifies where system messages are
stored. FILTER lets you specify operating system commands.
OVERLAY
Overlays one string with another:
Syntax
OVERLAY WITH [ONLY ].
This statement overlays all positions in field containing letters which occur in with
the contents of . remains unchanged. If you omit ONLY , all positions of containing
spaces are overwritten.
P
PACK
Converts type C variables to type P.
Syntax
PACK TO .
Packs the string and places it in the field . This can be reversed with the UNPACK
statement.
PARAMETERS
Declares parameters for a selection screen.
Syntax
PARAMETERS
, an input field appears on the corresponding selection screen. The additions allow
you to define default values, accept lowercase input, define the field as required,
check values, define a checkbox or radio button, prevent the field from being
displayed on the selection screen, or modify the field
PERFORM
Calls a subroutine.
Syntax
PERFORM
| ( ) [IF FOUND]
|()[IN PROGRAM ()][IF FOUND]
[USING ... ... ]
[CHANGING... ... ]
[ON COMMIT].
Calls an internal or external subroutine or the subroutine whose name occurs in the
field. The external program is or the name contained in . The IF FOUND addition
prevents a runtime error from occurring if the subroutine does not exist. The
USING and CHANGING additions fill the subroutine’s parameter interface. The
ON COMMIT addition delays the execution of the subroutine until the next
COMMIT WORK statement.
POSITION
Absolute position of the display in a list.
Syntax
POSITION .
Positions the list display in the column .
PRIVATE
Defines the private section of a class.
Syntax
PRIVATE SECTION.
Introduces the declaration of all of the components of a class that are only visible in
the class itself.
PROGRAM
Introduces a program.
Syntax
PROGRAM …
The first statement in some ABAP programs. Equivalent to: REPORT.
PROTECTED
Defines the protected section of a class.
Syntax
PROTECTED SECTION.
Introduces the declaration of all of the components of a class that are only visible in
the class and its subclasses.
PROVIDE
Loops through internal tables at given intervals.
Syntax
PROVIDE … FROM
… FROM
… FROM
… BETWEEN AND .
The contents of the specified fields of the internal tables … are placed in their
header lines. The processing block between PROVIDE and ENDPROVIDE is then
executed for each interval.
PUBLIC
Defines the public section of a class.
Syntax
PUBLIC SECTION.
Introduces the declaration of all of the components of a class that are visible in the
class, its subclasses, and all users.
PUT
Triggers a GET event.
Syntax
PUT .
Only occurs in logical databases. Directs the program flow according to the
structure of the logical database.
R
RAISE for Class-Based Exceptions
Raises an exception.
Syntax
RAISE EXCEPTION TYPE | .
Terminates processing and raises an exception of the exception class . If the
reference variable points to an object of an exception class, can be specified instead
of TYPE.
RANGES
Declares a RANGES table.
Syntax
RANGES FOR .
Declares a RANGES table for the field . A RANGES table has the same data type as
a selection table, but is not linked to input fields on a selection screen.
]
|CURRENT LINE
[FIELD VALUE [INTO ]… [INTO ]].
Reads either the line on the current or specified list or page, or the last line to have
been selected by the user. The addition specifies the fields that you want to read, and
the target fields into which they should be placed. The entire line is always placed in
the system field SY-LISEL, and the HIDE area is filled for the line.
RECEIVE
Receives results from an asynchronous function module call.
Syntax
RECEIVE RESULTS FROM FUNCTION [KEEPING TASK]
[IMPORTING ... fi = a i... ]
[TABLES ... fi = a i... ]
[EXCEPTIONS... ei = r i... ]
Occurs in special subroutines to receive IMPORTING and TABLES parameters
from function modules called using the STARTING NEW TASK addition
REFRESH
Initializes an internal table.
Syntax
REFRESH .
Resets the internal table to its initial value, that is, deletes all of its lines.
REFRESH CONTROL
Initializes a control.
Syntax
REFRESH CONTROL FROM SCREEN .
The control defined in the CONTROLS statement is reset with the initial values
specified for screen .
REJECT
Leaves an GET processing block.
Syntax
REJECT [].
Terminates the processing of the current line of the node of the logical database. If
you use the optional , the logical database reads the next line of the node .
REPLACE by Pattern
Replaces strings in fields with other strings using a pattern.
Syntax
REPLACE [ FIRST OCCURENCE OF | ALL OCCURENCES OF ] IN [ SECTION
OFFSET LENGTH OF ] WITH
[IGNORING CASE|RESPECTING CASE]
[IN BYTE MODE|IN CHARACTER MODE]
[REPLACEMENT COUNT ]
[REPLACEMENT OFFSET ]
[REPLACEMENT LENGTH ].
In the string , the search pattern is replaced by the content of . By default, the first
occurrence of is replaced. ALL OCCURENCES specifies that all occurrences be
replaced. In the fields and , trailing spaces in C fields are ignored, but included in .
The SECTION OFFSET LENGTH OF addition tells the system to search and
replace only from the position in the length . IGNORING CASE or RESPECTING
CASE (default) specifies whether the search is to be case-sensitive. In Unicode
programs, you must specify whether the statement is a character or byte operation,
using the IN BYTE MODE or IN CHARACTER MODE (default) additions. The
REPLACEMENT additions write the number of replacements, the offset of the last
replacement, and the length of the last replaced string to the fields , , and .
REPLACE by Position
Replaces strings in fields with other strings by position.
Syntax
REPLACE WITH INTO [LENGTH ].
[IN BYTE MODE|IN CHARACTER MODE].
ABAP searches the field for the first occurrence of the first characters in the pattern
and replaces them with the string . In Unicode programs, you must specify whether
the statement is a character or byte operation, using the IN BYTE MODE or IN
CHARACTER MODE (default) additions.
REPORT
Introduces a program.
Syntax
REPORT [MESSAGE-ID ]
[NO STANDARD PAGE HEADING]
[LINE-SIZE ]
[LINE-COUNT ()]
[DEFINING DATABASE ].
The first statement in executable ABAP programs. can be any name you choose.
The addition MESSAGE-ID specifies a message class to be used in the program.
The DEFINING DATABASE addition defines the program as the database
program of the logical database . The other additions are formatting specifications
for the default list of the program.
RESERVE
Inserts a conditional page break in a list.
Syntax
RESERVE LINES.
Executes a page break on the current page if less than lines are free between the
current line and the page footer.
RETURN
Leaves a processing block.
Syntax
RETURN.
Leaves the current processing block. In a reporting event: Jumps directly to the
output list.
ROLLBACK
Undoes the changes in a SAP LUW.
Syntax
ROLLBACK WORK.
ROLLBACK WORK always undoes all changes back to the start of the database
LUW. The update modules are not called, and the log entry is deleted from table
VBLOG.
S
SCROLL
Scrolls through lists
Syntax
SCROLL LIST FORWARD|BACKWARD [INDEX ].
SCROLL LIST TO FIRST PAGE|LAST PAGE|PAGE [INDEX ] [LINE ].
SCROLL LIST LEFT|RIGHT [BY PLACES] [INDEX ].
SCROLL LIST TO COLUMN [INDEX ].
Positions the current list or the list level in accordance with the additions specified.
You can scroll by window, page, columns, or to the left- or right-hand edge of the
list.
SEARCH
Searches for strings.
Syntax
SEARCH | FOR [ABBREVIATED]
[STARTING AT ]
[ENDING AT ]
[AND MARK]
[IN BYTE MODE|IN CHARACTER MODE].
Searches the field or table for the string in the field . The result is stored in SY-
FDPOS. The additions let you hide intermediate characters, search from and to a
particular position, and convert the found string into uppercase. In Unicode
programs, you must specify whether the statement is a character or byte operation,
using the IN BYTE MODE or IN CHARACTER MODE (default) additions.
SELECT
Reads data from the database.
Syntax
SELECT
INTO
FROM
[WHERE ]
[GROUP BY ]
[HAVING ]
[ORDER BY ].
The SELECT statement consists of a series of clauses, each of which fulfils a certain
task:
SELECT clause
Defines the structure of the selection.
Syntax
SELECT [SINGLE]|[DISTINCT]
* | [AS ]… ( [DISTINCT] ) [AS ]…
The selection can be one line, SINGLE, or several lines. You can eliminate duplicate
lines using the DISTINCT addition. To select the entire line, use *, otherwise, you
can specify individual columns . For individual columns, you can use aggregate
functions , and assign alternative column names .
INTO clause
Defines the target area into which the selection from the SELECT clause is written.
Syntax
… INTO [CORRESPONDING FIELDS OF]
| INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE
[PACKAGE SIZE ]
| INTO (, ,…)
The target area can be a flat work area , an internal table , or a list of fields . If you
use the CORRESPONDING FIELDS addition, data is only selected if there is an
identically-named field in the target area. If you use APPENDING instead of INTO,
the data is appended to an internal table instead of overwriting the existing
contents. PACKAGE SIZE allows you to overwrite or extend the internal table in a
series of packages.The data type of the target area must be appropriate for the
selection in the SELECT clause.
FROM clause
The FROM clause determines the database tables from which the data specified in
the SELECT clause is read.
Syntax
… FROM [ [INNER]|LEFT [OUTER] JOIN] [AS ]
[ON ]
[CLIENT SPECIFIED]
[BYPASSING BUFFER]
[UP TO ROWS]
You can read both single fields and groups of fields. You link several tables using
inner and outer joins to link tables with conditions , where is a single table or itself a
join condition. The names of database tables may be specified statically or
dynamically, and you can use alias names. You can bypass automatic client
handling with the CLIENT SPECIFIED addition, and SAP buffering with
BYPASSING BUFFER. You can also restrict the number of lines read from the
table using the UP TO ROWS addition.
WHERE clause
Restricts the number of lines selected.
Syntax
… [FOR ALL ENTRIES IN ] WHERE
The condition may contain one or more comparisons, tests for belonging to
intervals, value list checks, subqueries, selection table queries or null value checks,
all linked with AND, OR, and NOT. If you use the FOR ALL ENTRIES addition,
the condition is checked for each line of the internal table as long as contains a field
of the internal table as an operand. For each line of the internal table, the system
selects the lines from the database table that satisfy the condition. The result set is
the union of the individual selections resulting from each line.
GROUP BY clause
Groups lines in the selection.
Syntax
… GROUP BY
Groups lines with the same contents in the specified columns. Uses aggregate
functions for all other columns in each group. All columns of the SELECT clause
that are not listed in the GROUP BY clause must be included in aggregate
functions.
HAVING clause
Restricts the number of line groups selected.
Syntax
… HAVING
Like the WHERE clause, but can only be used in conjunction with a GROUP BY
clause. The HAVING clause uses conditions to restrict the number of groups
selected.
ORDER BY clause
Sorts the lines of the selection.
Syntax
… ORDER BY PRIMARY KEY |… [ASCENDING|DESCENDING]…
Sorts the selection in ascending or descending order according to the primary key or
the contents of the fields listed.
SELECT-OPTIONS
Declares selection criteria for a selection screen.
Syntax
SELECT-OPTIONS FOR
[DEFAULT [to ] [OPTION ] SIGN ]
[MEMORY ID ]
[LOWER CASE]
[OBLIGATORY]
[NO-DISPLAY]
[MODIF ID ]
[NO-EXTENSION]
[NO INTERVALS]
[NO DATABASE SELECTION].
Declares a selection table for the field . For , places input fields on the corresponding
selection screen. The additions allow you to set a default value, accept input in
lowercase, define a required field, suppress or modify the display on the selection
screen, restrict the selection table to a line or a selection to a single field, or prevent
input from being passed to a logical database.
SET BIT
Sets individual bits.
Syntax
SET BIT OF [TO ].
This statement sets the bit at position of the hexadecimal field to 1 (or to the value of
field ). The field must contain the value 0 or 1.
SET COUNTRY
Sets output Formats
Syntax
SET COUNTRY .
Sets the output formats for numeric and date fields for the country with the ID .
SET CURSOR
Sets the cursor on the screen.
Syntax
SET CURSOR FIELD [OFFSET ]
[LINE ].
SET CURSOR LINE [OFFSET ].
SET CURSOR .
Sets the cursor either to a particular position in a field, line, or column of a line.
SET DATASET
Syntax
SET DATASET [POSITIONS | END-OF_FILE]
[ATTRIBUTE ].
Changes the attributes of a file opened using OPEN DATASET. The POSITIONS
addition sets the current read/write position to the value in the field or to the end of
the file. The ATTRIBUTE addition passes the attributes to the file in a structure, ,
of the type DSET_ATTRIBUTES.
SET HANDLER
Registers event handlers in ABAP Objects.
Syntax
SET HANDLER… … [FOR |FOR ALL INSTANCES].
If you do not use the FOR addition, the handler is set for all static events. Use the
FOR addition to register handlers for instance events.
SET LANGUAGE
Sets the display language.
Syntax
SET LANGUAGE .
All text symbols are refreshed with the contents of the text pool in language .
SET MARGIN
Sets the margin of a print page.
SET MARGIN [].
Sends the current list page to the spool system with a margin of columns from the
left-hand edge and rows from the top edge of the page.
SET PARAMETER
Sets an SPA/GPA parameters
Syntax
SET PARAMETER ID FIELD .
Writes the value of the field to the SPA/GPA parameter in the user-specific SAP
memory.
SET PF-STATUS
Sets the GUI status
Syntax
SET PF-STATUS [EXCLUDING |]
[IMMEDIATELY] [OF PROGRAM ].
Sets the GUI status for the subsequent screens. The EXCLUDING addition allows
you to deactivate functions dynamically. The IMMEDIATELY addition sets the
GUI status of the list currently displayed. The OF PROGRAM addition allows you
to use a GUI status from another program.
SET PROPERTY
Sets a property of an OLE2 Automation object.
Syntax
GET PROPERTY OF
=.
Sets the property
SET SCREEN
Sets the next screen.
Syntax
SET SCREEN .
Temporarily overwrites the statically-defined next screen with . is processed after
the current screen.
SET TITLEBAR
Sets the screen title.
Syntax
SET TITLEBAR [OF PROGRAM ] [WITH ... ].
Sets the title for the subsequent screens. The OF PROGRAM addition allows you to
use a title from another program. The WITH addition fills any placeholders in the
title.
SET USER-COMMAND
Triggers a list event.
Syntax
SET USER-COMMAND .
Triggers a list event with the function code and calls the corresponding event block.
SHIFT
Shifts strings.
Syntax
SHIFT [BY PLACES] [LEFT|RIGHT|CIRCULAR]
[IN BYTE MODE|IN CHARACTER MODE].
Shifts the field by one or places. The additions allow you to specify the direction,
and how the empty spaces are dealt with. In Unicode programs, you must specify
whether the statement is a character or byte operation, using the IN BYTE MODE
or IN CHARACTER MODE (default) additions.
SPLIT
Splits a string.
Syntax
SPLIT AT INTO … INTO TABLE
[IN BYTE MODE|IN CHARACTER MODE].
This statement searches the character field for delimiter strings and the parts before
and after the delimiters are placed in the target fields …> … , or into a new line of
the internal table . In Unicode programs, you must specify whether the statement is
a character or byte operation, using the IN BYTE MODE or IN CHARACTER
MODE (default) additions.
START-OF-SELECTION
Event keywords for defining event blocks for reporting events.
Syntax
START-OF-SELECTION.
After the selection screen has been processed, the runtime environment triggers the
LOAD-OF-PROGRAM event, and the corresponding event block is executed.
STATICS
Defines static variables.
Syntax
STATICS …
Like DATA. Retains the value of a local variable beyond the runtime of the
procedure in which it occurs.
STOP
Leaves a reporting event.
Syntax
STOP.
Only occurs in event blocks for reporting events. Leaves the event block and goes to
the END-OF-SELECTION block.
SUBMIT
Calls an executable program of type 1.
Syntax
SUBMIT [AND RETURN] [VIA SELECTION-SCREEN]
[USING SELECTION-SET ]
[WITH ]
[WITH FREE SELECTIONS ]
[WITH SELECTION-TABLE ]
[LINE-SIZE ]
[LINE-COUNT ].
Calls the program . If you omit the AND RETURN addition, the current program is
terminated. Otherwise, the data from the current program is retained, and
processing returns to the calling program when has finished running. The other
additions control the selection screen and set attributes of the default list in the
called program.
SUBTRACT-CORRESPONDING
Subtracts components of structures.
Syntax
SUBTRACT-CORRESPONDING FROM .
All the subfields of the structures and having the same name are subtracted and the
results are stored in .
SUM
Calculates sums of groups.
Syntax
SUM.
Only occurs in loops through internal tables. Calculates the sums of the numeric
fields in all lines of the current control level and writes the results to the
corresponding fields in the work area.
SUPPLY
Fills context instances with values.
Syntax
SUPPLY = … = TO CONTEXT .
Fills the key fields of the context instance with the values .
SUPPRESS DIALOG
Prevents the current screen from being displayed.
Syntax
SUPPRESS DIALOG.
Can only occur in a PBO dialog module. The screen is not displayed, but its flow
logic is still processed.
T
TABLES
Declares an interface work area.
Syntax
TABLES .
Declares a structure with the same data type and the same name as a database table,
a view, or a structure from the ABAP Dictionary. Structures in main programs and
subroutines declared using TABLES use a common data area.
TOP-OF-PAGE
Event keywords for defining event blocks for list events.
Syntax
TOP-OF-PAGE [DURING LINE-SELECTION].
Whenever a new page begins while a standard list is being created, the runtime
environment triggers the TOP-OF-PAGE event and the corresponding event block
is executed. The addition DURING LINE-SELECTION has the same function, but
for detail lists.
TRANSFER
Writes to a file.
Syntax
TRANSFER TO [LENGTH ].
Writes the field to the file on the application server. You can specify the length of
the data you want to transfer using the LENGTH addition.
TRANSLATE
Converts characters to strings.
Syntax
TRANSLATE TO UPPER|LOWER CASE
|USING .
The characters of the string are converted into upper- or lowercase, or according to
a substitution rule specified in .
TRY
Introduces a TRY block.
Syntax
TRY.
Class-based exceptions can be handled using the CATCH statement, within the
block ended with ENDTRY.
TYPE-POOL
Introduces a type group.
Syntax
TYPE-POOL .
The first statement in a type group. This statement is not entered in the ABAP
Editor, but is automatically generated by the Dictionary in the ABAP Workbench.
A type group is an ABAP program that contains type definitions and constant
declarations that can be used in several programs.
TYPE-POOLS
Declares the types and constants of a type group to a program.
Syntax
TYPE-POOLS .
This statement allows you to use all the data types and constants defined in the type
group in your program.
U
ULINE
Places horizontal lines in the display list.
Syntax
ULINE [AT [/][ ][()]].
Without additions, creates a new line on the current list and fills it with a horizontal
line. The additions allow you to insert a line break and specify the starting position
and length of the line.
UNPACK
Converts type P variables to type C.
Syntax
UNPACK TO .
Unpacks the packed field and places it in the string with leading zeros. This can be
reversed with the PACK statement.
UPDATE
Changes entries in database tables.
Syntax
UPDATE SET =
|=+
| = – [WHERE ].
The value in the column is set to the value , increases it by , or decreases it by for all
lines selected. The WHERE clause specifies the lines that are changed. If you omit
the WHERE clause, all lines are changed.
Syntax
UPDATE FROM .
UPDATE FROM TABLE .
This deletes the line that has the same primary key as the work area , or deletes all
the lines in the database that have the same primary key as a line in the internal
table . The work area or the lines of the internal table must have at least the same
length and alignment as the lines of the database table.
W
WHEN
Introduces a statement block in a CASE control structure.
Syntax
WHEN [OR OR...] | OTHERS.
The statement block following a WHEN statement is executed if the contents of the
field in the CASE statement are the same as those of one of the fields . Afterwards,
the program carries on processing after the ENDCASE statement. The statement
block after WHEN OTHERS statement is executed if the contents of does not equal
any of the contents.
WHILE
Introduces a loop.
Syntax
WHILE [VARY FROM NEXT ].
Introduces a statement block that ends with ENDWHILE. The statement block
between WHILE and ENDWHILE is repeated as long as the logical expression is
true, or until a termination statement such as EXIT or CHECK occurs. The VARY
addition allows you to process fields the same distance apart in memory.
WINDOW
Displays a list as a modal dialog box.
Syntax
WINDOW STARTING AT [ENDING AT ].
Only occurs in list processing. The current detail list is displayed as a modal dialog
box. The top left-hand corner of the window is positioned at column and line . The
bottom right-hand corner is positioned at column and line (if specified).
WRITE
Displays lists.
Syntax
WRITE [AT [/][ ][()]] [AS CHECKBOX|SYMBOL|ICON|LINE]
[QUICKINFO ].
[
]
The contents of the field are formatted according to their data type and displayed in
the current list. . The additions before the field allow you to specify a line break, the
starting position, and the length of the field. The additions after the field allow you
to display checkboxes, symbols, icons, and lines. The
addition can contain various other formatting options. The QUICKINFO addition
allows you to assign a tool tip to the field.
WRITE TO
Assigns string values.
Syntax
WRITE TO [
].
Converts the contents of a data object to type C, and assigns the resulting string to
the variable . You can use the same formatting options available in the WRITE
statement
Important ABAP Tables
Written by admin on Nov 28th, 2007 | Filed under: ABAP
REPORT ZRAPTEMP.
* NO STANDARD PAGE HEADING
* LINE-SIZE <XX> LINE-COUNT <YY>
* MESSAGE-ID <ZC>.
**********************************************************************
*
* Description:
*
* Log:
*
* Date Init Description of change
* ------------------ ----- -----------------------------------------------------
* dd-mm-yyyy xxxx
*
**********************************************************************
*----------------------------------------------------------------------
*TABLES
*----------------------------------------------------------------------
TABLES:
*----------------------------------------------------------------------
*CONSTANTS
*----------------------------------------------------------------------
constants: xxx type i value 1.
*----------------------------------------------------------------------
*STANDARDTYPES
*----------------------------------------------------------------------
TYPES:
begin of st_xyz,
end of st_xyz.
*----------------------------------------------------------------------
*TABLETYPES
*----------------------------------------------------------------------
TYPES:
tt_xyz type standard table of st_xyz.
*----------------------------------------------------------------------
*INTERNALTABLES
*----------------------------------------------------------------------
DATA:
gi_xyz type tt_xyz.
*----------------------------------------------------------------------
*GLOBALVARIABLES
*----------------------------------------------------------------------
DATA:
* Working area for for table gi_xyz
g_xyz type st_xyz.
***************************************************************
*SELECTIONSCREEN
***************************************************************
***************************************************************
*EVENTS
***************************************************************
*--------------------------------------------------------------
*ATSELECTION-SCREENOUTPUT
*--------------------------------------------------------------
AT SELECTION-SCREEN OUTPUT.
PERFORM ATSELOUT_MODIFY_SCREEN.
*--------------------------------------------------------------
*INITIALIZATION
* Executed before the selection screen is displayed.
* Initialize fields on the selection screen,
* variables and internal tables
*--------------------------------------------------------------
INITIALIZATION.
PERFORM INIT_VARIABLES.
*---------------------------------------------------------------
* This event is assigned to the selection screen fields
* corresponding to the report parameter or selection criterion selfield1.
* If the report starts an error dialog at this point, precisely this field
* become ready for input.
*---------------------------------------------------------------
*at selection-screen on selfield1.
* if selfield1 <logical expression>.
* message E002 with text-003.
* endif.
*--------------------------------------------------------------
*START-OF-SELECTION
*--------------------------------------------------------------
START-OF-SELECTION.
* SET PF-STATUS <'XXXX'>.
* <AUTHORITY-CHECK OBJECT OBJECT NAME>
PERFORM READ_DATA.
*--------------------------------------------------------------
*END-OF-SELECTION
*--------------------------------------------------------------
END-OF-SELECTION.
PERFORM WRITE_REPORT.
* CLEAR <ITAB1-FIELD1>. "Used by interactive reports when drilling down
*--------------------------------------------------------------
*TOP-OF-PAGE
*--------------------------------------------------------------
TOP-OF-PAGE.
PERFORM WRITE_REPORT_HEADER.
*--------------------------------------------------------------
*END-OF-PAGE
*--------------------------------------------------------------
END-OF-PAGE.
PERFORM WRITE_REPORT_FOOTER.
*--------------------------------------------------------------
*ATUSER-COMMAND
* Fires when the user pushes a pushbutton
*--------------------------------------------------------------
* AT USER-COMMAND.
* CASE SY-UCOMM.
* WHEN 'XXX'.
* PERFORM <XXX>.
* WHEN 'YYY'.
* PERFORM <YYY>.
* ENDCASE.
*--------------------------------------------------------------
*ATLINE-SELECTION
* Fires when user click on a line
* in the report
*--------------------------------------------------------------
AT LINE-SELECTION.
* CHECK NOT <ITAB1-FIELD1> IS INITIAL.
* PERFORM <ZZZZ>.
* CLEAR <ITAB1-FIELD1>.
***************************************************************
*FORMS
***************************************************************
*--------------------------------------------------------------
*FORMATSELOUT_MODIFY_SCREEN
* Modification of the selection screen
*--------------------------------------------------------------
FORM ATSELOUT_MODIFY_SCREEN.
ENDFORM.
*--------------------------------------------------------------
*FORMINIT_VARIABLES
* Initialisation of variables
*--------------------------------------------------------------
FORM INIT_VARIABLES.
* APPEND s_year.
*--------------------------------------------------------------
*FORMREAD_DATA
* Read data from datbase table into
* internal table
*--------------------------------------------------------------
FORM READ_DATA.
* SELECT zzz yyy
* FROM databasetable1
* INTO table gi_xyz
* WHERE zzz in zselfield1>.
ENDFORM.
*--------------------------------------------------------------
*FORMWRITE_REPORT_HEADER
*--------------------------------------------------------------
FORM WRITE_REPORT_HEADER.
* FORMAT COLOR COL_HEADING.
* WRITE AT (10) <TEXT1>.
* WRITE AT (25) <TEXT2>.
* ULINE.
ENDFORM.
*--------------------------------------------------------------
*FORMWRITE_REPORT_FOOTER
*--------------------------------------------------------------
FORM WRITE_REPORT_FOOTER.
* WRITE: / <TEXT4>.
ENDFORM.
*--------------------------------------------------------------
*FORMWRITE_RAPPORT
* Udskrift af rapport
*--------------------------------------------------------------
FORM WRITE_RAPPORT.
* LOOP at gi_xyz into g_xyz.
* WRITE : / AT 10 <ITAB1-FIELD1> COLOR COL_KEY INTENSIFIED.
* FORMAT RESET.
* FORMAT COLOR COL_NORMAL.
* WRITE : / AT 25 gi_xyz-field1.
* WRITE : / AT 40 gi_xyz_filed2.
* HIDE <ITAB1-FIELD1>. "USed for interactive reporting
* NEW-LINE.
* ENDLOOP.
ENDFORM.
In this example is used transaction FB03 for the standard report that should
becalled.
You call one of your own reports the same way as you call a SAP standard report,
but you will have to define parameter IDs for the fields on the selection screen.
To do this you must edit the selection screen in the Object Browser. Select the screen
and add a parameterId in the attributes screen for each field.
Important: If you later change your report and save it, the paramter ID's will be
lost, and you will have to define them again.
Calling a dialog screen from a report and
passing data
Make a report
at user-command.
* Call the dialog screen. ZRE1 is the transaction code of the screen
call transaction 'ZRE1'.
* Get parameter from the dialog screen. ZRZ is the parameterID for the field in the
dialog
* screen you want to pass to the report.
get parameter id 'ZRC' field p_rc.
1 report ZDKFRAHEN_TEST001.
2
*----------------------------------------------------------------------
*
3 *
4 * This program demonstrates:
5 * - How to select a line in a report,
6 * - Show a custom dialog screen populated with values from the
selected
7 * line in the report
8 * - Change the vakue in the dialog screen and re-display the
report
9 * with the changed values
10 *
11 * Programmer: Henrik Frank
12 * Date : 07-08-2007
13
*----------------------------------------------------------------------
*
14
15
16
***********************************************************************
17 * DECLARATIONS
18
***********************************************************************
19 TABLES: mara,
20 makt,
21 zpluksortlist.
22
23
24 DATA: BEGIN OF tab OCCURS 1,
25 matnr LIKE mara-matnr,
26 mtart LIKE mara-mtart,
27 matkl LIKE mara-matkl,
28 maktx LIKE makt-maktx,
29 plant TYPE werks_d,
30 sortlistno LIKE zpluksort-sortlistno,
31 atwrt LIKE zpluksort-atwrt,
32 sort1 LIKE zpluksort-sort1,
33 sort2 LIKE zpluksort-sort2,
34 sort3 LIKE zpluksort-sort3,
35 END OF tab.
36
37 DATA:
38 g_screen2000 LIKE zpluksort, "Data for screen 2000
39 g_okcode2000(6) TYPE c, "OK code screen 2000
40 g_tabix LIKE sy-tabix,
41 g_sortkey(30) TYPE c,
42 g_text TYPE string,
43 g_sortlistno LIKE zpluksort-sortlistno.
44
45
***********************************************************************
46 * SELECTION SCREEN
47
***********************************************************************
48
49 SELECTION-SCREEN BEGIN OF BLOCK grp1 WITH FRAME TITLE text-100.
50 SELECT-OPTIONS: matnr FOR mara-matnr.
51 SELECT-OPTIONS: mtart FOR mara-mtart DEFAULT 'FERT'.
52 SELECT-OPTIONS: matkl FOR mara-matkl.
53 SELECT-OPTIONS: p_plant FOR zpluksortlist-plant DEFAULT '0000'.
54
55 PARAMETERS: show1 AS CHECKBOX.
56 PARAMETERS: sort1 RADIOBUTTON GROUP type.
57 PARAMETERS: sort2 RADIOBUTTON GROUP type.
58 SELECTION-SCREEN END OF BLOCK grp1.
59
60
61
62
***********************************************************************
63 * LIST EVENTS
64
***********************************************************************
65 START-OF-SELECTION.
66 * Read data and display list
67 PERFORM display_list.
"BC2058
68
69
70
*----------------------------------------------------------------------
*
71 * TOP-OF-PAGE
*
72
*----------------------------------------------------------------------
*
73 * Write title
*
74
*----------------------------------------------------------------------
*
75 TOP-OF-PAGE.
76 PERFORM write_title.
"BC2058
77
78
*----------------------------------------------------------------------
*
79 * TOP-OF-PAGE DURING LINE-SELECTION
*
80
*----------------------------------------------------------------------
*
81 * Write title when program returns sfrom screen 2000
82 *
83
*----------------------------------------------------------------------
*
84 TOP-OF-PAGE DURING LINE-SELECTION.
85 PERFORM write_title.
86
87
88
*----------------------------------------------------------------------
*
89 * AT LINE-SELECTION.
90
*----------------------------------------------------------------------
*
91 * User has choosen a line in the report
92 * Move key fields from report to screen 2000 and display the
screen
93
*----------------------------------------------------------------------
*
94
95 AT LINE-SELECTION.
96
97 CLEAR:
98 g_screen2000,
99 g_okcode2000.
100
101
102 * Move fields from report line to screen 2000
103 MOVE:
104 tab-sortlistno TO g_screen2000-sortlistno,
105 tab-atwrt TO g_screen2000-atwrt,
106 tab-sort1 TO g_screen2000-sort1,
107 tab-sort2 TO g_screen2000-sort2,
108 tab-sort3 TO g_screen2000-sort3.
109
110 * Call screen 2000 to edit values
111 CALL SCREEN 2000 STARTING AT 40 10 ENDING AT 100 20.
112
113
114
*----------------------------------------------------------------------
*
115 * AT USER-COMMAND.
116
*----------------------------------------------------------------------
*
117 * Dummy user command - Necessary to re-display list with
changes
118 * after return from screen 2000
119
*----------------------------------------------------------------------
*
120 AT USER-COMMAND.
121 IF sy-ucomm = 'DUMMY'.
122 sy-lsind = sy-lsind - 1.
123 PERFORM display_list.
124 ENDIF.
125
126
***********************************************************************
127 * SCREEN LOGIC FOR SCREEN 2000
128
***********************************************************************
129
130
131
*&---------------------------------------------------------------------
*
132 *& Module STATUS_2000 OUTPUT
133
*&---------------------------------------------------------------------
*
134 * PF status for screen 2000
135
*----------------------------------------------------------------------
*
136 MODULE status_2000 OUTPUT.
137 SET PF-STATUS 'STATUS_2000'.
138 ENDMODULE. " STATUS_2000 OUTPUT
139
140
*&---------------------------------------------------------------------
*
141 *& Module USER_COMMAND_2000 INPUT
142
*&---------------------------------------------------------------------
*
143 * User command screen 2000
144
*----------------------------------------------------------------------
*
145 MODULE user_command_2000 INPUT.
146 CASE g_okcode2000.
147 WHEN 'BUTOK'.
148 * OK button - update
149 PERFORM update_zpluksort.
150
151 * If update OK, then g_okcode2000 still = BUTOK
152 IF g_okcode2000 = 'BUTOK'.
153 * Execute dummy command to re-display the list
154 SET USER-COMMAND 'DUMMY'.
155 sy-ucomm = 'DUMMY'.
156 ENDIF.
157 SET SCREEN 0.
158
159 WHEN 'BUTCAN'.
160 * Cancel button - no update
161 SET SCREEN 0.
162 ENDCASE.
163
164
165 ENDMODULE. " USER_COMMAND_2000 INPUT
166
167
168
*&---------------------------------------------------------------------
*
169 *& Form write_title
170
*&---------------------------------------------------------------------
*
171 * Write list header
172
*----------------------------------------------------------------------
*
173 FORM write_title.
174 FORMAT COLOR 4.
175 WRITE: /1 'Carlsberg'.
176 WRITE: 40 'Sort of picking for selected materials'.
177 WRITE: 111(5) 'Page:'.
178 WRITE: 117(4) sy-pagno.
179
180 WRITE: /91 'Printet:'.
181 WRITE: 100 sy-datum DD/MM/YYYY.
182 WRITE: 111 'Time:'.
183 WRITE: 119 sy-uzeit USING EDIT MASK '__:__'.
184 FORMAT COLOR OFF.
185 ULINE.
186
187 WRITE AT 1 text-001. "Matnr
188 WRITE AT 10 text-002. "Description
189 WRITE AT 51 text-003. "Mtyp
190 WRITE AT 56 text-004. "Mat group
191 WRITE AT 66 text-005. "Sort1
192 WRITE AT 72 text-006. "Sort2
193 WRITE AT 78 text-007. "Sort3
194 WRITE AT 84 text-008. "Sort rule
195 WRITE AT 95 text-009. "Charac
196 WRITE AT 110 text-010. "Plant
197
198
199 NEW-LINE.
200
201 WRITE '-------' UNDER text-001.
202 WRITE '---------------------------------------' UNDER text-
002.
203 WRITE '----' UNDER text-003.
204 WRITE '---------' UNDER text-004.
205 WRITE '----' UNDER text-005.
206 WRITE '----' UNDER text-006.
207 WRITE '----' UNDER text-007.
208 WRITE '---------' UNDER text-008.
209 WRITE '------' UNDER text-009.
210 WRITE '----' UNDER text-010.
211
212
213
214
215 ENDFORM. " write_title
216
217
*&---------------------------------------------------------------------
*
218 *& Form display_list
219
*&---------------------------------------------------------------------
*
220 * Display list
221
*----------------------------------------------------------------------
*
222 FORM display_list.
223
224
225 CLEAR tab. REFRESH tab.
226 SELECT matnr mtart matkl INTO CORRESPONDING FIELDS OF TABLE
tab
227 FROM mara
228 WHERE matnr IN matnr
229 AND mtart IN mtart
230 AND matkl IN matkl.
231
232
233
234
235 LOOP AT tab.
236
237 CLEAR:
238 g_sortkey,
239 tab-sort1,
240 tab-sort2,
241 tab-sort3.
242
243
244 CALL FUNCTION 'Z_GET_SORT_FIELD'
245 EXPORTING
246 i_matnr = tab-matnr
247 i_plant = tab-plant
"BC2058
248 IMPORTING
249 e_sortlistno = tab-sortlistno
250 e_atwrt = tab-atwrt
251 e_sort1 = tab-sort1
252 e_sort2 = tab-sort2
253 e_sort3 = tab-sort3
254 EXCEPTIONS
255 no_sortfield = 1
256 no_material = 2
257 OTHERS = 3. .
258 IF sy-subrc <> 0.
259 * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
260 * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
261 ENDIF.
262
263 CLEAR makt.
264 SELECT SINGLE * FROM makt
265 WHERE matnr = tab-matnr
266 AND spras = 'E'.
267 IF sy-subrc NE 0.
268 SELECT SINGLE * FROM makt
269 WHERE matnr = tab-matnr
270 AND spras = 'K'.
271 ENDIF.
272 IF sy-subrc = 0.
273 tab-maktx = makt-maktx.
274 ELSE.
275 tab-maktx = ' '.
276 ENDIF.
277
278 MODIFY tab.
279 ENDLOOP.
280
281 IF show1 = 'X'.
282 LOOP AT tab.
283 IF tab-sort1 = ' ' AND
284 tab-sort2 = ' ' AND
285 tab-sort3 = ' '.
286 DELETE tab.
287 ENDIF.
288 ENDLOOP.
289 ENDIF.
290
291 IF sort1 = 'X'.
292 SORT tab BY matnr plant.
293 ENDIF.
294
295 IF sort2 = 'X'.
296 SORT tab BY sort1 sort2 sort3 matnr.
297 ENDIF.
298
299
300 LOOP AT tab.
301
302 NEW-LINE.
303 WRITE tab-matnr UNDER text-001.
304 WRITE tab-maktx UNDER text-002.
305 WRITE tab-mtart UNDER text-003.
306 WRITE tab-matkl UNDER text-004.
307 WRITE tab-sort1 UNDER text-005.
308 WRITE tab-sort2 UNDER text-006.
309 WRITE tab-sort3 UNDER text-007.
310 WRITE tab-sortlistno UNDER text-008.
311 WRITE tab-atwrt UNDER text-009.
312 WRITE tab-plant UNDER text-010.
313
314 HIDE:
315 tab-sortlistno,
316 tab-atwrt,
317 tab-sort1,
318 tab-sort2,
319 tab-sort3.
320
321
322 ENDLOOP.
323
324 ENDFORM. " display_list
325
*&---------------------------------------------------------------------
*
326 *& Form update_zpluksort
327
*&---------------------------------------------------------------------
*
328 * Update table ZPLUKSORT with changes to sort rule
329
*----------------------------------------------------------------------
*
330 FORM update_zpluksort.
331 DATA: l_answer TYPE string.
332
333 * Confirm update
334 CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
335 EXPORTING
336 textline1 = 'Do you want to update sort
rule ?'
337 titel = 'Update sort rule'
338 cancel_display = ''
339 IMPORTING
340 answer = l_answer.
341 IF l_answer <> 'J'.
342 g_okcode2000 = 'BUTCAN'.
343 EXIT.
344 ENDIF.
345
346 * Update
347 UPDATE zpluksort FROM g_screen2000.
348
349 IF sy-subrc = 0.
350 * Update OK - Show message
351 CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
352 EXPORTING
353 titel = 'Update'
354 textline1 = 'Sort rule updated'.
355 g_okcode2000 = 'BUTOK'.
356
357 ELSE.
358 * Update failed - Show message
359 CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
360 EXPORTING
361 titel = 'Error '
362 textline1 = 'Error in update of sort rule'.
363 g_okcode2000 = 'BUTCAN'.
364 ENDIF.
365
366
367
368 ENDFORM. " update_zpluksort
When using control levels with an internal table, remember to sort the internal table
in accordance with the control levels, and the fields in the table must occur in the
same order as you sort the table.
In the example below, carrid must be the first field in the table
When you use control levels the SUM statement can be used to generate totals.
Important: The fields in the internal table must be in the same order as the sort
order.
• at new xxxx
• write detail line
• at end of xxxx
Control levels
• AT NEW xxx
• AT END OF xxx
• AT FIRST
• AT LAST
Example
sort itab by bukrs.
loop at itab.
* Heading for every bukrs
at new bukrs.
write: / itab-bukrs.
endat.
* Detail line
write: / itab-bukrs.
* Grand totals
at last.
sum.
write: / 'Grand total', itab-bukrs.
endat.
endloop.
Note: To see how to recognize if the user has selected a valid line,
take a look at
START-OF-SELECTION.
* Read data for REPORT1 into itab1
END-OF-SELECTION.
PERFORM write_report1.
TOP-OF-PAGE.
* Write list header for REPORT1
AT USER-COMMAND.
* Respond when the user presses a function key
CASE sy-ucomm.
WHEN 'REPORT2'.
PERFORM write_reprt2.
WHEN 'REPORT3'.
PERFORM write_reprt3.
ENDCASE.
AT LINE-SELECTION.
* Istead of pressing a button can perform the same actions
* as i AT USER-COMMAND, by double clicking a line
* sy-lsind contains the list level.
* Each time an interactive list event occurs, sy-lsind is
* automatically increased by 1.
* At REPORT1 sy-lsin = 0
CASE sy-lsind.
WHEN 1.
PERFORM write_reprt2.
WHEN 2.
PERFORM write_reprt3.
ENDCASE.
TOP-OF-PAGE.
* Write report header for report1 ( sy-lsind = 0 )
WHEN 2.
* Write report header for REPORT3.
ENDCASE.
FORM WRITE_REPORT1.
LOOP at itab1.
* write report1.......
ENDLOOP.
ENDFORM.
FORM WRITE_REPORT2.
month = itab1_month.
LOOP at itab2.
ENDLOOP.
ENDFORM.
FORM WRITE_REPORT3.
LOOP at itab3.
ENDLOOP.
ENDFORM.
Dynamic line-size
Code
Example:
WRITE AT 10 text-001.
WRITE AT 20 text-002.
new-line.
ENDLOOP.
RESERVE...BACK
The rapport should look like this:
Myroad 12 a text
Mytown for
John Dowe
LOOP AT mytable.
RESERVE 10 LINES.
WRITE: / '2030'.
WRITE: / 'Mytown'.
BACK.
WRITE: / 'for'.
ENDLOOP.
Note: That you have to fill up with empty rows in the last column
untill there is
Vertical positioning:
Example:
POSITION 20.
WRITE 'Test'
Managing Output
DATASET EXPIRATION 3
NO DIALOG.
LOOP AT ITAB.
WRITE: / ITAB-ZZREVLOGPR.
ENDLOOP.
TABLES
listobject = li_listobject
EXCEPTIONS
empty_list = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
* Define checkbox
data: markfield(1) type c value space.
* Write list
loop at itab.
write: / markfield as checkbox, itab1-myfield.
endloop.
lineno = 0.
* Read markfield
read line lineno field value markfield.
* table
if markfield = 'X'.
* read the line igain to retrieve all fields of the line
read current line
field value itab1-myfield
into itab2-myfield.
append itab2.
endif.
enddo.
* Reading the lines and cehcking if the line has been checked
lineno = 0.
do.
* Counting the line numbers
lineno = lineno + 1.
enddo.
Example:
clear lineno.
new_contents = 'Changed'.
do.
* Count linenumber
lineno = lineno + 1.
* Change the value of the field itab-zzrevomr in the current line to the value
* of the variable new_contents
modify current line field value itab-zzrevomr from new_contents.
* Change format of the current line. In this example the firts field in the line is a
checkbox,
* and we want to prevent the user form changing the contents ( Input off )
modify current line
line format color col_negative intensified on
enddo.
NEW-LINE in Report
Addition:
1. ... NO-
SCROLLING
2. ...
SCROLLING
... NO-
SCROLLING
Example 1
I have found this example at The SAP Fan Club
TABLES: VBAP.
LOOP AT IVBAP.
WRITE:/ IVBAP-VBELN,
IVBAP-POSNR.
ENDLOOP.
TOP-OF-PAGE.
Example 2
If you use the codes below, the buttons will work automatically:
BACK = BACK
Exit = %EX
Cancel = RW
You have a report, and call a dialog screen where you modify data in the reports
underlying table. After modifying the data you want to return to the report screen,
and have it refreshed so that i displays the changes in the underlying table.
start-of-selection.
* Initial display of report
perform write_report.
* You have to display your own report headings that called from both the main
report and the
* sub report ( The second display )
top-of-page.
perform page_header.
case sy-ucomm.
when 'CHG'.
* Call dialog screen where data chenages are input. The code could be something
like:
set parameter id 'ZR1' field itab-zzrevomr.
call transaction 'ZRE3'.
* After you return from the dialog screen you want to remove the old report so
you
* don't redisplay it when you use the back button
sy-lsind = 0.
* Write the report again with new data
perform write_report.
form write_report.
*Here goes code that retrieves data for the report and write it, it could be something
like:
select * from zrevomr into table itab.
loop at itab.
write: / itab-zzrevomr, itab-zzrevomrtx.
endloop.
endform.
form page_header.
* .... Code for page header
endform.
Creating F1 or F4 help
1. Example 1: F1 Help
2. Example 2: F4 Help
Example 1: F1 Help
Create F1 help for custom ABAP programs at field level. This method can help
companies to eliminate the off-line documentation for custom programs. On top of
that, users are not required to search for help documentation for a custom program.
Logo is: "Press F1 for help anywhere in SAP".
Sample code:
You can maintain messages with varied degree of details here. You can also specify
examples in messages long text to clarify the contents of program to your valued
users.
Example 2: F4 Help
Note that for ranges both the low and high value of the field
must have there own ON VALUE-REQUEST
Example:
REPORT f4help.
PARAMETERS:
p_auart LIKE vbak-auart.
START-OF-SELECTION.
*---------------------------------------------------------------------*
* FORM f4_help_auart *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM f4_help_auart.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'VBAK'
fieldname = 'AUART'
* SEARCHHELP =''
* SHLPPARAM =''
* DYNPPROG =''
* DYNPNR =''
* DYNPROFIELD =''
* STEPL =0
* VALUE =''
* MULTIPLE_CHOICE =''
* DISPLAY =''
* SUPPRESS_RECORDLIST =''
* CALLBACK_PROGRAM =''
* CALLBACK_FORM =''
* TABLES
* RETURN_TAB =
* EXCEPTIONS
* FIELD_NOT_FOUND =1
* NO_HELP_FOR_FIELD =2
* INCONSISTENT_HELP =3
* NO_VALUES_FOUND =4
* OTHERS =5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
AT SELECTION-SCREEN OUTPUT.
IF EXECUTED = 1.
EXECUTED = 0.
CLEAR: var1, var2, etc.
REFRESH: selop1.
here you have to clear all your parameters, select options etc.
ENDIF.
START-OF-SELECTION.
EXECUTED = 1.
your main coding starts here.
END-OF-SELECTION.
Dear all,
I have parameters in my ABAP/4 reporting program:
parameters: date like sy-datum,
division (1) type c.
parameters: r1 radiobutton group rad1,
r2 radiobutton group rad2.
thank you
A:
LOOP AT SCREEN.
If screen-name = division.
if r1 ne space.
screen-invisible = 1.
elseif r2 ne space.
screen-invisible = 0.
endif.
modify screen.
endif.
ENDLOOP.
You may also try adding a statement for screen-input and/or screen output
instead. That way they are still visible, but you can't change them.
ips and Tricks for Selection Screen
1. Using select options to select records
2. Select options with more than one default value or range
3. Making a frame around groups of fields on the selection screen.
4. Making a checkbox
5. Making a radiobutton group
6. How to add an option after the user has finished the selection screen
7. Selection screen events
8. Making an option invisible
9. Selection screen - Parameters on a single line
10. Setting the title text of a selection screen dynamically
11. Using a custom toolbar in a selection screen
12. Skip line on selection screen
13. Using a matchcode
USNAM IN S_USNAM.
If you want to use more than one default value or default range, you add the values
to the internal table selection table.
Note: You don't have to declare the table, it is created automatically. The table has
the same name as the select variable ( In the example below s_hkont ).
INITIALIZATION.
MOVE: 'I' to s_hkont-sign,
'BT' TO S_HKONT-OPTION,
'87111100' TO S_HKONT-LOW,
'87111124' TO S_HKONT-HIGH.
APPEND S_HKONT.
MOVE: 'I' to s_hkont-sign,
'EQ' TO S_HKONT-OPTION,
'87111300' TO S_HKONT-LOW,
APPEND S_HKONT.
Making a checkbox
Example:
How to add an option after the user has finished the selection screen
If you don't want the user to be able to see the option you want to add, define it as
No-DISPLAY.
INITIALIZATION.
MOVE 'Unit' TO p_wmunit.
Define GUI titles for the report. In this example the GUI titles COLLILABEL
and PALLETLABEL has been defined. In the INITIALIZATION event,
dynamically
set which GUI title to show with the SET TITELBAR statement.
INITIALIZATION.
IF p_colli = 'X'.
SET TITLEBAR 'COLLILABEL'.
When you use your own custom toolbar in a selection screen, the flow of the
report changes. Below is an example of how to use the events in such a
report.
Important! To be abel to submit your report, the submit button on the custom
toolbar of the selection screen must be named
'ONLI' (= Execute) or 'PRIN' (= Execute and Print).
INITIALIZATION.
* Your custom toolbar for the selection screen
SET PF-STATUS '0002'.
AT SELECTION-SCREEN.
* Handle sy-ucomm from your custom toolbar on the selection screen. Note
that it is not necessary explicitly to handle 'ONLI' or 'PRIN'
CASE sy-ucomm.
WHEN 'GETDATA'.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
START-OF-SELECTION.
..... retreieve data for the ereport.....
END-OF-SELECTION.
* PF status for the report
SET PF-STATUS '0001'.
..... write report ......
Selection-screen skip 1.
Using a matchcode
Parameters:
matnr like mara-matnr matchcode object mat1.
* Submit report
SUBMIT rm07idif WITH SELECTION-TABLE li_selection AND RETURN.
Example:
***********************************************************************
*
* AT SELECTION SCREEN *
***********************************************************************
*
at selection-screen.
perform validate_selection_screen using g_returkode.
if g_returkode = c_returkode_error.
exit.
endif.
*&---------------------------------------------------------------------*
*& Form validate_selection_screen
*&---------------------------------------------------------------------*
* Validation of selection screen
*----------------------------------------------------------------------*
* -->P_G_RETURKODE text
*----------------------------------------------------------------------*
form validate_selection_screen using p_returkode.
ENDFORM.
Code
REPORT z_hfnk_slam1 .
PARAMETER:
p_name(10) TYPE c,
p_test(2) TYPE n.
START-OF-SELECTION.
PERFORM front_page.
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Form FRONT_PAGE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM front_page.
CALL FUNCTION 'RS_COVERPAGE_SELECTIONS'
EXPORTING
report = sy-cprog
variant ='' "sy-slset
no_import =''
TABLES
infotab = info
EXCEPTIONS
error_message = 1
variant_not_found = 3
OTHERS = 2.
* others = 4.
LOOP AT info.
* Clean up blank lines and "No selections"
IF info-line CS 'No selections'
OR info-line+1(77) IS INITIAL.
delete_index = sy-tabix - 1.
DELETE info INDEX sy-tabix.
READ TABLE info INDEX delete_index.
IF NOT info-line+2(1) IS INITIAL.
DELETE info INDEX delete_index.
ENDIF.
CONTINUE.
ENDIF.
ENDLOOP.
PERFORM write_cover.
ENDFORM. "FRONT_PAGE
*&---------------------------------------------------------------------*
*& Form WRITE_COVER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM write_cover.
LOOP AT info.
IF info-line CS 'Invisible'.
info-line = sy-uline.
WRITE: / info-line.
EXIT.
ENDIF.
WRITE: / info-line.
ENDLOOP.
NEW-PAGE.
ENDFORM. "WRITE_COVER
Selection screen
Resulting report
Example 2 Doing it yourself
Code:
ata:
l_sign(2) type c,
l_option(3) type c.
else.
l_option = 'to'.
endif.
write at 35 l_sign.
write at 39 s_prtdoc-low.
write at 55 l_option.
write at 59 s_prtdoc-high.
new-line.
endloop.
1 report ZDKFRAHEN_TEST001.
2
***********************************************************************
*
3 * This program demonstrates how to call custom F4 help for a
4 * field on the selection screen of a report
5 *
6 * The selection screen contains a select-options for PLANT.
validt
7 * values for plant can be found in custom table zpluksortlist.
8 * Besides the values from zpluksortlist it should also be
possible to
9 * select an empty value
10 *
11 * Programmer: Henrik Frank
12 * Date : 07-08-2007
13 *
14
***********************************************************************
*
15
16 tables: zpluksortlist.
17
18 SELECT-OPTIONS: p_plant FOR zpluksortlist-plant.
19
20 *-------------------------------------------------------------
21 * Call F4 help for plant
22 *-------------------------------------------------------------
23 AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_plant-low.
24 PERFORM show_f4_help.
25
26 AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_plant-high.
27 PERFORM show_f4_help.
28
29
*&---------------------------------------------------------------------
*
30 *& Form show_f4_help
31
*&---------------------------------------------------------------------
*
32 * Display F4 help for select-options P_PLANT
33
*----------------------------------------------------------------------
*
34 FORM show_f4_help.
35 DATA:
36 BEGIN OF it_plants OCCURS 0,
37 plant LIKE zpluksortlist-plant,
38 END OF it_plants.
39
40 DATA: t_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.
41
42 * Read plants from table ZPLUKSORTLIST
43 SELECT plant FROM zpluksortlist INTO TABLE it_plants.
44
45 CLEAR it_plants.
46
47 * Add defalut plant '0000'
48 it_plants-plant = '0000'.
49 APPEND it_plants.
50
51 * Add empty plant
52 it_plants-plant = ' '.
53 APPEND it_plants.
54
55
56 SORT it_plants BY plant.
57
58 CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
59 EXPORTING
60 retfield = 'PLANT' "Key field from
it_plants
61 dynpprog = sy-cprog "Program
62 dynpnr = sy-dynnr "Dynpro number
63 dynprofield = 'P_PLANT' "Select-options field
64 value_org = 'S' "Value return: C: cell
by cell,
65 "S: structured
66 display = 'F' "Override readiness
for input
67 TABLES
68 value_tab = it_plants "table with selection
values
69 return_tab = t_return "Return value
70 EXCEPTIONS
71 parameter_error = 1
72 no_values_found = 2
73 OTHERS = 3
74 .
75 IF sy-subrc <> 0.
76 MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
77 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
78 ENDIF.
79
80
81 ENDFORM. " show_f4_help
Click here to see how to make an ALV grid using ABAP Objects (ALV grid control)
REPORT zhfnk_alvtest.
TYPES:
BEGIN OF t_makt,
END OF t_makt.
DATA:
******************************************************************'
******************************************************************'
******************************************************************'
START-OF-SELECTION.
PERFORM alv_setup.
PERFORM read_data.
END-OF-SELECTION.
PERFORM display_alv.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
FORM read_data.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM alv_setup.
CLEAR wa_alv_fieldcat.
REFRESH alv_fieldcat.
* Matnr field
wa_alv_fieldcat-fieldname = 'MAKTX'.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM display_alv.
gd_repid = sy-repid.
alv_layout-colwidth_optimize = 'X'.
alv_layout-zebra = 'X'.
alv_layout-no_min_linesize = 'X'.
i_callback_program = gd_repid
is_layout = alv_layout
it_fieldcat = alv_fieldcat
* i_grid_title = text-005
TABLES
t_outtab = it_makt
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
FORM top_of_page_setup.
wa_header-typ = 'H'.
CLEAR wa_header.
EXPORTING
it_list_commentary = t_header.
Code
REPORT zalv_test.
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
IMPORTING
es_row_no
e_column.
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
METHOD on_double_click.
row_string = es_row_no-row_id.
INTO msg_string.
ENDMETHOD. "on_double_click
DATA:
START-OF-SELECTION.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
r_grid->set_table_for_first_display(
However, the standard print dialog screen for the ALV grid has an option "ALV
statistics". When this option ís chosen, a page with ALV statistics will be
printed before the ALV report and the total number of pages will be wrong as an
extra page has been added to the report.
The solution is to use the ALV events Top Of Page, Top Of List and End Of List as
demonstrated in the enclosed example.
REPORT zhfnk_alvtest.
*--------------------------------------------------------------------
* on each report page. However, if you include the ALV statistics when
* you print the report, this page will not be included in the total
* number of pages.
*
* 2006-10-05 Henrik Frank NNIT A/S
*--------------------------------------------------------------------
TYPE-POOLS: slis.
TYPES:
BEGIN OF t_makt,
END OF t_makt.
DATA:
******************************************************************'
******************************************************************'
DATA:
******************************************************************'
DATA:
g_totpages(3) TYPE n,
g_pageno(3) TYPE n,
g_start_of_list(1) TYPE c.
START-OF-SELECTION.
g_first_top_of_page = 'X'.
CLEAR g_start_of_list.
PERFORM alv_setup.
PERFORM build_events.
PERFORM read_data.
END-OF-SELECTION.
PERFORM display_alv.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
FORM read_data.
FROM makt
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM alv_setup.
CLEAR wa_alv_fieldcat.
REFRESH alv_fieldcat.
* Matnr field
wa_alv_fieldcat-fieldname = 'MAKTX'.
*&------------------------------------------------------------------*
*&------------------------------------------------------------------*
*-------------------------------------------------------------------*
FORM build_events.
EXPORTING
i_list_type = 0
IMPORTING
et_events = gt_events[].
INTO ls_event.
IF sy-subrc = 0.
ENDIF.
INTO ls_event.
IF sy-subrc = 0.
ENDIF.
ENDFORM. " BUILD_EVENTS
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM display_alv.
gd_repid = sy-repid.
alv_layout-colwidth_optimize = 'X'.
alv_layout-zebra = 'X'.
alv_layout-no_min_linesize = 'X'.
EXPORTING
i_callback_program = gd_repid
is_layout = alv_layout
it_fieldcat = alv_fieldcat
it_events = gt_events
* is_print = gd_prntparams
TABLES
t_outtab = it_makt
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
*------------------------------------------------------------------*
* Form TOP_OF_LIST
*------------------------------------------------------------------*
*------------------------------------------------------------------*
FORM top_of_list.
* Set flag that indicates that print of the ALV list has begun
g_start_of_list = 'X'.
ENDFORM. "TOP_OF_LIST
*---------------------------------------------------------------------*
* Form TOP_OF_PAGE
*---------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM top_of_page.
pagno(3) TYPE n.
*---------------------------------------------------------------------
* If the list is being printed (Not didslayed) and this is the first
*---------------------------------------------------------------------
CLEAR g_first_top_of_page.
ENDIF.
* If this is a printed list
IF sy-ucomm EQ 'PRIN'.
*---------------------------------------------------------------------
* The Start Of List event has not yet been triggered. Thsi means that
*---------------------------------------------------------------------
g_totpages = g_totpages + 1.
ENDIF.
wa_header-typ = 'H'.
g_pageno = sy-pagno.
CLEAR wa_header.
it_list_commentary = t_header.
ENDIF.
*-------------------------------------------------------------------
* Form END_OF_LIST
*-------------------------------------------------------------------
FORM end_of_list.
g_first_top_of_page = 'X'.
CLEAR g_pageno.
CLEAR g_start_of_list.
ENDFORM. "END_OF_LIST
*---------------------------------------------------------------------*
* Form get_total_number_of_pages
*---------------------------------------------------------------------*
* input table
*----------------------------------------------------------------------*
l_tot_lines TYPE i,
l_lines_per_page TYPE i,
p_total_number_of_pages = l_tot_pages.
IF p_total_number_of_pages = '0'.
p_total_number_of_pages = '1'.
ENDIF.
ENDFORM. " get_total_number_of_pages
Function modules
• CHANGEDOCUMENT_READ_POSITIONS
• CHANGEDOCUMENT_READ_HEADERS
Programs
Strings
Example:
w_matnr = '3617203-100'
REPLACE '-' WITH '' INTO w_matnr.
CONDENSE w_matnr NO-GAPS.
Concatenating
Addition:
... SEPARATED BY h
Example:
Syntax:
move t1+offset(length) to t2
write t1+offset(length) to t2
Example:
t1 = '0123456789'.
Instead of move you could have used write. In this example the result would have
been the same.
You can also use the Relational Operators for Character-Like Fields
CO, CN, CA, NA .... see the ABAP documentation for further informat
Word wrapping/Split
You can use the fucntion module SWA_STRING_SPLIT to split a tring into
smaller strings or use function module SWA_STRING_SPLIT
-----
>Does someone know how to word wrap fields from one internal table to
>a field in another internal table, when the fields have a different
>lengths ?
>E.g.
>should be
>table2-Field1:
>sy-tabix = 1: This is a
This example shows how to split the text in a field of one internal
table and place it into a field in another internal table that has
a shorter size
REPORT z_hfa_test .
DATA:
* Table containing texts that has to be split
BEGIN OF it_longstrings OCCURS 0,
line TYPE string,
END OF it_longstrings,
start-of-selection.
* Add some lines to it_longstrings
it_longstrings-line = '123456789012345 Hallo this is a very long'.
APPEND it_longstrings.
it_longstrings-line = 'line, that has to be split.'.
APPEND it_longstrings.
it_longstrings-line = 'The line has to be split into lines of 10
characters'.
APPEND it_longstrings.
TABLES
string_components = it_string_components
* EXCEPTIONS
* MAX_COMPONENT_LENGTH_INVALID =1
* OTHERS =2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
ENDLOOP.
END-OF-SELECTION.
LOOP AT it_shortstrings.
WRITE: / it_shortstrings-line.
ENDLOOP.
belob = '300120.00'.
if belob CA '.'.
l_pos = sy-fdpos.
internal
table using this syntax:
Each substring will be placed in its own table row. In the example below, the table
would have 5 rows.
Note that all output fields must be of type char or string
REPORT YDK8HENFR_TEST1 line-size 80.
end of l_output.
start-of-selection.
write: / l_output-name.
write: / l_output-age.
write: / l_output-address.
write: / l_output-city.
write: / l_output-zipc
System Variables
A complete list of the names of the SY variables can be found in the table SYST.
CASE SY-UCOMM.
SY-UCOMM WHEN 'RW'.
LEAVE PROGRAM.
WHEN OTHERS.
ENDCASE.
SY-LSIND This field contains the number of the current list in the list hierarchy
SY-PAGENO Page number of current page
Where I can find the list of transaction codes and their usage, I heard that there is
some table which contains all the transaction codes with their descriptions.
Does anyone know about the Table that consist all the T-Code?
Listed here are the various ways you can find the list of transaction codes and their
usage:
Fill in the Database table name and click the Display button.
- TSTC table will contain all the Tcodes and
- TSTCT table will contain all the Tcodes with Texts.
Once you entered the screen, click in Top Menu - Utilities - Table contents - Display
If you want to display all the transaction code (total - 57,048) you have to change the
Fields: Maximum number of hits to 99999 (default 500).
or
or
Goto transaction SE93
There are two ways where you can find the list of transaction codes in SE93.
Method 1:
You must be familiar with the starting characters strings for each of the R/3
application modules.
Assuming you know that most Materials Management transaction codes start with
MM.
In the Fields: Transaction code, type in MM* and press the function key F4
Method 2:
On the Top Menu, click Utilities - Find - Execute and the first 500 transaction will
be display.
If want to display all the tcodes, make sure you remembered to change the Fields:
Maximum no. of hits right at the bottom of the screen
Free lock:
CALL FUNCTION 'DEQUEUE_EZHR_INTER_IO'
EXPORTING
prgname = sy-cprog
bukrs = ''
affiliate = ''.
here iam posting the code, using this program u can find out the
avialble userexits for any Transaction if you want.
I have collected this program from othre groups, Mohan is posted this
in SDN.
thanks to mohan to provide such a helpfull program.
'''''
WRITE:/(95) SY-ULINE.
DESCRIBE TABLE JTAB.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No of Exits:' , SY-TFILL.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'No User Exit exists'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'Transaction Code Does Not Exist'.
ENDIF.
AT LINE-SELECTION.
GET CURSOR FIELD FIELD1.
CHECK FIELD1(4) EQ 'JTAB'.
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
''''''
To assign a variable a type at runtime, use the ABAP statement ASSIGN with the
option TYPE. For instance:
DATA: D_TYPE,
D_FIELD(35).
DATA: D_TEST TYPE P.
FIELD-SYMBOLS: <F>.
D_FIELD = 'D_TEST'.
D_TYPE = 'P'.
ASSIGN (D_FIELD) TO <F> TYPE D_TYPE.
Additionally you can use the option DECIMALS of the ASSIGN statement if your
type is 'P'. You can even change the type at runtime of previously assigned field
symbol like
One more thing for dynamic programing. With the following coding you can access
every DDIC table with the key you want:
The following code is just a function to loop total pages. To use from the beginning
of your report, you will have to loop through your report once before display. ABAP
does not provide
an easy "read-ahead" method of doing this, so this is the "cludgy" way of making it
work if needed.
FORM GET_TOTAL_PAGENO.
DO SY-PAGNO TIMES.
READ LINE 2 OF PAGE SY-INDEX.
REPLACE '*****' WITH NUM_PAGES_C INTO SY-LISEL.
MODIFY LINE 2 OF PAGE SY-INDEX.
ENDDO.
Dynamic SQL
• Dynamic where clause
• Using a dynamic table name
• Dynamic retrieval and writing of data
• Dynamic SELECT
* Build the where clause. Will look like this when finished
* WHERE ZAFSTMD02 = 'X' AND rbusa = '5145'
* Select
select * from zcostfreq
where (where_tab).
endselect.
Note that you can combine static and dynamic where clauses:
This report prints the number og entries in a table. The table name is specified by a
parameter.
data:
l_count type i.
parameters:
p_tab type tabname.
start-of-selection.
select count(*) from (p_tab) into l_count.
write: / 'Number of entries in table ', p_tab, l_count.
In this example, data is retrieved from the table selected on the selection screen, and
the contents of the table is written to the screen.
DATA:
* Create variable that can contain referecene to any data
dataref TYPE REF TO data.
FIELD-SYMBOLS:
<row> TYPE ANY,
<component> TYPE ANY.
PARAMETERS:
p_tab TYPE tabname.
START-OF-SELECTION.
* Create a workarea for the tabel selected on the selection screen
SELECT *
FROM (p_tab) UP TO 10 ROWS
INTO <row>.
NEW-LINE.
DO.
* Write all the fields in the record
ASSIGN COMPONENT sy-index
OF STRUCTURE <row>
TO <component>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
WRITE <component>.
ENDDO.
ENDSELECT.
Dynamic SELECT
TYPES:
BEGIN OF st_bseg,
bukrs LIKE bseg-bukrs,
belnr LIKE bseg-belnr,
dmbtr LIKE bseg-dmbtr,
END OF st_bseg.
DATA:
sel_list TYPE STANDARD TABLE OF edpline,
li_bseg TYPE STANDARD TABLE OF st_bseg,
l_bseg TYPE st_bseg.
START-OF-SELECTION.
APPEND 'bukrs belnr dmbtr' TO sel_list.
SELECT (sel_list)
FROM bseg UP TO 100 ROWS
INTO TABLE li_bseg.
ENDLOOP.
TYPES:
source_line(72).
DATA:
gi_source TYPE STANDARD TABLE OF source_line,
l_prog_name(30) TYPE c,
l_msg(120) TYPE c,
l_line(10) TYPE c,
l_word(10) TYPE c,
l_off(3) TYPE c.
IF sy-subrc <> 0.
WRITE : / 'Error', l_msg.
ELSE.
PERFORM write_hallo IN PROGRAM (l_prog_name).
ENDIF.
Dynamic Tokens
Example:
name = 'AGE'
sort itab by (name)
Field symbols
You can use field symbols to make the program more dynamic.
Example 1
In this exanmple the name of a table control isd substituted by a field symbol. Thus
you cal call the form with any internal table, using the name of the tablæe control as
a parameter.
form insert_row
using p_tc_name.
Example 2
TYPES:
BEGIN OF st_mytable,
name1 TYPE string,
name2 TYPE string,
age TYPE i,
END OF st_mytable.
DATA:
gi_mytable TYPE STANDARD TABLE OF st_mytable,
g_mytable TYPE st_mytable.
*------------------------------
* Define field symbols
*------------------------------
FIELD-SYMBOLS:
<myfield1> TYPE ANY,
<myfield2> TYPE ANY,
<myfield3> TYPE ANY,
<myline> TYPE ANY.
*------------------------------
g_mytable-name1 = 'Claudio'.
g_mytable-name2 = 'Jensen'.
g_mytable-age = 45.
APPEND g_mytable TO gi_mytable.
*------------------------------
* The normal way to do it
*------------------------------
LOOP AT gi_mytable INTO g_mytable.
WRITE: / g_mytable-name1, g_mytable-name2 ,g_mytable-age.
ENDLOOP.
SKIP 2.
*------------------------------
* Do it with field symbols
*------------------------------
LOOP AT gi_mytable ASSIGNING <myline>.
ASSIGN COMPONENT 1 OF STRUCTURE <myline> TO <myfield1>.
ASSIGN COMPONENT 2 OF STRUCTURE <myline> TO <myfield2>.
ASSIGN component 3 OF STRUCTURE <myline> TO <myfield3>.
WRITE: / <myfield1>,<myfield2>,<myfield3>.
ENDLOOP.
*------------------------------
* Unassign field symbols
*------------------------------
UNASSIGN <myfield1>.
UNASSIGN <myfield2>.
UNASSIGN <myfield3>.
UNASSIGN <myline>.
ENDSELECT.
REPORT zznfl_test2
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA:
it_p0027 TYPE STANDARD TABLE OF p0027,
wa_p0027 TYPE p0027.
START-OF-SELECTION.
> -----------------------------------------------
> > > Hi all,
> > > Can somebody help me with this (little) problem.
> > > -----------------------------------------------
> > > IS:
> > > DATA Z0051 LIKE T005 OCCURS 0 WITH HEADER LINE.
> > > DATA Z0052 LIKE T005 OCCURS 0 WITH HEADER LINE.
>>>
> > > SELECT * INTO TABLE Z0051 FROM T005.
> > > SELECT * INTO TABLE Z0052 FROM T005.
> > > =====
> > > -----------------------------------------------
A1:
There are a lot of ways you can use dynamically internal table assignments.
The best way, for my attitude, is to use the following code:
PROGRAM ZXXXXXX.
DATA: Z0051 LIKE T005 OCCURS 0 WITH HEADER LINE.
DATA: Z0052 LIKE T005 OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
PERFORM ADD-DYNAMIC TABLES Z0051.
PERFORM ADD-DYNAMIC TABLES Z0052.
END-OF-SELECTION.
A2:
Hi Roland,
Note, Z001 .... can only be interanl tables WITHOUT header line,
otherwise ASSIGN won't work. Is there a problem for you? I'm on 3.1H.
Regards,
Siarhei
ABAP FAQs
Q: Is ABAP program client dependent or independent?
A: Independent.
A: When you change data of one table the sy-subrc is returned. And then updation
of other affected tables takes place.
So if system fails to update other tables still sy-subrc returned is 0 (ie, Whwn first
table gets updated).
Q: Is there any standard SAP report which gives a count of the number of times a
program is executed ?
A: Try transaction STAT
Q: We want protect/lock a field so that only selected people can change the value
while others can only read. How to set
the authorizations?
A: Create an authorization object for change mode. Loop at screen in the user exit
and set input to 0. Check the user based
on sy-uname and the authorization. Decide whether input should be 0 or 1.
Q: How to lock an user defined transaction for some time during which no user can
access the same?
A: Use transaction SM01. Scroll through the transactions and check against the
transaction to be locked. And after the
maintenance is over, go back to SM01 and uncheck the same to unlock.
BDC
Q: Our ABAP program is working properly in Foreground. Can I schedule it for
background processing on the weekend?
A: SAP standard program RSBDCSUB helps you to schedule the job. Create a
variant for RSBDCSUB with the BDC
session name.
Q: How can we send a mail to the user intimating him that his report/BDC is
completed in background?
A: You can use FUNCTION RS_SEND_MAIL_FOR_SPOOLLIST
If Unix is being used, you may send a report to any internet mail with the following:
REPORT ZSNDMAIL .
DATA: COMND(200) type c.
DATA: RESULT(200) type c occurs 100 with header line.
PARAMETERS: FILE(60) type c lower case default
‘/sapdata/sd_outbound/testmail.dat’.
PARAMETERS: SUBJECT(60) type c lower case.
PARAMETERS: EMAIL(60) type c lower case.
INITIALIZATION.
TRANSLATE EMAIL TO LOWER CASE.
START-OF-SELECTION.
TRANSLATE EMAIL TO LOWER CASE.
CONCATENATE ‘cat’ FILE ‘| elm -s “‘ subject ‘”‘ email into comnd seperated by
space.
CALL ‘SYSTEM’ ID ‘COMMAND’ FIELD comnd ‘TAB’ FIELD
UNIX_RESULTS-*SYS*.
Loop at Results.
write: /1 results.
endloop
end-of-selection.
SAPScript
Q: We get the total number of pages as expected by using ‘SAPSCRIPT-
FORMPAGES’ in a duplex layout. In our case
duplex case is always ‘Terms & Conditions’. We do not want the number of pages
as in duplex printing. What is the best
possible solution?
A: On the Terms & Conditions page, Change the Page counter mode to ‘HOLD’ to
keep the page counter from incrementing
when you print the Term & Conditions.
RFC
Q: We want to move a SAP table to an Access table using
TABLE_EXPORT_TO_MSACCESS_RFC
Importing parameters are
DBNAME
DEST
FLG_APPEND
FLG_POPUP
LANGU
The table has three columns:
TABNAM
MANDT
SDATA
We have no Exporting parameters.
How shall we set the parameters?
A: Install the PS utilities, which are part of SAPGUI install CD. You may run
report RIACCESS from SE38.
Go to SALE -> Communication -> Define RFC Destination. Setup two RFC
destinations PS_ACCESS_1
and PS_ACCESS_2 and will have to get them to point to wdpsastr.exe and
wdpsatab.exe respectively. Then
execute RIACCESS and choose PS_ACCESS_1 to generate access tables. Please
note that Access only supports
tables with up 255 fields.
Transports
Q: In a Dev instance, we want to transport a modification to a layout set from one
client to another. What is the best way?
A: use transaction SE71. Choose Utilities->Copy from Client. Layout sets need not
be transported between clients ,
via transport requests DEVKxxxxxx.
Q: We need to keep track of the transports that need to flow through to other
systems (ie, DEV, TST, TRN, PRD etc).
Is there a way do this?
A: SAPCRAFT enables you to control the CTS from DEV system. This keeps track
of all transports at all stages and
enables you to allocate Import, export and Authorization functions to specific user.
Tables
Q: We specify the logical database. And we want a field that is not present in any of
the tables defaulted in logical
database. How can we want to add this additional field from a different table?
A: . Presume you have a logical database
table 1
table 2
table 3
Define the required field as additional field say fld of table 1, table 2 or table 3
and then in the code section define.
Perform get_f1d(zxxxxxxx) using f1d.
Form zxxxxxxx could be like;
Form get_f1d using f.
Select * from where ‘conditions’
f = table4 – f1d.
Regards,
ABAPer
———————
ABAPer, mail: abap.community@gmail.com http://www.erpdb.info
ADD
Variants:
1. ADD n TO m.
2. ADD n1 THEN n2 UNTIL nz GIVING m.
3. ADD n1 THEN n2 UNTIL nz TO m.
4. ADD n1 THEN n2 UNTIL nz
…ACCORDING TO sel …GIVING m.
5. ADD n1 FROM m1 TO mz GIVING m.
Variant 1 ADD n TO m.
Effect Adds the contents of n to the contents of M and stores the result in m.
This is equivalent to: m = m + n.
Example
DATA: NUMBER TYPE I VALUE 3,
Effect Adds the contents of the fields n1, n2, …, nz together and stores the result in
m, where n1 is the first, n2 the second and nz the last of a sequence of fields the
same distance apart. They can be either database fields or internal fields, but they
must all have the same type and length.
This is equivalent to: m = n1 + n2 + … + nz.
Example
The field SUM now contains 150 but its initial value is unimportant. The fields
within the field string NUMBERS remain unchanged.
Effect Calculates the total as in variant 2 but then adds it to the contents of the field
m.
This is equivalent to: m = m + n1 + n2 + … + nz
Example
DATA: BEGIN OF NUMBERS,
ONE TYPE P VALUE 10,
TWO TYPE P VALUE 20,
THREE TYPE P VALUE 30,
FOUR TYPE P VALUE 40,
FIVE TYPE P VALUE 50,
END OF NUMBERS,
Example
DATA: BEGIN OF NUMBERS,
ONE TYPE P VALUE 10,
TWO TYPE P VALUE 20,
THREE TYPE P VALUE 30,
FOUR TYPE P VALUE 40,
FIVE TYPE P VALUE 50,
END OF NUMBERS,
SUM TYPE I VALUE 1000,
INDEX TYPE I.
RANGES SELECTION FOR INDEX.
SELECTION-SIGN = ‘I’.
SELECTION-OPTION = ‘BT’.
SELECTION-LOW = 2.
SELECTION-HIGH = 4.
APPEND SELECTION.
ADD NUMBERS-ONE THEN NUMBERS-TWO
UNTIL NUMBERS-FIVE
ACCORDING TO SELECTION
GIVING SUM.
SUM now contains 90. Only the component fields TWO to FOUR were selected
from the field string NUMBERS and added together.
Effect The field n1 must be the first in a sequence of consecutive fields of the same
type. m1 and mz should contain the numbers of the first and last fields in this
sequence to be added together (whether fixed or variable). The total is stored in m.
Example
DATA: BEGIN OF NUMBERS,
ONE TYPE P VALUE 10,
TWO TYPE P VALUE 20,
THREE TYPE P VALUE 30,
FOUR TYPE P VALUE 40,
FIVE TYPE P VALUE 50,
END OF NUMBERS,
START TYPE I VALUE 2,
SUM TYPE I VALUE 1000.
*----------------Work VAriables
----------------------------------*DATA: S_DOC_CHNG LIKE
SODOCCHGI1.DATA: L_TAB_LINES LIKE SY-TABIX.DATA: COUNT1 TYPE I.DATA:
COUNT2(4) TYPE N.DATA: W_ITCPO LIKE ITCPO,W_DIALOG,W_ITCPP LIKE
ITCPP.DATA: W_BIN_FILESIZE(10) TYPE C.DATA: L_FILENAME LIKE RLGRAP-
FILENAME .DATA: OK_CODE LIKE SY-UCOMM.
*&———————————————————————*
*& Form DOWNLOAD_IN_TXT_MODE
*&———————————————————————*
* text
*———————————————————————-*
* –> p1 text
* <-- p2 text
*———————————————————————-*
FORM DOWNLOAD_IN_TXT_MODE.
REFRESH T_PDF.
CALL FUNCTION ‘CONVERT_OTF’
EXPORTING
FORMAT = ‘PDF’
MAX_LINEWIDTH = 255
IMPORTING
BIN_FILESIZE = W_BIN_FILESIZE
TABLES
OTF = T_OTFDATA
LINES = T_PDF
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
ENDFORM. ” DOWNLOAD_IN_TXT_MODE
*&———————————————————————*
*& Form DOWNLOAD_TO_PRES_SERV
*&———————————————————————*
* text
*———————————————————————-*
* –> p1 text
* <-- p2 text
*———————————————————————-*
FORM DOWNLOAD_TO_PRES_SERV.
COUNT2 = IT_REQ1-COUNT.
CONCATENATE ‘C:\RFQ_’ COUNT2 ‘.PDF’ INTO L_FILENAME .
CALL FUNCTION ‘DOWNLOAD’
EXPORTING
BIN_FILESIZE = W_BIN_FILESIZE
FILENAME = L_FILENAME
FILETYPE = ‘BIN’
TABLES
DATA_TAB = T_PDF
EXCEPTIONS
INVALID_FILESIZE = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
CUSTOMER_ERROR = 7
OTHERS = 8.
CLEAR COUNT2.
ENDFORM. ” DOWNLOAD_TO_PRES_SERV
*&———————————————————————*
*& Form SEND_MAIL_INSUR
*&———————————————————————*
* text
*———————————————————————-*
* –> p1 text
* <-- p2 text
*———————————————————————-*
FORM SEND_MAIL_INSUR.
DATA : L_CHRLEN TYPE I,
L_FILENAME LIKE RLGRAP-FILENAME ,
L_LENGTH LIKE T_OBJPACK-DOC_SIZE .
CLEAR :
T_OBJPACK,T_OBJTXT,T_OBJBIN,T_OBJHEAD,T_RECLIST,S_DOC_CHNG.
REFRESH : T_OBJPACK,T_OBJTXT,T_OBJBIN,T_OBJHEAD,T_RECLIST.
S_DOC_CHNG-OBJ_NAME = ‘RFQ Referrals’.
S_DOC_CHNG-OBJ_DESCR = ‘RFQ Referrals’.
DESCRIBE TABLE T_OBJTXT LINES L_TAB_LINES.
READ TABLE T_OBJTXT INDEX L_TAB_LINES.
S_DOC_CHNG-DOC_SIZE = ( L_TAB_LINES – 1 ) * 255 + STRLEN( T_OBJTXT
).
CLEAR T_OBJPACK-TRANSF_BIN.
T_OBJPACK-HEAD_START = 1.
T_OBJPACK-HEAD_NUM = 0.
T_OBJPACK-BODY_START = 1.
T_OBJPACK-BODY_NUM = L_TAB_LINES.
T_OBJPACK-DOC_TYPE = ‘RAW’.
APPEND T_OBJPACK.
PERFORM CONVERT_TABLE.
DESCRIBE TABLE T_OBJBIN LINES L_TAB_LINES.
T_OBJHEAD = L_FILENAME.
APPEND T_OBJHEAD.
T_OBJPACK-TRANSF_BIN = ‘X’.
T_OBJPACK-HEAD_START = 1.
T_OBJPACK-HEAD_NUM = 1.
T_OBJPACK-BODY_START = 1.
T_OBJPACK-BODY_NUM = L_TAB_LINES.
T_OBJPACK-DOC_TYPE = ‘PDF’.
T_OBJPACK-OBJ_NAME = ‘RFQ REFERRAL’.
T_OBJPACK-OBJ_DESCR = ‘RFQ REFERRALS : PDF Format’.
T_OBJPACK-DOC_SIZE = L_TAB_LINES * 255.
W_BIN_FILESIZE = L_TAB_LINES * 255.
MOVE W_BIN_FILESIZE TO L_LENGTH+3(9).
TRANSLATE L_LENGTH USING ‘ 0′.
T_OBJPACK-DOC_SIZE = L_LENGTH .
APPEND T_OBJPACK.
T_RECLIST-RECEIVER = IT_REQ-EMAIL.
T_RECLIST-REC_TYPE = ‘U’.
APPEND T_RECLIST.
*&———————————————————————*
*& Form CONVERT_TABLE
*&———————————————————————*
* text
*———————————————————————-*
* –> p1 text
* <-- p2 text
*———————————————————————-*
FORM CONVERT_TABLE.
DATA: HLTLINES TYPE I.
DATA: FLE1(2) TYPE P.
DATA: FLE2(2) TYPE P.
DATA: HFELD(500) TYPE C.
DATA: OFF1 TYPE P.
DATA: HTABIX LIKE SY-TABIX.
DESCRIBE TABLE T_PDF LINES HLTLINES.
DESCRIBE FIELD T_PDF LENGTH FLE1.
DESCRIBE FIELD T_OBJBIN LENGTH FLE2.
CLEAR T_OBJBIN. REFRESH T_OBJBIN.
CLEAR OFF1. CLEAR HFELD.
LOOP AT T_PDF.
HTABIX = SY-TABIX.
MOVE T_PDF TO HFELD+OFF1.
IF HTABIX = HLTLINES.
FLE1 = STRLEN( T_PDF ).
ENDIF.
OFF1 = OFF1 + FLE1.
IF OFF1 GE FLE2.
CLEAR T_OBJBIN.
T_OBJBIN = HFELD(FLE2).
APPEND T_OBJBIN.
SHIFT HFELD BY FLE2 PLACES.
OFF1 = OFF1 – FLE2.
ENDIF.
IF HTABIX = HLTLINES.
IF OFF1 GT 0.
CLEAR T_OBJBIN.
T_OBJBIN = HFELD(OFF1).
APPEND T_OBJBIN.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. ” CONVERT_TABLE
*&———————————————————————*
*& Form OPEN_SCRIPT1
*&———————————————————————*
* text
*———————————————————————-*
* –> p1 text
* <-- p2 text
*———————————————————————-*
FORM OPEN_SCRIPT1.
IF W_ITCPP IS INITIAL.
W_DIALOG = ‘X’.
IF SAV_OK_CODE = ‘PRNPRV’.
W_ITCPO-TDGETOTF = ‘ ‘.
ENDIF.
IF SAV_OK_CODE = ‘PDFD’ OR SAV_OK_CODE = ‘PDFM’.
W_DIALOG = ‘X’.
W_ITCPO-TDGETOTF = ‘X’.
ENDIF.
ELSE. ” if w_itcpp is initial.
CLEAR W_DIALOG.
MOVE-CORRESPONDING W_ITCPP TO W_ITCPO.
ENDIF. ” if w_itcpp is initial.
IF SAV_OK_CODE = ‘PRNPRV’.
W_DIALOG = ‘X’.
ENDIF.
*changed
CALL FUNCTION ‘OPEN_FORM’
EXPORTING
* APPLICATION = ‘DS’
* DIALOG = W_DIALOG
FORM = ‘ZRP_DUNNING1′
LANGUAGE = SY-LANGU
* OPTIONS = W_ITCPO
* IMPORTING
* RESULT = W_ITCPP
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
OTHERS = 10.
ENDFORM. ” OPEN_SCRIPT1
———————
ABAPer, mail: abap.community@gmail.com http://www.erpdb.info
Goto menu bar in that System –> Status click Gui Status Expand all the nodes
inside u will get all Function Code/ ok code for icons inside the in GUI menu Bar.
ASAP Business One Templates contains templates on BMPL, Business Blue Print,
Change Management Communication guide, Cutover Checklist, Go-Live Checklist,
Handover from sales checklist, Issue log, Meeting Agenda Template, Meeting
minutes template, Post Go-Live Questionaire, Project Kick-off Presentation, Project
Phase Sign-Off, Project Plan, Request for change, Risk assessment, Software
Delivery Receipt, Test case template, Test Strategy Guide and Training Plan.
ASAP Methodology
Written by rajivsharma.sap on Jul 11th, 2008 | Filed under: ASAP
Methodology
What is ALE?
Written by admin on Apr 4th, 2010 | Filed under: Application Linking and
Enabling(ALE)
ALE (Application Link Enabling) is used to support the construction and operation
of distributed applications, through the exchange of data messages ensuring data
consistency across loosely coupled SAP applications, using both synchronous and
asynchronous communications without the need for a central database.
• Application services
• Distribution services
• Communication services
The purpose of this guide on implementing SAP ALE whitepaper is to provide you
with a methodology on implementing SAP R/3′s ALE technology. For the executive
who is looking into deploying ALE the first chapter will be of benefit as well as the
summary for each of the remaining chapters which will give a good indication as to
the level of effort that will be required in order to implement ALE.
It highlights the areas to look at; it gives example documentation and describes the
implementation process in detail. It is not an idiot’s guide to implementing ALE.
Detailed knowledge of the ALE functionality together with project management
skills will ensure a smooth ALE implementation.
The Following Instructions walk you through how to set up an ALE Distribution
scenario on one client, so that the same client serves as both the sender and the
receiver system.
This kind of setup will help you to achieve a more economical testing environment
and is also an elegant distribution technique for certain production environment
scenarios, like to enable data distribution in cross-company business processes that
are not supported by standard interfaces.
Many times in SAP, you may come across situations where in the users wants to
have a separate transaction codes for some of the tables which can be easily
maintained or displayed in SM30. There are many reason why someone would need
like this? reasons may be to have a easy to remember transaction code then to
remember the lengthy and complicated table name and so on.. so how do we achieve
this.
Go to SE93 – Click on create and then select either Transaction with Variant or
Transaction with parameters.
I-choose transaction with parameters and now enter in the transaction ‘SM30′, and
in the end you will see a small table control, click on the first line in “Name on
Screen Field” and press F4 and select “viewname” and in the corresponding field
value enter the table name and now go to the second line and press F4 again and
select either show/update (depends either you want to display or maintain it) and
now in the corresponding field value enter ‘X’ then save. Refer the screenshot below
if you are lost. Continue Reading …
Comments (0) Get FREE daily updates by RSS or e-mail
SAP Transactions
Written by admin on Aug 8th, 2008 | Filed under: Tips & Tricks
Want to have the list of SAP transactions handy? Well you don’t have you
download SAP transactions from any website. The SAP table TSTC itself contains
the list of all the SAP Transactions.
So anytime you forget a SAP transaction, just go to the table TSTC and you can get
the entire list of sap transactions or how about using the SEARCH_SAP_MENU?
even that also helps you to find any SAP transaction easily.
Archive for the ‘Material Management (MM)’ Category
Vendor Returns
Written by amandeep.sandhu on Jul 14th, 2009 | Filed under: Material
Management (MM)
In our day-day business practise we come across various reasons where we need to
return back certain stock to vendor due to damages,excess stock, expiry goods ..etc
This process of ‘RETURNS TO VENDOR’ starts with Returns PO and ends with
creation of Credit memo in SAP.
Needed data:
Vendor code
Article code
Required quantity of stock availability
Condition details(Gross price)
tax data
Download the document with screenshots (2622) which helps you on working with
vendor returns.
When you enter a goods movement in the system, you must enter a movement type
to differentiate between the various goods movements. A movement type is a three
digit identification key for a goods movement. The following table contains
examples
of movement types.
Download the document on movement types (3511) which describes all the
movement types used in SAP.
The Quick reference on Vendor Management will provide you all the steps in:
The Quick reference on Purchase Requisition will provide you all the steps in:
The Quick reference on Invoice Verification will provide you all the steps on:
Understand about :
Continue Reading …
Q: Can’t you achieve all this by using today’s EAI and/or ETL applications?
A: EAI tools provide the connection between different systems on the technical layer
to ensure message handling, semantic mapping, routing and queuing of data. ETL
tools provide similar functionality but are typically deployed less as a message
handling layer and more as a batch-oriented, massive volume integration
mechanism. As a building block of the SAP NetWeaver platform, SAP MDM
leverages the process integration capabilities of SAP’s Exchange Infrastructure
(SAP XI), but, in addition, also provides services for content consolidation, data
harmonization, central maintenance and controlled data distribution according to
the business process semantics.
Master Data Harmonization: It is often necessary also to enable the maintenance and
consistent distribution of global attributes and to process and distribute information
centrally. This ensures
that all systems are supplied with the same global attributes after distribution, and
that business processes can be processed securely. The distributed objects can be
provided with additional
attribute values in the target systems.
Features:
All of the Content Consolidation scenario
PLUS
Central management and distribution of global attributes Post-distribution editing
in client systems Controlled distribution of local changes Example: Business partner
administration; central provision of sales articles; definition and administration of
non-variable parts.
Q: Who are the members of the Customer Advisory Council and how were they
selected?
A: Driven by our Industry Business Sectors for Manufacturing and Service
Industries, the Customer Advisory Council formation was a process of identifying
customers that are leaders in the area, with significant expertise in master data
management. Right now customers such as Dow Chemicals, Motorola
Semiconductor Products Sector, Nokia, and German Postbank have agreed to
participate. More candidates from the consumer products and retail industry are
expected.
Q: What is the contribution of these companies to the project and how does SAP
collaborate with them to meet future market requirements?
A: SAP is collaborating with those companies in order to verify the implementation
concepts and to jointly identify the development priorities. All participating
companies have significant
expertise in master data management topics already and are looking for standard
solutions to become available on the market. There is not yet a decision from those
companies to actually use this new solution, however SAP’s goal is to win those
customers to implement and run SAP MDM.
Q: Will it be possible to use SAP MDM only with SAP Exchange Infrastructure or
can a company also use other EAI tools?
A: The use of the SAP Exchange Infrastructure is the foundation for SAP MDM.
SAP solutions are powered by the SAP NetWeaver platform with high emphasis on
interoperability to :NET and
J2EE/Java.
Q: For which 3rd party products will SAP provide the adaptors?
A: In the first phase the adaptors to 3rd party products will be provided on a
project basis. SAP plans to make selected adaptors to 3rd party systems to a part of
the standard solution in future.
Q: What objects will be supported by SAP MDM? What services will be offered?
A: The initial release of SAP MDM will support the following master data objects:
business partner, product master, product structures, document links, technical
assets and change masters.
Services provided depend on the type of objects and will include maintenance of
objects, search for objects, workflow, mass changes, change notifications, duplicate
checking, and notifications
for object creation and discontinuation.
If you like this post, you may as well like these too:
1. SAP Controlling FAQs – Master Data 1. List the five types of master data in cost
center accounting (CCA). • Cost centers • Cost elements • Activity types • Statistical
key figures • Resources 2. What...
2. SAP Asset Accounting FAQs – Master Data 1. Describe the function of
depreciation areas. Depreciation area 01, which can be set up as the book depreciation, can
make automatic postings to the general ledger. Other depreciation areas...
3. SAP Asset Accounting FAQs – Old Assets Data Master 1. Base on quantity,
what are the three methods of old asset data transfer? In what status does the company code
have to be so that the transfer is possible?...
4. Difference between Master Data, Transaction Data and Customizing Data
Customizing Data refers to the customized information for a particular Client. This includes
data such as payment terms, discounts, pricing, tolerance limits, etc., which you do not
normally change on...
5. Material Master – Master data Configuration and PR Understand about : MM
Module data flow MM Module Master Data Requisition RFQ Quotation Release Strategy
Download the document on...
1. BD55 Conversion rule user exit. Link conversion rule user exit to the
different system \ partner combination.
2. WE19 EDI test tool. Use to test inbound Function module changes.
3. WE31 Segment create
4. WE30 Create IDoc extension type
5. WE82 Link Release detail to Extension IDoc Type
6. WE57 Assign function module to logical message and IDoc type
1. WE09 / WE02 IDoc lists according to content. View IDocs via specific IDoc
number or business application detail contained within the contents of a
segment.
2. WE05 View IDocs
3. WE60 IDoc type documentation tool
4. WE20 Partner profile configuration. Add partner detail together with
inbound and outbound relationships. We also incorporate message control
on the outbound IDocs. Utilize the organizational units to trap functional
errors for further processing.
5. BD87 Reprocess IDocs in error or waiting for action. (Both inbound and
outbound in 4.6. Use BD88 in prior versions)
Comments (0) Get FREE daily updates by RSS or e-mail
This document is written for system integrators who develop client interfaces
between SAP and other applications. It describes how to use the iWay Application
Adapter for SAP integrate SAP IDocs, RFC, BAPI and BEA WebLogic Server. It is
assumed that readers understand Web technologies and have a general
understanding of Microsoft Windows and UNIX systems.
IDOC Overview
Written by admin on Jul 17th, 2009 | Filed under: IDOCs
N - Show no screens.