0% found this document useful (0 votes)
69 views11 pages

ABAP Interview Questions

This document provides information about various SAP tables, BAPIs, and programs related to materials management, purchase orders, goods receipt, and invoice processing in SAP. It also includes details about IDOC development and smart forms. The key aspects covered are: - Tables used for purchase requisition (EBAN), purchase orders (EKKO, EKPO, EKBE), goods receipt (MKPF, MSEG), and invoices (RBKP, RSEG, BKPF, BSEG) - BAPIs used to update plant data in material master (BAPI_MATERIAL_SAVEDTA) and check material availability (BAPI_MATERIAL_AVAILABILITY)

Uploaded by

ramkarthick131
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views11 pages

ABAP Interview Questions

This document provides information about various SAP tables, BAPIs, and programs related to materials management, purchase orders, goods receipt, and invoice processing in SAP. It also includes details about IDOC development and smart forms. The key aspects covered are: - Tables used for purchase requisition (EBAN), purchase orders (EKKO, EKPO, EKBE), goods receipt (MKPF, MSEG), and invoices (RBKP, RSEG, BKPF, BSEG) - BAPIs used to update plant data in material master (BAPI_MATERIAL_SAVEDTA) and check material availability (BAPI_MATERIAL_AVAILABILITY)

Uploaded by

ramkarthick131
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

ME51N -> ME41 -> ME21N -> MIGO -> MIRO

PReq -> RFQ -> PO -> G/R -> Invoice

In General PR->PO->GR->INVOICE

Tables for Purchase Requisition:


EBAN -
Tables for Purchase Orders:
EKKO - Header
EKPO – Item
EKBE - History of PO

Tables for Goods Receipt:


MKPF - Material Document Header
MSEG - Material Document Item

Invoice
RBKP-header
RSEG-Item
Accounting doc
BKPF--header
BSEG—Item

Material check program. Program to check material status


(BAPI_MATERIAL_AVAILABILITY) and display it in the output if the deletion
indicator is set to blank.

BAPI_MATERIAL_SAVEDTA. Used this BAPI to update plant data in material


master and displayed the same in the ALV report.

Created a report to display BATCH material details for a material using MCH1
tables and checked the batch deletion indicator LVORM to be displayed in the
output.
Developed a report to display the list of production orders from AFKO and AFPO
to display the production order related details in the ALV report.

Created Idoc extension for MATMAS01 and populated the logic in custom
segment through an inbound function module exit to update fields in material
master.

Worked on IDOC ORDERS05 to send the delivery address details of the PO


whenever it is changed.

Worked on Smartforms to send the EKKO and EKPO PO details in print output.

Flow:

MRP run daily and check the material every day based on the inventory / open PO
and sales.

If there is no material in inventory, it will check whether the material is produced


inhouse or from vendor.
IF its inhouse, planned order will be created. Then production order will be
created.
If vendor material, then purchase req is created. Then purchase order is created.

MD13 and MD16 used to display planned orders. PLAF is the table.
CO03 to display production orders. AFKO/ AFPO tables for production order.

Movement type 101 for posting GR from order.

Question repository:

Reports:
 Events in ABAP report – LOAD of program
Initialization – first event to trigger
Top of page – used for displaying header.
At selection screen – where validations take place.
At selection screen output – validate and modify the selection
screen
At selection screen on – validate field level selection
Start of selection – it will execute the list of select statements. It
will be called even if not declared it in the report.
End of selection – States that the event start of selection has ended.
Logics can be written after end of selection.
At user command – used for handling, push buttons
At line selection – interactive list. SY-LSIND is used here to check
the first row.
HIDE statement holds the data to be displayed in the secondary list.
 Also we can capture what field we have selected using GET
CURSOR FIELD fieldname VALUE fieldvalue.
Field name selected in basic list is captured in the above statement
and we can use it to fetch the secondary list details.
TOP-OF-PAGE DURING LINE-SELECTION : top of page event for
secondary list.

 Interactive reports generate 20 secondary list and one main list. It


will give error LIST_TOO_MANY_LEVLS dump.
 ALV Report created using class cannot be executed in background.
It need to be executed, use docking container.
 At New statements can be used inside loop. It will not support
numeric fields and display it as ***
 Handling push button : Create PF status for push button ‘ZAEX’ and
call this SET PF status ‘ZAEX’ inside the form pf-status…. Endform.
Now Button is created. Logic for this button is written inside USER
COMMAND by capturing the function code.
 Set pf status 'ZEXM'. double click on the pf status . Then go to
application tool bar tab . Enter the function code in the input
field .Double click on the fcode. Enter the required text.
In the alv function module REUSE_ALV_GRID_DISPLAY , in this Fm in
the parameter I_CALLBACK_PF_STATUS_SET give the name of the A
name . The pf status should be in within form and endform. In this
Form and endform , you can handle the push button .
Form pf status.
case sy-ucomm.
when 'FCODE'.
-

endcase.
endform.

 Call the method SET_TABLE_FOR_FIRST_DISPLAY of class


CL_GUI_ALV_GRID and pass the required parameters.
 Keep the container inside the grid and display using set table for
first display.
 Do sum in field CatLog is used for summation of field.
 Workbench request is not client specific. It will reflect in other
clients (program/repository objects)
 Customizing request is client specific. It will not reflect in other
systems (table entries/standard text/)
 Update debugging used to debug FM executes after commit work
statement.
 Split ALV : Create object custom container. Create object splitter
for container. Use method GET_CONTAINER of class
CL_GUI_SPLITTER_CONTAINER two times to split two alv
containers. Then keep containers in ALV grid.

Smart forms:

 Bar code can be used in smart forms using SE78.


 Form Attribute/Form interface/Global definitions.
 Display smart forms in multiple languages. Select radio button into
all languages while creating smart forms in Form attributes. In
addition, we can use SE63 to translate.
 Form interface used to communicate with driver program.
 Data definition required for that smart forms.
 Cannot be created without main page.
 Main page generally will have item level details.
 Address can be displayed in the address window of smart forms
where we can pass ADRNR as input field.
 Page protection is to protect the contents displayed in another
page. If it has space, it will display in same page. Else next page.
There is a check box in output options in smart forms window. If
this option greyed out, we can try using FOLDER option and do the
page protection.
 FOLDER option groups several nodes together if smart forms is very
complex and we can also use page protection.
 Main window – flows continuously.
 Secondary window – displays text and static data.
 Final window only prints at the end of all other executions. Like to
display total in last or first page. But total can be found only after
executing all pages. So this window will be executed last.
 Copies window – the content kept inside copies window either kept
at original or copy to differentiate which is original and which is
copy.

SFSY-COPYCOUNT used to differentiate between original and copies


window.
We can choose window type as copies window while creating the
window.
 Go to next page check box used inside command node to explicitly
insert page break.

 In command node we can explicitly call certain pages directly.
 If smart forms has two pages page1 and page2, Give the next page
as page2 in page1 next page area.
 CONVERT_OTF or CONVERT_OTF_2_PDF FM used to convert smart
forms to PDF.
 RSTXTRAN used to transport standard text.
 Smart form is client independent whereas script is dependent.
 SFSY-FORMPAGES total number of pages. SFSY-FORMPAGE current
page.
 Table is dynamic and template is static.
 Page, Window, Main window, Secondary window, Copies window,
Final window, Text, Graphics, Address, template, table, command,
alternate, loop, folder, program lines.
 To work on pre printed smart form, use the soft copy in se78 and
create that image. Then you can simply use that image in smart
form background to check print preview.
 TNAPR output type and program name link. NAST – link for
document and output type

IDOC:
 Inbound 50-75. Outbound 0-49.
 EDID4 – Data records. EDIDC – Control records. EDIDS – status records.
 Creating Segment : Tcode - WE31
 Create extension tcode : WE30
Creating Message Type : Tcode - we81
Assigning Message type to Idoc type: Tcode - we82

 RBDMANI2 : Reprocess Idocs manually


 RBDMANIN : Posting of IDocs with Status 51
 RBDMOIND : Outbound Idocs status 03->12
 RSEOUT00 : For Processing 30 Status IDocs
 RBDAPP01 : For Processing 64 Status IDocs
 RBDAGAIN : Reprocess Incorrect Outbound IDocs
 RBDAGAI2 : Reprocessing of IDocs after ALE Input Error
 WE09 to view idoc for specific values/fields.
 We05/we02 to view idocs.
 We19 to reprocess idocs.
 We42/we41 – inbound/outbound process code.
 MASTER_IDOC_DISTRIBUTE FM to create idocs.
 TCODE: BD50 (Activate change pointer for message type)
 TCODE: BD66 (Segment Field-Change Document field)
 TCODE: BD61 (Activate change pointers generally)
 Outbound Process (Sending System) Steps :
1. SALE – To create logical systems
2. SM59 – Create RFC destination
3. BD64 – Distribution model – where we map the sender and receiver system
along with the message type.
4. WE21 – port
5. WE20 – partnerprofile
 Inbound Process:
SALE – To create logical systems
SM59 – Create RFC destination
BD64 – Distribution model – where we map the sender and receiver system
along with the message type.
WE21 – port
WE20 – partnerprofile
WE57 – Assign FM to basic type and idoc type.
WE42- create inbound process code

 BD56 – to filter segments – like only 2 segments should be displayed for this
condition instead of 5.
 BD55 to use conversion routines or BD79
 BD64 to filter the idocs coming inside/ going outside the system.
 There are two filtering in IDoc.
 Segment Filtering:
 Segment filtering can be achieved using transaction BD56. Here you can
suppress a whole segment irrespective of data inside it . You have to give
Message Type / Sender Partner / Receiver Partner.
 Data Filtering:
 Data filtering can be done in distribution model (BD64) where you can
restrict whole IDOCS or partials IDOCS to be send based on data in fields
inside IDOC depending on whether the segment in which you filter is at the
highest level or at a lower level. For example in MATMAS if you put a filter
of E1MARCM for a particular plant, only data for this plant will go and
other plants will be ignored.

BDC :
 BDCDATA : DYNPRO/DYNBEGIN/FNAM/FVAL/PROGRAM.
 BDC_OPEN_GROUP, BDC_INSERT, BDC_CLOSE_GROUP
 KEEP keeps the session even after processed successfully. Will be deleted
by BASIS.
 Table control : using counter and P+ inside the loop.
 Call transaction both asynchronous and synchronous updates. Session
only synchronous update. A E N mode in call transaction.
 Bdc for table maintenance generator can be created.

Tough program worked:

 CK11 cost estimate : For single amterial there are various prices. All prices will be provided in
excel. We need to add this and do a BDC for CK11. Then created BDC to mark and release the
material price for costing.
 Worked on incident where multiple output types are being created for shipments whenever it
was created using TMS. Expected is only one output. After lot of debugging, we found out there
was some incorrect READ statement written inside a routine.
 Need to split APO sales order into multiple sales order based on quantity. For eg : if sales order
has 112 quantity, we need to split it into 2 orders. Lot size were determined by functional. Here
it was 56 per lot.

BAPI_SLSRVAPS_SAVEMULTI2 used to create multiple orders. But here we encountered


performance issue when entire load was running.
‘CALL FUNCTION in Update task receiving results from’ we have used and limited the orders to
500 per run through parallel processing.
USER EXIT:
 User exit starts and end with with form and endform – need access key. Customer exits are
written inside FM like EXIT_XXX inside include – no access key needed.
 Using package we can find user exit in SMOD.
 U need to create project in CMOD and activate this user exit.
 USEREXIT_SAVE_DOCUMENT_PREPARE . : If you want to make the
validation you use this userexti and this is the last time to do the changes.
 USEREXIT_SAVE_DOCUMENT : If you want ot modify the code then you
can use it for this userexit.
 Implecit enhancement :</b> These are provided in specific areas of
standard source code:
 1. At the end of the programs ( reports, includes, function pools, module
pools)
 2. At the begin and end of subroutine forms.
 3. At the end of the functional module
 4. At the end of all visabilities areas
 In this case you do not need to create and enhancment spot. You directly
put your curosr on the enhancement option and create your
inplementations by right click.
 <b>Explicit enhancement :</b> It can be anywhere in your source code.
You need to explicitly have a enhancement point.It is of two types:
 1. Enhancement spot : It is the point where you can add your code. It can
have multiple implementations. All the implementations can active at a
time but the sequince of executions of the implementations can be
anything.
 2. enhancement section : If you want to execute your own code instead of
some portion standard code. Only the active implementation is execute.
Only one implementation is active at a time.

BADI :
 How to find BADI : Using class CL_EXIT_HANDLER.
 Using SE80 repository and package name.
 BADI can have multiple implementations. User exit cannot have multiple
implementations. You have to change the code in the same area.
 Multiple implementation button is checked for Multiple implementation
BADI.
 Filter check box is ticked for filter dependent BADI. We can restrict the
