Adobe Forms Tutorial Sap Abap Tutorials

SAP ABAP Tutorial - Free SAP ABAP training tutorials for beginners. Learn ABAP module starting from basics concepts Data Dictionary, Reports, Scripts & Smart Forms, Workbench, how to code and develop SAP system and Interview questions. Learn SAP ABAP/4 programming language for free of.

FORM write_hello. Neat video premiere pro cs6 mac crack app Write:/ 'Hello'. A subroutine is called by a PERFORM statement as follows. PERFORM write_hello. In the above example no parameters pased to the subroutine.

We will now see one more example of a simple subroutine that passes parameters. Now if you want to add two numbers. We need to write the following code. Data: d_sum type i, d_num1 type i, d_num2 type i. Perform addnumbers using d_num1 d_num2. Write:/ d_sum, d_num1, d_num2. *---------------------------------------------------------------------* * FORM addnumbers * *---------------------------------------------------------------------* *.

* *---------------------------------------------------------------------* * --> NUM1 * * --> NUM2 * *---------------------------------------------------------------------* form addnumbers using num1 num2. D_sum = num1 + num2. For the above code the output would be 15, 5, 10 because the values of the parameters would be as follows. D_sum = 15, d_num1 = 5, d_num2 = 10. This is because we are passing the parameters by REFERENCE and not by VALUE.

My mixtapez music & amp mixtapes. I mportant: For calling by reference, USING and CHANGING are equivalent. This means that the value of the actual parameters changes if the value of the formal parameters changes.

We will write some code to demonstrate this point. Data: d_sum type i, d_num1 type i, d_num2 type i. Perform pass_ref using d_num1 d_num2. Write:/ d_sum, d_num1, d_num2. *&---------------------------------------------------------------------* *& Form pass_ref *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_D_NUM1 text * -->P_D_NUM2 text *----------------------------------------------------------------------* FORM pass_ref USING P_D_NUM1 P_D_NUM2.

P_D_NUM1 = 100. P_D_NUM2 = 200. ' pass_ref The output of the above program would be 15, 100, 200. This is because the value of actual parameters is changed because the value of the formal parameters also changes. We will now see how to pass parameters by value.

To pass parameters by value we need to explicitly state it in the subroutine. When parameters are passed by VALUE the value of the actual parameters does not change, even if the value of the formal parameters changes. *&---------------------------------------------------------------------* *& Form pass_val *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * * -->P_D_NUM1 text * * -->P_D_NUM2 text *----------------------------------------------------------------------* FORM pass_val USING VALUE(P_D_NUM1) VALUE(P_D_NUM2).

P_D_NUM1 = 1000. P_D_NUM2 = 2000. ' pass_val Please find the code below that demonstrates this concept. Data: d_sum type i, d_num1 type i, d_num2 type i. Perform pass_val using d_num1 d_num2. Write:/ d_sum, d_num1, d_num2.

*&---------------------------------------------------------------------* *& Form pass_val *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * * -->P_D_NUM1 text * * -->P_D_NUM2 text *----------------------------------------------------------------------* FORM pass_val USING VALUE(P_D_NUM1) VALUE(P_D_NUM2). P_D_NUM1 = 1000. P_D_NUM2 = 2000. ' pass_val The output of the above program is 15, 5, 10. We will now see the effect of CHANGING when the PARAMETERS are passed by VALUE. If CHANGING is specified in PARAMETERS that are passed by value then the value of the ACTUAL Parameters also changes.

Please see the sample code below. Data: d_sum type i, d_num1 type i, d_num2 type i. Perform pass_val_chcg using d_num1 d_num2. Write:/ d_sum, d_num1, d_num2. *&---------------------------------------------------------------------* *& Form pass_val_chcg *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_D_NUM1 text * -->P_D_NUM2 text *----------------------------------------------------------------------* FORM pass_val_chcg USING VALUE(P_D_NUM1) CHANGING VALUE(P_D_NUM2). P_D_NUM1 = 1001. P_D_NUM2 = 2002.

' pass_val_chcg The output of the above program would be as follows. 15, 5, 2,002 This is because we have specified CHANGING only for the PARAMETER P_D_NUM2 and hence the actual Parameter d_num2 also changes.

    Search