SAP ABAP MATERIALS

SAP PRESS EBOOKS,INSTITUTE MATERIALS,SUPPORT ISSUES,TICKETTING TOOLS

1463988 10202039058114141 1070888609 n

SAP ABAP MATERIALS DOWNLOADS

REPORTS,INTERFACES,BATCH DATA COMMUNICATION PROGRAMMING,ENHANCEMENTS,SCRITS,SMART-FORMS,MODULE POOL PROGRAMING.

SAP ABAP MATERIALS

CLASS ROOM TEACHING MATERIALS

sap web gui login

http://molgaard.consolut.eu/sap/bc/gui/sap/its/webgui

Wednesday, August 20, 2014

SALE ORDER SAMPLE REPORT

SALES REPORT DISPLAYING CUSTOMAR WIZE
*&---------------------------------------------------------------------*
*& Report ZSD_R_RDDL002_S_CUST_REP_RK28
*&
*&---------------------------------------------------------------------*
*& AUTHOR: KRANTHI.
*& REPORT NAME: SALES REPORT DISPLAYING CUSTOMAR WIZE.
*& PURPOSE: TO DISPLAY ALL CUSTOMARS AND PLANTS BASED ON SALES ORDER
*& REQUEST NO:SMPK 900987.
*& VERSION:V1.
*& SPEC : 01.
*&
*&---------------------------------------------------------------------*
*& MODIFICATION LOG:
*& MOD1:I ADDED TWO NEW FIELDS KUNNR AND POSNR.
*&---------------------------------------------------------------------*
REPORT ZSD_R_RDDL002_S_CUST_REP_RK28 NO STANDARD PAGE HEADING LINE-SIZE 100.
*&---------------------------------------------------------------------*
*& Structores declaration
*&---------------------------------------------------------------------*
*structor declaration for sales order header.
TYPES:BEGIN OF TY_VBAK ,
VBELN TYPE VBELN_VA, "sales document
ERDAT TYPE ERDAT , "date on which record was created
AUDAT TYPE AUDAT , "document date
VKORG TYPE VKORG , "sales organization
VTWEG TYPE VTWEG , "distribution chennel
VKGRP TYPE VKGRP , "distribution group
KUNNR TYPE KUNAG , "sold-to party
END OF TY_VBAK ,
*structor declaration for sales order item.
BEGIN OF TY_VBAP ,
VBELN TYPE VBELN_VA, "sales document
POSNR TYPE POSNR_VA, "sales document item
MATNR TYPE MATNR , "meterial no
MATKL TYPE MATKL , "meterial group
ARKTX TYPE ARKTX , "shart text for sales order item
PSTYV TYPE PSTYV , "sales document item category
NETWR TYPE NETWR , "net value of order item
WERKS TYPE WERKS_EXT, "plant(own or external)
END OF TY_VBAP ,
*structor declaration for customar.
BEGIN OF TY_KNA1 ,
KUNNR TYPE KUNNR , "customar no1
NAME1 TYPE NAME1_GP, "name1
ORT01 TYPE ORT01_GP, "city
PSTLZ TYPE PSTLZ , "postal code
REGIO TYPE REGIO , "region(state)
END OF TY_KNA1 ,

*structor declaration for plants/branches.
BEGIN OF TY_T001W ,
WERKS TYPE WERKS_D , "plant
NAME1 TYPE NAME1 , "name
ORT01 TYPE ORT01 , "city
END OF TY_T001W ,
*structor declaration for final output for sales order wize.
BEGIN OF TY_OUTPUT_S,
KUNNR_C TYPE KUNNR , "customar no1
NAME1 TYPE NAME1_GP, "name1
ORT01 TYPE ORT01_GP, "city
PSTLZ TYPE PSTLZ , "postal code
REGIO TYPE REGIO , "region(state)
VBELN TYPE VBELN_VA, "sales document
ERDAT TYPE ERDAT , "date on which record was created
AUDAT TYPE AUDAT , "document date
VKORG TYPE VKORG , "sales organization
VTWEG TYPE VTWEG , "distribution chennel
VKGRP TYPE VKGRP , "distribution group
KUNNR TYPE KUNAG , "sold-to party
* VBELN TYPE VBELN_VA, "sales document
POSNR TYPE POSNR_VA, "sales document item
MATNR TYPE MATNR , "meterial no
MATKL TYPE MATKL , "meterial group
ARKTX TYPE ARKTX , "shart text for sales order item
PSTYV TYPE PSTYV , "sales document item category
NETWR TYPE NETWR , "net value of order item
* WERKS_o TYPE WERKS_EXT, "plant(own or external)
WERKS TYPE WERKS_D , "plant
* NAME1 TYPE NAME1 , "name
* ORT01 TYPE ORT01 , "city
END OF TY_OUTPUT_S .
*&---------------------------------------------------------------------*
*& internal tables declaration
*&---------------------------------------------------------------------*
*itab declaration for sales order header.
DATA:T_VBAK TYPE STANDARD TABLE OF TY_VBAK,
*itab declaration for sales order item.
T_VBAP TYPE STANDARD TABLE OF TY_VBAP,
*itab declaration for customar.
T_KNA1 TYPE STANDARD TABLE OF TY_KNA1,
*itab declaration for plants/branches.
T_T001W TYPE STANDARD TABLE OF TY_T001W,
*itab declaration for final output.
T_OUTPUT TYPE STANDARD TABLE OF TY_OUTPUT_S,
*&---------------------------------------------------------------------*
*& workareas declaration
*&---------------------------------------------------------------------*
*workarea declaration for sales order header.
W_VBAK TYPE TY_VBAK,
*workarea declaration for sales order item.
W_VBAP TYPE TY_VBAP,
*workarea declaration for customar.
W_KNA1 TYPE TY_KNA1,
*workarea declaration for plants/branches.
W_T001W TYPE TY_T001W,
*workarea declaration for final output.
W_OUTPUT TYPE TY_OUTPUT_S,
W_OUTPUT1 TYPE TY_OUTPUT_S,

