Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

CREATING DYNAMIC TEMPLATES IN SMART FORMS.

$
0
0

The common problem while using the template for address or header information is that when the data is not available for that particular column the line appears blank. This problem can be avoided as seen in SAP SCRIPTS by using SCRIPT CONTROL COMMAND <IF>…<END IF>.Unfortunately the same cannot be done while designing TEMPLATES in SMART FORMS.

 

One way to avoid this is by using TABLES without data option i.e. by UN-checking the Internal table option as shown below in the screenshot.


                        Image1.JPG

By doing so our table becomes and behaves like a dynamic template.


Steps to Design Dynamic Template.


Step-1.  Create a sample smart form  & add the interface fields as shown below.


                         Image2.JPG


Step-2. Create a secondary window to place your dynamic template as shown below.

 

                                 Image4.JPG

 

Step-3.  Create LINE TYPES with required columns to be displayed. Shown below is the dynamic template created for testing.

                              Image3.JPG

Step-4.  Provide conditions in Conditions Tab as shown below.

 

                              Image5.JPG


Step-5  Wrap the fields and map the corresponding values to line types.


Execute the SMART FORM after mapping. The interface values are passed as shown below.



TEST-1.  Passing all values to the interface parameters and then execute.

           

                              Image6.JPG

 

                    Image7.JPG


Test-2.   Passing empty values to the interface parameter LINE3_DATA and then execute.


                          Image8.JPG

                                   Image9.JPG



Output :- As you can see in the Dynamic template the LINE3_DATA value was empty. As per the condition provided the Line type has not appeared and the space has been automatically adjusted WHEREAS in Static template the line appears even when no data is passed.


Please find the attached sample program for better understanding.


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>