![]() ![]() The actual screens created through SE51 transaction, are called subscreen screens if defined in screen attributes. The term subscreen applies both to the screen that you embed, and the area on the main screen in which you place it. You can include multiple sub-screens on main screen. Subscreens allow you to embed one screen within another at runtime. Your program becomes easier to maintain as changes to functions often only have to be implemented in the subroutine.Before you read this tutorial make sure you what a Dialog Program is …Ī subscreen is an independent screen that is displayed in an area of another ("main") screen. It splits the program's task into sub-functions, so that each subroutine is responsible for one subfunction. Hence, using subroutines makes your program more function-oriented. The above code produces the following output − Step 4 − Save, activate and execute the program. Write: / 'Subroutine created successfully'. We need to include PERFORM statement to call the subroutine. The subroutine has been created successfully. Step 3 − Write the code in FORM and ENDFORM statement block. The subroutine name is 'Sub_Display' as shown in the following screenshot. ![]() Write the subroutine name in the field and then click the continue button. Step 2 − Select Create and then select Subroutine. Open the existing program and then right-click on program. When ENDFORM is encountered, control jumps back to the statement following the PERFORM statement. The control jumps to the first executable statement in the subroutine. We can call a subroutine by using PERFORM statement. A subroutine can be defined using Form and EndForm statements.įollowing is the general syntax of a subroutine definition. We can call this subroutine in our programs as many times as we wish. To make this code easier to maintain, we can encapsulate the code into a subroutine. Basically, they are the same code blocks. We have program X with 3 different source code blocks. ![]() You page out a part of a program to a subroutine to get a better overview of the main program, and to use the corresponding sequence of statements many times as depicted in the following diagram. It is a modularization unit within the program where a function is encapsulated in the form of source code. A subroutine is a reusable section of code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |