Designing of Smartform Part 2

  • So, In the Previous part what we have done is that we have created 6 windows for our 6 sections.
  • We assigned the size of each window accordingly.

Before, moving Forward, let’s see the contents of our Employee Header and Item table.

  • Employee Table data

    


  • Project Details Table data


Note :-

  • As we can see in the header employee table we have data for employee and in the Item ( Project Details ) table we have three project for each employee.
  • So in the smartform we will display the employee details in a template in the header section and project details in form of a table in the item section.

Texts in Smartforms :-

  • Using texts we can display the data on the screen of smartform.

How to use text ?

  • Right click on the window and select text.



    Note :-

    • While creating text, you might see that MS Office gets opened, you can use it for writing your text, or you can use Change Editor to write your texts.
      • Click on goto → Change Editor



For Window 2 :-

  • We need to give employee Id and value of Employee Id.
  • So for static data we will have to create a template :-

Template :-

  • Template is used for fixed number of rows and columns.
  • Template is for static data or fixed data.
  • For Template it, is mandatory that the size of the template should not exceed the size of the window.
  • So, I will right click on the window and will create a template.


  • since, the width of my window 2 was 8 cm, so I am dividing into two columns for storing employee id label and its value.

  • Now, right click on the template and create two texts for these two columns of template.



    • For first text pass row and column as 1 and 1 in the Output structure.
    • and for the second we will pass 1 and 2 as columns
  • Now, For Employee Id Value we will ne taking it as an input from the user, so we will import it from the FORM interface tab.



    • now pass it to the second text of the template of window 2.



    • Now, if i try to execute my smartform for 101 employee id, it should be displayed like below.




For Window 3 :-

  • We just need to give a text for Employee Data Label.




For Window 4 :-

  • We will display Employee data which is fixed so we will create a template.

  • As discussed earlier template dimensions cannot exceed the window dimensions. now for the employee data.



  • Now suppose for, employee data, we want to display Employee id, employee name, manager and salary.

  • So we will use four columns and two rows in each row we will have their label and value for 2 fields.



    • Here, we will have 2 rows.
    • Now we will create total 8 texts in this template for four fields of employee table.


    • So, now our data is in the custom employee table and we need to bring data from table to the smartform.
    • we will do, it at last, firstly we need to create text for our all windows.

For Window 5 :-

  • Create a text for Project details heading.

Now, if I try to execute my smartform, I can see my smartform will be looking like below,



For Main Window :-

  • I have to display the entire project details for the corresponding employees.

    Suppose, I will be displaying, project id, project name and project type for the below data.



  • So, for multiple data, I need to use Table for that, So, I will create a table in the main window with 3 columns.



    • Now, we will pass the header in table, in header I will create texts to display the labels for table data.
      • i.e. 3 labels.
      • Create table line and corresponding texts.

  • Now, We need to bring data in the smartform, so I will bring the data by writing the logic.

  • I will go to the global definition.

  • In types tab I will create type structure for both our employee and project tables.



  • In, Global data, we will create internal and work area for both the structures.




In initialization, we will write logic.




  • Now I will simply go to the 4th window and I will pass the employee details into the texts of the template.








    Now, For Project details :-

    • go to main area of table → right click on it and click on create → table line.








    Execute the smartform :-





Comments

Popular posts from this blog

Introduction to OData | Ui5 | Fiori

ODATA topics necessary for SAP Ui5 / FIORI

Introduction to SAP