About ABAP Program and more D 0.2 ver 0.2 [Working With Selection Text ,Parameters and its Options (With Program) ]

Working With Selection Text ,Parameters and its Options (With Program).

Value Keywords - By using a value Keywords we can default a variable vale

Syntax :

Data : <variable name> type <data type> value <value>.

Example :

Data : v_num type I value 100.
Write : 'the value is', V_num.

Result :





Working with constant a variable value will not be changed throughout the program and it will be constant.

Syntax:

Constants : <variable name> type <data type>.

Example :
Constants : c_int type I value 20.
Write : 'the value is', c_int.

Result :









Working with Parameters, are used to accept the value in the run time from the user.

Syntax:

Parameters :  <variable name> type <data type>.

Example :

Parameters : p_num type I.
Write : 'the value of parameter is ' , P_num.

Result :













As we know about parameters now. lets talk about Selection Screen.

Selection Screen: Whenever we define parameters in ABAP program . Selection Screen
will display. We need to input and press F8 (Execute).


Working With Selection Text.

Selection Texts - Is What the end user can see when they execute a Tcode..

Working with Selection Texts :

Go to -> Text Element -> Selection Text

See in the Figure below :


















Enter the Text for the Parameter (Enter the value)

See in the Figure below :
















Save(Ctrl+s) and Activate(Ctrl+F3) -> back(F3) -> Activate (Ctrl+F3) -> Run(F8).



























Working With Parameters and its Options (With Program)



Program Name : ZRV_Paramters












Coding :

Parameter : P_var type I,
                 p_var1 type I.
Data : v_sum type I.
V_sum = P_var + P_var1.
Write : 'Value after adding the P_Var and P_var1 is', V_sum.







Result :













Output list: When we run our program the display after running it is called Output list.

Working With the Parameter and its Options :
1>Obligatory
2>Default
3>Checkbox
4>Radio Button
5>No-Display

Program Name : ZRV_Paramters_options












coding :

* Obligatory
Parameters : P_var type I obligatory.
* Default
Parameters : p_var1 type I default 10.
* Checkbox
Parameters : p_cb1 as Checkbox,
                    p_cb2 as Checkbox.
* X Will select the checkbox in the run time of program.
Parameters : p_cb3 as Checkbox,
                    p_cb4 as Checkbox default 'X'.
* Radio Button
Parameters : P_rb1 radiobutton group rb1 ,
                    P_rb2 radiobutton group rb1.
* no- display (will not display when you run the program)
Parameters : P_var3 type I no-display.




















Result :
















P.S : In the group of radio button the first radio button is by default selected.


Enjoy SAP ABAP !!!!

No comments:

Post a Comment