Working with Global Definitions and Program Lines

Scenario: To calculate the total seats available using the values “Maximum seats available” and the “Occupied seats”. In this case, we would be defining Maximum Seats and Occupied Seats in the form interface and Seats Available in the Global definitions. We would write some code to calculate Seats available and then print the same.  

Procedure: Create a new smart form and, in the Form Interface, define the following two fields: (To know about Form Interface, click here. )


Now click on “Global definitions” :


Now define a variable, SEATS_AVAIL


Now to calculate Seats Available, select Main Window à Create à Flow Logic à Program Lines


Now mention the input parameters as SEATS_MAX and SEATS_OCC and the output parameter as SEATS_AVAIL. Write the code to calculate SEATS_AVAIL. 


Now to print these values on the layout, create a text by selecting Main Window à Create à Text: 


Save and do the syntax check. Activate the Smart Form. 

Test the smart form by clicking on F8. Enter some values for max_seats and avail_seats 


Execute the function module. 


Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image