2006 Oct 17 7:09 AM
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?
2006 Oct 17 7:11 AM
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?
2006 Oct 17 7:11 AM
2006 Oct 17 7:16 AM
2006 Oct 17 7:22 AM
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.
2006 Oct 17 7:26 AM
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
2006 Oct 17 7:28 AM
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. " displayKind Regards
Eswar
Kind Regards
Eswar
2006 Oct 17 7:29 AM
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.
2006 Oct 17 7:20 AM
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
2006 Oct 17 9:26 AM
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,
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |