| CARVIEW |
SAP Upgrade from 4.6C to ECC6.0
Posted by: amitkhari on: February 14, 2009
Site Name has changed to abapcode.info
Posted by: amitkhari on: February 14, 2009
Now You can read Complete Site on https://abapcode.info.
This Site Contains whole sap document about SAP ABAP Online Magazine
ABAP,ABAP report,Interactive Report,ALV grid,ALV list,IDOC,User Exit,RFC,Smartform,sapscript,ABAP Performance,Remote Function Module( RFC ),Function Module,Modularization techniques,ABAP tools,ALV report Generator,ABAP Interview Questions,BDC,BAPI,ALE,BADI, EDI,InternalTable,DataStructure,LSMW,Domain,DataElement,Basis and Administration ,ABAP HR development,ABAP Debugger,BW,ExceptionHandling,Download FI, CO, MM, PP, SD, PM, PS, QM, SM, HR, BW, APO,ABAP Tutorial
Read Complete Posting on https://abapcode.info
Learn Object Oriented Pogramming ( OOPS )
Posted by: amitkhari on: March 9, 2008
Definitions
Public attributes
Private attributes
Instance attributes
Static attributes
Public methods
Private methods
Constructor method
Static constructor
Protected components
Polymorphism
Public attributes
Public attributes are defined in the PUBLIC section and can be viewed and changed from outside the class. There is direct access to public attributes. As a general rule, as few public attributes should be defined as possible.
PUBLIC SECTION.
DATA: Counter type i.
Private attributes
Private attributes are defined in the PRIVATE section. The can only be viewes and changed from within the class. There is no direct access from outside the class.
PRIVATE SECTION.
DATA: name(25) TYPE c,
planetype LIKE saplane-planetyp,
Instance attributes
There exist one instance attribute for each instance of the class, thus they exist seperately for each object. Instance attributes are declared with the DATA keyword.
Static attributes
Static attributes exist only once for each class. The data are the same for all instances of the class, and can be used e.g. for instance counters. Static attributes are defined with the keyword CLASS-DATA.
PRIVATE SECTION.
CLASS-DATA: counter type i,
Public methods
Can called from outside the class
PUBLIC SECTION.
METHODS: set_attributes IMPORTING p_name(25) TYPE c,
p_planetype LIKE saplane-planetyp,
Private methods
Can only be called from inside the class. They are placed in the PRIVATE section of the class.
Constructor method
Implicitly, each class has an instance constructor method with the reserved name constructor and a static constructor method with the reserved name class_constructor.
The instance constructor is executed each time you create an object (instance) with the CREATE OBJECT statement, while the class constructor is executed exactly once before you first access a class.
The constructors are always present. However, to implement a constructor you must declare it explicitly with the METHODS or CLASS-METHODS statements. An instance constructor can have IMPORTING parameters and exceptions. You must pass all non-optional parameters when creating an object. Static constructors have no parameters.
Static constructor
The static constructor is always called CLASS_CONSTRUCTER, and is called autmatically before the clas is first accessed, that is before any of the following actions are executed:
Creating an instance using CREATE_OBJECT
Adressing a static attribute using ->
Calling a ststic attribute using CALL METHOD
Registering a static event handler
Registering an evetm handler method for a static event
The static constructor cannot be called explicitly.
Protected components
When we are talking subclassing and enheritance there is one more component than Public and Private, the Protected component. Protected components can be used by the superclass and all of the subclasses. Note that Subclasses cannot access Private components.
Polymorphism
Polymorphism: When the same method is implemented differently in different classes. This can be done using enheritance, by redefining a method from the superclass in subclasses and implement it differently.
Other Related Topics :
Object Oriented ABAP-Local and Global Classes
A easy Reference for ALV grid Control
Object Oriented ALV-Using two Containers we can display data
Object Oriented ALV-Sample program to insert Logo in ALV
Learn Object Oriented ABAP online and Download Tutorial
Read Complete Posting on https://abapcode.info
How to assign Variable type at run time?
Posted by: amitkhari on: March 9, 2008
Dynamic programing can save a lot of ‘superfluous’ coding.
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: .
D_FIELD = ‘D_TEST’.
D_TYPE = ‘P’.
ASSIGN (D_FIELD) TO 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
ASSIGN TO TYPE ‘C’.
One more thing for dynamic programing. With the following coding you can access every DDIC table with the key you want:
SELECT SINGLE * FROM (DF_TNAME) INTO S_TMP WHERE (IF_KEY).
It is very powerful, isn’t it !!!
[ Ingo-Willy Raddatz, posted to SAP listserver]
Example 1: Print page “n of x pages” on reports
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.
WRITE SY-PAGNO TO NUM_PAGES_C LEFT-JUSTIFIED.
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.
ENDFORM. ” GET_TOTAL_PAGENO
Read Complete Posting on https://abapcode.info
* raise
* message … raising
Using the raise Statement
Use the raise statement to exit the function module and set the value of sy-subrc on return.
Syntax for the raise Statement
The following is the syntax for the raise statement.
raise xname.
where:
* xname is the name of the exception to be raised.
The following points apply:
* xname can be any name that you make up. It does not have to be previously defined anywhere. It can be up to 30 characters in length. All characters are allowed except ” ‘ . , and :.
* Do not enclose xname within quotes.
* xname cannot be a variable.
When the raise statement is executed, control returns immediately to the call function statement and a value is assigned to sy-subrc based on the exceptions you have listed there. Values assigned to export parameters are not copied back to the calling program. Listings 1.7 and 1.8 and Figure 1.9 illustrate how this happens.
Listing 1.7 How to Set the Value of SY-SUBRC from Within a Function Module
1 report ztx2007.
2 parameters parm_in default ‘A’.
3 data vout(4) value ‘INIT’.
4 call function ‘Z_TX_2008’
5 exporting
6 exname = parm_in
7 importing
8 pout = vout
9 exceptions
10 error_a = 1
11 error_b = 4
12 error_c = 4
13 others = 99.
14 write: / ‘sy-subrc =’, sy-subrc,
15 / ‘vout =’, vout.
Listing 1.8 This Is the Function Module Called from Listing 1.7
1 function z_tx_2008.
2 *”————————————————————
3 *”*”Local interface:
4 *” IMPORTING
5 *” VALUE(EXNAME)
6 *” EXPORTING
7 *” VALUE(POUT)
8 *” EXCEPTIONS
9 *” ERROR_A
10 *” ERROR_B
11 *” ERROR_C
12 *” ERROR_X
13 *”————————————————————
14 pout = ‘XXX’.
15 case exname.
16 when ‘A’. raise error_a.
17 when ‘B’. raise error_b.
18 when ‘C’. raise error_c.
19 when ‘X’. raise error_x.
20 endcase.
21 endfunction.
The code in Listings 1.7 and 1.8 produce this output, if you specify a value of A for parm_in:
sy-subrc = 1
vout = INIT
* In Listing 1.7, line 4 takes the value from parm_in and passes it to the function module z_tx_2007. Control transfers to line 1 of Listing 1.8.
* In Listing 1.8, line 14 assigns a value to the pout parameter. This parameter is passed by value, so the change is only to the local definition of pout. The original has not yet been modified.
* In Listing 1.8, line 15 examines the value passed via parameter exname. The value is B, so line 17-raise error_b-is executed. Control transfers to line 9 of Listing 1.7. Because the raise statement has been executed, the value of pout is not copied back to the calling program, thus the value of vout will be unchanged.
* In Listing 1.7, the system scans lines 10 through 13 until it finds a match for the exception named by the just-executed raise statement. In this case, it’s looking for error_b. Line 11 matches.
* On line 11, the value on the right-hand side of the equals operator is assigned to sy-subrc. Control then transfers to line 20.
The special name others on line 13 of Listing 1.7 will match all exceptions not explicitly named on the exceptions addition. For example, if line 7 of Listing 20.8 were executed, exception error_x would be raised. This exception is not named in Listing 1.7, so others will match and the value of sy-subrc will be set to 99. You can code any numbers you want for exception return codes.
If an export parameter is passed by value, after a raise its value remains unchanged in the calling program even if a value was assigned within the function module before the raise statement was executed. If the parameter was passed by reference, it will be changed in the caller (it has the Reference flag turned on in the Export/Import Parameters screen). This effect is shown in Listing 20.7. The value of pout is changed in the function module and, if a raise statement is executed, the changed value is not copied back into the calling program.
Read Complete Posting on https://abapcode.info
- In: SAP Upgrade
- 1 Comment
Read_text Function Module has been Modified in new Version.Please Comment INLINE table in ECC6.0.It is no more use in it.
Older Version ( 4.6c)
CALL FUNCTION ‘READ_TEXT’
EXPORTING
client = sy-mandt
id = thead-tdid
language = thead-tdspras
name = thead-tdname
object = thead-tdobject
TABLES
lines = inline
inline = XXXX “comment this one in new version , it is no more have any use
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
SAP Function modules Related to Files
Posted by: amitkhari on: January 6, 2008
WS_UPLOAD – File transfer from presentation server file to internal table
WS_DOWNLOAD – File Transfer From Internal Table to Presentation Server File
WS_DOWNLOAD – Save Internal Table as File on the Presentation Server
WS_FILE_DELETE – Delete File at the Frontend
WS_FILENAME_GET – Call File Selector
FILENAME_GET – popup to get a filename from a user, returns blank filename if user selects cancel
LIST_DOWNLOAD – Download of ABAP list (Report) to local file
LIST_TO_ASCI – Converts the specified list (LIST_INDEX) or the provided list (LISTOBJECT) to ASCII.
RZL_READ_FILE – Read a file from the presentation server if no server name is given, or read file from remote server. Very useful to avoid authority checks that occur doing an OPEN DATASET. This function using a SAP C program to read the data.
RZL_WRITE_FILE_LOCAL – Saves table to the presentation server (not PC). Does not use OPEN DATASET, so it does not suffer from authority checks!
SAP Function Module for Date and Time
Posted by: amitkhari on: January 3, 2008
Get a date
DATE_GET_WEEK Returns week for a date
WEEK_GET_FIRST_DAY Returns first day for a week
RP_LAST_DAY_OF_MONTHS Returns last day of month
FIRST_DAY_IN_PERIOD_GET Get first day of a period
LAST_DAY_IN_PERIOD_GET Get last day of a period
RP_LAST_DAY_OF_MONTHS Determine last day of month
Date calculations
DATE_COMPUTE_DAY Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.
DATE_IN_FUTURE Calculate a date N days in the future.
RP_CALC_DATE_IN_INTERVAL Add days/months to a date
RP_CALC_DATE_IN_INTERVAL Add/subtract years/months/days from a date
SD_DATETIME_DIFFERENCE Give the difference in Days and Time for 2 dates
MONTH_PLUS_DETERMINE Add or subtract months from a date. To subtract a month, enter a negative value for the ‘months’ parameter.
DATE_CREATE Calculates a date from the input parameters:
Example: DATE_CREATE
CALL FUNCTION ‘DATE_CREATE’
EXPORTING
anzahl_jahre = 1
anzahl_monate = 2
anzahl_tage = 3
datum_ein = ‘20010101’
IMPORTING
datum_aus = l_new_date.
Result:
l_new_date = 20020304
Example: MONTH_PLUS_DETERMINE
data: new_date type d.
CALL FUNCTION ‘MONTH_PLUS_DETERMINE’
EXPORTING
months = -5 ” Negative to subtract from old date, positive to add
olddate = sy-datum
IMPORTING
NEWDATE = new_date.
write: / new_date.
Holidays
HOLIDAY_GET Provides a table of all the holidays based upon a Factory Calendar &/ Holiday Calendar.
HOLIDAY_CHECK_AND_GET_INFO Useful for determining whether or not a date is a holiday. Give the function a date, and a holiday calendar, and you can determine if the
date is a holiday by checking the parameter HOLIDAY_FOUND.
Example: HOLIDAY_CHECK_AND_GET_INFO
data: ld_date like scal-datum default sy-datum,
lc_holiday_cal_id like scal-hcalid default ‘CA’,
ltab_holiday_attributes like thol occurs 0 with header line,
lc_holiday_found like scal-indicator.
CALL FUNCTION ‘HOLIDAY_CHECK_AND_GET_INFO’
EXPORTING
date = ld_date
holiday_calendar_id = lc_holiday_cal_id
WITH_HOLIDAY_ATTRIBUTES = ‘X’
IMPORTING
HOLIDAY_FOUND = lc_holiday_found
tables
holiday_attributes = ltab_holiday_attributes
EXCEPTIONS
CALENDAR_BUFFER_NOT_LOADABLE = 1
DATE_AFTER_RANGE = 2
DATE_BEFORE_RANGE = 3
DATE_INVALID = 4
HOLIDAY_CALENDAR_ID_MISSING = 5
HOLIDAY_CALENDAR_NOT_FOUND = 6
OTHERS = 7.
if sy-subrc = 0 and
lc_holiday_found = ‘X’.
write: / ld_date, ‘is a holiday’.
else.
write: / ld_date, ‘is not a holiday, or there was an error calling the function’.
endif.
Checking dates
DATE_CHECK_PLAUSIBILITY Check to see if a date is in a valid format for SAP. Works well when validating dates being passed in from other systems.
Converting dates
DATE_CONV_EXT_TO_INT Conversion of dates to SAP internal format e.g. ‘28.03.2000’ -> 20000328 Can also be used to check if a date is valid ( sy-subrc 0 )
Function to return literal for month
he table you want to use is T247. You can also use the function MONTH_NAMES_GET. [ Monique Goodrich ,posted to SAP listserver]
You can also try table T015M. It has the month number in it’s key.
[Walter Barr , posted to SAP listserver]
Formatting
DATUMSAUFBEREITUNG Format date as the user settings
Other
MONTH_NAMES_GET It returns all the month and names in repective language.
CURRENCY_AMOUNT_SAP_TO_IDOC – Convert currency to IDOC format
CONVERT_TO_LOCAL_CURRENCY – Conversion of currency
CLOI_PUT_SIGN_IN_FRONT Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all
character fields), not right justifed as numbers normally are.
CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.
CONVERT_TO_LOCAL_CURRENCY Convert from foreign currency to local currency
Example 1: Convert amount to/from string
Amount to string:
CALL FUNCTION ‘HRCM_AMOUNT_TO_STRING_CONVERT’
EXPORTING
betrg = 3000
WAERS = ‘DKK’
* NEW_DECIMAL_SEPARATOR =
* NEW_THOUSANDS_SEPARATOR =
IMPORTING
STRING = slam
.
String to amount:
CALL FUNCTION ‘HRCM_STRING_TO_AMOUNT_CONVERT’
EXPORTING
string = slam2
DECIMAL_SEPARATOR = ‘.’
* THOUSANDS_SEPARATOR =
WAERS = ‘HUF’
IMPORTING
BETRG = b2
* EXCEPTIONS
* CONVERT_ERROR = 1
* OTHERS = 2
Basic Question :
(1)Choose the menu path Tools->Administration, Monitoring->System monitoring->User overview. What is the transaction code for this transaction?
(2) What is the transaction code for the R/3 main menu? (The main menu is the first menu displayed after logon.)
(3)What is the transaction code for the menu path Tools->Development Workbench?
(4)If there are three R/3 systems in your current system landscape, how many databases are there?
(5)If an R/3 system has two application servers, how many instances does it have?
(6)What is Open SQL?
(7)What advantages does Open SQL offer over native SQL?
(8)Which part of the work process is used to implement Open SQL?
(9)When is a roll area allocated, when is it de-allocated, and what does it contain?
(10)When is a user context allocated, when is it de-allocated, and what does it contain?
(11)When does the roll-out occur, and why does it occur?
(12)What two things does the tables statement do?
(13)To what does the term default table work area refer?
(14)If the select statement is missing an into clause, where do the rows go?
(15)If a write statement does not contain a slash, is the output written to the same line as the output for the previous write statement or is it written to a new line?
(16)What is the name of the system variable that indicates whether any rows were found by the select statement?
(17)What is the name of the system variable that indicates how many rows were found by the select statement?
(18)What is the purpose of the domain?
(19)What does the data element contain?
(20)To what does the term application data refer?
(21)For fields of type DEC, is the decimal point stored with the value of the field?
(22)What are the transaction codes of the four data browsers. Which one is most commonly used, and which one cannot be used to update data?
(23)What is the difference between a transparent table and a pooled or cluster table?
To Get ABAP Interview Question Pls Click here
Read Whole Site there
Topic Wise Content
blog content
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | |
Blog Stats
- 561,138 hits
-
Subscribe
Subscribed
Already have a WordPress.com account? Log in now.

Recent Comments