Saturday, September 27, 2014

Create a simple Web Dynpro Application

Creating a Web Dynpro Component
...
1. Start ABAP Workbench (SE80) and select Web-Dynpro-Comp./Intf. from the   available object list. 














2. To create a new Web Dynpro component, enter the name ZZ_00_SFLIGHT
for the new component in the selection dialog of the object list, and select Display














3. In the dialog box that appears, you can enter a description of the new object and selectas typeWeb Dynpro Component. In this dialog you also have the chance to maintain the name of the default window.











Assign the component ZZ_00_SFLIGHT to package $TMP. 











As a result, you can now see the newly created Web Dynpro component
ZZ_00_SFLIGHT object tree, which contains the objects component controller,
component interface (which contains the entries interface controller and interface
views) and windows. You can access the objects using double-click.














Creating a new View and Assigningthe View to the Window
...
1. Click on the Web Dynpro component ZZ_00_SFLIGHT in the object tree and open the context menu to create a new view.















 2. Create a view MAINVIEW.







TheView Editor will be started on the right side of the Workbench window. In order to open the Layout tab and the View Designer, a popup appears asking for user and password for the SAP Web Application Server. Use the same user/password which you used for logon to the SAP system.















3. Save the view MAINVIEW. 














After saving the view MAINVIEW, it appears in the object tree of the Web Dynpro component under entry Views














4. Now open window ZZ_00_SFLIGHT by clicking on Windows and double-clicking on ZZ_00_SFLIGHT. Switch to change mode. 















5. Now open the view structure and move the view MAINVIEW inside the window structure on the right hand side by Drag and Drop. 








Open the window structure on the right hand side and you will see the embedded MAINVIEW. 







6. Save your changes.

Creating a View Context for MAINVIEW  Select view MAI NVIEW and switch to tab Context. Create a node in the View Controller by opening the context menu

1. Open the View Editor for view MAINVIEW and switch to tab Context. Create a context node SFLIGHT_NODE in the View Contro ller by opening the corresponding context menu. 















Maintain the properties according to the screen shot below. Select SFLIGHT as
Dictionary Structure and “0...n” for the Cardinality
.
Select button Add Attribute from Structure and select all components of structure
SFLIGHT.

















Press OK
The result should look like this:
.
















You have now created a context node SFLIGHT_NODE which refers to the data
structure of table SFLIGHT and which can contain 0 to n entries at runtime. The context node has been created in the view context, since no data exchange with other views is planned. Therefore, the component controller context usage is not necessary. 
2. Save your changes of view MAINVIEW. 
Creating a corresponding UI Element for the context node
SFLIGHT_NODE
...
1. Switch to tab Layout of view MAINVIEW.
2. Insert a new UI element of type table under ROOTUIELEMENTCONTAINER and assign the properties in the given table.











The name of the table is SFLIGHT_TABLE.
3. Create the binding of SFLIGHT_TABLE with context node SFLIGHT_NODE, selectText View as Standard Cell Editors and activate bindings for all cells.













Select context node SFLIGHT_NODE and press Continue.


















Make sure that the binding for all context attributes is enabled (all checkboxes are
activated) and press Confirm Entry (Enter).












The result should look like this:













4. Modify the property text of UI element Caption_1 to value Flights.














5. Save your changes. 
Supply data from Table SFLIGHT at runtime

1. Switch to tab Methods of view MAINVIEW and double-click method
WDDOINIT. Enter the given coding.













2. Save your changes. 
Creating a Web Dynpro Application
...
1. Click on the Web Dynpro component ZZ_00_SFLIGHT in the object tree and open the context menu to create a new application.














2. Enter a name (or accept the proposed name) and press Continue (Enter)
.






3. Save as local object.














Activating and running your Application
...
1. Activate all objects













2. Select all relevant objects and press Continue (Enter).













3. To start the application, right click on your Web Dynpro application entry and select context menu entry Test.













A browser will be started to run the WebDypro application. Log on using the same
credentials as before.The result page should look like this:

Friday, September 26, 2014

Ranges In SAP ABAP

  1. Creating Range Tables in SAP ABAP (Simple Explanation)
 Usage and Explanation- A Range table can be used when you want to split the data into single table or Multiple tables.This data can be used while selecting data for multiple conditions.Whenever you create a Range Table by default there are 4 values created for this table namely

  • Sign
  • Option
  • Low
  • High
-You can pass value to sign as either 'I' (Include) or 'E'(Exclude)
-Option can be used for operand like 'EQ'(Equal to),'NE'(Not Equal To),'BT'(Between)
-Low is the actual value that you need to pass in the table
-High option is not needed unless using the BT option

Coded Example - Lets say there is a scenario where you need to check for entries in multiple tables. You cannot check For All Entries more than one table, Hence we would be using Range tables to achieve this purpose.


*&-------------------------------------------------------------*
*& Report  Z_RANGE_STATEMENT
*&
*&-------------------------------------------------------------*
REPORT  Z_RANGE_STATEMENT.

TYPES: BEGIN OF t_ekko,
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
  statu TYPE ekpo-statu.
TYPES :END OF t_ekko.

DATA: lt_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      wa_ekko TYPE t_ekko.

DATA: r_ebeln type range of ekko-ebeln,  "range table
      wa_ebeln like line of r_ebeln.     "work area for range table


START-OF-SELECTION.
*Filling data for Range table 
wa_ebeln-sign   = 'I'.   "I = include, E = exclude
wa_ebeln-option = 'EQ'.  "EQ, BT, NE
wa_ebeln-low    = 'Value needed to be stored'.
*wa_ebeln-high   =    "not needed unless using the BT option
Append wa_ebeln to r_ebeln.
*Select Data from EKPO
select ebeln
       ebelp
       statu 
  from ekpo
  into table it_ekko
 where ebeln IN r_ebeln.
If sy-subrc is Initial.
SORT it_ekko BY ebeln ebelp.
Endif.
Use LOOP . . ENDLOOP and add multiple entries.
Tutorial - Create two range tables and select data from Mara based on the two Range tables. If you face any issues/Questions/Concerns please comment below and i will answer your queries.

Thursday, September 25, 2014

How to Create Customer










Creating Sold to Party    (Customer master)
T code used – XD01
 


                                             General data (address, contact person…..)
                                                                Tab (address)





                                                             Company code data
                                                      Tab (account management)
 




                                                             Sales area data
                                                              Tab (SALES)
 




                                                               TAB (SHIPPING)
 




                                                          TAB(BILLING DOC)
 



                                                   TAB – PARTNER FUNCTION



                                                          CREATED CUSTOMER



                                                               Assigning ship to party
                                                     Create a ship to party like sold to party
                                                                   T code XD01
                                                                   General data



                                                             Contact person



                                                       Company code data



                                                                  Sales area data
                                                                    Shipping tab



                                                                 Billing tab



                                                              Partner function



                                                               Created ship to party




                            Assignment of ship to party (100005) with sold to party (1000116)
                                                              T code XD02
                       In the sales area data, partner function tab assign the ship to party (100005)