Jan 22, 2015

SAP ABAP FAQs- Part 1

ABAP FAQ

Question 1: What is the difference between User Exit and Function Exit?

 

User Exit

Customer Exit

User exit is implemented in the form of a Subroutine i.e. PERFORM xxx.
Example: INCLUDE MVF5AFZZ à
PERFORM userexit_save_document_prepare.  

A customer exit can be implemented as:

·         Function exit

·         Screen Exit

·         Menu Exit

·         Field Exit

Example: CALL Customer function ‘xxx’
INCLUDE xxx.
You modify this include.

In case of a PERFORM, you have access to almost all the data. So you have better control, but more risk of making the system unstable.

You have access only to the importing, exporting, changing and tables parameter of the Function Module. So you have limited access to data.

User exit is considered a modification and not an enhancement.

A customer exit is considered an enhancement.

You need Access Key for User Exit.

You do not need access key.

Changes are lost in case of an upgrade.

Changes are upgrade compatible.

User exit is the earliest form of change option offered by SAP.

Customer exits came later and they overcome the shortcomings of User Exit.

No such thing is required here.

To activate a function exit, you need to create a project in SMOD and activate the project.


Question 2: What is the difference between RFC and BAPI? 

BAPI

RFC

Just as Google offers Image/Chart/Map APIs OR Facebook offers APIs for Comment/Like, SAP offers APIs in the form of BAPIs. BAPI is a library of function modules released by SAP to the public so that they can interface with SAP.

RFC is nothing but a remote enabled function module. So if there is a Function Module in SAP system 1 on server X , it can be called from a SAP system 2 residing on server Y.

There is a Business Object Associated with a BAPI. So a BAPI has an Interface, Key Field, Attributes, Methods, and Events.

No Business Object is associated with a RFC.

Outside world (JAVA, VB, .Net or any Non SAP system) can connect to SAP using a BAPI.

Non–SAP world cannot connect to SAP using RFC.

Error or Success messages are returned in a RETURN table.

RFC does not have a return table.

 



Question 3: 
What is the difference between SAPSCRIPT and SMARTFORM? 

SAPSCRIPT

SMARTFORM

SAPSCRIPT is client dependent.

SMARTFORM is client independent.

SAPSCRIPT does not generate any Function module.

SMARTFORM generates a Function Module when activated.

Main Window is must.

You can create a SMARTFORM without a Main Window.

SAPSCRIPT can be converted to SMARTFORMS. Use Program SF_MIGRATE.

SMARTFORMS cannot be converted to SCRIPT.

Only one Page format is possible

Multiple page formats are possible.

Such thing is not possible in SCRIPT.

You can create multiple copies of a SMARTFORM using the Copies Window.

PROTECT … ENDPROTECT command is used for Page protection.

The Protect Checkbox can be ticked for Page Protection.


The way SMARTFORM is developed and the way in which SCRIPT is developed is entirely different. Not listing down those here. That would be too muc

Question 4: 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”.


Question 5: What is the difference between BDC and BAPI?


BAPI

BDC

BAPI is faster than BDC.

BDC is relatively slower than BAPI.

BAPI directly updates database.

BDC goes through all the screens as a normal user would do and hence it is slower.

No such processing options are available in BAPI.

Background and Foreground processing options are available for BDC.

BAPI would generally used for small data uploads.

BDCs would be preferred for large volumes of data upload since background processing option is available.

For processing errors, the Return Parameters for BAPI should be used.This parameter returns exception messages or success messages to the calling program.

Errors can be processed in SM35 for session method and in the batch input program for Call Transaction method.



Question 6: What is the difference between macro and subroutine?


Macro

Subroutine

Macro can be called only in the program it is defined.

Subroutine can be called from other programs also.

Macro can have maximum 9 parameters.

Can have any number of parameters.

Macro can be called only after its definition.

This is not true for Subroutine.

A macro is defined inside:
DEFINE …
….
END-OF-DEFINITION.

Subroutine is defined inside:
FORM …..
…..
ENDFORM.

Macro is used when same thing is to be done in a program a number of times.

Subroutine is used for modularization.

 

Question 7: What is the difference between SAP memory and ABAP memory?

 

SAP Memory

ABAP Memory

When you are using the SET/GET Parameter ID command, you are using the SAP Memory.

When you are using the EXPORT IMPORT Statements, you are using the ABAP Memory.

SAP Memory is User Specific.
What does this mean?àThe data stored in SAP memory can be accesses via any session from a terminal. 

ABAP Memory is User and Transaction Specific.What does this mean?à The data stored in ABAP memory can be accessed only in one session. If you are creating another session, you cannot use ABAP memory.


Question 8: What is the difference between AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT?


AT SELECTION-SCREEN is the PAI of the selection screen whereas
AT SELECTION-SCREEN OUTPUT is the PBO of the selection screen.


Question 9: What is the difference between SY-INDEX and SY-TABIX?
Remember it this way à TABIX = Table.
So when you are looping over an internal table, you use SY-TABIX.
When you use DO … ENDDO / WHILE for looping, there is no table involved.
So you use SY-INDEX.

For READ statement, SY-INDEX is used.

Question 10: What is the difference between VIEW and a TABLE?

A table physically stores data.
A view does not store any data on its own. It can contain data from  tables and it just accesses/reads data from those tables.

Question 11:
 What is the difference between Customizing and Workbench request?  

A workbench request is client independent whereas a Customizing request is client dependent.
Changes to development objects such as Reports, Function Modules, Data Dictionary objects etc. fall under Workbench requests.

Changes in SPRO / IMG that define system behavior fall under customizing requests.
An example would be ‘defining number ranges’ in SPRO.

In short, generally a developer would end up creating a Workbench request and a Functional Consultant would create a Customizing request.

 

 

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhu23hwde57xd9T8WltOJdHR8u0DwOPhbgfWp-PZNsQ2B1diJYUBte82AAFITjbdOxbwdZyhEjk660qC76MQ7LtnMeB9N5uIPHWWGVycPow6ENEkDea1Adc7XvP9aeGvtMwMqID6y6HGvB/s1600/cts.png

 

Question 12: What is the difference between PASS BY VALUE and PASS BY REFERENCE?

These concepts are generally used for Function modules or Subroutines etc. and their meaning can be taken literally.

Say we are passing a variable lv_var:
CALL FUNCTION 'DEMO_FM'
   EXPORTING
     VAR  = lv_var.

When we PASS lv_var by VALUE , the actual value of lv_var is copied into VAR.
When we PASS lv_var by REFERENCE , the reference or the memory address of lv_var is passed to the Function module. So VAR and lv_var will refer to the same memory address and have the same value. 


Question 13: What is the difference between Master data and Transaction data?

 

Master data is data that doesn’t change often and is always needed in the same way by business.
Ex: One time activities like creating Company Codes, Materials, Vendors, Customers etc.

Transaction data keeps on changing and deals with day to day activities carried out in business.
Transactions done by or with Customers, Vendors, and Materials etc. generate Transaction Data. So data related to Sales, Purchases, Deliveries, Invoices etc. represent transaction data

Some important transactions here for Master Data:
Material: MM01 MM02 MM03
Vendor: XK01 , XK02 , XK03
Customer: Xd01 , XD02 , XD03

Some Important transactions for Transaction data:
Purchase Order: ME21n , ME22n , ME23n
Sales Order: VA01 , VA02 , VA03
Goods Receipt: MIGO
Invoices: MIRO


Question 14: What will you use SELECT SINGLE or SELECT UPTO 1 ROWS ?

There is great confusion over this in the SAP arena.
If you Google, you will see lots of results that will say SELECT SINGLE is faster and efficient than SELECT UPTO 1 ROWS.
But that is 100% incorrect.

SELECT UPTO 1 ROWS is faster than SELECT SINGLE.
If for a WHERE condition, only one record is present in DB, then both are more or less same.
However, If for a WHERE condition multiple records are present in DB, SELECT UPTO 1 ROWS will perform better than SELECT SINGLE. 

 

Question 15: What is the difference between .Include Structure and .Append structure? 

 

Let’s say you want to use the Structure X in your table Y.
With .Include X, you can include this structure in multiple tables.
With .Append X, you specify that structure X has been used in table Y and that this cannot be used in any other table now.  So you restrict structure X only to Table Y.

 

Question 16: Can you describe the events in ABAP?


CLASSICAL EVENTS

  • Initalization
  • At selection-screen output
  • At seelction-screen on field
  • At selection-screen on block
  • At selection-screen
  • Start-of-selection
  • End-of-selection

INTERACTIVE EVENTS

  • At line-selection
  • At user-command
  • At pfnn
  • Top-of-page during line selection

LIST EVENTS

  • Top-of-page
  • End-of-page

CONTROL BREAK EVENTS

  • At first
  • At last
  • At new
  • At end of
  • On change of

INITIALIZATION

Before the standard selection screen is displayed

 

AT SELECTION-SCREEN

After user input on a selection screen has been processed, but while the selection screen is still active

 

START-OF-SELECTION

After the standard selection screen has been processed, before data is read from the logical database

 

GET node

After the logical database has read a data record from the node node

 

GET node LATE

After all of the nodes of the logical database have been processed that are hierarchically subordinate to the node node in the structure of the logical database

 

END-OF-SELECTION

After all data has been read by the logical database

 

List processor events:

TOP-OF-PAGE

In list processing when a new page starts

 

END-OF-PAGE

In list processing when a page ends

 

AT LINE-SELECTION

When the user triggers the predefined function code PICK

 

AT PFnn

When the user triggers the predefined function code PFnn

 

AT USER-COMMAND

 

When the user triggers a function code defined in the program


Question 17:
What events do you know in Module Pool Programming?


PBO: you know this . If not you should know this . That's basic.
PAI: You know this. If not you should know this . That's basic.
POV: Process on Value request … i.e. when you press F4.
POH: Process on help request … i.e. when you press F1.

 

Question 18: Can you show multiple ALVs on a Single Screen?


Yes, there are multiple ways of doing this:

·         If you are using OOALV, you can create multiple custom containers
   (cl_gui_custom_container)
 & put an ALV control (cl_gui_alv_grid) in each of those.

·         You can even use a Splitter container control and place multiple ALVs in each of
    the split container.

·         If you are using Normal ALV, You can use the following FMS:

1.      REUSE_ALV_BLOCK_LIST_INIT

2.      REUSE_ALV_BLOCK_LIST_APPEND

3.      REUSE_ALV_BLOCK_LIST_DISPLAY

 

Question 19: A system has two clients 100 and 500 on the same application server. If you make changes to a SAPSCRIPT on client 100, will the changes be available in client 500?

No.  SAPSCRIPT is client dependent. You will have to transport changes from client 100 to client 500. However, for SMARTFORMS, Changes will be made both for client 100 and client 500.

 

Question 20: There are 1000’s of IDOCs in your system and say you no longer need some of them? How will you get rid of those IDOCs?

One way is to archive the IDOCs using transaction SARA.
But what the interviewer was expecting was ‘How do you change IDoc Status’?
There are different ways of doing this:

A) Use FM IDOC_STATUS_WRITE_TO_DATABASE

B) USE FMs:
     EDI_DOCUMENT_OPEN_FOR_PROCESS and
     EDI_DOCUMENT_CLOSE_PROCESS

Question 21: What is the difference between CHAIN … ENDCHAIN and FIELD commands in Module Pool?

If you want to validate a single field in Module Pool, you use the FIELD Command.
On error, this single filed is kept open for input.

If you however want to validate multiple fields, you can use the CHAIN … ENDCHAIN command. You specify multiple fields between CHAIN and ENDCHAIN.
On error, all fields between CHAIN …… ENDCHAIN are kept open for input.

Question 22: What are the types of Function Modules? What is an UPDATE function module?

There are three types of Function Modules: Normal , RFC , UPDATE.

 

 

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAsXYegKqf4-xb55huiflfLS_y8G6Pfxp5p-Wy1IpPitprh0mE5jOIHiIZgs-mAHOEwizdzIvPPNzZGEMAq6q9YuI7CawMOEtEt4FDTw_8dE95Vm6fwDG_mdvztySR0XM1IdgcMWGFsyWk/s1600/FMS.png

 

 

The aim of the Update function module is either to COMMIT all changes to database at once or to ROLLBACK all the changes. By definition, an update function module is used to bundle all the updates in your system in one LUW (logical unit of work).

This FM is called whenever COMMIT WORK statement is encountered in the calling program and the way you call it is CALL FUNCTION XXX IN UPDATE TASK.

Have a look at FM EDI_DOCUMENT_CLOSE_PROCESS_UPD and do a where used.
This FM is used as Update FM in case you make changes to IDoc contents/status via your program.

Question 23: How is the table sorted when you do not specify field name and Ascending or Descending? On what criteria will the table be sorted? Do internal table have keys?

Yes, internal table have keys.
The default key is made up of the non-numeric fields of the table line in the order in which they occur.


Question 24: Explain what is a foreign key relationship? Explain this with the help of an example.

Let’s discuss about tables EKKO (PO header) and EKPO (PO line item).
Can you have an entry in table EKPO without having an entry in table EKKO?
In other words can you have PO line items without the PO header?

How does this happen? The answer is foreign key relationship.
So foreign keys come into picture when you define relationship between two tables.

 

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhypS_T2P2qhQNt74qdqlAZGlbKD8rwj6kDjvGAvH5w508_DEbvNVr9ETVJ2IWWlv9yZIIt16VlJD6_GyiIRpoXHKFO1jc14WxvmtjhYMPYvpFe5YTNbRveHGb3FuSSXsNsAq_OC54UtCbJ/s1600/table.png


Foreign keys are defined at field level.
Check the foreign key relation for field EBELN of table EKPO.
The check table is EKKO. This just means that whenever an entry is made in EKPO, it is checked whether the entered value for EBELN already exists in EKKO. If not, entry cannot be made to EKPO table.
  

Question 25 : What is the difference between a value table and a check table?

Check table is maintained when you define foreign key relationships.
For Check table, read question above.


Value table is defined and maintained at a domain level.
At a domain level, you can mention allowed values in the form of:
1) Single values
2) Ranges
3) Value tableFor example, have a look at domain SHKZG. Only allowed values are S and H for Debit/Credit indicator. Whenever and wherever you use this domain, the system will force you to use only these two values: S and H.

