Documente Academic
Documente Profesional
Documente Cultură
Introduction
f (8)
i
i
i
c(1)
c(L)
x(L)
n(L)
x(2)
p((L+2)/2)
x(L)
t(6)
c(L)
string
xstring
c(L)
Elementary types
Structure
Internal tables (array)
b) Alphanumeric
Elementary type
e.g. constants: " cannot change constants
collegeName(6)
type c value 'Humber',
maxNumberOfSeats type i value 30.
data: maxReservations
e.g. 1. data:
begin of student, " student record structure
id(9)
type n,
name(25),
phone(10),
end of student.
data professor like student.
student-id = 123456789.
student-name = 'Tanya Davis'.
student-phone = '4166576622'.
move student to professor.
e.g.2.
types:
begin of phoneNumber,
countryCode(3) type n,
areaCode(3)
type n,
number(7)
type n,
end of phoneNumber,
begin of employee,
id(9)
type n,
name(25) type c,
cellPhone type phoneNumber occurs 2,
end of Employee.
data: employees type employee occurs 200.
TABLES TYPE
LINE TYPE
o defines attributes of individual fields i.e. array structure
ACCESS TYPE (
o Use index to access lines or access by key in certain kinds
of internal tables (arrays)
STANDARD TABLE OR INDEXED TABLE
o Mostly access by index
o Access by non-unique key via sequential search
o e.g.
types:
begin of customer,
id (9)
type n,
name(25)
type c,
end of customer,
"sequential table
customerStandardTable
type standard table of customer
with non-unique key id.
data:
"work area
wa_customer
type customer,
"internal table
myCustomerStandardTable
customersStandardTable,
tableIndex
type
type sy-tabix.
HASHED TABLE
o access by unique key only
types:
begin of customer,
id
type student-id,
name type student-name,
phone type student-phone,
end of customer,
customerHashedTable type hashed table of customer
with unique key id.
data:
wa_customer type customer,
myCustomerHashedTable type customerHashedTable .
parameters:
pa_id
type student-id.
You can create a lock on a object of SAP thorugh transaction SE11 and enter any
meaningful name start with EZ Example EZTEST_LOCK.
Use: you can see in almost all transaction when you are open an object in Change mode
SAP could not allow to any other user to open the same object in change mode.
Example: in HR when we are enter a personal number in master data maintainance screen
SAP can't allow to any other user to use same personal number for changes.
Technicaly:
When you create a lock object System automatically creat two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above
FM.
xvbak = vbak
xvbuk = vbuk
xkomk = tkomk
importing
lvf_subrc = lvf_subrc
tables
xvbfa = xvbfa
xvbap = xvbap
xvbup = xvbup.
The exit calls function module EXIT_SAPMV45A_003
2. How to find user exits
Display the program where you are searching for and exit and search for CALL
CUSTOMER-EXIT
If you know the Exit name, go to transaction CMOD.
Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.
You will now come to a screen that shows the function module exits for the exit.
3. Using Project management of SAP Enhancements
We want to create a project to enahance trasnaction VA01
- Go to transaction CMOD
- Create a project called ZVA01
- Choose the Enhancement assign radio button and press the Change button
In the first column enter V45A0002 Predefine sold-to party in sales document . Note that
an enhancement can only be used i 1 project. If the enhancement is already in use, and
error message will be displayed
Press Save
Press Components. You can now see that enhancement uses user exit
EXIT_SAPMV45A_002. Double click on the exit.
Now the function module is displayed. Double click on include ZXVVAU04 in the
function module
Insert the following code into the include: E_KUNNR = '2155'.
Activate the include program. Go back to CMOD and activate the project.
Goto transaction VA01 and craete a salesorder.
write:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
write:/(95) sy-uline.
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.
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.
*---End of Program
Menu Exits
Menu exits add items to the pulldown menus in standard SAP applications. You can use
these menu items to call up your own screens or to trigger entire add-on applications.
SAP creates menu exits by defining special menu items in the Menu Painter. These
special entries have function codes that begin with "+" (a plus sign). You specify the
menu items text when activating the item in an add-on project.
Screen Exits
Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing
special subscreen areas on a standard R/3 screen and calling a customer subscreen from
the standard screens flow logic.
Function Module Exits
Function module exits add functions to R/3 applications. Function module exits play a
role in both menu and screen exits.
When you add a new menu item to a standard pull down menu, you use a function
module exit to define the actions that should take place once your menu is activated.
Function module exits also control the data flow between standard programs and screen
exit fields. SAP application developers create function module exits by writing calls to
customer functions into the source code of standard R/3 programs.
These calls have the following syntax:
CALL CUSTOMER-FUNCTION 001.
Field Exits
Field exits allow you to create your own programming logic for any data element in the
Dictionary. You can use this logic to carry out checks, conversions, or business-related
processing for any screen field. Example: The data element BBBNR identifies a
companys international location number. You might want to set up your R/3 System so
that all international location numbers are larger than 100.
The field exit concept lets you create a special function module that contains this logic.
You assign the special function module to the data element BBBNR. You then assign the
module to any programs and screens in which users can add new international location
numbers. When you activate your field exit, the system automatically triggers your
special routine whenever a user enters a company location number.
In 4.6c, you can use "RSMODPRF" program to create field exits.
An example of a user exits :-
function module
Insert the following code into the include: E_KUNNR = '2155'.
Activate the include program. Go back to CMOD and activate the project.
Goto transaction VA01 and create a salesorder. Note that Sold-to-party now automatically
is "2155"
update. The user should not notice any difference because screen
generation is very fast.
3. Can you read the contents of other screen fields in the field exit?
o In principle, every field exit can store its value in the global
variables of the function group (TOP) and hence make them
available to other field exits. Note here that field exits are
always called and not only if an entry is made in the field or if
the field is empty. In addition, it is not possible to make any
assumptions about the order in which the field exits will be
called in the future.
4. How does the field exit behave on step loop fields ?
o After the user has entered data, the field exit is called in PAI
as often as there are visible fields in the step loop. The system
variable SY-STEPL is incremented each time. If a new value is
assigned to the field, it is displayed in the module between LOOP
and ENDLOOP. This module is also called once for each visible step
loop line.
5. Can field exits be debugged ?
o No. Field exits must be tested separately in the ABAP/4
Development Workbench. For errors which only occur in the screen
environment, it is helpful to write interesting variable to the
file system using TRANSFER... . These can then be analysed there.
6. What can you do if the field contents are no longer transported to to
ABAP/4.
o Check whether a value is assigned to the field OUTPUT.
7. When is the field exit called if a conversion exit is attached to the
data element ?
o The field exit is called after the conversion exit. This means
that the INPUT field receives the data in the same format as the
ABAP/4 program also receives it.
8. Although a global field exit is inactive, a function module is called
which does not exist (for example FIELD_EXIT_PROGRAMM_@)
o This is an error in the kernel which no longer occurs as of 3.0C.
As a temporary measure, it is useful to assign a program and a
screen which do not exist to the field exit and then activate the
field exit.
9. Field exit is not visible in CMOD, although created.
o If you want to create a field exit for a data element, a function
module is proposed with the name FIELD_EXIT_. This
function module must exist for the field exit to work. If you do
not create this function module, but do create one with a suffix,
the data element is not displayed in CMOD.
10.Field exit is not executed although it is active.
o Fields which do not have the 'Input field' attribute usually do
not trigger a field exit. The field exit is designed to allow an
extended input check. It is therefore only called for input fields
- even if they are not ready for input at runtime of the
application by LOOP AT SCREEN.
This rule does not apply, however, if the field is located within
a steploop. Here the field will be always activated, even if it is
invisible.
o Field exits can only be executed for fields that are directly
related tothe dictionary. If the relation is indirect, i.e. via an
ABAP declaration ( LIKE ), no field exit can be executed.
11.Field exits on check buttons do not work
o Field exits are only intended for input fields. As check buttons
count as graphical elements, you cannot install field exits on
them.
12.Field exits do not work on selection screens
In the implementation view, the users of Business Add-Ins can customize the logic they
need or use a standard logic if one is available.
In contrast to customer exits, Business Add-Ins no longer assume a two-level
infrastructure (SAP and customer solutions), but instead allow for a multi-level system
landscape (SAP, partner, and customer solutions, as well as country versions, industry
solutions, and the like). Definitions and implementations of Business Add-Ins can be
created at each level within such a system infrastructure.
SAP guarantees the upward compatibility of all Business Add-In interfaces. Release
upgrades do not affect enhancement calls from within the standard software nor do they
affect the validity of call interfaces. You do not have to register Business Add-Ins in
SSCR.
The Business Add-In enhancement technique differentiates between enhancements that
can only be implemented once and enhancements that can be used actively by any
number of customers at the same time. In addition, Business Add-Ins can be defined
according to filter values. This allows you to control add-in implementation and make it
dependent on specific criteria (on a specific Country value, for example).
All ABAP sources, screens, GUIs, and table interfaces created using this enhancement
technique are defined in a manner that allows customers to include their own
enhancements in the standard. A single Business Add-In contains all of the interfaces
necessary to implement a specific task.
The actual program code is enhanced using ABAP Objects. In order to better understand
the programming techniques behind the Business Add-In enhancement concept, SAP
recommends reading the section on ABAP Objects.
program an AUTHORITY-CHECK.
AUTHORITY-CHECK OBJECT <authorization object>
ID <authority field 1> FIELD <field value 1>.
ID <authority field 2> FIELD <field value 2>.
...
ID <authority-field n> FIELD <field value n>.
The OBJECT parameter specifies the authorization object.
The ID parameter specifies an authorization field (in the authorization object).
The FIELD parameter specifies a value for the authorization field.
The authorization object and its fields have to be suitable for the transaction. In most
cases you will be able to use the existing authorization objects to protect your data. But
new developments may require that you define new authorization objects and fields.
tables can be processed, and the next 50 records from VBAk can be read. Remember 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.
SELECT vbeln erdat
FROM vbak
INTO TABLE li_vbak PACKAGE SIZE 50.
SELECT posnr matnr meins
FROM vbap
INTO TABLE li_vbap
FOR ALL ENTRIES IN li_vbak
WHERE vbeln = li_vbak-vbeln.
IF sy-subrc = 0.
* 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.
*-- End of Program
SAP memory
The SAP memory, otherwise known as the global memory, is available to a user during
the entire duration of a terminal session. Its contents are retained across transaction
boundaries as well as external and internal sessions. The SET PARAMETER and GET
PARAMETER statements allow you to write to, or read from, the SAP memory.
ABAP/4 memory
The contents of the ABAP/4 memory are retained only during the lifetime of an external
session (see also Organization of Modularization Units). You can retain or pass data
across internal sessions. The EXPORT TO MEMORY and IMPORT FROM MEMORY
statements allow you to write data to, or read data from, the ABAP memory.
1)BAPI are RFC enabled function modules. the difference between RFc and BAPI are
business objects. You create business objects and those are then registered in your BOR
(Business Object Repository) which can be accessed outside the SAP system by using
some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the
business object and its method from external system in BAPI there is no direct system
call. while RFC are direct system call 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 standardized BAPIs are provided:
Reading instances of SAP business objects
GetList ( ) With the BAPI GetList you can select a range of object key values, for
example, company codes and material numbers.
The BAPI GetList() is a class method.
GetDetail() With the BAPI GetDetail() the details of an instance of a business object
type are retrieved and returned to the calling program. The instance is identified via its
key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or
delete instances of a business object type
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.
Create( ) and CreateFromData! ( )
The BAPIs Create() and CreateFromData() create an instance of an SAP business object
type, for example, a purchase order. These BAPIs are class methods.
Change( )
The BAPI Change() changes an existing instance of an SAP business object type, for
example, a purchase order. The BAPI Change () is an instance method.
Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business
object type from the database or sets a deletion flag.
The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business
object type. The instance to be cancelled remains in the database and an additional
instance is created and this is the one that is actually canceled. The Cancel() BAPI is an
instance method.
tables: mara.
data: i type hashed table of mara with unique key matnr
7) and 8) ABAP objects are root for your program and reports.
If you need to find out the Okcodes for BDC sessions, look for program RSBDCCUA
and run it for any platform say 'WN' for windows or MC for Mac and it will generate list
of function codes
**********
If you want to protect a program against debugging, you just have to set the STATUS = S
in the attributes view of the main program.
**********
**********
Find the Table Name For a Field.
I know couple of ways to find the table name for a field.
like.
1. Part the cursor at the field and press F1 & F9.
2. se84 or se15
3. st05 (sql trace).
4. Setting Break point in ABAP.
**********
Given a transaction code, how can I find the menu path?
In 4.6c, you can used tcode search_sap_menu to find the SAP MENU tcode.
Please note that there are no tcode available to find the path of the IMG transaction.
**********
Can line-size of abap report large than 255?
You can have line-size upto 1023.
Along with Report statement pass the line-size as 1023. Ex. Report xyz line-size 1023.
**********
How to find out the number of days between a given date, excluding Saturdays and
Sundays and public holidays?
Try functions,
=> DATE_CONVERT_TO_FACTORYDATE
=> HR_HK_DIFF_BT_2_DATES
**********
REPORT ZREP1.
parameter : paramet(18) type c.
write : paramet.
AND RETURN.
ENDCASE.
TOP
Indeed these powerful ABAP/4 functions are very interesting and can bring some
advantages. Improve your home development easily. They belong to standard objects and
should never be changed.
Bp_event_raise
Trigger an event from ABAP/4 program.
Bp_joblog_read
Fetch job log executions filling the structure TBTC5.
G_set_get_all_values
Fetch values from a set filling the structure RGSB4.
Popup_to_confirm_loss_of_data
Create a dialog box in which you make a question whether the user wishes to
perform a processing step with loss of data.
Popup_to_confirm_step
Create a dialog box in which you make a question whether the user wishes to
perform the step.
Popup_to_confirm_with_message
Create a dialog box in which you inform the user about a specific decision point
during an action.
Popup_to_confirm_with_value
Create a dialog box in which you make a question whether the user wishes to
perform a processing step with a particular object.
Popup_to_decide
Create a dialog box in which you require the user between the two processing
alternatives, or to cancel the action.
Popup_to_decide_with_message
Create a dialog box in which you inform the user about a specific decision point
Popup_to_display_text
Create a dialog box in which you display a two-line message.
Rfc_system_info
Fetch information from the current instance filling the structure FRCSI.
Rs_send_mail_for_spoollist
Send messages from ABAP/4 programs to SAPoffice. The structure SOLI may
contain the message.
Rzl_sleep
Hang the current application from 1 to 5 seconds.
Rzl_submit
Submit a remote report.
Sapgui_progress_indicator
Set progress indicator on the left lower corner of the current window.
Sd_print_terms_of_payment
Format terms of payment according to base line date and payment terms.
So_wind_spool_list
Browse printer spool numbers according to user informed.
So_spool_read
Fetch printer spool according to the spool number informed.
So_user_list_read
List of all users filling the structure SOUD3.
Spell_amount
Return the amount in words filling the structure SPELL.
Th_saprel
Gather information from the current system including upgrade activities. It
completes fields from the structure KKS03.
Th_server_list
Gather information of all instances filling the structure MSXXLIST.
Th_user_list
List of logged users filling the structure UINFO.
Th_user_info
Information about the current user. It completes fields from the structure KKS03.
Th_wpinfo
List of work processes filling the structure WPINFO.
Ws_upload
Transfer files from the frontend to the application server.
Ws_download
Transfer files from the application server to the frontend.
Ws_excel
Download files at the frontend in excel format.
Ws_execute
Execute an external program on the presentation server.
Ws_file_delete
Delete file at the frontend.
Ws_volume_get
Get the label from a frontend device.
Ws_msg
Create a dialog box in which you display an one-line message.
TOP
Information Technology has many key words and SAP R/3 has introduced many others. In order
to understand even better this field you should keep in mind those terms.
RFC
A way to implement communication between application programs via Abap/4 function
call.
Semaphores
When a work process locks a resource, it sets a semaphore. Another work process that
also wants to access it must then wait.
SysID
A set of three letters or number that identify a system. Some sets are not allowed
because they are used by SAP. They are informed when the system is installed.
TCP/IP
It is the most widely used transport protocol for open systems. R/3 clients and servers
communicate using TCP/IP.
Telnet
It provides terminal access to hosts using TCP/IP protocol. It is a well-known command
among Systems Administrators.
Token Ring
It is a LAN architecture with ring topology. The transmission speed is 4 MBit/s or 16
MBit/s. This involves a 'free token' which circles the loop picking up transmissions. The
receiver station places a confirmation bit into the busy token. As soon as the busy token
reaches the sender station again, it is converted back to a free token and sent on to the
next station.
Transport
It is a request to transport objects from the software development environment, identified
as the source system, to the specified target system.
WAN (Wide Area Networks)
They are normally operated either by the telephone company or by private companies
that offer leased lines, switched lines or packet lines.
Work process
Work processes perform the bulk of the processing carried out by SAP systems. They
perform dialog steps in user transactions and carry out updates, lock management,
printing services, and so on.
Workbench
The ABAP/4 Workbench, a graphical programming environment, is used to create
application programs. The programming tools are accessed using buttons, dialogs and
windows.
Workflow
It consists of time and logical sequence of work items, which are precessed by human
agents or mechanical processing units.
X.25
It is a standardized network access protocol for the packet switching network. The
maximum transmission speed is 64 KBit/s.
TOP
TOP
Graphics on SAPscript
The program RSTXLDMC can be used to upload graphics (file extension .tif on
PC files) into individual standard text.
Adding icons
The include ICON can be easily used in your programs. All icons can be
checked through the transaction ICON. Sequences of characters begin and finish
with the symbol @. Even plain files under operating system can contain those
strings.
Adding symbols
The include SYMBOL can be easily used in your programs. It makes available
a great number of symbols.
%pri
Print the current report
%pc
Download the current report
%sc
Call the find function
p+
Go to the next page
pGo to the previous page
p++
Go to the last page
p-Go to the first page
Helpful reports
RSCLTCOP Copy tables across clients
RSAVGL00 Table adjustment across clients
RSINCL00 Extended program list
RSBDCSUB Release batch-input sessions automaticly
RSTXSCRP Transport SAPscript files across systems
RSORAREL Get the Oracle Release
RGUGBR00 Substitution/Validation utility
RSPARAM Display all instance parameters
RSUSR003 Check the passwords of users SAP* and DDIC in all clients
RSUSR006 List users last login
Meaning of info structures' first letter
A
B
C
D
E
F
G
H
I
S
X
Pricing
Output determination
Account determination
Material determination
Rebates
Index
Listing and Exclusion
Batch determination
Profile determination
Statistics
Statistics extra
ii)Pool tables & iii)Cluster tables These are logical tables that are arranged as records of transparent tables.one cannot use
native sql on these tables
(only opensql).They are not managable directly using database system tools.
iv)Internal tables - .
12. What is the step by step process to create a table in data dictionary?
ans:step 1: creating domains(data type,field length,range).
step 2: creating data elements(properties and type for a table
field).
step 3: creating tables(SE11).
13. Can a transparent table exist in data dictionary but not in the data base
physically?
ANS:- NO.
TRANSPARENT TABLE DO EXIST WITH THE SAME STRUCTURE BOTH IN THE
DICTIONARY AS WELL AS IN THE DATABASE,EXACTLY WITH THE SAME
DATA AND FIELDS.
14. What are the domains and data elements?
ANS:DOMAINS : FORMAL DEFINITION OF THE DATA TYPES.THEY SET
ATTRIBUTES SUCH AS DATA TYPE,LENGTH,RANGE.
DATA ELEMENT : A FIELD IN R/3 SYSTEM IS A DATA ELEMENT.
15. Can you create a table with fields not referring to data elements?
ANS:YES. eg:- ITAB LIKE SPFLI.here we are referening to a data object(SPFLI) not data
element.
16. What is the advantage of structures? How do you use them in the ABAP
programs?
ANS:Adv:- GLOBAL EXISTANCE(these could be used by any other program without
creating it again).
17. What does an extract statement do in the ABAP program?
ANS:Once you have declared the possible record types as field groups and defined their
structure, you can fill the extract dataset using the following statements:
EXTRACT <fg>.
When the first EXTRACT statement occurs in a program, the system creates the extract
dataset and adds the first extract record to it. In each subsequent EXTRACT statement,
the new extract record is added to the dataset
EXTRACT HEADER.
When you extract the data, the record is filled with the current values of the
corresponding fields.
As soon as the system has processed the first EXTRACT statement for a field group
<fg>, the structure of the corresponding extract record in the extract dataset is fixed. You
can no longer insert new fields into the field groups <fg> and HEADER. If you try to
modify one of the field groups afterwards and use it in another EXTRACT statement, a
runtime error occurs.
By processing EXTRACT statements several times using different field groups, you fill
the extract dataset with records of different length and structure. Since you can modify
field groups dynamically up to their first usage in an EXTRACT statement, extract
datasets provide the advantage that you need not determine the structure at the beginning
of the program.
18. What is a collect statement? How is it different from append?
ANS: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 numeric fields in the existing entry.
19. What is open sql vs native sql?
ANS:20. What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using
it?
ANS:21. What is the meaning of ABAP/4 editor integrated with ABAP/4 data dictionary?
ANS:22. What are the events in ABAP/4 language?
ANS:Initialization, At selection-screen,Start-of-selection,end-of-selection,top-of-page,end-ofpage, At line-selection,At user-command,At PF,Get,At New,At LAST,AT END, AT
FIRST.
23. What is an interactive report?
What is the obvious diff of such report compared with classical type reports?
ANS:-
An Interactive report is a dynamic drill down report that produces the list on users choice.
diff:a) THE LIST PRODUCED BY CLASSICAL REPORT DOESN'T allow user to interact
with the system
the list produced by interactive report allows the user to interact with the system.
b) ONCE A CLASSICAL REPORT EXECUTED USER LOOSES CONTROL.IR USER
HAS CONTROL.
c) IN CLASSICAL REPORT DRILLING IS NOT POSSIBLE.IN INTERACTIVE
DRILLING IS POSSIBLE.
24. What is a drill down report?
ANS:Its an Interactive report where in the user can get more relavent data by selecting
explicitly.
25. How do you write a function module in SAP? describe.
ANS:creating function module:called program - se37-creating funcgrp,funcmodule by assigning
attributes,importing,exporting,tables,exceptions.
calling program - SE38-in pgm click pattern and write function name- provide
export,import,tables,exception values.
26. What are the exceptions in function module?
ANS:COMMUNICATION_FAILURE
SYSTEM_FAILURE
27. What is a function group?
ANS:GROUP OF ALL RELATED FUNCTIONS.
28. How are the date and time field values stored in SAP?
ANS:DD.MM.YYYY. HH:MM:SS
30. Name a few data dictionary objects? //rep//
ANS:TABLES,VIEWS,STRUCTURES,LOCK OBJECTS,MATCHCODE OBJECTS.
31. What happens when a table is activated in DD?
ANS:It is available for any insertion,modification and updation of records by any user.
45. What are internal tables? How do you get the number of lines in an internal
table?
How to use a specific number occurs statement?
ANS:i)It is a standard data type object which exists only during the runtime of the program.
They are used to perform table calculations on subsets of database tables and for reorganising the contents of database tables according to users need.
ii)using SY-DBCNT.
iii)The number of memory allocations the system need to allocate for the next record
population.
46. How do you take care of performance issues in your ABAP programs?
Performance of ABAPs can be improved by minimizing the amount of data to be
transferred.
The data set must be transferred through the network to the applications, so reducing the
amount OF time and also reduces the network traffic.
Some measures that can be taken are:
- Use views defined in the ABAP/4 DDIC (also has the advantage of better reusability).
- Use field list (SELECT clause) rather than SELECT *.
- Range tables should be avoided (IN operator)
- Avoid nested SELECTS.
i)system tools
ii)field symbols and field groups.
ans:Field Symbols : Field symbols are placeholders for existing fields. A Field Symbol does
not physically reserve space for a field,but points to a field which is not known until
runtime of the program.
eg:- FIELD-SYMBOL <FS> [<TYPE>].
Field groups : A field group combines several fields under one name.At runtime,the
INSERT command is used to define which data fields are assigned to which field group.
There should always be a HEADER field group that defines how the extracted data will
be sorted,the data is sorted by the fields grouped under the HEADER field group.
47. What are datasets?
ANS:The sequential files(ON APPLICATION SERVER) are called datasets. They are used for
file handling in SAP.
48. How to find the return code of a statement in ABAP programs?
ANS:Using function modules.
they are coded in include programs (External programs) and are included in ABAP/4
programs.
80. Can you call a subroutine of one program from another program?
ans:- Yes- only external subroutines Using 'SUBMIT' statement.
81. What are user exits? What is involved in writing them? What precations are
needed?
82. What are RFCs? How do you write RFCs on SAP side?
83. What are the general naming conventions of ABAP programs?
ANS:Should start with Y or Z.
84. How do you find if a logical database exists for your program requrements?
ans:SLDB-F4.
85. How do you find the tables to report from when the user just tell you the
transaction he uses? And all the underlying data is from SAP structures?
ans:Transcode is entered in command field to open the table.Utilities-Table contents-display.
86. How do you find the menu path for a given transaction in SAP?
ans:87. What are the different modules of SAP?
ans:FI,CO,SD,MM,PP,HR.
89. How do you get help in ABAP?
ans:HELP-SAP LIBRARY,by pressing F1 on a keyword.
90. What are different ABAP/4 editors? What are the differences?
ans:91. What are the different elements in layout sets?
ans:PAGES,Page windows,Header,Paragraph,Character String,Windows.
92. Can you use if then else, perform ..etc statements in sap script?
ans:yes.
93. What type of variables normally used in sap script to output data?
94. How do you number pages in sapscript layout outputs?
95. What takes most time in SAP script programming?
ANS:LAYOUT DESIGN AND LOGO INSERTION.
96. How do you use tab sets in layout sets?
97. How do you backup sapscript layout sets? Can you download and upload?
How?
98. What are presentation and application servers in SAP?
ANS:The application layer of an R/3 System is made up of the application servers and the
message server. Application programs in an R/3 System are run on application servers.
The application servers communicate with the presentation components, the database,
and also with each other, using the message server.
99. In an ABAP/4 program how do you access data that exists on a presentation
server vs on an application server?
ans:i)using loop statements.
ii)flat
100. What are different data types in ABAP/4?
ans:Elementary predefined C,D,F,I,N,P,T,X.
userdefined TYPES.
ex: see in intel book page no 35/65
Structured predefined TABLES.
userdefined Field Strings and internal tables.
101. What is difference between session method and Call Transaction?
ans:102. Setting up a BDC program where you find information from?
ans:103. What has to be done to the packed fields before submitting to a BDC session.
ans:fields converted into character type.
2. SAP LIST VIEWER is ALV . its main advantage is by using ALV technique we can
find totals ,subtotals ,sort in any order etc there itself in the list output of course we need
to write all those functionalities while using ALV...also many functional modules are
defined under ALV concept...
3. GETCURSOR is used to trace the position of the cursor in the list ..
suppose we want to double click on any filled in the list and want to trace data using that
field we use getcursor .....
4.AT SELECTION-SCREEN is used where you have a seperate selection screen using
select-options or parameters where as AT USER-COMMAND is used where no selection
screen exists....at.user-command is mainly used while setting pf-status which means
creating our own menu with function codes etc...
Shiva
I had seen some of the standard abap that the table name had *, like *ekpo. What is
the meaning? What is the difference between with * and without * ?
It just lets you use the table a second time. For example:
select single * from ekpo where ebeln = '12345' and ebelp = '1'.
select single * from *ekpo where ebeln = '67890' and ebelp = '1'.
You now have two separate records, one in ekpo and one in *ekpo.
Another way to do this is to simply use the 'into' argument in the 'select' statement to read
the second ekpo record into some other field. The '*' format can be confusing, I think it
may be left over from earlier releases, like 2.2.
EKPO is database table and *EKPO is internal table.
Once you select into EKPO, you can use it the same way as *EKPO.
How do I use variables in the FORMAT command?
DATA COLORID TYPE I VALUE 4.
FORMAT INTENSIFIED ON COLOR = COLORID.
When using CALL 'SYSTEM' id 'COMMAND' field unix-command, how does one
capture the results of the command? For example, if the unix-command were the
date?
You capture the results in the table e.g TABL, like this
DATA: BEGIN OF TABL OCCURS 0,
LINE(560),
END OF TABL.
REFRESH TABL.
CALL 'SYSTEM' ID 'COMMAND' FIELD PARCOM_LOC
ID 'TAB' FIELD TABL-*SYS*.
I am working on a program that needs to show number of days between 2 dates.
When I scanned the function library, I only found a function to give you the number
of years between dates. I can probably code this in ABAP but does anyone know if a
function exists to do this.
I wrote this example for you. I think this is what you need.
DATA: DATE_1 LIKE SY-DATUM,
DATE_2 LIKE SY-DATUM.
DATA DAYS TYPE I.
DATE_1 = SY-DATUM.
DATE_2 = SY-DATUM + 65.
DAYS = DATE_2 - DATE_1.
WRITE:/ 'DATE_2=',DATE_2,'DATE_1=',DATE_1,'DAYS=',DAYS.
Run this code and then you will understand.
How do I concatenate two strings in Abap/4?
For all SAP Versions
STR_LENGTH = STRLEN( STRING1 ).
MOVE STRING1 TO STRING3.
WRITE STRING2 TO STRING3+STR_LENGTH.
For SAP Version 3.0 choose:
CONCATENATE STRING1 STRING2 INTO STRING3.
If you want a space between both fields:
CONCATENATE STRING1 STRING2 INTO STRING3 SEPARATED BY ' '.
For SAP Version 2.2 choose Functions:
*
* Different Selection Options separated by Tabstrips 1,2 and 3
*
* Written by : SAP Basis, ABAP Programming and Other IMG Stuff
*
http://www.sap-img.com
*
REPORT ZTABSTRIPS LINE-SIZE 120
NO STANDARD PAGE HEADING.
TABLES: ekko, ekpo, eket, marc, t134h.
*---------------------------------------------------------------------*
*
Tab Strips 1
*---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK vendor WITH FRAME TITLE text-t00.
SELECT-OPTIONS vendor FOR ekko-lifnr.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (10) text-m01.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
SELECT-OPTIONS vplant FOR ekko-reswk.
SELECTION-SCREEN END OF BLOCK vendor.
SELECTION-SCREEN END OF SCREEN 101.
*---------------------------------------------------------------------*
*
Tab Strips 2
*---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK data1 WITH FRAME TITLE text-t02.
SELECT-OPTIONS: busarea FOR t134h-gsber,
plant
FOR ekpo-werks,
puorg
FOR ekko-ekorg.
SELECTION-SCREEN END OF BLOCK data1.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK data2 WITH FRAME TITLE text-t03.
SELECT-OPTIONS sched
FOR ekko-ebeln.
SELECT-OPTIONS matl
FOR ekpo-matnr.
SELECTION-SCREEN END OF BLOCK data2.
SELECTION-SCREEN END OF SCREEN 102.
*---------------------------------------------------------------------*
*
Tab Strips 3
*---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF SCREEN 103 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK rype WITH FRAME TITLE text-t04.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS del RADIOBUTTON GROUP one.
SELECTION-SCREEN COMMENT 4(35) text-c05 FOR FIELD del.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS fix RADIOBUTTON GROUP one.
SELECTION-SCREEN COMMENT 4(35) text-c06 FOR FIELD fix.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK rype.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK interval WITH FRAME TITLE text-t05.
SELECTION-SCREEN BEGIN OF LINE.
*
* Subscreen selection 1 : User Name
*
2 : Last Login Date
*
3 : Class Belong To
*
* Written by : SAP Basis, ABAP Programming and Other IMG Stuff
*
http://www.sap-img.com
*
REPORT ZSUBSCREEN.
TABLES: USR02,
"Logon data
SSCRFIELDS. "FIELDS ON SELECTION SCREENS
*--------------------------------------------------------------* SUBSCREEN 1
*--------------------------------------------------------------SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-010.
SELECT-OPTIONS: USERNAME FOR USR02-BNAME.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN END OF SCREEN 100.
*--------------------------------------------------------------* SUBSCREEN 2
*--------------------------------------------------------------SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-020.
SELECT-OPTIONS: LASTLOGI FOR USR02-TRDAT.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN END OF SCREEN 200.
*--------------------------------------------------------------* SUBSCREEN 3
*--------------------------------------------------------------SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-030.
SELECT-OPTIONS: CLASSTYP FOR USR02-CLASS.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN END OF SCREEN 300.
* STANDARD SELECTION SCREEN FOR SCROLLING LEFT AND RIGHT
SELECTION-SCREEN: FUNCTION KEY 1,
FUNCTION KEY 2.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK SUB FOR 15 LINES,
END OF BLOCK SUB.
START-OF-SELECTION.
SELECT * FROM USR02 WHERE BNAME IN USERNAME
AND ERDAT IN LASTLOGI
AND CLASS IN CLASSTYP.
WRITE: / 'User ', USR02-BNAME,
'Last Login Date ', USR02-TRDAT,
'Last Login Time ', USR02-LTIME,
'CLASS ', USR02-CLASS.
ENDSELECT.
END-OF-SELECTION.
INITIALIZATION.
* SCREEN ICON LEFT AND RIGHT
SSCRFIELDS-FUNCTXT_01 = '@0D@'.
SSCRFIELDS-FUNCTXT_02 = '@0E@'.
SUB-PROG = SY-REPID.
SUB-DYNNR = 100.
AT SELECTION-SCREEN.
CASE SY-DYNNR.
WHEN 100.
IF SSCRFIELDS-UCOMM = 'FC01'.
SUB-DYNNR = 300.
ELSEIF SSCRFIELDS-UCOMM = 'FC02'.
SUB-DYNNR = 200.
ENDIF.
WHEN 200.
IF SSCRFIELDS-UCOMM = 'FC01'.
SUB-DYNNR = 100.
ELSEIF SSCRFIELDS-UCOMM = 'FC02'.
SUB-DYNNR = 300.
ENDIF.
WHEN 300.
IF SSCRFIELDS-UCOMM = 'FC01'.
SUB-DYNNR = 200.
ELSEIF SSCRFIELDS-UCOMM = 'FC02'.
SUB-DYNNR = 100.
ENDIF.
ENDCASE.
***********************************************************************
* AUTO DISALLOWED BACK POSTING TO PREVIOUS PERIOD
***********************************************************************
REPORT ZBDCMMRV.
TABLES: MARV.
* Batch Input Name
PARAMETERS P-BTCHSN(12)
DEFAULT 'MMRVCHANGE'.
* Company Code
PARAMETERS P-BUKRS LIKE MARV-BUKRS.
* Auto / Manual run the Batch Input Program
PARAMETERS P-RUN
AS CHECKBOX
DEFAULT 'X'.
* INTERNAL TABLE FOR DATA
DATA: BEGIN OF ULTAB OCCURS 50,
BUKRS LIKE MARV-BUKRS,
END OF ULTAB.
"Company Code
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'BDC_OKCODE'.
IPUTTAB-FVAL = '/11'.
APPEND IPUTTAB.
ENDFORM.
***********************************************************************
* FORM
: CLOSE-SESS
*
* DESCRIPTION : CLOSE THE SESSION
*
***********************************************************************
FORM CLOSE-SESS.
* closing the session.
IF P-RUN = 'X'.
* Auto run the Batch Input Program
CALL TRANSACTION 'MMRV'
USING IPUTTAB
MODE
'E'
UPDATE 'S'
MESSAGES INTO MESSTAB.
ELSE.
* Maual run the Batch Input Program
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE
= 'MMRV'
TABLES
DYNPROTAB = IPUTTAB.
ENDIF.
ENDFORM.
***********************************************************************
* FORM
: PRN-ULTAB
*
* DESCRIPTION : PRINT OK TABLE
*
***********************************************************************
FORM PRN_ULTAB.
WRITE: / ULTAB-BUKRS.
W-LINE-NO = W-LINE-NO + 1.
WRITE: '
RECORD# ', W-LINE-NO.
ENDFORM.
***********************************************************************
* FORM
: CRE-BATCH-SESS
*
* DESCRIPTION : CREATE BATCH SESSION
*
***********************************************************************
FORM CRE-BATCH-SESS.
** Create BTCI session **
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = P-BTCHSN
USER
= SY-UNAME
KEEP
= 'X'.
ENDFORM.
I use (tab and ,) delimeter for bdc but I could not upload data from note pad to sap.
As you mentioned that you have used ( tab & , ) this is wrong you have to use TAB OR ,
(comma) .
Use , (comma). While executing bdc you have to mention delimiter factor at bdc screen.
Nitin
Can anybody tell me, if we are using excel sheet as a data provider for BDC
Program, then how to define a delimiter so that my BDC programe should
automatically split the field.
You either save the excel sheet as Tab delimited file or .csv file. and declare your internal
table to get the corresponding the contents from the file. Then when its tab delimited or
.csv, SPLIT the contents into respective fields.
Here is a sample for CSV file :
*declaration of internal tables.
DATA : BEGIN OF IT_DUMMY OCCURS 0,
TEXT(500),
END OF IT_DUMMY.
DATA : BEGIN OF IT_MAIN OCCURS 0,
MATNR LIKE RMMG1-MATNR,
"material selection to change
DISLS LIKE MARC-DISLS,
"lot size key
END OF IT_MAIN.
*uploading the input file***********************************************
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME
= INPUT
TABLES
DATA_TAB
= IT_DUMMY
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE
=3
NO_BATCH
=4
UNKNOWN_ERROR
=5
OTHERS
= 6.
*appending it_main by splitting the uploaded file
LOOP AT IT_DUMMY.
SPLIT IT_DUMMY AT ',' INTO IT_MAIN-MATNR IT_MAIN-DISLS.
APPEND IT_MAIN.
ENDLOOP.
Initial data
matnr like mara-matnr,
mbrsh like mara-mbrsh,
mtart like mara-mtart,
"Material Code
"Industry Data
"Material Type
Org Data
Werks
lgort
vkorg
vtweg
"Plant
"Storage Location
"Sales Orgnization
"Distribution Chanel
Basic 1
Maktx Like makt-maktx, "Description
meins like mara-meins, "Uom
matkl like mara-matkl, "Material Group
BISMT LIKE MARA-BISMT, " Old Material Number
spart like mara-spart, "Division
brgew(7),"like mara-brgew, "Gross Weight
gewei like MARA-GEWEI, "Weight Unit
ntgew(7)," like mara-ntgew, "Net Weight
like
like
like
like
marc-werks,
mard-lgort,
mvke-vkorg,
mvke-vtweg,
* Purchasing
MAKTL LIKE MARA-MATKL, "Material Group
ekwsl like MARA-EKWSL, " Purchasing Value Key
ekgrp like MARC-EKGRP, " Purchasing Group
*
*
Mrp 1
disgr
ekgrp
dismm
dispo
disls
BSTMI
BSTMA
BSTRF
BSTFE
like
like
like
like
like
like
like
like
like
MARC-DISGR,
MARC-EKGRP,
MARC-DISMM,
MARC-DISPO,
MARC-DISLS,
MARC-BSTMI,
MARC-BSTMA,
MARC-BSTRF,
MARC-BSTFE,
"Mrp Group
"Purchasing group
"Mrp Type
"Mrp Controller
"Lot Size
Mrp 2
beskz like MARC-BESKZ, "Procurement type
lgpro like MARC-LGPRO, "Production Storage Location
dzeit(3),"like MARC-DZEIT, "In house Production time
plifz(3),"like MARC-PLIFZ, "Planned delivery time
fhori(3),"like MARC-FHORI, "Sched margin key
eisbe like MARC-EISBE, "Safety stock
Mrp 3
PERKZ LIKE MARC-PERKZ,
vrmod like MARC-VRMOD, "Consumption mode
vint1(3)," like MARC-VINT1, "Backward Consumption period
vint2(3),"like MARC-VINT2, "Forward Consumption period
mtvfp like MARC-MTVFP, "Availability Check
Mrp 4
sbdkz like MARC-SBDKZ,
SAUFT like MARC-SAUFT,
SFEPR like MARC-SFEPR,
* Accounting 1
bklas like
vprsv like
verpr(7),"
STPRS like
"Individual/ Collective
"Repetitive Manufacturing
"REM Profile
*COSTING
EKALR LIKE MBEW-EKALR," With qty str
LOSGR like MARC-LOSGR, " Costing Lot size
end of ITAB.
**********************************************************
Data: W_record type I, "Record Allready exists.
w_trecord type I. "Total record processed
start-of-selection.
perform upload.
Perform Open_group.
"Create a session
clear : w_record,w_trecord.
perform semi. "Create Semi Finish Materials
if w_trecord gt 0 or w_record gt 0.
perform batch_job.
endif.
perform close_group.
"Close session
FORM SEMI.
loop at ITAB.
*
Check for material in master *************************
select single * from mara where matnr eq ITAB-matnr.
if sy-subrc ne 0.
w_trecord = w_trecord + 1.
*Initial Screen
perform bdc_dynpro
perform bdc_field
*
*perform
*
*perform
*perform
*
*perform
*
*perform
*
*perform
*perform
*
*perform
*
*perform
*perform
*
*perform
*
*perform
*
bdc_field
bdc_dynpro
bdc_field
bdc_field
bdc_field
bdc_dynpro
bdc_field
bdc_field
bdc_dynpro
bdc_field
bdc_field
bdc_field
*Org Data
perform bdc_dynpro
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
*Basic 1
perform bdc_dynpro
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
'MSICHTAUSW-DYTXT(01)'.
using 'BDC_OKCODE'
'/00'.
using 'SAPLMGMM' '0070'.
using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(17)'.
using 'BDC_OKCODE'
'/00'.
using 'MSICHTAUSW-KZSEL(17)'
ITAB-KZSEL_17_011.
using 'SAPLMGMM' '0070'.
using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
using 'BDC_OKCODE'
'/00'.
using 'SAPLMGMM' '0070'.
using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(13)'.
using 'BDC_OKCODE'
'=ENTR'.
using 'MSICHTAUSW-KZSEL(13)'
ITAB-KZSEL_13_012.
using 'SAPLMGMM' '0080'.
using 'BDC_CURSOR'
'RMMG1-LGORT'.
using 'BDC_OKCODE'
'=ENTR'.
using 'RMMG1-WERKS'
ITAB-WERKS.
using 'RMMG1-LGORT'
ITAB-LGORT.
using 'SAPLMGMM' '4004'.
using 'BDC_OKCODE'
'=SP09'.
using 'MAKT-MAKTX'
ITAB-MAKTX.
using 'MARA-MEINS'
ITAB-MEINS.
using 'MARA-MATKL'
ITAB-MATKL.
using 'MARA-BISMT'
ITAB-BISMT.
using 'MARA-SPART'
ITAB-SPART.
using 'MARA-MTPOS_MARA'
'NORM'.
using 'BDC_CURSOR'
'MARA-NTGEW'.
using 'MARA-BRGEW'
ITAB-BRGEW.
using 'MARA-GEWEI'
ITAB-GEWEI.
using 'MARA-NTGEW'
ITAB-NTGEW.
*Purchasing
perform bdc_dynpro
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
*MRP 1
perform bdc_dynpro
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
*MRP 3
perform bdc_dynpro
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
*MRP 4
perform bdc_dynpro
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
*Work Scheduling
perform bdc_dynpro
perform bdc_field
perform bdc_field
perform bdc_field
ITAB-BESKZ.
using 'MARC-LGPRO'
ITAB-LGPRO.
using 'MARC-DZEIT'
ITAB-DZEIT.
using 'MARC-PLIFZ'
ITAB-PLIFZ.
using 'MARC-FHORI'
ITAB-FHORI.
using 'BDC_CURSOR'
'MARC-EISBE'.
using 'MARC-EISBE'
ITAB-EISBE.
using 'SAPLMGMM' '4000'.
using 'BDC_OKCODE'
'=SP15'.
using 'MAKT-MAKTX'
ITAB-MAKTX.
using 'MARC-PERKZ'
ITAB-PERKZ.
using 'MARC-VRMOD'
ITAB-VRMOD.
using 'MARC-VINT1'
ITAB-VINT1.
using 'MARC-VINT2'
ITAB-VINT2.
using 'BDC_CURSOR'
'MARC-MTVFP'.
using 'MARC-MTVFP'
ITAB-MTVFP.
using 'SAPLMGMM' '4000'.
using 'BDC_OKCODE'
'=SP17'.
using 'MAKT-MAKTX'
ITAB-MAKTX.
using 'MARC-SBDKZ'
ITAB-SBDKZ.
using 'BDC_CURSOR'
'MARC-SFEPR'.
using 'MARC-SAUFT'
ITAB-SAUFT.
using 'MARC-SFEPR'
ITAB-SFEPR.
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
using 'MARA-MEINS'
ITAB-MEINS.
using 'MARC-FEVOR'
ITAB-FEVOR.
using 'MARC-LGPRO'
ITAB-LGPRO.
using 'MARC-SFCPF'
ITAB-SFCPF.
using 'MARC-DZEIT'
ITAB-DZEIT.
endif.
perform bdc_field
perform bdc_field
*Accounting
perform bdc_dynpro
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
perform bdc_field
IF ITAB-VPRSV = 'S'.
perform bdc_field
using 'MARC-LGPRO'
itab-LGPRO.
using 'MARC-DZEIT'
itab-DZEIT.
using 'SAPLMGMM' '4000'.
using 'BDC_OKCODE'
'=SP26'.
using 'MAKT-MAKTX'
ITAB-MAKTX.
using 'MARA-MEINS'
ITAB-MEINS.
using 'MARA-SPART'
ITAB-SPART.
using 'BDC_CURSOR'
'MBEW-STPRS'.
using 'MBEW-BKLAS'
ITAB-BKLAS.
using 'MBEW-VPRSV'
ITAB-VPRSV.
using 'MBEW-STPRS'
ITAB-STPRS.
using 'MBEW-STPRS' "FILLS STD PRICE
ITAB-VERPR.
0
0.
perform bdc_field
perform
using 'MAKT-MAKTX'
ITAB-MAKTX.
bdc_field
using 'BDC_CURSOR'
'MARC-PRCTR'.
bdc_field
using 'MARA-MEINS'
ITAB-MEINS.
bdc_field
using 'MBEW-EKALR'
ITAB-EKALR.
bdc_field
using 'MARC-LOSGR'
ITAB-LOSGR.
bdc_transaction using 'MM01'.
perform
perform
perform
perform
REFRESH BDCDATA.
*
*************************************************************
else.
w_record = w_record + 1.
endif.
ENDLOOP.
ENDFORM.
form Upload.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE
FILENAME
FILETYPE
TABLES
DATA_TAB
EXCEPTIONS
CONVERSION_ERROR
INVALID_TABLE_WIDTH
INVALID_TYPE
NO_BATCH
UNKNOWN_ERROR
GUI_REFUSE_FILETRANSFER
OTHERS
ENDFORM.
= ' '
= ' '
= ' '
= ITAB
=
=
=
=
=
=
=
1
2
3
4
5
6
7.
form batch_job.
uline.
format color col_heading.
if w_trecord gt 0.
Write:/ 'Background Job has been Created for ',
w_trecord right-justified, 'Semi-Fin', 80 ''.
write:/ 'Please follow the following steps to run this job',
80 ''.
write:/ 'as listed below.', 80 ''.
format color col_normal.
skip.
write:/05 '1.Goto Transaction SM35', 80 ''.
write:/05 '2.Select your Session Name', 80 ''.
write:/05 '3.Click On Execute Button', 80 ''.
endif.
if w_record gt 0.
format color col_negative.
write:/ w_record ,'records already existed', 80 ''.
format color off.
endif.
uline.
endform.
FORM GET_MAX_LINES.
* set w_maxlines to the number of var-loop occurrences on the screen so
* that we know when to page forward on screen 0102
* also initialise w_next_line to zero for GET_NEXT_LINE
* this subroutine caters for all cases - including screens without loops
CLEAR: W_MAXLINES,
W_NEXT_LINE.
IMPORT DYNPRO W_HDR
W_FLD
W_LOG
W_MC
ID W_DYNPRONAME.
LOOP AT W_FLD WHERE LTYP EQ 'L'.
MOVE W_FLD-LINE TO W_SCRLINE. "first var-loop line
MOVE W_FLD-LBLK TO W_SCRLEN. "depth of loop block
EXIT.
ENDLOOP.
IF SY-SUBRC EQ 0
AND W_SCRLEN NE 0.
* sy-srows = total no of lines on screen
* w_scrline = actual first line of loop so that
* w_scrline - 1 = number of heading lines (before loop)
* 4 = no of lines at top of screen - command line, pushbuttons, 2 ulines
* 3 = no of lines after loop - uline & Page count
* w_scrlen = no of lines in loop block
* w_maxlines = sy-srows - ( wscrline - 1 ) - 4 - 3
* and then 1 less but not sure why!
W_MAXLINES = SY-SROWS - W_SCRLINE - 1 - 4 - 3.
W_MAXLINES = W_MAXLINES - 1.
W_MAXLINES = W_MAXLINES DIV W_SCRLEN.
ELSE.
MOVE 99 TO W_MAXLINES. "this required if no screen loop
ENDIF.
ENDFORM.
***********************************************************************
*
FORM GET_NEXT_LINE.
* set w_page if page forward is required
W_NEXT_LINE = W_NEXT_LINE + 1.
IF W_NEXT_LINE GT W_MAXLINES.
W_NEXT_LINE = 1.
W_PAGE = 'Y'.
ELSE.
W_PAGE = 'N'.
ENDIF.
ENDFORM.
***********************************************************************
*
or
Here, this one also works fine :
select zfpcd~cadivi zfpcd~proforma zfpcd~factura zfpcd~aniofactura
zfpcd~montousd zfpcd~montoap zfpcd~ebeln zfpcd~inco1
zfpcd~lifnr lfa1~name1 zcdvs~status zfpcd~conint
into it_lista
from zfpcd inner join zcdvs
on zfpcd~ebeln = zcdvs~ebeln
and zfpcd~proforma = zcdvs~proforma
and zfpcd~lifnr = zcdvs~lifnr
inner join lfa1
on zfpcd~lifnr = lfa1~lifnr
where zcdvs~status = '04'.
= '101'
cputm
werks
= ht_mkpfmseg-matnr
= ht_mkpfmseg-
ebeln = ht_mkpfmseg-ebeln
ebelp = ht_mkpfmseg-ebelp
transporting erfmg.
if sy-subrc <> 0.
move-corresponding ht_mkpfmseg to ht_mkpfmsegsel.
insert table ht_mkpfmsegsel.
else.
ht_mkpfmsegSel-budat = ht_mkpfmseg-budat.
ht_mkpfmsegSel-cputm = ht_mkpfmseg-cputm.
ht_mkpfmsegSel-matnr = ht_mkpfmseg-matnr,
ht_mkpfmsegSel-werks = ht_mkpfmseg-werks.
ht_mkpfmsegSel-ebeln = ht_mkpfmseg-ebeln.
ht_mkpfmsegSel-ebelp = ht_mkpfmseg-ebelp.
add ht_mkpfmseg-erfmg to ht_mkpfmsegSel-erfmg.
modify table ht_mkpfmsegSel transporting erfmg.
endif.
endloop.
" at this point ht_mkpfmsegSel has the data collected that you want.
loop at ht_mkpfmsegSel.
.... Here put the code between your select ... endselect.
endloop.