*&---------------------------------------------------------------------
*& global variable declaration.
*&---------------------------------------------------------------------*
G_kunnr TYPE VBAK-kunnr.
*&---------------------------------------------------------------------*
*& selection screen declaration.
*&---------------------------------------------------------------------*
SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS:S_kunnr FOR G_kunnr.
SELECTION-SCREEN:END OF BLOCK B1.
*&---------------------------------------------------------------------*
*& initilization event declaration
*&---------------------------------------------------------------------*
INITIALIZATION.
*clearing workareas
CLEAR:W_VBAK,
W_VBAP,
W_KNA1,
W_T001W,
W_OUTPUT.
*refreshing internal table
REFRESH:T_VBAK,
T_VBAP,
T_KNA1,
T_T001W,
T_OUTPUT.
*&---------------------------------------------------------------------*
*& at selection screen event declaration
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN.
*validating sales order number
DATA:L_kunnr TYPE kunnr.
SELECT SINGLE
kunnr
INTO
L_kunnr
FROM
kna1
WHERE kunnr IN S_kunnr.
IF SY-SUBRC <> 0 .
MESSAGE:E002(YNRK_MESS) WITH 'no data found from' S_KUNNR-LOW 'to' S_KUNNR-HIGH
.
ENDIF.
*&---------------------------------------------------------------------*
*& start of selection event declaration
*&---------------------------------------------------------------------*
START-OF-SELECTION.
*get vbak data.
PERFORM SUB_GET_VBAK.
*get vbap data.
PERFORM SUB_GET_VBAP.
*get kna1 data.
PERFORM SUB_GET_KNA1.
*get t001w data.
PERFORM SUB_GET_T001W.
*&---------------------------------------------------------------------*
*& top of page event declaration
*&---------------------------------------------------------------------*
TOP-OF-PAGE.
*displaying the report heading.
WRITE:/40 'SALESORDER REPORT'.
ULINE.
*displaying the header column headings
WRITE:/2 'customar no', 20 'name1' , 30 'document date' , 40 'sales organization',
50 'distribution chennel' ,

60 'distribution group' , 70'sold-to party' , 80 'postal code' , 90
'region',100 'city'.
ULINE.
*displaying the item column headings.
WRITE:/2 'sales item' , 20 'meterial no' , 30 'meterial group', 40 'shart text' ,
50 'item catagory' ,
60 'city' , 70 'net value'.
*&---------------------------------------------------------------------*
*& end of selection event declaration
*&---------------------------------------------------------------------*
END-OF-SELECTION.
*populating data into final output internal table.
PERFORM SUB_POPULATE_DATA_FINAL_OUTPUT.
*displaying the final output.
PERFORM SUB_DISPLAY_OUTPUT.
*&---------------------------------------------------------------------*
*& Form sub_get_vbak
*&---------------------------------------------------------------------*
* this routine is used to get the sales order header data from database.
*----------------------------------------------------------------------*
FORM SUB_GET_VBAK .
SELECT VBELN "sales document
ERDAT "date on which record was created
AUDAT "document date
VKORG "sales organization
VTWEG "distribution chennel
VKGRP "distribution group
KUNNR "sold-to party
FROM
VBAK
INTO TABLE T_VBAK
WHERE kunnr IN S_kunnr.
IF SY-SUBRC <> 0.
MESSAGE:I003(YNRK_MESS) WITH 'no data found in the given range'.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " sub_get_vbak
*&---------------------------------------------------------------------*
*& Form sub_get_vbap
*&---------------------------------------------------------------------*
* this routine is used to get sales order item data.
*----------------------------------------------------------------------*
FORM SUB_GET_VBAP .
CHECK T_VBAK IS NOT INITIAL.
SELECT VBELN "sales document
POSNR "sales document item
MATNR "meterial no
MATKL "meterial group
ARKTX "shart text for sales order item
PSTYV "sales document item category
NETWR "net value of order item
WERKS "plant(own or external)
FROM
VBAP
INTO TABLE T_VBAP
FOR ALL ENTRIES IN T_VBAK
WHERE VBELN = T_VBAK-VBELN.
ENDFORM. " sub_get_vbap
*&---------------------------------------------------------------------*
*& Form sub_get_kna1
*&---------------------------------------------------------------------*
* this routine is used to get the customar data from database.

