ABAP

1. What is an ABAP?

2. What is an ABAP data dictionary?

3. What are domains and data element?

4. What is foreign key relationship?

5. Describe data classes?

6. What is an ABAP/4 Query?

7. What is BDC programming?

8.What is ITS?What are the merits of ITS?

9. What is DynPro?

10. What are the events in ABAP/4 language?

11. How to upload data using CATT ?

12. What is the differences between structure and table in data dictionary in ABAP?

13. What is the difference between macro and subroutine?

14.  Steps To Create A Simple SAP ADOBE Form And Calling It In A Web Dynpro ABAP Application

 

1. What is an ABAP?

ABAP (Advanced Business Application Programming) is a high level programming language created by the German software company SAP. It is currently positioned as the language for programming SAP’s Web Application Server, part of its Net Weaver platform for building business applications. Its syntax is somewhat similar to COBOL.

2. What is an ABAP data dictionary?

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

3. What are domains and data element?

Domains: Domain is the central object for describing the technical characteristics of an attribute of an business objects. It describes the value range of the field.

Data Element: It is used to describe the semantic definition of the table fields like description the field. Data element describes how a field can be displayed to end-user.

4. What is foreign key relationship?

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

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

Systemdata: It is the data which R/3 system needs for itself.

6. What is an ABAP/4 Query?

ABAP/4 Query is a powerful tool to generate simple reports without any coding. ABAP/4 Query can generate the following 3 simple reports:

Basic List: It is the simple reports.

Statistics: Reports with statistical functions like Average, Percentages.

Ranked Lists: For analytical reports. – For creating a ABAP/4 Query, programmer has to create user group and a functional group. Functional group can be created using with or without logical database table. Finally, assign user group to functional group. Finally, create a query on the functional group generated.

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

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

8.What is ITS?What are the merits of ITS?

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

9. What is DynPro?

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

10. What are the events in ABAP/4 language?

Initialization, At selection-screen, Start-of-selection, end-of-selection, top-of-page, end-of-page, At line-selection, At user-command, At PF, Get, At New, At LAST, AT END, AT FIRST.

11. How to upload data using CATT ?

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

12. What is the differences between structure and table in data dictionary in ABAP?

Structure and table both are 2/2 matrices but there are many 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 does not have.
3. Table can have the technical attribute but a structure does not have.

13. What is the difference between macro and subroutine?

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

 14. Steps To Create A Simple SAP ADOBE Form And Calling It In A Web Dynpro ABAP Application

Step 1. Creating The Form Interface
Go to transaction code SFP. Select the radio button ‘Interface’, give a name to your interface and click on the create button

In the Create Interface pop-up give a description and then click on the ‘Save’ button

Provide the Transport package and the transport request details.
Double click on the import parameter of the form interface and create a new import parameter PERNR of type PERNR-PERNR

Similarly, double click on the Global Data in the Global Definitions and create a new variable PA0006 of type PA0006.

Now, double click on the ‘Code Initialization’ in Initializations, specify PERNR as an import parameter, PA0006 as and output parameter and copy and paste the following code lines to read the permanent address of an employee from infotype 0006

DATA :
lt_p0006 TYPE TABLE OF pa0006 .

REFRESH lt_p0006.
CALL FUNCTION ‘HR_READ_INFOTYPE’
EXPORTING
tclas = ‘A’
pernr = pernr
infty = ‘0002’
begda = ‘18000101’
endda = ‘99991231’
TABLES
infty_tab = lt_p0006
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE lt_p0006 INTO pa0006 WITH KEY subty = ‘2’ .

Save and activate your Form Interface.

Step 2. Creating And Designing The Form
Come back to the main screen of the transaction SFP, select the radio button ‘Form’, give your form a name and click on the create button

In the Create Form pop-up box enter a description and the interface name created in Step 1, then click on the ‘save’ button

Provide the Transport package and the transport request details.

Now drag and drop the structure ‘PA0006’ of Global Data from the Interface in the left hand side to Context window on the right-hand side.

Click on the tab Layout tab to go to the Form Builder.

Drag and drop all required fields from the Data View to the Body Pages, and set the field properties as per your requirement.

Save and activate your form.

Step 3. Creating Web Dynpro Application.

Go to Transaction SE80, choose Web-Dynpro-Comp./Intf in the object list and provide a new name (Y_WDA_ADOBE_FORM) and press enter key.

In the create object pop-up click on the ‘Yes’ button to create a new Web Dynpro Application. Enter the description and choose the ‘Type’ radio button as Web Dynpro Component

Provide the Transport package and the transport request details.

Double click on the MAIN view and select the Context tab and create a new context attribute with name PERNR and type as PERNR-PERNR.

Now go to the Layout tab and insert a new Label UI, an Input field UI and a Button UI element in the ROOTELEMENTCONTAINER

Bind the Input field UI element’s value property with the context attribute PERNR.

Create a new Action SHOW_FORM and assign it to the OnAction property of the button UI element.

Copy and paste the code below to the event handler ON ACTION – SHOW_FORM.
method ONACTIONSHOW_FORM .
DATA :
lv_pernr TYPE persno,
formoutput TYPE fpformoutput,
lo_el_context TYPE REF TO if_wd_context_element,
ls_context TYPE wd_this->element_context,
lv_w_cx_root TYPE REF TO cx_root,
gv_fmname TYPE rs38l_fnam, ” function module name
lv_mesg TYPE string,
gs_fpoutparams TYPE sfpoutputparams.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `PERNR`
IMPORTING
value = lv_PERNR ).
gs_fpoutparams-nodialog = ‘X’. ” suppress printer dialog popup
gs_fpoutparams-getpdf = ‘X’.
* gs_fpoutparams-getxml = ‘X’.
CALL FUNCTION ‘FP_JOB_OPEN’
CHANGING
ie_outputparams = gs_fpoutparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
TRY.
CALL FUNCTION ‘FP_FUNCTION_MODULE_NAME’
EXPORTING
i_name = ‘Y_FORM’
IMPORTING
e_funcname = gv_fmname.
CATCH cx_root INTO lv_w_cx_root.
lv_mesg = lv_w_cx_root->get_text( ).
* MESSAGE e201(hrpadin01) WITH lv_formname3 lv_mesg.
ENDTRY.
CALL FUNCTION gv_fmname
EXPORTING
pernr = lv_pernr
IMPORTING
/1bcdwb/formoutput = formoutput.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION ‘FP_JOB_CLOSE’
* IMPORTING
* E_RESULT =
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
cl_wd_runtime_services=>attach_file_to_response( i_filename = ‘SAP_ADOBE_FORM.pdf’
i_content = formoutput-pdf
i_mime_type = ‘application/pdf’ ).
endmethod.

Create the Web Dynpro Application by right clicking the Web Dynpro Component. Give your application a name and description

Save and activate your Web Dynpro Application.
The Final Output
Right click on the Web Dynpro application and click on Test to test your application in the web browser.

Closing Notes:
You can also call the Adobe Form in Web Dynpro Application by using the UI element Interactive-Form. But, it is a good idea to design your ADOBE form separately in transaction code SPF as shown in this tutorial. This way you can also call the same form in reports and other applications too.
Also, instead of opening the Adobe form in the web browser, we have used the method attach_file_to_response( ) of class cl_wd_runtime_services to open the ADOBE form via download pop-up, this is also a good way because many a times users have performance issues when showing the form in the web browser

Comments are closed.