Do you Know ?

Adding two numbers in SAP ABAP using parameters.

Adding two numbers in SAP ABAP using parameters.

What is Parameter option in ABAP ?

Parameter option will let you to keep the text box to input the data. So that user can use that particular program to run as many times you want to do so. Where as static program without parameter option will give same results even if you run for number of times.

Let’s do a simple addition program using parameter option.

Go to SE38 to create an executable program.


Provide the program name ,say Z_Addition.

Click Create.

Select
Type : Executable program
Stauts : SAP Standard  Production program
Application : Sales ( can choose any)


Click Save.



Click “Local Object”.



Code:
_______________________________________________________________________________
REPORT  Z_ADDITION.

parameter: number1 type i,
           number2 type i.

 data Sum type i.

 Sum = number1 + number2.

 write:/ Sum.
_______________________________________________________________________________

Save ( Ctrl + S)!

To check the syntax errors press Ctrl+F2.


And then Press Ctrl+F3 to activate the object.

Finally, press F8 to execute the program ..


Opens the parameters window to enter the input.

Press F8 to execute the program.


Similarly you can do Multiplication, subtraction, division so on.