3 Replies Latest reply: Jan 23, 2008 3:46 PM by Jay Tripathy RSS

sap abap- perform using....changing....

mujeeb ahmed
Currently Being Moderated

1. can u explain me about ' perform....using...changing....'

subroutine and how to work with it.


2. how to declare constants (global declarations).

  • Re: sap abap- perform using....changing....
    Sriram Ponna
    Currently Being Moderated



    You can declare global constants as below :


    constants : gc_bukrs like bsis-bukrs value '1000'.


    Find below docu for perform.


    PERFORM form(prog).





    1. ... TABLES   itab1 itab2 ...


    2. ... USING    u1 u2 u3 ...


    3. ... CHANGING c1 c2 c3 ...


    4. ... IF FOUND




    This variant is not allowed in an ABAP Objects context.See PERFORM form(prog) not allowed.



    Calls the subroutine form defined in program prog ("external PERFORM").





    You pass parameters to the external subroutine as described in variant 1.




    However, you can also do it using a shared data area (DATA BEGIN OF COMMON PART).




    Please consult Data Area and Modularization Unit Organization documentation as well.




    You can use nested calls, including several different subroutines in different programs.




    When you call a subroutine that belongs to a program prog, prog is loaded into the PXA buffer (if it has not been loaded already). To minimize the possibility of memory problems, try not to use too many external subroutines from a large number of different programs.




    Addition 1

    ... TABLES itab1 itab2 ...




    See variant 1, addition 1.




    Addition 2

    ... USING u1 u2 u3 ...




    See variant 1, addition 2.




    Addition 3

    ... CHANGING c1 c2 c3 ...




    See variant 1, addition 3.




    Addition 4

    ... IF FOUND




    The specified subroutine is only called if the subroutine and its main program exist. Otherwise, the statement is ignored.





    If the program exists but not the subroutine, the program itself is still loaded.


    If the specified program contains errors, a runtime error occurs.


    You can only find out if the subroutine exists by programming a check yourself (for example, by setting a flag that you pass to it).



    SRiram Ponna.

  • Re: sap abap- perform using....changing....
    Satish Panakala
    Currently Being Moderated



    If you want to pass the variable as read only then use USING clause and if you want the variable to be read/ write one then you can use Changing clause.


    Using changing clause you can retireve values from performs. that is pass a vriable as changing and assign value to it in FORM then you can read the same variable in calling routine.





  • Re: sap abap- perform using....changing....
    Jay Tripathy
    Currently Being Moderated




    go through this link this will give you complete idea about the form....perform as well as using and changing.