package.json in Nodejs

Posted: March 30, 2014 in Magento
Tags:

From Nodejs Doc:

The most important things in your package.json are the name and version fields. Those are actually required, and your package won’t install without them. The name and version together form an identifier that is assumed to be completely unique.

 

In project root folder package.json describes your application properties such as

  • name
  • dependencies
  • scripts
  • dependencies

An example of package.json

{
     “name”: “application-name”, //Your application/package name
     “version”: “0.0.1”, //application/package version
     “private”: true,
     “scripts”: {
     “start”: “node app.js”
},
    “dependencies”: {
           “express”: “3.2.4”,
           “jade”: “*”
    }
}

When you run the command from the root folder

npm install

it will create a node_modules folder and the declared dependencies are installed in this folder.
To run a script file using package.json, first include the script(scriptfilename.js) in package.json and the command

npm scriptfilename

will run that script.

If you have a npm account and you want to publish your package in npm, the version field is used to track the version of your package. To publish the package use the command

npm publish

To start a project, create a folder, and run “npm init” in that folder.Then when installing npm modules use: 

npm install <name> –save

This adds them as dependencies to your package.json.

Version:

Version must be parseable by node-semver.

Check node-semver at https://github.com/isaacs/node-semver. To install node-semver use the command

npm install semver

Description :

This helps people discover your package, as it’s listed in npm search.

Keywords :

It’s an array of strings. This helps people discover your package as it’s listed in npm search.

homepage

The url to the project homepage.

License :

Specify a license for your package so that people know how they are permitted to use it, and any restrictions you’re placing on it.
example

{ “license” : “BSD-3-Clause” }

Reference:
package.json – https://www.npmjs.org/doc/json.html
npm-scripts – https://www.npmjs.org/doc/misc/npm-scripts.html
Running Scripts with npm – http://anders.janmyr.com/2014/03/running-scripts-with-npm.html

Data Element Vs Domain

Posted: February 6, 2014 in Magento

dataelement  tells semantic attributes of a field

 

domain tells technical attributes of a field

 

domain

 

A table is composed of fields. To create a field you need a data element.A data element’s definition requires a domain.

 

The domain contains the technical characteristics of a field, such as the field length and data type.

 

When you create a new field, you must decide whether to create a new domain or reuse an existing one. To make this decision, determine whether the data type or length of your field should be dependent on an existing SAP field. If your field should be independent, create a new domain. If your field should be dependent, reuse an existing SAP domain. Similarly, you should reuse data elements if your field labels and documentation should change when SAP changes theirs.

 

**********************************8

 

Data element provides business context. i.e., it provides field labels for the field in the backend,

 

Data type :

A data element is an elementary type. It describes the type attributes (data type, field length and possibly the number of decimal places) and screen information (explanatory text or field help) about unstructured data objects (table fields and structure fields or variables).

 

Table fields and structure fields with the same contents should refer to the same data element. This ensures that the attributes of these fields are always consistent.

 

A data element can be referenced in ABAP programs with TYPE. This permits you to define variables that take on the type attributes of the data element in an ABAP program.

 

Domain :

A domain describes the technical attributes of a field, such as the data type or the number of positions in a field. The domain defines primarily a value range describing the valid data values for the fields referring to this domain.

 

Different technical fields of the same type can be combined in a domain. Fields referring to the same domain are changed at the same time when a domain is changed. This ensures the consistency of these fields.

 

Additional info about data element

1.Data type, number of places and possibly the decimal places were entered directly. In this case the field is not filled.

2.A data element is assigned to the field. The field then gets its data type, length and possibly decimal places from this data element. The semantic attributes of the element (field help, representation of the field in input templates with keyword text, column headers for list output of the table contents and editing of the output with parameter IDs) are also copied.

ABAP Interview questions and answers

Posted: February 6, 2014 in Magento

 

What is a report?

Report is a program used to fetch data from the database tables and display it on the screen. It has 2 screens selection screen(optional) and list or output screen.

When the TOP-OF-PAGE event does get triggered?

TOP-OF-PAGE event will be triggered when the first ULINE, WRITE or SKIP statement occurs in a program.

What is the difference between SKIP and RESERVE?

SKIP provides empty space between lines, while RESERVE executes a page break on the current page if the number of lines between current line and the page footer is less than the number specified in RESERVE statement.

What is the difference between SKIP and NEW-LINE?

SKIP generates a blank line, while the NEW-LINE causes the control to move to next line.

What is hotspot?

Hotspot is an area on the list where the mouse pointer turns into an upright hand symbol. A single click on the hotspot does the same thing as a double-click.

What does HIDE statement do?

The HIDE statement hides the contents of the line along with the line numbers in a system defined HIDE area. This is used in interactive reporting.

What are the events in classical reports?

INITIALIZATION

AT SELECTION-SCREEN

START-OF-SELECTION

END-OF-SELECTION

TOP-OF-PAGE

END-OF-PAGE

How many detail lists can be created in interactive reporting?

20

What is the name of the system variable that holds the contents of the selected line in interactive reporting?

SY-LISEL

Can we set page headers to details lists?

Yes. Use TOP-OF-PAGE DURING LINE-SELECTION event.

 

Reports and Transactions:

 

1.            What is LDB. Disadvantages of LDB and also advantages.

Logical Database is special ABAP program. It’s nested select statements.

Advantages: If you use LDB, it retrieves data as per foreign key relations from different tables. You need not know the relations among tables.

Disadvantages: Runtime will be increased if you use LDB.

 

2.            What are the events associated with LDB and their purpose.

GET and GET LAST. GET will be triggered for each record and retrieves a record. GET LAST will be triggered at end of each record.

 

3.            In which order they will be triggered.

First Get and then Get last of same table.

 

4.            How will you change the selection screen of a LDB.

Selection screen can be changed through you add selection screen option in the program, these will be automatically added to LDB selection screen for this program.

 

5.            Where you attach the LDB to a report.

One is Attributes, two at report header.

 

6.            How many LDBs you can use in a Report.

Only one.

 

7.            Order of events triggered during execution of report program.

Initialization, selection-screen, at selection-screen, start-of-selection etc

 

8.            How to get help and/or possible values for selection screen fields

Events AT SELECTION-SCREEN ON HELP REQUEST and AT SELECTION-SCREEN ON VALUE REQUEST.

 

9.            How many secondary lists you can have in a report.

20 secondary list and 1 basic list.

 

10.          What are events, which triggers secondary lists.

At line-selection, At PFnn, At User-command.

 

11.          What is the purpose of HIDE statement. Any other methods other than HIDE for same purpose.

Hide will help in transferring data from basic list to secondary list or one list to other list. Other methods are GET CURSOR and SY-LISEL.

 

12.          What are the different techniques for Data processing/refining in ABAP reports.

1.            Internal Tables. 2. Extracts (Field Groups)

 

13.          Can you put a SQL Join statement in ABAP? If yes, How

Through alias (only in 4.0 and above versions)

 

14.          What is the system variable, which tells about number database records handled.

SY-DBCNT

 

15.          What are different techniques available for modularization.

Internal Subroutines, External Subroutines, Macros, Function modules and Include programs.

 

16.          What are different types of internal tables and their usage.

 

Standard Internal Tables

Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition.

This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command). The response time for accessing a standard table is in linear relation to the number of table entries. If you need to use key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you can fill a standard table by appending records and then sort it. If you then use key access with the binary search option (BINARY), the response time is in logarithmic relation to the number of table entries.

Sorted Internal Tables

Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition. Standard tables and sorted tables both belong to the generic group index tables.

This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key.

Hashed Internal Tables

Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition.

This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and using internal tables that are similar to database tables.

 

 

17.          One of my users has access to SE38 transaction, and so he can run the program developed by you. You have attached this report/transactional program to a particular Z* transaction. To restrict the users to Execute this program, what you do it from programming side?

 

Check for Authorization object S_TCODE with value “Z—-” in initialization event.

(Code:

Authority-check object ‘S_TCODE’

id ‘TCD’ field ‘ZBC_REQ’.)

 

18. We need to download an internal table to the Presentation Server (local workstation).

Whenever we run the program, the same file has to be saved as a separate file in sequential order. Ex: 0001.txt, 0002.txt etc. Where can we store the last file number?

 

SAP has a table TVARV for storing the variants.

A record may be created in TVARV for all the programs that require these kind of incremental records.

For Ex: the record could be 010ZBC_TEST MM sequence rec where first part consists of client code and the program being run. Client code is required because TVARV does not have a field for client code. The second part is the description indicating the purpose what the record is created. This entire string may be posted in the Name field (char – 30).

The Type field (char- 1) may be populated with P or S (Parameter or Selection)

Low field (char- 45) may be populated with ‘0001’ when run first time and increment it by one in your program for downloading of the internal table.

 

19.          When we create a customer the information is updated in structure RF02D and the

Some tables like KNA1 are updated. How can we find the tables for master data transactions?

Go to ABAP Workbench -> Overview -> application hierarchy – SAP -> (or SE81 transaction code) follow the customizing based tree for your application. Double click on a lowest level to get for the correct marked development class. Then, here you can find all the tables, views, logical databases etc..,

 

1.            When using Open SQL statements in an ABAP/4 program, you must ensure the following.

a)            The database system being addressed must be supported by SAP.

b)            The database tables being addressed must be defined in the ABAP/4 dictionary.

c)            Both a and b

d)            None

Ans. c

____________________________________________________________________________

 

2.            Which of the following statements are correct?

a)            A database interface translates SAP’s Open SQL statements into SQL commands specific to the database in use. Native SQL statements access the database directly.

b)            When you use Native SQL, the addressed database tables do not have to be known to the ABAP/4 dictionary. In Open SQL, the addressed database tables must be defined in the ABAP/4 dictionary.

c)            There is automatic client handling in Native SQL whereas clients must always be specified in Open SQL.

Ans. a,b

____________________________________________________________________________

 

3.            Which of the following are true?

a)            TABLE is used as a synonym for STANDARD TABLE

b)            You can only access a hashed table using the generic key operations. Explicit or implicit index operations (such as LOOP … FROM oe INSERT itab within a LOOP) are not allowed.

c)            All hashed tables are index tables.

d)            We have to define the hash procedure explicitly for HASHED TABLE.

Ans. a, b

____________________________________________________________________________

 

4.            Can a transparent table exist in data dictionary but not in the database physically?

a)            True

b)            False

Ans. b

_____________________________________________________________________________

 

5.            Can you create a table with fields not referring to data elements?

a)            Yes

b)            No

Ans. a

_____________________________________________________________________________

 

6.            How do you create a batch input session for a transaction?

a)            ‘Call transaction’ in background mode.

b)            ‘Call transaction’ in error mode.

c)            ‘Bdc_insert’ for the transaction.

d)            None of the above.

Ans. c

____________________________________________________________________________

 

7.            What is the alternative to batch input session?

a)            Load module

b)            Call transaction

c)            BAPI

d)            Idoc segment

Ans. b

____________________________________________________________________________

 

8.            The following are true about ‘EXEC SQL’.

a)            You can end the Native SQL with a semicolon.

b)            You can end the Native SQL with a period.

c)            You cannot perform reliable authorization checks using EXEC SQL.

d)            Host variables in the Native SQL are identified with a preceding hash (#).

Ans. a, c

____________________________________________________________________________

 

9.            The following are true about database locking.

a)            Database systems set physical locks on all lines affected by a database call.

b)            Read locks prevent the setting of further read locks for the objects in question.

c)            Read locks prevent other transactions from setting write locks for the objects in question.

d)            Write locks allow other transactions to set read locks for the objects in question.

Ans. a, c

____________________________________________________________________________

 

10.          What are field symbols?

a)            Field symbols are like pointers in C that can point to any data object in ABAP/4 and to structures defined in ABAP/4 dictionary.

b)            Field symbols have to be created with type specifications only.

c)            You cannot assign one field symbol to another.

d)            All operations you have programmed with the field symbol are carried out with the assigned field.

Ans. a, d

____________________________________________________________________________

 

11.          EXTRACT statement

a)            The first EXTRACT statement extracts the first extract record.

b)            The first EXTRACT statement creates the extract dataset and adds the first extract record.

c)            Each extract record contains, if specified, the fields of the field group.

d)            Each extract record contains, if specified, the fields of the field symbol.

Ans. b, c

____________________________________________________________________________

 

12.          You cannot assign a local data object defined in a subroutine or function module to a field group.

a)            True

b)            False

Ans. a

____________________________________________________________________________

 

13.          Which of the following are true?

a)            COLLECT can only be used with STANDARD TABLE.

b)            To use COLLECT, the internal table should be derived from a database table with an explicit key.

c)            If the system finds a numeric component, that is not part of the key, the numeric fields that are not part of the table key (see ABAP number types) are added to the sum total of the existing entries. If it does not find an entry, control passes on to the next record in the internal table.

d)            If the system finds a numeric component, that is not part of the key, the numeric fields that are not part of the table key (see ABAP number types) are added to the sum total of the existing entries. If it does not find an entry, the system creates a new entry instead.

Ans. d

_________________________________________________________________________

 

14.          Which of the following are true?

a)            ABAP queries are created by associating them to a logical database or through a direct read/data retrieval program.

b)            ABAP queries are created from functional areas that are created from a logical database or through a direct read/retrieval program.

c)            ABAP queries are created from user groups attached to the functional areas that are created from a logical database or through a direct read/retrieval program.

d)            ABAP queries are created through the regular report program.

Ans. c

____________________________________________________________________________

 

15.          A logical unit of work (LUW or transaction) begins

a)            Each time you start a transaction.

b)            Each time you end a transaction.

c)            When the database changes of the previous LUW have been confirmed (database commit).

d)            Before the database changes of the previous LUW have been cancelled (database rollback).

Ans. a, d.

____________________________________________________________________________

 

16.          A database commit is triggered by

a)            ABAP/4 command COMMIT WORK.

b)            CALL SCREEN, CALL DIALOG.

c)            A Remote Function Call

d)            CALL TRANSACTION

Ans. a, b, c, d

____________________________________________________________________________

 

17.          The following are true about SAPscript control commands.

a)            If a control command is unknown or it contains syntax errors, the line containing it will be printed out as it is.

b)            If a control command is unknown or it contains syntax errors, the line containing it will be treated as a comment line.

c)            A maximum of one control command may appear in each line.

d)            A maximum of six control commands may appear in each line.

Ans. b, c

____________________________________________________________________________

 

18.          To output SAPscript layout sets, in the print program

a)            You must always start the output with OPEN_FORM and end it with CLOSE_FORM.

