Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
romit_raina
Active Participant
8,019
Hey There,
I am explaining the concept of calling multiple forms having each different layout from single form.
By creating the different pages (having different layout) in the single form and based on the condition type we can trigger the specific page.
Below is the Step to Step process which shows you how to create the form like that.

Step 1: Creation of Smart form With Multiple Page:
                                        Here I am taking example of 5 forms (Pages) with different Layout which will trigger in a Single form. Below Image will give you more details:

In the above Image you can see 5 Pages are created with different Page Layout (Portrait / Landscape).
Five Main windows are created which will trigger based on the Output type.

Step 2: Create the Text Field inside the Main Window :
                                   Create the Text Field which you want to show in Output, as this is demo I have created single text field which will displayed in the output. You can put the complete logic based on the Business requirement.Below is the snapshot of it:

   
       

Step 3: Logic for triggering the respective page:
                                   In this step I can show you how different pages can be triggered based on the input you have given. Based on the Interface Variable (example - Output Type) we can trigger the respective page. Below is the example for the same.
Example: If requirement is to show the respective Page details based on the output type:


OutTypePage
P1FORM1
P2FORM2
P3FORM3
P4FORM4
P5FORM5

To get this requirement we need to add Logic in the INITIALIZATION TAB of the Global Definition. Logic is as follows:  

    CASE gv_out.
        WHEN 'P1'. 
              CONTROL_PARAMETERS-startpage = 'FORM1'.
         WHEN 'P2'.
               CONTROL_PARAMETERS-startpage = 'FORM2'.
         WHEN 'P3'.
               CONTROL_PARAMETERS-startpage = 'FORM3'.
         WHEN 'P4'.
               CONTROL_PARAMETERS-startpage = 'FORM4'.
         WHEN 'P5'. 
               CONTROL_PARAMETERS-startpage = 'FORM5'.
   ENDCASE.
In the above Logic GV_OUT  is the Output type variable which is coming from as an input to the Smartform.

CONTROL_PARAMETERS is the default Interface field in the Smartform.
This output type (GV_OUT)  will be defined in the FORM INTERFACE.



Step 4: Output :

               Based on the input give to the Page (form) will be triggered, below are the outputs;

1. If P1 is the Input to the form, output will be:

              

2. If P2 is the Input to the form, output will be:

         
3. If P3 is the Input to the form, output will be:
          
      
4. If P4 is the Input to the form, output will be:

        
5. If P5 is the Input to the form, output will be:
              


Conclusion:

          At last we are able to get multiple forms by triggering a Single Smart form. As we also see at a Single point of Time Only 1 form / page is getting triggered so there are Performance issue.
Also if your data are large and it overflowing you can create the NEXT PAGE of each one of the above 5 pages. Need to assign the NEXT page to the respective FORMS (Page).
Note: - Things that need to take care is that Main Window of each Page should be of Same Width.
Keep Learning

Stay Awesome
   Romit Raina

1 Comment
Labels in this area