BADI logic for different country specific values. FLT_VAL is the parameter
created in method.
 for eg for specific country codes we can have separate logics.
 SE18 – BADI def / SE19 – BAID implementation
 ME_PROCESS_PO_CUST used for change item details of BADI. In process
item method.
 COMMIT WORK should not be used inside BADI or user exit.
 For multiple implementations there is no sequence control because at the
time of BADI definition it does not know which implementation will be
active. Badi with filter is different.

BAPI :

 Part of Businees Objest Repository(BOR). A BAPI is remotely enabled


function module
 BAPI stores in BOR. RFC Does not.
 BAPI updates DB fast. BDC updates through screens.
 BAPI_SALESORDER_CREATEFROMDAT2 used to create sales order.
 BAPI_SALESORDER_CHANGE used to change sales order
 In extensionIN parameter we can pass values to custom fields.
 EXTENSIONIN-STRUCTURE pass the structure name and the values in
 EXTENSIONIN-VALUEPART1 we give the values we pass in our program.
 Fields have to be marked with X to be updated in DB.
 By simply looking at BAPI_TRANSACTION_COMMIT code, we see quickly
what is different from COMMIT WORK. It calls BUFFER_REFRESH_ALL
function module right after COMMIT WORK.

Dictionary:

 Validation can be done in TMG using events.05 – creating entry 01-before


saving DB
 SE14 – Activate and adjust DB.
 Database view : Just adds two tables and display
 Maintenance view: Add two tables and display and also can be maintained
 Projection view : project only certain columns of the table. Only one table
can be used. Can be maintained.
 Help view:
 Search help exit used to have some validation at the search help level.
RESULT_TAB is the parameter where the results are stored in search help
exit.

 Table type : We can declare the internal table in the SE11


(this is global we can use any program) is
called as table type.
 Line type : same as bove for structure or work area.
 A table type describes the structure and functional attributes of an
internal table in ABAP. In ABAP programs you can reference a table type
TTYP defined in the ABAP Dictionary with the command DATA <inttab>
TYPE TTYP. An internal table <inttab> is created in the program with the
attributes defined for TTYP in the ABAP Dictionary.

 A type group/pool is sort of like an INCLUDE program which you use to put
all of your TYPES statements into, mostly it is used for reuse, so you
define your TYPES there
 TYPE-POOLS pool. TYPE-POOLS : SLIS is common example.
 This statement allows you to use all the data types and constants defined
in the type group pool in your program. You can use several type groups in
the same program.
 Collective search help adds multiple values to the search help field. That
is it will have two tabs to select the values. But in elementary it will have
only one tab. For eg: Name is the only field in collective search help. You
can populate the values for name in F4 from 3 differrent elementary search
helps in 3 different tabs when u click F4.

 CONVERSION routines are written at domain level and we can create
custom conversion routines.

Routines:

 Output routine for output types. Pricing routines for pricing.


 600 to 999 is the number for custom routines.
 We have to remember that Every New Routine needs an Access Key.
 VOFM to create routine. Once routine is created, we need to activate it. To
generate this routine run RV80HGEN program.
 TRFM and TRFMT are the tables gets updated for these routines.
 Add this standard program in TR so that no need to generate this routine
using this program when TR moves to other client.

Miscellaneous:

Parell cursor method:

sort: lt_vbpa by kunnr, "Sorting by key is very important


lt_kna1 by kunnr. "Same key which is used for where condition is used here
loop at lt_vbpa into wa_vbpa.
read lt_kna1 into wa_kna1 " This sets the sy-tabix
with key kunnr = wa_vbpa-kunnr
binary search.
if sy-subrc = 0. "Does not enter the inner loop
v_kna1_index = sy-tabix.
loop at lt_kna1 into wa_kna1 from v_kna1_index. "Avoiding Where clause
if wa_kna1-kunnr <> wa_vbpa-kunnr. "This checks whether to exit out of loop
exit.
endif.

****** Your Actual logic within inner loop ******


endloop. "KNA1 Loop
endif.
endloop. " VBPA Loop

cl_alv_table_create=>create_dynamic_table to create dynamic internal table at run


tiem in ALV.

 SELECT SINGLE * ---> It selects the First Matcing row satisfying the Where
Condition.
 while
 SELECT * UP TO 1 ROW ---> selects all the Records satisfying the given
Condition and then it applies aggregation as well as orders and returns the
First Record according to these Records.

You might also like