b)            Within one transaction, you can use only one OPEN_FORM and CLOSE_FORM to open and close a layout set.

c)            WRITE_FORM should be used within an OPEN_FORM and CLOSE_FORM.

d)            WRITE_FORM can be used without an OPEN_FORM and CLOSE_FORM.

Ans. a, c

____________________________________________________________________________

 

19.          The transaction CMOD and SMOD are

a)            Used to create enhancements to standard SAP programs.

b)            Used to create enhancements to ABAP queries.

c)            Used to create the user exits, menu exits and screen exits.

d)            Used to modify the standard function groups.

Ans. a, c

____________________________________________________________________________

 

20.          Which of the following are tools to report data in ABAP?

e)            ALV

f)             ALE

g)            LSMW

h)            SmartForms

 

Ans: a

____________________________________________________________________________

 

21.          ABAP Query tool is used to:

a)            Enquire about a running-program status

b)            Automatically generate code for reporting

c)            Perform database operations for user-written programs

d)            None of the above

 

Ans: b.

____________________________________________________________________________

 

22.          In ABAP Query tool…

e)            Each user can be assigned to several user-groups

f)             Each user can be assigned to several functional areas

g)            Each functional area can be assigned to several user-groups

h)            One user can be assigned only to one user-group.

 

Ans: a, b, c

____________________________________________________________________________

 

23.          Logical databases must be used to create an ABAP Query

a)            True

b)            False

 

Ans: b

____________________________________________________________________________

 

24.          In a BDC program, how would you handle errored records? Would you…

a)            Rerun the program

b)            Report the errored records

c)            Generate a batch-input session with errored records

d)            Create an output file, to be run again after corrections

 

Ans: b, c, d

____________________________________________________________________________

 

25.          What are IDocs?

a)            Documentation of executable programs

b)            Documents used for data-transport between SAP and non-SAP s/w.

c)            Documents used for data-transport between two different SAP systems

d)            Documents used for one-time data-migration activities.

 

Ans: b, c

____________________________________________________________________________

 

26.          For transportation of data from a presentation server into SAP, the function module used is

a)            UPLOAD

b)            WS_UPLOAD

c)            FILE_UPLOAD

d)            DATA_UPLOAD

 

Ans: a, b

____________________________________________________________________________

 

27.          For one-time high volume data-uploads into SAP from non-reliable systems, the following are generally used:

a)            BDC

b)            LSMW

c)            Direct table update

d)            Idocs

 

Ans: a, b

____________________________________________________________________________

 

28.          In an ABAP program, the INITIALIZATION event is invoked

a)            Before the AT-SELECTION-SCREEN event

b)            After the AT-SELECTION-SCREEN event

c)            Could be either way

d)            Cannot be predicted

 

Ans: a

____________________________________________________________________________

 

29.          The statement to check whether an internal table itab_test has no records, is:

IF itab_test is initial.

a)            TRUE

b)            FALSE

 

Ans: b.

____________________________________________________________________________

 

30.          The statement used to clear all the contents of an internal table is:

a)            CLEAR itab.

b)            REFRESH itab.

c)            FREE itab.

d)            DELETE itab.

 

Ans: b, c

____________________________________________________________________________

 

31.          The AT-SELECTION-SCREEN event is triggered when…

a)            ENTER key is hit on the selection-screen

b)            F8 key is hit on the selection-screen

c)            Any field on selection-screen is populated

d)            F4 key is hit on the selection-screen

 

Ans: a, b

____________________________________________________________________________

 

32.          What is the transaction-code for viewing batch-runs of a program?

a)            SE37

b)            SM37

c)            SM35

d)            SM30

 

Ans: b

____________________________________________________________________________

 

33.          SY-BATCH can be used to determine whether a program is being run in batch-mode, within the AT-SELECTION-SCREEN event.

a)            TRUE

b)            FALSE

 

Ans: b

____________________________________________________________________________

 

34.          The following statements will clear the header-line of an internal table:

a)            DELETE ITAB.

b)            FREE ITAB.

c)            REFRESH ITAB.

d)            CLEAR ITAB.

 

Ans: d

____________________________________________________________________________

 

35.          The SAP Logon password is always case-insensitive.

a)            TRUE

b)            FALSE

 

Ans: b

 

P.S: From ECC6.0, SAP Logon Password is case-sensitive.

 

What is an ABAP dictionary?

ABAP dictionary is a central data management system. Its main function is to support the creation and management of data definitions.

What are the basic objects of the data dictionary?

Tables

Domains

Data elements

Structures

Foreign keys

What is the difference between Data elements and Domains?

Data Element     Domain

Data Element gives semantic attributes like field labels and online documentation            Domain gives the technical attributes like data type and field length

Can you delete a domain which is being used by data elements?

No

Can you define a field without a data element?

Yes. Use the path Utilities – > Direct Entry Type

What are the difference between Tables and Structures?

Table     Structure

Table has an underlying database table No underlying database table

Table has a primary key No primary key

Table has technical attributes     No technical attributes

What is a Data Class?

The Data class determines in which table space the table is stored when it is created in the database.

What is a Size Category?

The Size category describes the probable space requirement of the table in the database.

What is a view?

A view is a logical view on one or more tables.  i.e. the data from a view is not actually physically stored in the database instead the data will be derived from one or more tables during runtime.

What are the different types of views and their definition?

Database View

Help View

Projection View

Maintenance View

 

1. What is the typical structure of an ABAP/4 program? 

ANS –    HEADER ,BODY,FOOTER.

 

2. What are field symbols and field groups.? 

    Have you used “component idx of structure” clause with field groups?     

ANS:-     Field symbols:-

               Field groups :-

Can any body explain me what is field group?

Field groups are groups similar fields together into one name. Field group works in conjuction with   

INSERT f1 f2 INTO fg

EXTRACT fg

SORT BY fg

LOOP … ENDLOOP

INSERT f1 f2 INTO fg

———————

The insert statement is used to create a field group dynamically by inserting the field into it. Only global data fields can be inserted and not local data fields eg : in form modules.

EXTRACT fg

———- 

This will combine all the fields in the fieldgroup and write them to a sequential dataset as a single record.

SORT BY fg

———-

Sorting of sequential dataset by field group.

LOOP AND ENDLOOP

—————

LOOP.

  AT ***

……

….

ENDAT.

  AT ***

…..

….

ENDAT.

ENDLOOP.                      

3. What should be the approach for writing a BDC program? 

ANS:-

STEP 1: CONVERTING THE LEGACY SYSTEM DATA TO A FLAT FILE to internal table CALLED “CONVERSION”.

STEP 2: TRANSFERING THE FLAT FILE INTO SAP SYSTEM CALLED “SAP DATA TRANSFER”.

STEP 3: DEPENDING UPON THE BDC TYPE i)call transaction(Write the program explicity)

         ii) create sessions (sessions are created and processed.if success data will transfer).

4. What is a batch input session? 

ANS:-

BATCH INPUT SESSION is an intermediate step between internal table and database table. 

Data along with the action is stored in session ie data for screen fields, to which screen it is passed,program name behind it, and how next screen is processed.

5. What is the alternative to batch input session? 

ANS:-

Call transaction.

6. A situation: An ABAP program creates a batch input session. 

    We need to submit the program and the batch session in back ground. How to do it? 

ANS:-

     go to SM36 and create background job by giving 

     job name,job class and job steps (JOB SCHEDULING)

8. What are the problems in processing batch input sessions? 

    How is batch input process different from processing online? 

ANS:-

PROBLEMS:-

 i) If the user forgets to opt for keep session then the session will be automatically removed from the session queue(log remains).  However if session is processed we may delete it manually.

ii)if session processing fails data will not be transferred to SAP database table.

10. What are the different types of data dictionary objects? 

ans:-

tables, structures, views, domains, data elements, lock objects, Matchcode objects.

11. How many types of tables exists and what are they in data dictionary? 

ans :-

4 types of tables

i)Transparent tables – Exists with the same structure both in dictionary as well as in database exactly with the same data and fields.   Both Opensql and Nativesql can be used.

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:- by Madhukar

Open SQL , native SQL are the interfaces to create the database applicatons.

Open SQL is consistant across different types of existing Databases.

Native SQL is the database language specific to database.Its API is specific to the databse.

Open SQL API is consistent across all vendors

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-of-page, 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.

32. What is a check table and what is a value table? 

Check table will be at field level checking.

Value table will be at domain level checking ex: scarr table is check table for carrid.

33. What are match codes? describe? 

ans:-

It is a similar to table index that gives list of possible values for either primary keys or non-primary keys.

34. What transactions do you use for data analysis? 

ANS:-

35. What is table maintenance generator? 

ANS:-

36. What are ranges? What are number ranges? 

ANS:-

    max,min values provided in selection screens.

37. What are select options and what is the diff from parameters? 

ANS:-

select options provide ranges where as parameters do not.

SELECT-OPTIONS declares an internal table which is automatically filled with values or ranges 

of values entered by the end user. For each SELECT-OPTIONS , the system creates a selection table.

SELECT-OPTIONS <SEL> FOR <field>.

A selection table is an internal table with fields SIGN, OPTION, LOW and HIGH. 

The type of LOW and HIGH is the same as that of <field>. 

The SIGN field can take the following values: I Inclusive (should apply) E Exclusive (should not apply)

The OPTION field can take the following values: EQ Equal GT Greater than NE Not equal BT Between LE Less 

than or equal NB Not between LT Less than CP Contains pattern GE Greater than or equal NP No pattern.

diff:-

PARAMETERS allow users to enter a single value into an internal field within a report. 

SELECT-OPTIONS allow users to fill an internal table with a range of values.

For each PARAMETERS or SELECT-OPTIONS statement you should define text elements by choosing 

Goto – Text elements – Selection texts – Change.

Eg:- Parameters name(30).

when the user executes the ABAP/4 program,an input field for ‘name’ will appear on the selection screen.You can change the comments on the left side of the input fields by using text elements as described in Selection Texts.

38. How do you validate the selection criteria of a report? 

And how do you display initial values in a selection screen? 

ANS:-

validate :- by using match code objects.

display :- Parameters <name> default ‘xxx’.

               select-options <name> for spfli-carrid.

39. What are selection texts? 

ANS:-

40. What is CTS and what do you know about it? 

ANS:-

The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing, and then transport the changes between the SAP Systems and clients in your system landscape.

This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project.

For practical information on working with the Change and Transport System, see Change and Transport Organizer and Transport Management System.

41. When a program is created and need to be transported to prodn does selection texts always go with it? if not how do you make sure? Can you change the CTS entries? How do you do it? 

ANS:-

42. What is the client concept in SAP? What is the meaning of client independent? 

ANS:-

43. Are programs client dependent? 

ANS:-

    Yes.Group of users can access these programs with a client no.

44. Name a few system global variables you can use in ABAP programs? 

ANS:-

SY-SUBRC,SY-DBCNT,SY-LILLI,SY-DATUM,SY-UZEIT,SY-UCOMM,SY-TABIX…..

SY-LILLI IS ABSOLUTE NO OF LINES FROM WHICH THE EVENT WAS TRIGGERED.

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 re-organising 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.

49. What are interface/conversion programs in SAP? 

ANS : 

CONVERSION : LEGACY SYSTEM TO FLAT FILE.

INTERFACE  : FLAT FILE TO SAP SYSTEM.

 

What is a ‘Z’ report?

Y or Z report refer to customized abap programs written for modules such as mm, sd, pp or fi/co etc.

Can we create an ABAP program without using Y or Z?

No, this is because all non Yor Z programs are standard SAP programs.

 

1. How data is stored in cluster table? 

Each field of cluster table behaves as tables which contains the no. of entries.

 

2. What are client dependant objects in abap/sap? 

SAP Script layout, text element, and some DDIC objects.

 

3. On which even we can validate the input fields in module progams? 

In PAI (Write field statement on field you want to validate, if you want to validate group of fields put in chain and End chain statement.)

 

4. In selection screen I have three fields, plant mat no and material group. If I input plant how do I get the mat no and material group based on plant dynamically? 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATERIAL. 

CALL FUNCTION ‘F4IF_INT_TABLE_VALUE_REQUEST’ to get material and material group for the plant.

 

5. How do you get output from IDOC? 

Data in IDOc is stored in segments, the output from Idoc is obtained by reading the data stored in its respective segments.

 

6. When top of the page event is triggered? 

After excuteing first write statement in start-of-selection event.

 

7. Can we create field without data element and how? 

In SE11 one option is available above the fields strip. Data element/ direct type.

 

8. How do we debug sapscript? 

Go to SE71 give lay set name , go to utilities select debugger mode on.

 

9. Which transaction code can I used to analyze the performance of ABAP program. 

TCode AL21.

 

10. How can I copy a standard table to make my own z_table.

Go to transaction SE11. Then there is one option to copy table. Press that button.  Enter the name of the standard table and in the Target table enter Z table name and press enter.

 

Following are some of the answers which I gave upto my knowledge.

 

1. What is the use of ‘outerjoin’ 

Ans. With the use of outer join you can join the tables even there is no entry in all the tables used in the view.

        In case of inner join there should be an entry in al the tables use in the view.

 

2. When to  use logical database?

Ans. Advantage of Logical databases:

        less coding s required to retrieve data compared to normal internel tables.

        Tables used LDB are in hierarchial structure.

 

3. What is the use of ‘table index’?

Ans .Index is used for faster access of data base tables.

 

4. What is the use of ‘FOR ALL ENTRIES’?

Ans. To avoid nested select statements we use SELECT FOR ALL ENTRIES statement.

        If there r more than 10000 records SELECT FOR ALL ENTRIES is used.

        Performance wise SELECT FOR ALL ENTRIES is better to use.

 

5. Can you set up background processing using CALL TRANSACTION?

       Yes,Using No Screen Mode.

 

6. What are table buffers?

    Table buffers reside locally on each application server in the system. The data of buffered tables can thus be accessed 

    directly  from the buffer of the application server. This avoids the time-consuming process of accessing the database.

 

    Buffering is useful if table needs to be accessed more no. of times in a program.

 

With Compliments from: Pavan

 

1. How do I set a flag for a field in any table?

Create a char field of length 1. for example field STAS-LKENZ is Deletion Indicator. It means that if the value in the field is ‘X’ then that record has been deleted.

 

2. Can I execute user exits? If yes, how?

Yes you can. after finding the user exit, you need to use, goto CMOD add ur user-exit to your project. Then activate the FM which you require. Now go into that function module there will be a Include program wit name ZX* . Double click on it, it will ask to create an object, answer it Yes and then write your code in it.

 

3. How do I find the output type of a table or a program?

Table TNAPR / NAST               *– Raj

 

What is an ABAP data dictionary?- ABAP 4 data dictionary describes the logical structures of the objects used in application development and shows how they are mapped to the underlying relational database in tables/views.

What are domains and data element?- Domains:Domain is the central object for describing the technical characteristics of an attribute of an business objects. It describes the value range of the field. Data Element: It is used to describe the semantic definition of the table fields like description the field. Data element describes how a field can be displayed to end-user.

What is foreign key relationship?- A relationship which can be defined between tables and must be explicitly defined at field level. Foreign keys are used to ensure the consistency of data. Data entered should be checked against existing data to ensure that there are now contradiction. While defining foreign key relationship cardinality has to be specified. Cardinality mentions how many dependent records or how referenced records are possible.

 

Describe data classes.- Master data: It is the data which is seldomly changed. Transaction data: It is the data which is often changed. Organization data: It is a customizing data which is entered in the system when the system is configured and is then rarely changed. System data:It is the data which R/3 system needs for itself.

What are indexes?- Indexes are described as a copy of a database table reduced to specific fields. This data exists in sorted form. This sorting form ease fast access to the field of the tables. In order that other fields are also read, a pointer to the associated record of the actual table are included in the index. Yhe indexes are activated along with the table and are created automatically with it in the database.

Difference between transparent tables and pooled tables.- Transparent tables: Transparent tables in the dictionary has a one-to-one relation with the table in database. Its structure corresponds to single database field. Table in the database has the same name as in the dictionary. Transparent table holds application data. Pooled tables. Pooled tables in the dictionary has a many-to-one relation with the table in database. Table in the database has the different name as in the dictionary. Pooled table are stored in table pool at the database level.

What is an ABAP/4 Query?- ABAP/4 Query is a powerful tool to generate simple reports without any coding. ABAP/4 Query can generate the following 3 simple reports: Basic List: It is the simple reports. Statistics: Reports with statistical functions like Average, Percentages. Ranked Lists: For analytical reports. – For creating a ABAP/4 Query, programmer has to create user group and a functional group. Functional group can be created using with or without logical database table. Finally, assign user group to functional group. Finally, create a query on the functional group generated.

What is BDC programming?- Transferring of large/external/legacy data into SAP system using Batch Input programming. Batch input is a automatic procedure referred to as BDC(Batch Data Communications).The central component of the transfer is a queue file which receives the data vie a batch input programs and groups associated data into “sessions”.

What are the functional modules used in sequence in BDC?- These are the 3 functional modules which are used in a sequence to perform a data transfer successfully using BDC programming: BDC_OPEN_GROUP – Parameters like Name of the client, sessions and user name are specified in this functional modules. BDC_INSERT – It is used to insert the data for one transaction into a session. BDC_CLOSE_GROUP – This is used to close the batch input session.

What are internal tables?- Internal tables are 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 re-organising the contents of database tables according to users need.

What is ITS? What are the merits of ITS?- ITS is a Internet Transaction Server. ITS forms an interface between HTTP server and R/3 system, which converts screen provided data by the R/3 system into HTML documents and vice-versa. Merits of ITS: A complete web transaction can be developed and tested in R/3 system. All transaction components, including those used by the ITS outside the R/3 system at runtime, can be stored in the R/3 system. The advantage of automatic language processing in the R/3 system can be utilized to language-dependent HTML documents at runtime.

What is DynPro?- DynPro is a Dynamic Programming which is a combination of screen and the associated flow logic Screen is also called as DynPro.

What are screen painter and menu painter?- Screen painter: Screen painter is a tool to design and maintain screen and its elements. It allows user to create GUI screens for the transactions. Attributes, layout, filed attributes and flow logic are the elements of Screen painter. Menu painter: Menu painter is a tool to design the interface components. Status, menu bars, menu lists, F-key settings, functions and titles are the components of Menu painters. Screen painter and menu painter both are the graphical interface of an ABAP/4 applications.

What are the components of SAP scripts?- SAP scripts is a word processing tool of SAP which has the following components: Standard text. It is like a standard normal documents. Layout sets. – Layout set consists of the following components: Windows and pages, Paragraph formats, Character formats. Creating forms in the R/3 system. Every layout set consists of Header, paragraph, and character string. ABAP/4 program.

What is ALV programming in ABAP? When is this grid used in ABAP?- ALV is Application List viewer. Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. The report output can contain up to 90 columns in the display with the wide array of display options.

What are the events in ABAP/4 language?- Initialization, At selection-screen, Start-of-selection, end-of-selection, top-of-page, end-of-page, At line-selection, At user-command, At PF, Get, At New, At LAST, AT END, AT FIRST.

What is CTS and what do you know about it?- The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing, and then transport the changes between the SAP Systems and clients in your system landscape. This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project.

What are logical databases? What are the advantages/ dis-advantages of logical databases?- To read data from a database tables we use logical database. A logical database provides read-only access to a group of related tables to an ABAP/4 program. Advantages: i)check functions which check that user input is complete, correct,and plausible. ii)Meaningful data selection. iii)central authorization checks for database accesses. iv)good read access performance while retaining the hierarchical data view determined by the application logic. dis advantages: i)If you donot specify a logical database in the program attributes,the GET events never occur. ii)There is no ENDGET command,so the code block associated with an event ends with the next event statement (such as another GET or an END-OF-SELECTION).

What is a batch input session?- BATCH INPUT SESSION is an intermediate step between internal table and database table. Data along with the action is stored in session ie data for screen fields, to which screen it is passed, program name behind it, and how next screen is processed.

How to upload data using CATT ?- These are the steps to be followed to Upload data through CATT: Creation of the CATT test case & recording the sample data input. Download of the source file template. Modification of the source file. Upload of the data from the source file.

What is Smart Forms?- Smart Forms allows you to create forms using a graphical design tool with robust functionality, color, and more. Additionally, all new forms developed at SAP will be created with the new Smart Form solution.

How can I make a differentiation between dependent and independent data?- Client dependent or independent transfer requirements include client specific or cross client objects in the change requests. Workbench objects like SAPscripts are client specific, some entries in customizing are client independent. If you display the object list for one change request, and then for each object the object attributes, you will find the flag client specific. If one object in the task list has this flag on, then that transport will be client dependent.

What is the difference between macro and subroutine?- Macros can only be used in the program the are defined in and only after the definition are expanded at compilation / generation. Subroutines (FORM) can be called from both the program the are defined in and other programs . A MACRO is more or less an abbreviation for some lines of code that are used more than once or twice. A FORM is a local subroutine (which can be called external). A FUNCTION is (more or less) a subroutine that is called external. Since debugging a MACRO is not really possible, prevent the use of them (I’ve never used them, but seen them in action). If the subroutine is used only local (called internal) use a FORM. If the subroutine is called external (used by more than one program) use a FUNCTION.

 

 

1. What is the typical structure of an ABAP/4 program? 

ANS:-

   HEADER ,BODY,FOOTER.

 

2. What are field symbols and field groups.? 

    Have you used “component idx of structure” clause with field groups?

 

ANS:-

    Field symbols:-

 

    Field groups :-

 

Can any body explain me what is field group?

 

Field groups are groups similar fields together into one name. Field group works in conjuction with

 

INSERT f1 f2 INTO fg

EXTRACT fg

SORT BY fg

LOOP … ENDLOOP

 

INSERT f1 f2 INTO fg

———————

 

The insert statement is used to create a field group dynamically by inserting the field into it. Only global data fields can be inserted and not local data fields eg : in form modules.

 

EXTRACT fg

———-

 

This will combine all the fields in the fieldgroup and write them to a sequential dataset as a single record.

 

SORT BY fg

———-

 

Sorting of sequential dataset by field group.

 

LOOP AND ENDLOOP

—————

 

LOOP.

  AT ***

……

….

ENDAT.

  AT ***

…..

….

ENDAT.

ENDLOOP.                         *– Chinmaya

 

3. What should be the approach for writing a BDC program? 

ANS:-

STEP 1: CONVERTING THE LEGACY SYSTEM DATA TO A FLAT FILE to internal table CALLED “CONVERSION”.

STEP 2: TRANSFERING THE FLAT FILE INTO SAP SYSTEM CALLED “SAP DATA TRANSFER”.

STEP 3: DEPENDING UPON THE BDC TYPE i)call transaction(Write the program explicity)

         ii) create sessions (sessions are created and processed.if success data will transfer).

 

4. What is a batch input session? 

ANS:-

BATCH INPUT SESSION is an intermediate step between internal table and database table. 

Data along with the action is stored in session ie data for screen fields, to which screen it is passed,program name behind it, and how next screen is processed.

 

5. What is the alternative to batch input session? 

ANS:-

Call transaction.

 

6. A situation: An ABAP program creates a batch input session. 

    We need to submit the program and the batch session in back ground. How to do it? 

ANS:-

     go to SM36 and create background job by giving 

     job name,job class and job steps (JOB SCHEDULING)

 

8. What are the problems in processing batch input sessions? 

    How is batch input process different from processing online? 

ANS:-

PROBLEMS:-

 i) If the user forgets to opt for keep session then the session will be automatically removed from the session queue(log remains).  However if session is processed we may delete it manually.

ii)if session processing fails data will not be transferred to SAP database table.

 

10. What are the different types of data dictionary objects? 

ANS:-

tables, structures, views, domains, data elements, lock objects, Matchcode objects.

 

 

11. How many types of tables exists and what are they in data dictionary? 

ans :-

4 types of tables

i)Transparent tables – Exists with the same structure both in dictionary as well as in database exactly with the same data and fields.   Both Opensql and Nativesql can be used.

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:- by Madhukar

Open SQL , native SQL are the interfaces to create the database applicatons.

Open SQL is consistant across different types of existing Databases.

Native SQL is the database language specific to database.Its API is specific to the databse.

Open SQL API is consistent across all vendors

 

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-of-page, 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.

 

32. What is a check table and what is a value table? 

Check table will be at field level checking.

Value table will be at domain level checking ex: scarr table is check table for carrid.

 

33. What are match codes? describe? 

ans:-

It is a similar to table index that gives list of possible values for either primary keys or non-primary keys.

 

34. What transactions do you use for data analysis? 

ANS:-

 

35. What is table maintenance generator? 

ANS:-

 

36. What are ranges? What are number ranges? 

ANS:-

    max,min values provided in selection screens.

 

37. What are select options and what is the diff from parameters? 

ANS:-

select options provide ranges where as parameters do not.

 

SELECT-OPTIONS declares an internal table which is automatically filled with values or ranges 

of values entered by the end user. For each SELECT-OPTIONS , the system creates a selection table.

 

SELECT-OPTIONS <SEL> FOR <field>.

 

A selection table is an internal table with fields SIGN, OPTION, LOW and HIGH. 

The type of LOW and HIGH is the same as that of <field>. 

The SIGN field can take the following values: I Inclusive (should apply) E Exclusive (should not apply)

The OPTION field can take the following values: EQ Equal GT Greater than NE Not equal BT Between LE Less 

than or equal NB Not between LT Less than CP Contains pattern GE Greater than or equal NP No pattern.

diff:-

PARAMETERS allow users to enter a single value into an internal field within a report. 

SELECT-OPTIONS allow users to fill an internal table with a range of values.

 

For each PARAMETERS or SELECT-OPTIONS statement you should define text elements by choosing 

Goto – Text elements – Selection texts – Change.

 

Eg:- Parameters name(30).

when the user executes the ABAP/4 program,an input field for ‘name’ will appear on the selection screen.You can change the comments on the left side of the input fields by using text elements as described in Selection Texts.

 

38. How do you validate the selection criteria of a report? 

And how do you display initial values in a selection screen? 

ANS:-

validate :- by using match code objects.

display :- Parameters <name> default ‘xxx’.

               select-options <name> for spfli-carrid.

 

39. What are selection texts? 

ANS:-

 

40. What is CTS and what do you know about it? 

ANS:-

 

The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing, and then transport the changes between the SAP Systems and clients in your system landscape.

This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project.

For practical information on working with the Change and Transport System, see Change and Transport Organizer and Transport Management System.

 

41. When a program is created and need to be transported to prodn does selection texts always go with it? if not how do you make sure? Can you change the CTS entries? How do you do it? 

ANS:-

 

42. What is the client concept in SAP? What is the meaning of client independent? 

ANS:-

 

43. Are programs client dependent? 

ANS:-

    Yes.Group of users can access these programs with a client no.

 

44. Name a few system global variables you can use in ABAP programs? 

ANS:-

SY-SUBRC,SY-DBCNT,SY-LILLI,SY-DATUM,SY-UZEIT,SY-UCOMM,SY-TABIX…..

SY-LILLI IS ABSOLUTE NO OF LINES FROM WHICH THE EVENT WAS TRIGGERED.

 

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 re-organising 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.

 

49. What are interface/conversion programs in SAP? 

ANS : 

CONVERSION : LEGACY SYSTEM TO FLAT FILE.

INTERFACE  : FLAT FILE TO SAP SYSTEM.

 

1) What is runtime analysis? Have you used this?

 

It’s checks program execution time in microseconds. When you go to SE30.  If you give desired program name in performance file. It will take you to below screen. You can get how much past is your program.

 

2) What is meant by performance analysis? Have done

 

3) How to transfer the objects? Have you transferred any objects?

 

4) How did you test the developed objects?

 

I was testing a developed object. There are two types of testing

– Negative testing 

– Positive testing

 

In negative testing we will give negative data in input and we check any errors occurs.

 

In positive testing we will give positive data in input for checking errors.

 

Read also; Role of SAP Consultant In Testing

 

8) How did you handle errors in Call Transaction?

 

We can create a internal table like ‘bsgmcgcoll’. All the messages will go to internal table. We can get errors in this internal table.

 

Below messages are go to internal table. when you run the call transaction.

– Message type

– Message id

– Message Number

– Variable1

– Variable2 

– Variable3

 

See also; Retreive Error Message from BDC

 

9) Among the Call Transaction and Session Method, which is faster?

 

Call transaction is faster then session method. But usually we use session method in real time…because we can transfer large amount of data from internal table to database and if any errors in a session. Process will not complete until session get correct.

 

10) What are the difference between Interactive and

 

Drill Down Reports?

 

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

 

Drill down report is nothing but interactive report…drilldown means above paragraph only.

 

11) How to pass the variables to forms?

 

12) What is the table, which contain the details of all the name of the programs and forms?

 

Table contains vertical and horizontal lines. We can store the data in table as blocks. We can scroll depends upon your wish. And these all are stored in database (data dictionary).

 

Which contain the details of all the name of the programs and forms? (I don’t know).

 

13) How did you test the form you developed? How did you taken print?

 

14) What are Standard Texts?

 

16) What is the difference between Clustered Tables and Pooled Tables?

 

A pooled table is used to combine several logical tables in the ABAP/4 dictionary. Pooled tables are logical tables that must be assigned to a table pool when they are defined.

 

Cluster table are logical tables that must be assigned to a table cluster when they are defined.

 

Cluster table can be used to store control data they can also used to store temporary data or text such as documentation.

 

17) What is pf-status?

 

Pf status is used in interactive report for enhancing the functionality. If we go to se41, we can get menus, items and different function keys, which we are using for secondary list in interactive report.

 

18) Among “Move” and “Move Corresponding”, which is efficient one?

 

I guess, ‘move corresponding’ is very efficient then ‘move’ statement. Because usually we use this stamtent for internal table fields only…so if we give move corresponding. Those fields only moving to other place (what ever you want).

 

19) What are the output type and Tcodes?

 

20) Where we use Chain and End chain?

 

21) Do you use select statement in loop end loop, how will be the performance? To improve the performance?

 

22) In select-options, how to get the default values as current month first date and last date by default? 

      Eg: 1/12/2004 and 31/12/2004

 

Prem Kumar

 

Q: How to compare the 2 tables between the 2 systems?

Ans: Which is using the transaction code is ‘oy19’.

 

Q. What is the use of pick statement do?

Ans: The pick statement is used to it will capture the user action.

        ex: if sy-ucomm = ‘x’.

       This statement is used to capture the user action.

I have a MySQL table which is as follows:
id | name        | parent_id
19 | category1   | 0
20 | category2   | 19
21 | category3   | 20
22 | category4   | 21
Here id 19 is the parent entry. And id with value 20, 21 and 22 are its children. So it will look like
19
|
20
|
21
|
22
Now I need to select all the childs of the given parent. ie If I input 19 the output should be
(20, ‘category2’, 19),
(21, ‘category3’, 20),
(22, ‘category4’, 21),
and for the input 30, output should be
(31, ‘category6’, 30),
(32, ‘category7’, 31),
So here is the create table query
Create table query:
CREATE TABLE `category` (
 `category_id` int(11) NOT NULL AUTO_INCREMENT,
 `name` varchar(20) NOT NULL,
 `parent` int(11) DEFAULT NULL,
 PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1
Sample data:
INSERT INTO `category` (`category_id`, `name`, `parent`) VALUES
(19, ‘category1’, 0),
(20, ‘category2’, 19),
(21, ‘category3’, 20),
(22, ‘category4’, 21),
(30, ‘category5’, 0),
(31, ‘category6’, 30),
(32, ‘category7’, 31);
The solution:
SELECT @pv := category_id AS category_id, name, parent
FROM category
JOIN (
SELECT @pv :=19
)tmp
WHERE parent = @pv ;
Javascript is an extremely flexible language. It allow variable declaration anywhere. Hoisting is the JavaScript interpreter’s action of moving all variable and function declarations to the top of the current scope. However, only the actual declarations are hoisted. Any assignments are left where they are.
Step 1: Consider following immediately-invoked function expression (IIFE)
(function() {
  var a = 1;
  var b = 2;
  var c = 3;
  alert(a + ” ” + b + ” ” + c);
})();
It displays the string “1 2 3”.
Step 2: Now what happen if we move the alert one step higher.
(function() {
  var a = 1;
  var b = 2;
  alert(a + ” ” + b + ” ” + c);
  var c = 3;
})();
This is a valid JavaScript code, which does not generate any exception.It will alert “1 2 undefined“.
Step 3:
(function() {
  var a = 1;
  var b = 2;
  alert(a + ” ” + b + ” ” + c);
  var c = 3;
})();
Step 4: Now remove the variable declaration var c = 3 and our code will look like
(function() {
  var a = 1;
  var b = 2;
  alert(a + ” ” + b + ” ” + c);
})();
But this will make a ReferenceError about the variable c is not defined.
So what is the difference between Step 3 and Step 4? This is due to Javascript behaviour known as “hoisting”. Now what is hoisting?
Hoisting is the JavaScript interpreter’s action of moving all variable and function declarations to the top of the current scope. However, only the actual declarations are hoisted. Any assignments are left where they are. So our IIFE will look like
(function() {
  var a;
  var b;
  var c;
  a = 1;
  b = 2;
  c = 3;
  alert(a + ” ” + b + ” ” + c);
})();
So our Step 3 code will look like
(function() {
  var a;
  var b;
  var c;
  a = 1;
  b = 2;
  alert(a + ” ” + b + ” ” + c);
  c = 3;
})();
The interesting points to remember here are
1. JavaScript does not have block statement scope; rather, it will be local to the code that the block resides within.
2. Javascript’s declaration of variables in a function scope, meaning that variables declared in a function are available anywhere in that function, even before they are assigned a value (value will be undefined if not assigned and no ReferenceError).
No another interesting problem related to hoisting. What will be the value alerted in the following code?
var myvar = 1;
function foo() {
    myvar = 10;
    return;
    function myvar() {}
}
foo();
alert(myvar);
In the first statement global variable myvar is set to 1
Then the function foo() is called
Function myvar() {} is hoisted and creates a local variable myvar that masks the global myvar.
The local variable myvar is set to 10 (overwriting the function a) in the function foo.
As the function foo() return it will alert the global variable myvar which is still 1. Remember the local variable myvar inside the function foo() will lost the scope as the function return.
Here the important point to note is that  within the body of a function, a local variable takes precedence over a global variable with the same name. If you declare a local variable or function parameter with the same name as a global variable, you effectively hide the global variable.
Block-level scope: When control enters a block, such as the if statement, new variables can be declared within that scope, without affecting the outer scope.  Example C
Function-level scope:  Blocks, do not create a new scope. Only functions create a new scope.
Example Javascript
From the documentation ECMAScript Standard
If the variable statement occurs inside a FunctionDeclaration, the variables are defined with function-local scope in that function, as described in section 10.1.3. Otherwise, they are defined with global scope (that is, they are created as members of the global object, as described in section 10.1.3) using property attributes { DontDelete }. Variables are created when the execution scope is entered. A Block does not define a new execution scope. Only Program and FunctionDeclaration produce a new scope. Variables are initialised to undefined when created. A variable with an Initialiser is assigned the value of its AssignmentExpression when the VariableStatement is executed, not when the variable is created.

Automatic garbage collection is the process of looking at heap memory, identifying which objects are in use and which are not, and deleting the unused objects. All Garbage Collector involves in making sure the heap does not run out of space.  The object is not reachable when no live thread can access it. Objects are created on heap in Java  irrespective of their scope. Class variables or static members are created in method area of Java memory space and both heap and method area is shared between different thread.

You can make an object garbage collected by :

  • Explicitly assigning a reference to null

  • Reassigning the reference to another object will cause older object to be eligible for Garbage Collector.

  • After the method return the local variables in that method will be automatically eligible for Garbage Collector

  • Even if objects have valid references, but still there is no way to reach them, they will be Garbage Collector’ed.

Garbage collection relieves java programmer from memory management. Java Virtual Machine throws OutOfMemoryError or java.lang.OutOfMemoryError when there is no memory space for creating new object in heap. Garbage Collection in Java is carried by a daemon thread called Garbage Collector.You can invoke Garbage Collector manually using the methods Runtime.getRuntime().gc() or System.gc(), but there is no guarantee that Garbage Collector will happen. The code written in finalize method are executed before the object is Garbage Collectoed and gives an opportunity to perform any sort of cleanup required.. The finalize() method is defined in Object.

The Serial GC: With the serial collector, both minor and major garbage collections are done serially.  it uses a mark-compact collection method.This method moves older memory to the beginning of the heap so that new memory allocations are made into a single continuous chunk of memory at the end of the heap. This compacting of memory makes it faster to allocate new chunks of memory to the heap.

The Parallel GC: The parallel garbage collector uses multiple threads to perform the young generation garbage collection.

NodeJS module.exports

Posted: August 17, 2013 in Javascript
Tags:

module.exports is the fundamental part of node.js. In Node, variables, functions, classes and class members are only visible in the same file. module.exports is the object that’s actually returned as the result of a require call.

helloworld.js

var hello = ‘hello ‘;

var print = function(name) {

return hello + name;

};

You cannot access the hello variable or hello function from outside the file. This has nothing to do with the use of the var keyword. Rather, the fundamental Node building block is called a module which maps directly to a file. So we could say that the above file corresponds to a module named “helloworld” and everything within that module is private. “require” is used to load a module, which is why its return value is typically assigned to a variable:

 var helloworld = require(‘./helloworld’);

Note we are not using the file extension within the require. To expose the variables, functions, classes and class members we use module.exports.

var hello = ‘hello ‘;

var print = function(name) {

return hello + name;

};

module.exports.hello = hello;

module.exports.print = print;

So that we can call the function and the variable from other file using the below code

var helloworld = require(‘./helloworld’);

helloworld.hello = “welcome”;

console.log(helloworld.print());

There’s another way to expose things in a module:

var print = function(hello, name) {

this.hello = hello;

this.name = name;

};

module.exports = print;

Here we are exporting print directly, without any indirection. The difference between:

module.exports.print = print;

//vs

module.exports = print;

is all about how it’s used:

var helloworld = require(‘./helloworld’);

var hello = new helloworld.print();

//vs

var hello = new helloworld();

What happens when you directly export a function:

var print = function(hello, name) {

this.hello = hello;

this.name = name;

};

module.exports = print;

When you require the above file, the returned value is the actual function. This means that you can do:

require(‘./helloworld’)(‘hello’,’myname’);

Which is really just a condensed version of:

var helloworld = require(‘./helloworld’)

helloworld(‘hello’,’myname’);

require is a plain object whose properties may be accessed using the variable. If you overwrite exports then it will no longer refer to module.exports. So if you wish to assign a new object (or a function reference) to exports then you should also assign that new object to module.exports. The name assigned to exports object can be different from the internal function name.

var internalFunction = function() { … };

exports.aliasname = internalFunction;

Then to call the function

var m = require(‘mymodule’);

m.aliasname(); // invokes module.internalFunction

Unified Modeling Language

Posted: August 16, 2013 in Other
Tags:

A class is a description of a quantity of objects that are typified by the same characteristics and the same behaviors.

An object has and Identity, a status, and a behavior. Identity is an attribute that distinguish each object from all other objects of its class. Object is a concrete- uniquely identifiable instance of a class.

 UML Diagram Types:-

  • Class Diagram:- Show the classes and the relationships between them. Ie a static view of a model.

  • Behavior Diagram:- Shows the sequence in which the objects relate to each other.

  • Component Diagram:- Shows the organization and dependencies of components.

Static relationships:-

Association:- An association describes a semantic relationship between classes. The specific relationship between objects in these classes is known as an object link. Object liks are the instances of associations.

Recursive association:- An association can be recursive. Recursive associations are used to link two different objects in one class.

Roles of association:-

  • Cardinality:- Cardinality shows how many instances can participate in the relationship. It is depended on the concreate siuation that is being modeled.

  • Multiplicity:- Multiplicity is the number of participating objects in the other class.

 Aggregation and Composition:-

These are speciatlization of association. They show that an object consists of other objects or contains other objects. The relationship can be described with “consists of” or “is part of”. Aggregation and Composition are displayed as aline between two classes that is labled with a small rhombus. Composistion is a specialization of aggregation. It meads that the contained object cannot exist without the aggregate. Therefore the cardinality of the aggregate can only be exactly one. The parts are created either with, or after the aggregate, and they are distroyed either with or before the aggregate. Composistion is denoted by a filled-in rhombus.

 Generalization and Specialization:- Generalization and Specialization are always bidirectional. Generalization can be described with the words “is a special”. They are indicated by a triangular arrow.

 Object diagram:-

An Object diagram is a snapshot taken during program execution, which describes the instances of the calsses and the relationships between them. It is a variant of the class diagram and is only useful for representing a complex class diagram.

 Sequence diagram:-

It display certain processes or situations. It focus on the time sequence of the behavior:

  • Creating and deleting objects

  • Exchanging messages between objects

An ‘X’ marks the end of the lifeline. The control focus shows the objects active period:

  • An object is active when actions are executed

  • An object is indirectly active if it is waiting for a subordinate procedure to end

Delegation Principle in a Sequence Diagram:-

In delegation, two objects are involved in handling a request. The recipient of the request passes on the execution of the request to a delegate.

Authorization

Posted: July 27, 2013 in Magento
Tags: ,

Critical data and part of functional scope of SAP system must be protected from unauthorized access. Using Authorization check in program user only access for which he or she is authorized.
Authorization object can be defined with in object classes
While defining authorization object , specify appropriate fields with out values. Then create actual authorization by subsiquently assigning values to these fields. This authorization can be integrated into Required user master records by means of authorization profile.
Several different authorization can be created for an authorization object.
authorization check principle:-
At runtime use AUTHORITY-CHECK statement to check whether the actual user has the authorization required for executing the function in his or her user master record. If SY-SUBRC=0 The user permitted.Defining and implementing authorization check are responsibilty of developer.
authorization and profile definition and design of the user master records are responsibility of admin.
Creation:-
Define the structure of authorization concept. An object usually consists of the ACTVT(activity) field and one other field , which specify the data type to be protected. The value of these authorization fields specify what the user is authorized to do.
SU20 to create fields
SU21 create object class and then create fields
If object contains the ACTVT field, then maintain permitted activities with reference to the object.
Table TACT contains all possible activity codes including their description.
Table TACTZ contains the activity codes that are permitted for spe ific objects.
If you do not want to carry out a check for a field, either do not enter it in AUTHORITY-CHECK statement or enter DUMMY as the field value
AUTHORITY-CHECK OBJECT ‘S_CARRID’
ID ‘CARRID’ DUMMY
ID ‘ACTVT’ FIELD ’02’.

Workflow

Posted: July 22, 2013 in Magento
Tags: ,

A workflow model breaks a process down to its individual steps, which are then assigned to various people, or rather , to their roles with in the company.
Increase speed and transparency of business processes
A workflow event creates a link between an activity in the SAP system and the people involved and the program steps that belongs to this process.
Unlimited number of workflow steps can be assigned to a workflow event and complex workflow sequences can be assigned to a process
Application areas:-
Automating the distribution of information.