Another example is domain MATNR. For this domain the value table is MARA.
So whenever and wherever, you use this domain the system will force you to use values for MATNR in table MARA.

 

 

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTOevdseRtW64irEi2mO1INIGqINHFJu-Usvh88LqmVSd8g3zPyvLrSKRvI9MP-17GgHw5ufwHTGY-zEvtyaWl1_uk9tAsam-vP_oYlhk0dmkqSka05xXe8jlTjZM0HkcRqVmTQYfIi_LD/s1600/tab2.png

 

Question 26: How do you find BAPI?

Approach1:
You can go to Transaction BAPI and then search for your desired object.
Say you want to find a BAPI for creating users in the system, in such case you can search for the ‘User’ and find the relevant BAPIs.

Approach2:
Another way is to find a Business Object. Say you want to find a BAPI for creating Material in SAP and you know the BO for Material is BUS1001006. You can go to Transaction SWO1 and enter the BO BUS1001006 in the BOR. Then have a look at the methods for this BO.

 

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdrme9-zlsSXqFQLQ3MGvXtbIEGYqaAcs8alOP30xealUH6uWWmS1i7ekKDb5oyAvw8-g5qWue-hnm1fB9r4BC4fcQydIVpU-lfuJ-p_y9h_1_RgEyKcxL37cO4EzPo_DGr9Gxxx0U0-7F/s1600/bapi.png

 

 

 

Question 27: How do you find BADI?
Approach1: 

Go to Class CL_EXITHANDLER in SE24 ---> Put a breakpoint in method GET_INSTANCE.Now go and execute your transaction code for which you want to find BADI.
You will find the BADI in the changing parameter exit_name:

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Y1AaziO_ovhMre9S03lustZchHwfEFjSFOchK9ASNfGpMOAHKRw02mPLpW-0SeHPZTHRiABe1_e6eATIp7Jk298lgw9rX8_B3A8rWjeD8OTN31LvKhdF4kWHlDcCcBzBcWkiYYs2I7_m/s1600/badi.png

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfWIpmljoTCbvAD5Rbln-GSViYgedAyWd8BzODKUPMUJv3lGwpwOJQYbZN8I88J2l0Rcr-lrb2s9nlHYIN43gfTuyrsD60mgEGmGv1Ip950bYsm4PVfyoea26upN_T46J01bz55PBTpM5Y/s1600/badi2.png
Approach 2:
Go to Tcode SE84 à Enhancements àBADIs à Definitions.
Find the package for the Tcode for which you are finding the BADI.

Enter it as shown and hit execute:https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8uT7qt1HaSK5Sf9bB402U3cbMU7rYFlP6NSRPpsnc5wIhBEzpOm9hw-_JYigEvj8Bjj3IXw0f51txTTflJR7Q2jhpjjNbH2jqrbr06nLghspyQOfcmtp73YIOfAm4UGbxWLjp0Gb-KuqJ/s1600/badi1.png

 

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfWIpmljoTCbvAD5Rbln-GSViYgedAyWd8BzODKUPMUJv3lGwpwOJQYbZN8I88J2l0Rcr-lrb2s9nlHYIN43gfTuyrsD60mgEGmGv1Ip950bYsm4PVfyoea26upN_T46J01bz55PBTpM5Y/s1600/badi2.png

 

Question 28:  Can you have a Smartform without a main window?

Yes, you can create a Smartform without a Main Window. But there is no need to do anything of such sort.

Whenever you create a Smartform, a main window is created by default. I can't think of a situation , where you will have a situation in which it is mandatory for you to remove the Main Window. But still I have seen this question in ABAP interviews. So I have put it here.

 

Question 29: 

How do you find the name of the Function Module for a Smartform?

When is this function module created?

 

The function module for Smartform is created when the Smartform is activated.

You can find the name of the Function Module for a Smartform by going to

Environment --> Function Module Name.

 

Question 30: What is a Final Window?

Final Window is called after all the other windows are called in a Smartform.

 

Question 31:

What is the difference in a Table and a Template in Smartform?
A Template has fixed number of Rows and Columns whereas a Table can have variable rows and columns i.e. you can have a internal table with contents associated to a Table element but not to a Template. 

Simply A table = Template in Loop 

Table is a dynamic and template is a static

 

Question 32:

You have created a Smartform in DEV environment. Then you migrated the Smartform to PROD environment. Will the name of the function module be same in DEV and PROD?

Once you transport the Smartform from DEV to PROD environment, a new function module name for the Smartform in generated in the PROD environment. For a particular Smartform , generated function module names are different in different systems.One can get the name of the function module for Smartform by passing the Smartform name to FM SSF_FUNCTION_MODULE_NAME.


Hence in the driver program for Smartform, it is common practice to use FM SSF_FUNCTION_MODULE_NAME and then calling the Smartform Function Module.


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'Z_SMARTFORM'

IMPORTING

fm_name = lv_fm_name


CALL FUNCTION lv_fm_name

 

Question 33:  How do you convert a Smartform Output to PDF output?

>>>>>>>

 

Question 34:  How do you achieve Bar Code printing in Smartforms?


Step1:
 Use SE73 i.e. SAP-Script Font Maintenance and create a Bar code say ZDEMO.

Step 2: For Smartform, create a character format C1 and use the recently created Barcode ZDEMO.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYfz9R08TNA7HuscDykL9gAlZVYreARB0vv3zo1B_VOCXpt8W9dGTwJ694AQe-XAPuFnKNiPGuPmEuzrn_WsUzIBqMiI0egTCuB-Ajgqh2BIi2Z28MbDLV61LDQZspOt55wurrmVyhk79U/s1600/bar.png


It can be finally used to print Barcode as:

 

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix3F_9LIcQ3fMmZde3WQjYFjTJ8GLAfCW3mK1j_oisC-olAzfcYp_oZsumhApCKbZPk_mJ64Icrk5-1O9aaMTUvXFruhx7udLG1VjxIjjWwisgjl2jtrvSjtUBLzdsWL0YQDAsJ8k1HsNn/s1600/bar1.png

Ref- http://www.saptechnical.com/Tutorials/Smartforms/Barcode/Index.htm

        http://wiki.scn.sap.com/wiki/display/Snippets/Step-by-step+New+Barcode+Technology+for+Smart+Forms

Question 35:

How do you add a Watermark Or a Background Image for Smartforms ?

 

If you go to the properties of a page in Smartform, you will find a tab for Background Image.

 

Specify the source of the image you need here and it can be used as background image / Watermark in Smartforms.

Graphics can be maintained using T.code SE78.

 

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDCL8kXMUGc8afuka3RK49WGXjGYn3cB13DHnOehjCsiOGzBCYOVzFrSH-ZaOaf9NLGqXGvE8q54Z04rqLiHZkY42JxnyFVXiZo_lE99LjrsUqUB-uSqNzvsVApBkCeJhWfcFYMbC5VZSW/s1600/bc.png

Question 36:

How will you print on both sided of a Smartform?

At the Page level in Smartforms, you can find something called as Print Mode.

Set the Print mode to duplex to print on both sides of the Smartform.

 

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMEcBRSbITU-bSlF4YmbuJH2XglxA5F6hmE6yVn2fbeH0Wgjr0ULTj__Y99fvpwH6rVnRGYQW2L7hBjHofdpi1UwLyKyZQ0VIDmUvnxO66DjkyBdvJyoQtWqYj9ZYVLdbY__wW-pOb5bha/s1600/bothside.png

 

Question 37: How do you achieve Page Protection in Smartform ?

 

While one can use the PROTECT ..... ENDPROTECT command for SAP-Scripts, for Smartforms the Page-Protection checkbox can be used to ensure page protection:

 

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg77eruE2-YWf94UDSUbU-lyUzPH1slauOwbK1UQBHcKf97JA9ek6OediJZC-qsMNGFDxTAyYLgC-WK7RMBVAem5kQ6u8VGliPiXO1WTRQn-MTPsN9wJwScq99NP_bMQpkF1cCuX8txnoeh/s1600/page.png

Note:  You have Page-protection property only for Text Elements in the Main Window.

 

Question 38:

Can you move a Smartform from one SAP system to another without using transports ?

Yes, this can be achieved using the Upload/Download feature for Smartforms.

One can download the Smartform from one system and save it as an XML file.

Once that is done, the XML file can be used to upload the Smartform in another system.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH4pQIKtqm6fXVfgmPipKihle_501JhxXbkO5fyMhqF0bxugyRArrklWFsrQOlk8f_gaVZzFdbKrYbXA4HklButNvEJj6Wv9qc0esMmHhF3uI_LB-K16fhZTZOJFeZ_Ex22zhR0fuSc9fF/s1600/upload.png


Question 39:  What is a Copies Window?

 

A copies window is similar to a secondary window, in that you can define multiple copies windows for one form with any size and positioning on the page, and a copies window cannot contain continuous text. A special feature of the copies window is the additional feature that you can decide to make processing depend on whether the

form is printed as an original or as a copy (if you are printing more than 1

copy). It is therefore possible to identify copies individually.

 

Question 40: How do you pass data to Smartforms from the driver program?

 

Question 41: How do you Debug Smartforms ?


Question 42:  How would you go about printing a logo in a Smartform?


Question 43: How do you print address number in Smartforms ?


Question 44: How do you print Symbols and Icons in Smartforms?

Question 45: What are Basic Nodes and Auxiliary Nodes ?


Question 46: 
What is the use of Folder in Smartforms ?


1. It just use to combine diferrent node into logical groups.

2. It can be used for page protection by checking the page protect check box. So that every thing in folder will be printed on same page.


Question 47: What is the difference between Call Transaction Method and the Session method ?

 

Session Method

Call Transaction

Session method id generally used when the data volume is huge.

Call transaction method is when the data volume is   low

Session method is slow as compared to Call transaction.

Call Transaction method is relatively faster than Session method.

SAP Database is updated when you process the sessions. You need to process the sessions separately via SM35.

SAP Database is updated during the execution of the batch input program.

Errors are automatically handled during the processing of the batch input session.

Errors should be handled in the batch input program.

 

Question 48: How do you do BDC for a table control?
With other things as usual, there is a special trick that you have to use while doing BDC for table control.
You need to use the BDC OKCODE '=P+'.
Its the BCD_OKCODE for Page down that can be used for scrolling down in table control.

 

Question49: Is there any method apart from BDC for data upload to SAP?

Apart from BDC and LSMW, you can use BAPIs to upload data into SAP.
BAPIs should be preferred over BDCs, because they process data faster than BDC.

A BAPI is faster since it updates Database "directly". Whereas BDC call transaction and goes through the whole screen sequence as any user would do.

 

BAPI

BDC

BAPI is faster than BDC.

BDC is relatively slower than BAPI.

BAPI directly updates database.

BDC goes through all the screens as a normal user would do and hence it is slower.

No such processing options are available in BAPI.

Background and Foreground processing options are available for BDC.

BAPI would generally used for small data uploads.

BDCs would be preferred for large volumes of data upload since background processing option is available.

For processing errors, the Return Parameters for BAPI should be used.This parameter returns exception messages or success messages to the calling program.

Errors can be processed in SM35 for session method and in the batch input program for Call Transaction method.

 

Question 50: How do you process errors in Call Transaction method ?


Let's have a look at the syntax for CALL TRANSACTION method.
Sample code:

DATA: BEGIN OF G_T_MESSTAB OCCURS 0.

        INCLUDE STRUCTURE BDCMSGCOLL.

DATA: END OF G_T_MESSTAB.

 

CALL TRANSACTION 'MB11'

    USING G_T_BDCDATA

          MODE 'E'

          UPDATE 'S'

          MESSAGES INTO G_T_MESSTAB.

 

All the error messages will be trapped inside G_T_MESSTAB

 

Question 51: What is the use of program RSBDCSUB?
There are two ways to process the BDC sessions:
1) Go to SM35 ---> Choose session ---> hit process.
     Now See Question no. 10.
2) Use program RSBDCSUB.
     RSBDCSUB schedules the session to be processed in background.

Let's take an example to understand this.

The sessions are created at one point of time and processed at other point of time and this may create a problem: For example: a BDC program creates a session for updating 1500 customers in SAP. However , before this session is processed via SM35 , a user inserts 100 customers in the system manually. In this case , the session will have at least 100 errors when the session is processed from SM35.

One way to avoid this is to use the program "RSBDCSUB" in the batch input program itself so that the session is processed as soon as it is created.
RSBDCSUB schedules the session to be processed in background.

 

Question 52: What is the structure of the BDC table?

 

The BDCDATA consists of the following fields:

§  PROGRAM [CHAR 40] - Online program name.

§  DYNPRO [NUMC 4] - Screen number.

§  DYNBEGIN [CHAR 1] - Flag to indicate the start of a new screen.

§  FNAM [CHAR 132] - Field name of a screen field to be filled with data.

§  FVAL [CHAR 132] - The actual value to be filled into the specified screen field.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5s3VZBqPeQ42A9mXZ_G3lVe8eoNPA6iZ1NGrN8ltvUVRDtKNQbXUk0boH9bqrSWm3p7VBd3hHqS0geVB7wTW5RMfOZ3OdgnbII0OCnx7zwI_dyyC19HldJzNp05O_qVhhYzV4VQK_8SJx/s1600/bdc1.PNG

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK4o9i6hZzzD5kUDoC26Ljm8pttUAlKA6FZTCfnWvFWN-XOyxjCV9ULztrz84WgxhUu6EBCvbqk-GlaroUYCb6KJn1EwBQLO6EyxsvRwvf9SeiBTQ1wX8Y0XV8NGbAI1o-nW4BehtmX_Ou/s1600/bdc.png

 

Question 53: What is the difference between BDC_OKCODE and BDC_CURSOR?

BDC_OKCODE: is used for storing commands during the recording. like '/00' is the command for 'ENTER' Key.

BDC_CURSOR: contains the cursor position. it contians the field in which cursor will be.

Example code:

perform bdc_field       using 'BDC_CURSOR'

                                                'PROJ-PSPID'.

perform bdc_field       using 'BDC_OKCODE'

 

                                                '=BU'.

 

Question 54: What are the 3 methods that we use in sequence in a Batch input session method ?

 

1) BDC_OPEN_GROUP for opening the Batch Input Session

2) BDC_INSERT for inserting the transactional data into SAP

3) BDC_CLOSE_GROUP for closing the Batch Input Session

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkmfGggCdZjf8TEwBFot4w95gEJWteEMvsnlgRdp8Pn_CGVY8yDrQgcvGum7OF6LBaIBSLx3PojSrSjjj3SYAcd9F8imB887erNkIfg4UxKPrLoX02-xsqNIq80oEwjihPOexgB5B62EDU/s1600/bdc2.png


If there are n records , the BDC_INSERT method should be called n times.
BDC_OPEN_GROUP and BDC_CLOSE_GROUP are called only once.

General Information about a session is stored in table APQI.
Transaction data for a session is stored in table APQD.

Question 55: What is the difference between Synchronous and Asynchronous Update ?

In Synchronous update , the database is updated before the next transaction is taken for processing in a batch input.

In Asynchronous update , the system doesn't wait for updating the database before the next transaction is taken for processing in a batch input.

 

Question 56: What is the transaction for Recording BDC ?

 The Tcode is SHDB.

 

 

Question 57: How do you read files from the Application server ?

 

You can use the commands:
OPEN DATASET ---> opens the file(dataset) either in read /write mode.
READ DATASET ---> Read the file
CLOSE DATASET ---> Close the dataset once the date has been read .

Question 58: How do you read files from the presentation server ?

 

You can use the Function Modules :
GUI_UPLOAD --> To read data from file into an internal table
GUI_DOWNLOAD --> To write data from internal table to a file on presentation server


Question 59: What is difference between SE01, SE09, SE10?

 

SE01 - Transport Request Organizer

 

SE09 - Workbench Request Organizer

 

 

SE10 - Customizing Request Organizer

 

Question 60: Can we create a field without data element ?


Yes , it possible first you have to select predefined component in table.

 

In this condition no need to defined data element, directly you can defined domain for field 


Question 61: Describe data classes. 

 

Master data: It is the data which is seldom 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.


Question 62: What is the differences between structure and table in data dictionary in ABAP? 


Differences between table and structure. 


1. Table can store the data physically but a structure dose not store.

2. Table can have primary key but a structure dose not have.

3. Table can have the technical attribute but a structure dose not have.

  1. Structure doesn't contain technical attributes.
  2. Structure doesn't contain primary key.
  3. Structure doesn't stores underline database level.

Question 63: What is difference between dialog program and a report? 

 

Report is a executable program 

Dialog is a module pool program.It has to be executed via a transaction only. 

Dialog programming is used for customization of screens

 

Question 64: What are the different types of data dictionary objects? 

 

Data Dictionary Objects

 

* Tables

* Views

* Domain

* Data Element

* Type Groups

* Search Helps/Matchcode Objects

* Lock objects

* Structures

* Table Types

 

Question 65: How to eliminate duplicate entries in internal tables? 

 

SORT itab.

DELETE ADJACENT DUPLICATES FROM itab COMPARING ALL FIELDS. 

 

Question 66: What are the events in Table Maintenance?


Ref- http://wiki.scn.sap.com/wiki/x/2oiLCw

 

Question 67:  Maximun number of Main Window in SAP Script?

 

You can have multiple main windows in Sapscripts(Upto 99)


Each form must have one window of type MAIN. Such a window is called the main window of the form. For SAPscript forms, the main window has a central meaning:-

  •  It controls the page break.
  •  It contains the text body that may cover several pages.
  •  It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).

As soon as a window of type MAIN is full, SAPscript automatically triggers a page break and continues to output the remaining text in the main window of the subsequent page. Page windows of type MAIN have the same width throughout the form. The SAPscript composer thus avoids reformatting of the text after each page break.


If a page does not have a main window, the system implicitly processes all other windows of the page and continues with the subsequent page. This page must not call itself as subsequent page (recursive call), since this would produce an endless loop. In such a case, SAPscript terminates the output after three subsequent pages.


Question 68: Difference between .include and .append?


Include structure allows to add one or more structure into structure or table.Also placed positioning anywhere. Upto 6 include structure can be used in a table.

 

Append structure can be placed only at the end of a structure or table which also stops further insertion of fields.Only one append structure can be used.


Question 69: What is a Size Category in SAP Data Dictionary?

 

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

This is maintained in Technical setting of a table. The available sizes are :

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5lq1vvatortRpQw37yM8IIxpSZTnqWIH3ji6R7OKMaWBkDlA4D1Fm_apZtqCWPWzXvXvUpZu19PileloUatsa2V7X67dXrRyFKXHFwiXWwLz3-JVBKvhx5QCzgbxVkjdKF1RRKoWQxMZy/s1600/size.PNG

 

Question 70: What is the difference between VIEW and a TABLE in SAP?


A table physically stores data.


A view does not store any data on its own. It can contain data from multiple tables and it just accesses/reads data from those tables.


Question 71:What is a Data Class in SAP Data Dictionary?


Data class determined the physical area of table inside database, it is available under technical settings of table in Se11...Example: APPL0, APPL1 etc


Question 72: WHAT IS THE DIFFERENCE BETWEEN CHECK TABLE AND VALUE TABLE?


CHECK TABLE:

A foreign key links two tables T1 and T2 by assigning fields of table T1 to the primary key fields of table T2. Table T2 is then known as the check table of the foreign key.


VALUE TABLE:

Sometimes when you define a domain, you already know that all fields that use the domain will need to be checked against a particular table. You can store this information in the domain definition by specifying a value table.


If you try to define a foreign key for a field that points to this domain, the value table of the domain is proposed as the check table for the foreign key.


Question 73:What is the difference between Master data and Transaction data in SAP?


Master data is data that doesn’t change often and is always needed in the same way by business.

Ex: One time activities like creating Company Codes, Materials, Vendors, Customers etc. Transaction data keeps on changing and deals with day to day activities carried out in business.


Transactions done by or with Customers, Vendors, and Materials etc. generate Transaction Data. So data related to Sales, Purchases, Deliveries, Invoices etc. represent transaction data.


Some important transactions here for Master Data: Material: MM01 MM02 MM03.

Vendor: XK01 , XK02 , XK03 

Customer: Xd01 , XD02 , XD03. 

Some Important transactions for Transaction data: Purchase Order: ME21n , ME22n , ME23n.

Sales Order: VA01 , VA02 , VA03.

Goods Receipt: MIGO.

Invoices: MIRO.


Question 74:What is the difference between Structure and work area?


Structure and Work area have same functionality but structure is defined in data dictionary and can be used in both program level and data dictionary, work area can only be used in program.


Question 75: WHAT ARE THE DIFFERENCES BETWEEN CLUSTER TABLES AND POOLED TABLES?


Cluster tables:

Table type in the ABAP Dictionary.

The data of several cluster tables is stored together in a single table cluster in the database. A cluster table is thus known only in the ABAP Dictionary, not in the database.


Pooled tables:

Table type in the ABAP Dictionary.


The data of several pooled tables are stored together as a table pool in the database. Therefore, a pooled table is known in the ABAP Dictionary, but not in the database.


Question 76: What is a Match Code in SAP Data Dictionary?


Match code is a tool to help us to search for data records in the system. Match Codes are an efficient and user-friendly search aid where key of a record is unknown.

 

Question 77: What are the Data types of the ABAP/4 layer?


Possible ABAP/4 data types:

C: Character.

D: Date, format YYYYMMDD.

F: Floating-point number in DOUBLE PRECISION (8 bytes).

I: Integer.

N: Numerical character string of arbitrary length.

P: Amount of counter field (packed; implementation depends on h/w platform).

S: Time Stamp YYYYMMDDHHMMSS.

V: Character string of variable length, length is given in the first two bytes.

X: Hexadecimal (binary) storage.


Question 78:  What is a table pool in SAP?


Table pool (or pool) is used to combine several logical tables in the ABAP/4 Dictionary. The definition of a pool consists of at least two key fields and a long argument field (VARDATA).


Question 79: What are the difference between Table and Structure?


The major difference is, the Data Base tables hold the physical data where as Structures doesn't hold any data. Structure holds data in runtime.



Question 80:Types of ABAP reports in SAP?


ABAP report types are of 7 types. ABAP report types are available in report’s attributes screen.

  • Executable program.
  • Function group (containing function modules) 
  • Include 
  • Interface pool 
  • Class pool 
  • Module pool 
  • Subroutine pool 

Question 81: How many lists can be displayed through an interactive report?



Maximum 21 lists can be displayed (1 basic list 20 secondary lists).


Question 82: Select up to 1 row and select single difference ?


Select single fetches first matching record. If more than one matching records are there then only the first matching record will be considered other records will not be taken into account. 

 

Whereas select up to 1 rows will fetch all the matching records from the database. (Again it will assign only One Record to the internal table/Work area)


Question 83: Control break events in ABAP?


1. AT-FIRST: This is used when we want to execute the statements before records are processed.

2. AT-LAST: This event is used when we want to execute the statements after all records are processed.

3. AT-NEW: This event is used when we want to execute the statement before group of records are processed.

4. AT-END: This event is used when we want to execute the statements after processing of group of records.


Question 84: How to Debug RFC Function module?

 

SE38 –> Utilities –> Settings –> ABAP Editor –> Debugging Activate the external debugging and choose the New Debugger option in ABAP debugger. Go to the particular place in the code and put break point, pop will appear then choose the HTTP break point. If you are triggering the RFC from SAP portal make sure that both the user ID should be same If the users are different then provide the XI/Portal User ID in the users field.


Question 85: WHAT IS THE DIFFERENCE BETWEEN ABAP MEMORY AND SAP MEMORY?


ABAP MEMORY:

Area of memory assigned to a particular transaction and any modules called from there.

ABAP memory does not depend on the ABAP program that generates it during a transaction. This means that any object stored there can be read by any ABAP program during the same transaction.

In contrast to ABAP memory, which exists only for the life of one transaction, there is also global SAP memory, which extends beyond transaction limits.

SAP MEMORY:

Global, user-related memory that extends beyond transaction limits.

 

Access to the SAP memory is via SPA/GPA parameters.


Question 86:What is the difference between SY-TABIX and SY-INDEX?


SY-TABIX : Stores current line of an internal table 

SY-INDEX : loop iteration counter in do and while loops

 

Question 87: How to transport variants in SAP ABAP?



We use RSTRANSP program to transport variants in SAP ABAP, go to SE38, provide RSTRANSP execute, provide program name, variant name, execute create transport.


Question 88 What is Modularization and its benefits?

 

If the program contains the same or similar blocks of statements or it is required to process the same function several times, we can avoid redundancy by using modularization techniques. By modularizing the ABAP/4 programs we make them easy to read and improve their structure. Modularized programs are also easier to maintain and to update.


Question 89: What are the events in interactive reporting?


AT LINE-SELECTION Moment at which the user selects a line by double clicking on it or by positioning the cursor on it and pressing F2.

AT USER-COMMAND Moment at which the user presses a function key.

TOP-OF-PAGE DURING Moment during list processing of a secondary list

LINE-SELECTION Secondary list at which a new page starts.


Question 90:What is a function Group in SAP?


Function Group is a collection of function modules that shares global data with each other.

 

When an ABAP/4 program contains a CALL FUNCTION statement, the system loads the entire function group in with the program code at run time. Every function module belongs to a function group.


Question 91: What are subroutines in SAP Programs?



Subroutines are program modules, which can be called from other ABAP/4 programs or within the same program.

 

Question 92:What is the difference between the function module and a normal ABAP/4 subroutine?


In contrast to normal subroutines function modules have uniquely defined interface. 

Subroutines do not return values.

Subroutines do not return exceptions.

Subroutines cannot be tested independently.

 

Declaring data as common parts is not possible for function modules. Function modules are stored in a central library.

 

Question 93:What are logical databases? What are the advantages/disadvantages of logical databases?


A Logical Database is a hierarchical structure of tables. Use the GET statement to process Logical Databases.

- LDB consists of logically related tables grouped together – used for reading and processing data.

- Advantages = 1. No need of programming for retrieval , meaning for data selection.

- 2. Easy to use standard user interface, have check completeness of user input.

 

Disadvantages = 1. Fast in case of lesser no. of tables But if the table is in the lowest level of hierarchy, all upper level tables should be read so performance is slower.


Question 94: When you prefer LSMW in SAP?

 

When we need to update medium amount of data we use LSMW. LSMW is also used when the person like functional consultant has less programming language.


Question 95: Which BDC technique you prefer?

 

If we want to transfer large amount of data and when we need to use more than one transaction code we prefer session method. For small or less amount of data and for single transaction use call transaction. 


Question 96: Can you set up background processing using CALL TRANSACTION?

 

Yes, Using No Screen Mode in 'CALL TRANSACTION'


Question 97: What is the last entry in all BDC tables?

 

In all BDC tables the last entry is to save the data by using the field name BDC_OKCODE and a field value of ‘/11’.


Question 98: Performance techniques in ABAP reports


1. The sequence of fields must be same as per database table

2. During writing select query write all fields in sequence as per database table.

3. Never write select statements inside loop….endloop.

4. Use st05 SQL trace, se30 run time analysis, code inspector, SLIN (Extended Program Check),etc.

5. Use select single * statement instead of select *

6. Always use primary key

 

7. Use binary search but before using binary search sort that table.

 

Question 99:You are running a report. It is taking long time for execution. What steps will you do to reduce the execution time?

  • Run time analysis
  • System Trace
  • Extended code check
  • Performance tuning

Question 100:  What is structure of IDOC?


IDOC has three type of records: 

1.Control Record -- contains control info ex: receiver port etc 

2. Data record -- Contains IDOC data 

3.Status -- holds IDOC status.


Question 101:Difference between data element & Domain?


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.

 

Question 102: What is the length of function code at user-command?

 

Each menu function, push button, or function key has an associated function code of length 4 (for example, FREE), which is available in the system field SY-UCOMM after the user action.

 

Question 103: What are conversion routines in SAP ABAP?

 

These are objects which are used to convert data from display format to SAP internal format and from SAP internal format to display format.

 

A conversion routine is identified by its five-place name and is stored as a group of two function modules. The function modules have a fixed naming convention. The following function modules are assigned to conversion routine xxxxx:

 

CONVERSION_EXIT_xxxxx_INPUT

CONVERSION_EXIT_xxxxx_OUTPUT



The INPUT module performs the conversion from display format to internal format. The OUTPUT module performs the conversion from internal format to display format.


Question 104: What are the differences between simple and interactive ABAP reports?

 

A simple ABAP report allows the user to interact with the whole business-result data. In case of interactive reports user can interact with specific result data at a time.


Question 105: What are local objects in SAP?



Local objects (Dev class $TMP) are independent of correction and transport system.

 

Question 106: What is the difference between collect and sum?

 

SUM.


When processing an internal table in a block starting with LOOP and concluded by ENDLOOP , SUM calculates the control totals of all fields of type I , F and P (see also ABAP/4 number types ) and places them in the LOOP output area (header line of the internal table or an explicitly specified work area).


When you use SUM in a LOOP with an explicitly specified output area, this output area must be compatible with the line type of the internal table.When using LOOP to process a sorted extract (see SORT ), the control total of f at the end of the group appears in the field SUM(f) –  if f is type I , F or P. 


COLLECT.

COLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab .


If you use only COLLECT to fill an internal table, COLLECT makes sure that the internal table does not contain two entries with the same default key fields.


If, besides its default key fields, the internal table contains number fields,the contents of these number fields are added together if the internal table already contains an entry with the same key fields.


If the default key of an internal table processed with COLLECT is blank, all the values are added up in the first table line.


If you specify waINTO , the entry to be processed is taken from the explicitly specified work area wa . If not, it comes from the header line of the internal table itab .


After COLLECT , the system field SY-TABIX contains the index of the – existing or new – table entry with default key fields which match those of the entry to be processed.


COLLECT can create unique or compressed datasets and should be used precisely for this purpose. If uniqueness or compression are unimportant, or two values with identical default key field values could not possibly occur in your particular task, you should use APPEND instead. However, for a unique or compressed dataset which is also efficient, COLLECT is the statement to use.


If you process a table with COLLECT , you should also use COLLECT to fill it. Only by doing this can you guarantee that the internal table will actually be unique or compressed, as described above and COLLECT will run very efficiently.


If you use COLLECT with an explicitly specified work area, it must be compatible with the line type of the internal table.

 

Question 107:  How to transport a variant?

 

1. run report RSTRANSP using SE38

or

2. Go to SE38.

Select the variants radio button.

You will go to the variant screen.

Select the variant and from the menu select transport request.

 

Question 108: Can we write the code both call transaction and session method in single program?


Yes it is possible to write call transaction and session in one program.


Question 109:Which BDC you prefer?

 

Ans. If we want to transfer large amount of data and when we need to use more than one transaction code we prefer session method. For small or less amount of data and for single transaction use call transaction.

 

Question 110: When u prefer LSMW?



Ans. When we need to update medium amount of data we use LSMW. LSMW is also used when the person like functional consultant has less programming language.



Question 111:Preformance techniques

Ans.

1. The sequence of fields must be same as per database table

2. During writing select query write all fields in sequence as per database table.

3. Never write select statements inside loop….endloop.

4. Use st05 SQL trace, se30 run time analysis, code inspector, slin,etc.

5. Use select single * statement instead of select *

6. Always use primary key

 

7. Use binary search but before using binary search sort that table.


Question 112: What is occurs in internal table?

 

Ans. Occurs addition to the Declaration will give initial size to that table.occur statement allocates 8kb of memory to the internal table.


Question 113: How to Debug RFC Function module?

Ans:

SE38 –> Utilities –> Settings –> ABAP Editor –> Debugging

Activate the external debugging and choose the New Debugger option in ABAP debugger.

Go to the particular place in the code and put break point, pop will appear then choose the HTTP break point.

If you are triggering the RFC from SAP portal make sure that both the user ID should be same

 

If the users are different then provide the XI/Portal User ID in the users field.


Question 114: Difference between select option and ranges ?


Ans. The main difference between select option and ranges is that ranges implicitly or automatically creates internal table with fields like OPTION,LOW,HIGH,SIGN,etc . Where as in case of select option we have to explicitly create internal table.

When u declares a select options it will implicitly declare an internal table (ranges) for you.

While using RANGES syntax u can declare internal table explicitly.

The only need of declaring ranges is when you r not taking input from the user but you want make limit based selection at that time it will be use full e.g. SELECT ** from ** where MATNR in val_range.

 

here u can use select-option or ranges : val_range.


Question 115: How can we handle table control in BDC?

Ans.We can handle table control using line index

Line index indicates which line of Table control is to be use for BDC transaction

Ex -

perform bdc_field using ‘RC29K-AUSKZ(01)’

 

Indicates 1st line of table control is going to be used for transaction which is Line index of Table Control


Question 116:  What is the difference between the data in the internal tables XVBAP and YVBAP, specifically in user exit MV45AFZZ

XVBAP and YVBAP are internal structures which get modified as the SO is changes through VA02.

 

YVBAP holds old data, and XVBAP holds the changed data.

 

Any changes made to this structure through user exit would result in the corresponding change in the sales order item data.

 

YVBAP - Contains the line item data from Database VBAP

 

XVBAP - Contains the Current changes on the Line Items

 

Q: Steps to create Enhancement Spot/ BADI

 

1. Go to se18.
2. Enter the name enhancement spot and click create.
3. On next screen click on create new BADI.
4. Once the BADI is created then expand the tree on the left side.
5. Then double click on interface and give the name of the interface.
6. On the next screen it will ask for interface methods and its level ,that is it static or instance ?
7. Go to se19, and then click on enhancement spot ,enter the name of enhacement spot created above and click on  implement.
8. On next pop up give the name of enhancement implementation.
9. On next screen give the name of BADI implementation and its implementation class and also BADI definition just created above and save.
10. Now back to se18 and there activate both enhancement spot and BADI implementaion.And see both BADI interface and implementation.

Q: How to find BADI/Exit calls in any transaction?

Sometimes it is not so easy to find a BADI method or user exit to implement at an exact momment of the execution of a program. Here is one of the ways that can be used to spot which BADI method or user exit should be implemented.

1. Enter SE24;
2. Enter the class name CL_EXITHANDLER;
3. Double-click the method GET_INSTANCE;
5. Set a break-point at command line CASE sy-subrc (near line 25);
6. Execute the transaction you want to analyse; It will stop at the break-point you have just set on class CL_EXITHANDLER when it finds any BADI method/Exit call.
7. On debug screen, type the field name exit_name. This field contains the BADI method/Exit name which is being called in the program on that momment.
8. Press F8 to see the next calls.

Q: How can I solve dump due to insufficient memory (SELECT)?

I am using a SELECT query on a database table. Since the number of records in the table is very large,
the program dumps due to insufficient memory. How can I solve this?

 

In this case you could use the PACKAGE SIZE addition in the SELECT query to process in limited amount of data,
thus avoiding the memory overloads.

Ex: 

SELECT *

FROM 

INTO TABLE itab

PACKAGE SIZE .

IF sy-subrc EQ 0.

\*" Process the n records

ENDIF.

ENDSELECT.

Q: How can I convert numerals into the corresponding text?

Use the Function Module SPELL_AMOUNT to convert the integer into text.

Ex: 

DATA v_int TYPE i VALUE '1000'.

DATA words LIKE SPELL.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = v_int

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = words.

WRITE words-word.


Q: How to convert a date to internal or external format?

Use the functions modules CONVERT_DATE_TO_EXTERNAL or CONVERT_DATE_TO_INTERNAL

to convert the date. When converting to external format, the date format from the user's user profile will be used.

When converting to internal format, the result will be in YYYYMMDD format.

Q: 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. The indexes are activated along with the table and are created automatically with it in the database.

 

INDEXES are helpful for accessing data from the database tables.

PRIMARY INDEX: This is automatically generated the movement we create a database table.It is only for the key fields in the table.

SECONDARY INDEX : This is given in addition to the Primary Index already existing for the table ,so as to improve the data retrieval consistently, so as a result the performance is also increased.Secondary Index is also helpful in reducing the load on the Database.

Q: Difference between XVBAP and YVBAP in MV45AFZZ Include

YVBAP - Contains the line item data from Database VBAP

XVBAP - Contains the Current changes on the Line Items


Q:ABAP - how to read locked infotype records in HR ?


In HR master data maintenance, you can lock individual infotype datarecords. These data records are normally ignored during evaluationsusing PNPCE. If you set the PNP-SW-IGNORELOCKEDRECORDS switch to N (atthe INITIALIZATION or START-OF-SELECTION events), the report can howeverinstruct PNPCE to read locked data records too. Authorization Check: PNP_SW_SKIP_PERNR, PNP_GET_AUTH_SKIPPED_PERNRS.


INITIALIZATION.

 

pnp-sw-ignorelockedrecords = 'N'.


Q: How to test a RFC connection in Production?


In Production environment generally consultants do not have access to SM59. In that case use program RSRFCPIN to test the RFC destination. Most consultants must have SA38 authorization. 

 

Q: Enhancement section & Enhancement point 


Enhancement Point -

If you have written code using enhancement point your custom code will be executed along with the standard code.

 

Enhancement Section -

 

If you have written code using enhancement section, only your custom code will be executed replacing standard code. standard code will not be executed.


Q: What is 'Log data Changes' in Z-Table creation?


Table log history in SCU3 if the Table is logged for changes..> Technical settings-->Log data changes.


Q: Prerequisites for "For All Entries" ?


1.Duplicates are automatically removed from the resulting data set. Hence care should be taken that the unique key of the detail line items should be given in the select statement.

 

2.If the table on which the For All Entries IN clause is based is empty, all rows are selected into the destination table. Hence it is advisable to check before-hand that the first table is not empty.


3.If the table on which the For All Entries IN clause is based is very large, the performance will go down instead of improving. Hence attempt should be made to keep the table size to a moderate level.


Q: What are INDEX in a Table?


INDEXES are helpful for accessing data from the database tables.

 

PRIMARY INDEX: This is automatically generated the movement we create a database table.It is only for the key fields in the table.

 

SECONDARY INDEX : This is given in addition to the Primary Index already existing for the table ,so as to improve the data retrieval consistently, so as a result the performance is also increased.Secondary Index is also helpful in reducing the load on the Database.


Q: Advantages of Domains and Data Elements :

a)      Re-usability

 

b)      Foreign Key Relationships Can be maintained Because the Foreign Key Fields and Check table fields should have the Same Domain.


Q: Which is the better - JOINS or SELECT... FOR ALL ENTRIES...?


In most scenarios INNER JOIN performs better than FOR ALL ENTRIES, and should be used first. Only if there are performance issues should FOR ALL ENTRIES be considered, and careful measurements taken before and after to validate whether there really are performance gains. 

The effect of FOR ALL ENTRIES needs to be observed first by running a test program and analyzing SQL trace. Certain options set by BASIS can cause FOR ALL ENTRIES to execute as an 'OR' condition. This means if the table being used FOR ALL ENTRIES has 3 records, SQL Trace will show 3 SQL's getting executed. In such a case using FOR ALL ENTRIES is useless. However of the SQL Trace shows 1 SQL statement it's beneficial since in this case FOR ALL ENTRIES is actually getting executed as an IN List.

JOINS are recommended over FOR ALL ENTRIES. There is no real limit to the number of tables that can be joined; however greater complexity can make maintenance harder, and if there are problems with the join, make it harder to resolve them. If the JOIN is being made on fields which are key fields in both the tables, it reduced program overhead and increases performance. 

 

In some scenarios, you are presented with an internal table. In these situations, you may have no choice but to use FOR ALL ENTRIES.

 

Q: What is difference between enhancement point and section?

 

Enhancement Point and Enhancement Section are used during explicit enhacement.

 

The basic difference is

 

Enhancement Point -

If you have written code using enhacement point your custom code will be executed along with the standard code.

 

Enhancement Section -

If you have written code using enhancement section, only your custom code will be executed replacing standard code. standard code will not be executed.

 

Q: What is Implicit enhancement and explicit enhancement?

  • Explicit Enhancements – Explicit enhancements are provided by SAP at various point of the code. They are provided with ENHANCEMENT-POINT and ENHANCEMENT-SECTION. We will learn more about both of them in upcoming articles, but the basic is ENHANCEMENT-POINT is the empty placeholder for the code where as ENHANCEMENT-SECTION is the placeholder with default code.
  • Implicit Enhancements – Implicit enhancements are not delivered by SAP in the code, but SAP has given flexibility to implement them at various locations
    • Beginning of the Subroutine/Method/FM/Include
    • End of the subroutine/Method/FM/Include
    • Class Enhancements – Pre/Post/Overwrite method
    • FM Enhancements – Additional Parameters


Q- Structure of BDCMSGCOLL

Fields in BDCMSGCOLL table are

TCODE

DYNAME

DYNUMB

MSGTYP

MSGSPRA

MSGID

MSGNR

MSGV1

MSGV2

MSGV3

MSGV4

ENV

FLDNAME

ENHANCEMENT FRAMEWORK

Enhancement Framework in SAP ABAP is the new enhancement concept that helps the customers, consultants and third parties by giving an option of enhance the standard code base with the custom code that they want to add.

Below diagram shows the options available in enhancement framework.


IMPLICIT Enhancements:

In a abap report, there are two places at which the enhancements are possible by default.

One is the start of the report and at the end of the report.

So, by default in all the reports, customers can do enhancements at the start and end by creating enhancement implementations.

EXPLICIT Enhancements:

In this case, SAP has to explicitly provide the places in the report where exactly it can be enhanced.

So, again there are three options to do the same.

1. Enhancement Point:

          Enhancement points has to be created in the report where exactly customer can enhance such that the desired results at that point can be changed

by the enhancement implementations.

2. Enhancement Section:

          Enhancement sections has to be created in the report by selecting the section of code lines which can be enhanced by the customer implementation.

3. BAdi:

          BAdis are the ways of enhancements which are mainly available for ABAP Objects where a BAdi definition will be created with a interface with fixed signature that can be implemented by the customer by BAdi implementation.


Q: FAQ on OOP ABAP

http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=281773094



 

****continued...

 

 

How to change Transport request from Released to Modifiable

Step 1: Go to SE38 – Execute Program RDDIT076.  Step 2: Give your released requests number and execute again. Step 3: After executing, yo...