*----------------------------------------------------------------------*
FORM SUB_GET_KNA1 .
DATA:T_VBAK1 TYPE STANDARD TABLE OF TY_VBAK.
T_VBAK1 = T_VBAK.
SORT T_VBAK1 BY KUNNR.
DELETE ADJACENT DUPLICATES FROM T_VBAK1 COMPARING KUNNR.
SELECT KUNNR "customar no1
NAME1 "name1
ORT01 "city
PSTLZ "postal code
REGIO "region(state)
FROM
KNA1
INTO TABLE T_KNA1
FOR ALL ENTRIES IN T_VBAK1
WHERE KUNNR = T_VBAK1-KUNNR.
ENDFORM. " sub_get_kna1
*&---------------------------------------------------------------------*
*& Form sub_get_t001w
*&---------------------------------------------------------------------*
* this routine is used to get t001w data from database.
*----------------------------------------------------------------------*
FORM SUB_GET_T001W .
CHECK T_VBAP IS NOT INITIAL.
DATA:T_VBAP1 TYPE STANDARD TABLE OF TY_VBAP.
T_VBAP1 = T_VBAP.
SORT T_VBAP1 BY WERKS.
DELETE ADJACENT DUPLICATES FROM T_VBAP1 COMPARING WERKS.
SELECT WERKS "plant
NAME1 "name
ORT01 "city
FROM
T001W
INTO TABLE T_T001W
FOR ALL ENTRIES IN T_VBAP
WHERE WERKS = T_VBAP-WERKS.
ENDFORM. " sub_get_t001w
*&---------------------------------------------------------------------*
*& Form sub_populate_data_final_output
*&-----------------------------------------------------------------------------*
* this routine is used to populating the data into final output internal table
*------------------------------------------------------------------------------*
FORM SUB_POPULATE_DATA_FINAL_OUTPUT .
*looping sales order item internal table
LOOP AT T_VBAP INTO W_VBAP.
W_OUTPUT-POSNR = W_VBAP-POSNR.
W_OUTPUT-MATNR = W_VBAP-MATNR.
W_OUTPUT-MATKL = W_VBAP-MATKL.
W_OUTPUT-ARKTX = W_VBAP-ARKTX.
W_OUTPUT-PSTYV = W_VBAP-PSTYV.
W_OUTPUT-NETWR = W_VBAP-NETWR.
*reading sales order header table.
CLEAR:W_VBAK.
READ TABLE T_VBAK INTO W_VBAK WITH KEY VBELN = W_VBAP-VBELN.
IF SY-SUBRC = 0.
W_OUTPUT-VBELN = W_VBAK-VBELN.
W_OUTPUT-ERDAT = W_VBAK-ERDAT.
W_OUTPUT-AUDAT = W_VBAK-AUDAT.
W_OUTPUT-VKORG = W_VBAK-VKORG.
W_OUTPUT-VTWEG = W_VBAK-VTWEG.
W_OUTPUT-VKGRP = W_VBAK-VKGRP.
W_OUTPUT-KUNNR = W_VBAK-KUNNR.
ENDIF.
*reading customar data.

CLEAR:W_KNA1.
READ TABLE T_KNA1 INTO W_KNA1 WITH KEY KUNNR = W_VBAK-KUNNR.
IF SY-SUBRC = 0.
W_OUTPUT-KUNNR = W_KNA1-KUNNR.
W_OUTPUT-NAME1 = W_KNA1-NAME1.
W_OUTPUT-ORT01 = W_KNA1-ORT01.
W_OUTPUT-PSTLZ = W_KNA1-PSTLZ.
W_OUTPUT-REGIO = W_KNA1-REGIO.
ENDIF.
*reading plants/branches data.
CLEAR:W_T001W.
READ TABLE T_T001W INTO W_T001W WITH KEY WERKS = W_VBAP-WERKS.
IF SY-SUBRC = 0.
W_OUTPUT-WERKS = W_T001W-WERKS.
W_OUTPUT-NAME1 = W_T001W-NAME1.
W_OUTPUT-ORT01 = W_T001W-ORT01.
ENDIF.
APPEND W_OUTPUT TO T_OUTPUT.
CLEAR:W_OUTPUT.
ENDLOOP.
SORT T_OUTPUT BY KUNNR WERKS.
ENDFORM. " sub_populate_data_final_output
*&---------------------------------------------------------------------*
*& Form sub_display_output
*&---------------------------------------------------------------------*
* this routine is used to display the final output.
*----------------------------------------------------------------------*
FORM SUB_DISPLAY_OUTPUT .
*looping the final output internal table
LOOP AT T_OUTPUT INTO W_OUTPUT1.
W_OUTPUT = W_OUTPUT1.
AT NEW KUNNR.
ULINE.
WRITE:/2 W_OUTPUT-KUNNR , 20 W_OUTPUT-NAME1, 30 W_OUTPUT-AUDAT, 40 W_OUTPUTVKORG
, 50 W_OUTPUT-VTWEG ,
60 W_OUTPUT-VKGRP , 70 W_OUTPUT-KUNNR , 80 W_OUTPUT-PSTLZ , 90
W_OUTPUT-REGIO , 100 W_OUTPUT-ORT01.
ULINE.
ENDAT.
WRITE:/2 W_OUTPUT-POSNR , 20 W_OUTPUT-MATNR , 30 W_OUTPUT-MATKL , 40 W_OUTPUTARKTX
, 50 W_OUTPUT-PSTYV ,
60 W_OUTPUT-ORT01 , 70 W_OUTPUT-NETWR.
*caluculating subtotal.
AT END OF KUNNR.
ULINE.
SUM.
WRITE:/60 'SUBTOTAL' :,70 W_OUTPUT1-NETWR.
ENDAT.
*caluculating grand total.
AT LAST.
ULINE.
SUM.
WRITE:/60 'GRAND TOTAL': , 70 W_OUTPUT1-NETWR.
ULINE.
WRITE:/80 'Prepared by RK'.
ENDAT.
ENDLOOP.

ENDFORM. " sub_display_output

Wednesday, August 13, 2014

SAP SMARTFORMS INTERVIEW QUESTIONS AND ANSWERS

SMARTFORMS INTERVIEW QUESTIONS AND ANSWERS


*An SAP R/3 system has 2 clients 800 & 810. You create an SAP Script Z_Script and a Smartform Z_Smartform in client 800. Will both Z_Script and Z_Smartform be available in client 810 as well?

Client 200 will have just the Smartform Z_Smartform and not the SAP Script Z_Script.

SAP-Script is client dependent whereas SMARTFORM is client independent. Many people don't understand what this is all about. The above answer should suffice. However, if you still do not understand this, find an SAP system where you have 2 clients. Create a dummy Smartform / script in one client and check whether they exist in the other client.

*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.

SAP SCRIPTS INTERVIEW QUESTIONS AND ANSWERS

SAP SCRIPTS INTERVIEW QUESTIONS AND ANSWERS




42. What for Sap script are used?
Ans: Sap script is used to design and print the layout sets.

43. What are Sap script elements?
Ans:  Header, Pages, Windows, Page windows, Paragraph formats, Character formats, Documentation.

44. What are different types of windows?
Ans:  There are 4 types of windows. 1. Main window 2. Constant window 3. Variable window 4.Grid screen.

45. What is the character format? What are they?
Ans:

46. How to print a logo?
Ans: To print a logo run the report program RSTXLDMC, give the macro name. In the layout set Insert-Graphics give the file name.

47. What are the settings you done while creating a logo as an abaper?
Ans:

48.How you write a print program?
Ans To write a print program use the function modules OPEN_FORM, WRITE_FORM, CLOSE_FORM.

49. How will you call a layout set in a print program?
Ans: You should give the layout set name in the OPEN_FORM attributes. It will open that layout set form for writing purpose.

50. Have you ever debugged a layout set? How will you debug a layout set?
Ans:

51. At a time how many variables you can see while debugging?
Ans: at a time you can see 4 variables while debugging.

52. What is difference between watch point and break point?
Ans:



53. How will you debug a report, Transaction, BDC program?
Ans:



54. What are the Sap script elements?
Ans: Header, Pages, Windows, Page Window, Paragraph format, Character format, Documentation.

55. How many types of windows in SAP Script? What are they? Explain?
Ans: In Sap script they are 3 types of windows.
1.      Main window: whose contents can extend more than one page.
2.      Constant window: Whose content does not change from page to page.
3.      Variable window: Whose content change from page to page.

56. For layout set how many main windows and how many sub windows?

Ans: Per layout set, you can create only one main window and up to 99 sub windows.

ENHANCEMENTS INTERVIEW QUESTION AND ANSWERS

ENHANCEMENTS INTERVIEW QUESTION AND ANSWERS

ALE IDocs interview questions and answers

ALE-IDOCS FAQ'S

Question 1:  What is ALE ?
ALE stands for Application Link Enabling. As it’s name indicates , it links two systems.
ALE is a technology that can enable exchange of data between two different Systems ( Sap – Sap OR Sap – Non Sap). ALE technology enables distributed yet integrated installation of SAP systems.

ALE architecture comprises of 3 layers :

Application layer refers to the application data ( SD , MM , FI or data for any SAP application ) . In this layer the data is collected to be distributed and then sent to the distribution layer.
Distribution layer determines to whom should the data generated by the application layer has to be distributed i.e. it is in the distribution layer that the recipient is determined , the data is formatted or filtered and then an actual is created.

Communication layer takes the responsibility of delivering the Idoc to the receiving system and communicates to the receiving system via tRFC , File ports , FTP or TCP/IP etc.
ALE uses IDoc as a vehicle to transfer data between two systems.

Question 2:  What is EDI ?
EDI stands for Electronic Data Interchange. It refers  to the electronic exchange of business data in a structured format between two systems. The EDI subsystem generally converts the Idoc data into one of the many EDI formats and generates an EDI file in an X12 format. The middleware then translates the X12 file to an IDOC format and the IDOC is sent to the SAP system.


Question 3:  What is an Idoc?   What is IDoc Type?   What is an IDoc Extension ?
An IDoc (Intermediate document) is a vehicle that is used to transfer data from one system to another.
IDoc is not a technology of some sort , but it is just a container that holds data . 
It holds data in a structured format i.e. in the Fields of the Segments.

IDoc Type vs. IDoc: 
An IDoc Type is nothing but a collection of one or more structures defined in a system with specific fields. It does not hold Data.
However, an IDoc is something that holds the values in the fields of the structure defined by IDOC type.

The transaction code to view an IDoc type (Basic and extension) is WE30.
Examples: ORDERS04, DEBMAS04, MATMAS04, CREMAS04.
These are all SAP standard Basic IDoc Types.

You can even have an IDoc extension in which you can use the existing Basic IDoc type and add extra segments and fields to it. Usually we extend an IDoc when the standard SAP IDoc type is not able to cater to the business process.

Question 4:  What are the types of records in SAP ALE Idocs and where is this information stored ?
There are three types of records in SAP ALE Idocs:
Control Records: Control record information for an IDoc is stored in standard table EDIDC.
Data Records:     Control record information for an IDoc is stored in standard table EDIDD.
Status Records:   Control record information for an IDoc is stored in standard table EDIDS.


Question 5:  What is an Idoc status?  What are the different types of Idoc statuses that you know ?
When an IDoc is sent from one system to another , it goes through variuos stages.The IDoc status indicates the stage that the Idoc in currently in.
There about 75 IDoc statuses.There is no way you can remember those all .
Don’t even try to ! You will probably remember only those on which you have worked .

But here are a few that you should know:
0-49 indicates an Outbound IDoc and 50-75 as Inbound IDoc. 

01  IDoc generated
02  Error passing data to port
03  Data passed to port OK

51  Application document not posted
52  Application document not fully posted
53  Application document posted


Question 6:  What is a Port ? What are the types of Ports ?
A port is a communication channel through which Messages can be sent or received in SAP .
The sender and the receiver both specify the port through which they will communicate.

The common port types are the TRFC Port and the File Port.
If both sender and receiver mention TRFC ports, data is exchanged via RFC connections.
If however , a file port is mentioned , the IDOC is written in a flat file at the specified location at the sender system.Then a FTP transfer should be done from that location to the receiver system or a Middleware that will send the file to the receiver system.

The transaction to maintain ports is WE21.

Question 7:  What is a Message type and Idoc Type ? What is the difference between Message type and an IDoc type?
A Message type and an IDoc type are closely related . In fact, you will find that a Message type is always associated with an IDoc type.Whereas an IDoc type is a detailed version with all the segments and fields , a Message type is used just to specify the kind of information that a system can send or receive to or from another system.

So If system SAP1 has a Partner Profile where it specifies MATMAS as an outbound message type , it just means that SAP1 can send material master data to say system SAP2.
If system SAP1 has a Partner Profile where it specifies MATMAS as an inbound message type , it just means that SAP1 can receive material master data from say system SAP2.
What all fields can be sent and received will be specified in the IDoc type.
Some other message types: DEBMAS( Customers), CREMAS(Vendors) belong to the Master data.

The link between a message Type and an IDoc type is maintained in Tcode WE82.

Question 8:  What is a partner profile ? What are the types of partner profiles ?
To be able to communicate with a partner via an IDoc interface, each system needs to maintain a partner profile. A partner profile is a mechanism by which the system can specify what kind of messages (message types) it can send or receive.
Partner profiles can be maintained in WE20.


Question 9:  What is a distribution model in ALE IDocs ?
The distribution model describes how ALE messages flow between different logical systems.
You can mention the sender and receiver logical systems, the message type to be distributed and also distribute data(IDocs) based on certain conditions by using the distribution model.
The ALE layer uses the distribution model to control which systems will receive the information(IDocs) and also filter the data based on certain conditions.
Distribution Models can be created and maintained in transaction BD64.

Question 10:  What are process codes ?

More interview questions on ALE IDocs :
Question 11:How do you read data from an IDoc in a program ?
Question 12:How do you send Idoc from a program ?
Question 13:How do you achieve filtering in a distribution model ?
Question 14:Can I create a flat file from an IDOC ? If Yes , How ?
Question 15:You want to create and send an IDOC to another the moment a PO is created in your            system . How will you achieve this ?
Question 16:How to Reprocess Idocs in SAP?
Question 17:What is a change Pointer?
Question 18:What is serialization of Idocs?
Question 19:Important tcodes in ALE Idocs.
Question 20:Important programs in ALE Idocs:

Monday, August 11, 2014

MODULE POOL PROGRAMMING

     MODULE POOL PROGRAMMING


  1. What is a transaction?
-          A transaction is dialog program that change data objects in a consistant way.

  1. What are the requirements a dialog program must fulfill?
A dialog program must fulfil the following requirements
-          a user friendly user interface.
-          Format and consistancey checks for the data entered by the user.
-          Easy correction of input errors.
-          Access to data by  storing it in the data bases.

       3.What are the basic components of dialog program?
-          Screens (Dynpros)
-          Each dialog in an SAP system is controlled by dynpros.A dynpros consists of a screen
And its flow logic and controls exactly one dialog step.
-          ABAP/4 module Pool.
     Each dynpro refers to exactly one ABAP/4 dialog program .Such a dialog program is also       called a module pool ,since it consists of interactive modules.

4.What is PBO and PAI events?
PBO- Process Before Output-It determines the flow logic before displaying the screen.
PAI-Process After Input-It determines the flowlogic after the display of the screen and after receiving inputs from the User.

5. What is dynpro?What are its components ?
-          A dynpro (Dynamic Program) consists of a screen and its flow logic and controls exactly one dialog steps.
-          The different components of the dynpro are :
Flow Logic: calls of the ABAP/4 modules for a screen .
Screen layout:Positions of the text ,fields,pushbuttons and so on for a screen
Screen Attributes:Number of the screen,number of the subsequent screen,and others
Fields attributes :Definition of the attributes of the individual fields on a screen.

6. What is a ABAP/4 module pool?
-Each dynpro refers to exactly one ABAP/4 dialog program.Such a dialog program is also called
a module pool ,since it consists on interactive modules.

7..Can we use WRITE statements in screen fields?if not how is data transferred from field data to screen fields?
-We cannot write field data to the screen using the WRITE statement.The system instead transfers data by comparing screen fields names with ABAP/4  variable names.If both names are the same,it
transfers screen fields values to ABAP/4 programs fields and Vice Versa.This happens immediately after displaying the screen.

8.Can we use flow logic control key words in ABAP/4 and vice-versa?
-          The flow control  of a dynpro consists os a few statements that syntactically ressemble ABAP/4  statements .However ,We cannot use flow control keywords in ABAP/4 and vice-versa.

9.What is GUI status? How to create /Edit GUI status?
-A GUI status is a subset of the interface elements used for a certain screen.The status comprises
those elements that are currently needed by the transaction .The GUI status for a transaction may be composed of the following elements:
-Title bar.
-Mneu bar.
-Application tool bar
-Push buttons.

To create and edit GUI status and GUI title,we use the Menu Painter.

10. How does the interection between  the Dynpro and the ABAP/4 Modules takes place?
-A transaction is a collection os screens and ABAP/4 routines ,controlled and executed by a Dialog processor.The Dilaog processor processes screen after the screen ,thereby triggering the appropriate
ABAP/4 processing of each screen .For each screen,the system executes the flow logic that contains the corresponding ABAP/4 processing.The controls passes from screen flow logic to ABAP/4 code and back.

11. How does the Dialog handle user requests?
-          when an action is performed ,the system triggers the PROCESS AFTER INPUT event.The data passed includes field screen data data entered by the user and a function code. A  functioncode is a technical name that has been allocated in a screen Painter or Menu Painter to a meny entry,a push button,the ENTER key or a function Key of a screen.An internal work field(ok-code)in the PAI module evaluates the function code,and the appropriate action is taken.


  1. What is to be defined for a push button fields in the screen attributes?
-          A function code has to be defined in the screen attributes for the push buttons in a screen.

  1. How are the function code handles in Flow Logic?
           - When the User selects a function in a transaction ,the system copies the function code into a           specially   designated work field called OK_CODE.This field is Global in ABAP/4 Module Pool.The OK_CODE can then be evaluated in the corresponding PAI module. The function code is always passed in Exactly the same way , regardless of Whether it comes from a screen’s pushbutton,a menu
option ,function key or other GUI element.

14.What controls the screen flow?
-          The SET SCREEN and LEAVE SCREEN statements controls screen flow.



  1. The Function code currently active is ascertained by what Variable?
-          The function code currently active in  a Program can be ascertained from the SY-UCOMM  Variable.

  1. The function code currently  active is ascertained by what variable ?
-          By SY-UCOMM Variable.


  1. What are the “field” and “chain” Statements?
-          The FIELD and CHAIN flow logic statements let you Program Your own checks.FIELD and CHAIN tell the system Which fields you are checking and Whether the System should Perform Checks in the flow logic or call an ABAP/4 Module.

  1. What is an “on input filed” statements?
-          ON INPUT
The ABAP/4 module is called only if a field contains the Value other than the initial Value.This initial Value is determined by the filed’s Dta Type: blanks for character Fields
,Zeroes for numerics. If the  user changes the Fields Value back t o its initial value,ON INPUT does not trigger a call.


  1. What is an “on request Field” statement?
-          ON REQUEST
  The ABAP/4 Module is called only if the user has entered the value in the field value since the last screen display .The Value counts as changed Even if the User simply types in the value that was already there .In general ,the ON REQUEST condition is triggered through any
Form of” MANUAL INPUT’.

  1. What is an on”*-input filed” statement?
ON *-INPUT
-          The ABAP/4 module is called if the user has entered the “*” in the first  character of the field, and the field has the attribute  *-entry in the screen Painter.You can use this option in Exceptionla cases where you want to check only fields with certain Kinds of Input.


  1. What are conditional chain statement?
ON CHAIN-INPUT similar to ON INPUT.
The ABAP/4 module is called if any one of the fields in the chain contains a value other than its initial value(blank or nulls).
ON CHAIN-REQUEST
This condition functions just like ON REQUEST, but the ABAP/4 module is called if any one of the fields in the chain changes value.

  1. What is “at exit-command:?
The flowlogic Keyword at EXIT-COMMAND is a special addition to the MODULE statement in the Flow Logic .AT EXIT-COMMAND lets you call a module before the system executes the automatic fields checks.

  1. Which Function type has to be used for using “at exit-command” ?
-          To Use AT EXIT – COMMAND ,We must assign a function Type “E” to the relevant function in the MENU Painter OR Screen Painter .

  1. What are the different message types available in the ABAP/4 ?
-          There are 5 types of message types available.
-          E: ERROR
-          W-WARNING
-          I –INFORMATION
-          A-ABNORMAL TERMINATION.
-          S-SUCCESS

  1. Of the two “ next screen “ attributes the attributes that has more priority is -------------------.
Dynamic.


  1. Navigation to a subsequent screen can be specified statically/dynamically .(TRUE/FALSE).
                  TRUE.


  1. Dynamic screen sequence  for a  screen can be set using ------------- and ----------------- commands
 
      Set Screen, Call screen.

27. The commands through Which an ABAP/4 Module can “branch to “ or “call” the next screen are

   1.------------,2--------------,3---------------,4------------.

-          Set screen<scr no>,Call screen<scr no> ,Leave screen, Leave to screen <scr no>.


       28. What is difference between SET SCREEN and CALL SCREEN ?
  
-          With SET SCREEN the current screen simply specifies the next screen in the chain , control branches to this next screen  as sonn as th e current screen has been processed .Return from next screen to current screen is not automatic .It does not interrupt  processing of the current screen.If we want to branch  to the next  screen without finishing  the current one ,use LEAVE SCREEN.

-          With CALL SCREEN , the current (calling) chain is suspended , and a next screen (screen chain) is called .The called can then return to the suspended chain with the statement LEAVE SCREEN TO SCREEN 0 .Sometime we might want  to let an user call a pop up screen from the main application screen to let him enter secondary information.After they have completed their enteries, the users should be able to close the popup and return directly to the place where they left off in the main screen.Here comes CALL SCREEN into picture .This statement lets us insert such a sequence intp the current one.

29. Can we specify the next screen number with a variable (*Yes/No)?
   
-          Yes

30.    The field SY-DYNR refers to--------------

Number of the current screen.

31.    What is dialog Module?
-          A dialog Module is a callable sequence of screens that does not belong to a particular transaction.Dialog modules have their module pools , and can be called by any transaction.

32.    The Syntex used to call a screen as dialog box (pop up)is---------

 CALL SCREEN <screen number.>
STARTING AT <start column><start line>
ENDING AT <end column> <end line>

33.    What is “call mode”?
-          In the ABAP/4  WORLD each stackable sequence of screens is a “call mode”, This is IMP because of the way u return from the given  sequence .To terminate a call mode and return to a suspended chain set the “next screen” to 0 and leave to it:
      LEAVE TO SCREEN 0 or (SET SCREEN 0 and LEAVE SCREEN) .When u return to     the suspended chain execution resumes with the statement  directly following the original CALL SCREEN statement.The original sequence of screens in a transaction (that is , without having stacked any additional call modes),you returned from the transaction altogether.


34.    The max number of  calling modes stacked at one time is?
-          NINE

35.    What is LUW  or Data base Transaction ?

-          A “LUW”(logical unit of work) is the span of time during which any database updates must be performed in an “all or nothing” manner .Either they are all performed (committed),or they are all thrown  away (rolled back).In the ABAP/4 world , LUWs and
-          Transactions can have several meanings:

LUW (or “database LUW” or “database transaction”)

This is the set of updates terminated by a database commit. A LUW lasts ,at most , from one screen change to the next (because the SAP system triggers database commits automatically at every screen change).

36.    What is SAP LUW or Update Transaction?
Update transaction (or “SAP LUW”)
This is a set of updates terminated by an ABAP/4 commit.  A SAP LUW may last much longer than a database LUW, since most update processing extends over multiple transaction screens.  The programmer terminates an update transaction by issuing a COMMIT WORK statement.

37.    What happens if only one of the commands SET SCREEN and LEAVE SCREEN is used without using the other?
If we use SET SCREEN without LEAVE SCREEN, the program finishes processing for the current screen before branching to <scr no>.  If we use LEAVE SCREEN without a SET SCREEN before it, the current screen process will be terminated and branch directly to the screen specified as the default next-screen in the screen attributes.

38.    What is the significance of the screen number ‘0’?
In “calling mode”, the special screen number 0 (LEAVE TO SCREEN 0) causes the system to jump back to the previous call level.  That is, if you have called a screen sequence with CALL SCREEN leaving to screen 0 terminates the sequence and returns to the calling screen.  If you have not called a screen sequence, LEAVE TO SCREEN 0 terminates the transaction.

39.    What does the ‘SUPPRESS DIALOG’ do?
Suppressing of entire screens is possible with this command.  This command allows us to perform screen processing “in the background”.  Suppresing screens is useful when we are branching to list-mode from a transaction dialog step.

40.    What is the significance of the memory table ‘SCREEN’?
At runtime, attributes for each screen field are stored in the memory table called ‘SCREEN’.  We need not declare this table in our program.  The system maintains the table for us internally and updates it with every screen change.

41.    What are the fields in the memory table ‘SCREEN’?
Name                             Length                   Description

NAME                           30                           Name of the screen field
GROUP1                       3                              Field belongs to field group 1
GROUP2                       3                              Field belongs to field group 2
GROUP3                       3                              Field belongs to field group 3
GROUP4                       3                              Field belongs to field group4
ACTIVE                        1                              Field is visible and ready for input.
REQUIRED                  1                              Field input is mandatory.
INPUT                           1                              Field is ready for input.
OUTPUT                       1                              Field is display only.
INTENSIFIED             1                              Field is highlighted
INVISIBLE                  1                              Field is suppressed.
LENGTH                       1                              Field output length is reduced.
DISPLAY_3D              1                              Field is displayed with 3D frames.
VALUE_HELP            1                              Field is displayed with value help.

42.    Why grouping of fields is required? What is the max no of modification groups for each field?
If the same attribute need to be changed for several fields at the same time these fields can be grouped together.  We can specify up to four modification groups for each field.

43.    What are the attributes of a field that can be activated or deactivated during runtime?
Input, Output, Mandatory, Active, Highlighted, Invisible.

44.    What is a screen group? How it is useful?
Screen group is a field in the Screen Attributes of a screen.  Here we can define a string of up to four characters which is available at the screen runtime in the SY-DNGR field.  Rather than maintaining field selection separately for each screen of a program, we can combine logically associated screens together in a screen group.

45.    What is a Subscreen? How can we use a Subscreen?
A subscreen is an independent screen that is displayed in a n area of another (“main”) screen.  To use a subscreen we must call it in the flow logic (both PBO and PAI) of the main screen.  The CALL SUBSCREEN stratement tells the system to execute the PBO and PAI events for the subscreen as part of the PBO or PAI events of the main screen.  The flow logic of your main program should look as follows:
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN <area> INCLUDING ‘<program>’ ’<screen>’.
PROCESS AFTER INPUT.
CALL SUBSCREEN <area>.
Area is the name of the subscreen area you defined in your main screen.  This name can have up to ten characters.  Program is the name of the program to which the subscreen belongs and screen is the subscreen’s number.

46.    What are the restrictions on Subscreens?
Subscreens have several restrictions.  They cannot:
·             Set their own GUI status
·             Have a named OK code
·             Call another screen
·             Contain an AT EXIT-COMMAND module
·             Support positioning of the cursor.

47.    How can we use / display table in a screen?
ABAP/4 offers two mechanisms for displaying and using table data in a screen.  These mechanisms are TABLE CONTROLS and STEP LOOPS.

48.    What are the differences between TABLE CONTROLS and STEP LOOPS?
TABLE CONTROLS are simply enhanced STEP LOOPS that display with the look and feel of a table widget in a desktop application.  But from a programming standpoint, TABLE CONTROLS and STEP LOOPS are almost exactly the same.  One major difference between STEP LOOPS and TABLE CONTROLS is in STEP LOOPS their table rows can span more than one time on the screen.  By contrast the rows in a TABLE CONTROLS  are always single lines, but can be very long.  (Table control rows are scrollable).  The structure of table control is different from step loops.  A step loop, as a screen object, is simply a series of field rows that appear as a repeating block.  A table control, as a screen object consists of: I) table fields (displayed in the screen ) ii) a control structure that governs the table display and what the user can do with it.

49.    What are the dynapro keywords?
FIELD, MODULE, SELECT, VALUES and CHAIN are the dynapro keywords.

50.    Why do we need to code a LOOP statement in both the PBO and PAI events for each table in the screen?
We need to code a LOOP statement in both PBO and PAI events for each table in the screen.  This is because the LOOP statement causes the screen fields to be copied back and forth between the ABAP/4 program and the screen field.  For this reason, at least an empty LOOP….ENDLOOP must be there.

51.    The field SY-STEPL refers to the index of the screen table row that is currently being processed.  The system variable SY-stepl only has a meaning within the confines of LOOP….ENDLOOP processing.  Outside the loop, it has no valid value.

