Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

perform & form st

Former Member
0 Likes
944

hi all,

suppose i write form st first and then perform st in my prog

then what will happen.whether it will show error

or it will execute as usual without any effect?

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
0 Likes
908

hi,

your perform cannot be reached

A.

hi all,

suppose i write form st first and then perform st in my prog

then what will happen.whether it will show error

or it will execute as usual without any effect?

8 REPLIES 8
Read only

andreas_mann3
Active Contributor
0 Likes
909

hi,

your perform cannot be reached

A.

Read only

Former Member
0 Likes
908

HI Sanjeev,

It throws an error message ...

Regards,

Santosh

Read only

0 Likes
908

ya i know but i wnat to know that whether for a particular form perform should be declared first

or it can be declared afterwards also.

Read only

0 Likes
908

Generally according ABAP programming standards, all the forms will be at the last of the program and performs will be before them according to the required sequence.

Regards

Read only

0 Likes
908

Dear Sanjeev

If the process is under one block and your FORM is above PERFORM, it wont work.

Whereas cases whereby, PERFORM is under another subroutine and FORM for this PERFORM is above it can recognize.

Eg:

data: num type i.

start-of-selection.

write:/ num.

perform display.

write:/ num.

*&---------------------------------------------------------------------*
*&      Form  add
*&---------------------------------------------------------------------*
FORM add  USING P_NUM type i.

  p_num = p_num + 10.
  write:/ p_num.

ENDFORM.                    " add

*&---------------------------------------------------------------------*
*&      Form  display
*&---------------------------------------------------------------------*
FORM display .

  perform add using num.

ENDFORM.                    " display

Kind Regards

Eswar

Kind Regards

Eswar

Read only

0 Likes
908

hi,

u will not get any error, but the form statement will not be accssible and u will not get any o/p.

if u want to write form befor perform, and u want that form to be accessible , only thing u can do is write form in an event which triggers afetr start-of-selection and write it above.

ex

REPORT ztest NO STANDARD PAGE HEADING LINE-SIZE 172.

end-of-selection.

form abc.

write 'abc'.

endform.

start-of-selection.

perform abc.

in the above, though form is written above it triggers later than perform.

so, the logic is perform should always trigger first than form.

Read only

Former Member
0 Likes
908

It will show an error.It is not correct process.

Check this simple example.

report z_example.

tables:kna1.

data:begin of it_kna1 occurs 0,

kunnr like kna1-kunnr,

name1 like kna1-name1,

end of it_kna1.

select kunnr name1 from kna1 into table it_kna1 up to 10 rows.

form display.

loop at it_kna1.

write:/ it_kna1-kunnr,it_kna1-name1.

endloop.

endform.

perform display.

Regards

Read only

shishupalreddy
Active Contributor
0 Likes
908

hi,

As ABAP is strcutured programing it ont execute the perform stmnt if you write it after fORM stmnt.

always form----endforms must be at the end of the program .i mean after all perform s .

otherwise some times it will give you the error

'the statement is not accessible.'

regards,