52.    How can we declare a table control in the ABAP/4 program?

Using the syntax controls <table control name> type tableview using screen <scr no>.

53.    Differentiate between static and dynamic step loops.
Step loops fall into two classes: Static and Dynamic.  Static step loops have a fixed size that cannot be changed at runtime.  Dynamic step loops are variable in size.  If the user re-sizes the window the system automatically increases or decreases the number of step loop blocks displayed.  In any given screen you can define any number of static step loops but only a single dynamic one.

54.    What are the two ways of producing a list within a transaction?
By submitting a separate report.
By using leave to list-processing.

55.    What is the use of the statement Leave to List-processing?
Leave to List-processing statement is used to produce a list from a module pool.  Leave to list processing statement allows to switch from dialog-mode to list-mode within a dialog program.

56.    When will the current screen processing terminates?
A current screen processing terminates when control reaches either a Leave-screen or the end of PAI.

57.    How is the command Suppress-Dialog useful?
Suppressing entire screens is possible using this command.  This command allows us to perform screen processing “in the background”.  The system carries out all PBO and PAI logic, but does not display the screen to the user.  Suppressing screens is useful when we are branching to list-mode from a transaction dialog step.

58.    What happens if we use Leave to list-processing without using Suppress-Dialog?
If we don’t use Suppress-Dialog to next screen will be displayed but as empty, when the user presses ENTER, the standard list output is displayed.

59.    How the transaction that are programmed by the user can be protected?
By implementing an authority check.

60.    What are the modes in which any update tasks work?
Synchronous and Asynchronous.

61.    What is the difference between Synchronous and Asynchronous updates?
A program asks the system to perform a certain task, and then either waits or doesn’t wait for the task to finish.  In synchronous processing, the program waits: control returns to the program only when the task has been completed.  In asynchronous processing, the program does not wait: the system returns control after merely logging the request for execution.

62.    SAP system configuration incluedes Dialog tasks and Update tasks.
63.    Dialog-task updates are Synchronous  updates.
64.    Update –task updates are Asynchronous updates.
65.    What is the difference between Commit-work and Rollback-Work tasks?
Commit-Work statement “performs” many functions relevant to synchronized execution of tasks.  Rollback-work statement “cancels: all reuests relevant to synchronized execution of tasks.

66.    What are the different database integrities?
·             Semantic Integrity.
·             Relational Integrity.
·             Primary Key Integrity.
·             Value Set Integrity.
·             Foreign Key integrity and
·             Operational integrity.

67.    All SAP Databases are Relational Databases.
68.    What is SAP locking?
It is a mechanism for defining and applying logical locks to database objects.

69.    What does a lock object involve?
The tables.
The lock argument.

70.    What are the different kinds of lock modes?
Shared lock
Exclusive lock.
Extended exclusive list.

71.    How can a lock object be called in the transaction?
By calling Enqueue<lock object> and Dequeue<lock object> in the transaction.

72.    What are the events by which we can program “help texts” and display “possible value lists”?
-PROCESS ON HELP-REQUEST (POH).
-PROCESS ON VALUE-REQUEST (POV).

73.    What is a matchcode?
A matchcode is an aid to finding records stored in the system whenever an object key is required in an input field but the user only knows other (non-key) information about the object.

74.    In what ways we can get the context sensitive F1 help on a field?
-          Data element documentation.
-          Data element additional text in screen painter.
-          Using the process on help request event.

75.    What is roll area?
A roll area contains the program’s runtime context.  In addition to the runtime stack and other structures, all local variables and any data known to the program are stored here.

76.    How does the system handle roll areas for external program components?
-          Transactions run in their own roll areas.
-          Reports run in their own roll areas.
-          Dialog modules run in their own roll areas
-          Function modules run in the roll area of their callers.

77.    Does the external program run in the same SAP LUW as the caller, or in a separate one?
-          Transactions run with a separate SAP LUW
-          Reports run with a separate SAP LUW.
-          Dialog modules run in the same SAP LUW as the caller
-          Function modules run in the same SAP LUW as the caller.
The only exceptions to the above rules are function modules called with IN UPDATE TASK (V2 function only) or IN BACKGROUND TASK (ALE applications).  These always run in their own (separate) update transactions.

78.    What are function modules?
Function modules are general-purpose library routines that are available system-wide.

79.    What are the types of parameters in the function modules?
In general, function module can have four types of parameters:
-          EXPORTING: for passing data to the called function.
-          IMPORTING: for receiving data returned from the function module.
-          TABLES: for passing internal tables only, by reference (that is, by address).
-          CHANGING: for passing parameters to and from the function.

80.    What is the difference between Leave Transaction and Call Transaction?
In contrast to LEAVE TO TRANSACTION, the CALL TRANSACTION  statement causes the system to start a new SAP LUW.  This second SAP LUW runs parallel to the SAP LUW  for the calling transaction.

81.    How can we pass selection and parameter data to a report?
There are three options for passing selection and parameter data to the report.
-          Using SUBMIT…WITH
-          Using a report variant.
-          Using a range table.

82.    How to send a report to the printer instead of displaying it on the screen?
We can send a report to the printer instead of diplaying it on the screen.  To do this, use the keywords TO SAP-SPOOL:
SUBMIT RSFLFIND…TO SAP-SPOOL DESTINATION ‘LT50’.

83.    How can we send data to external programs?
Using SPA/GPA parameters(SAP memory).
Using EXPORT/IMPORT data (ABAP/4 memory)

84.    What are SPA/GPA parameters (SAP memory)
SPA/GPA parameters are field values saved globally in memory.  There are two ways to use SPA/GPA parmeters:
By setting field attributes in the Screen Painter.
By using the SET PARAMETER or GET PARAMETER statements.