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

help please

Former Member
0 Likes
564

wat is difference between "do-enddo" and "form-endform".

5 REPLIES 5
Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
541

Hi,

In ABAP, every processing block ends with keyword 'END'... For example DO - ENDDO, LOOP- ENDLOOP, FORM - ENDFORM, CASE - ENDCASE.

Do---Enddo

is used in to perform a step in a loop. Normally a conditions is attached with loop sothat looping will continue till condition holds true.

Form ---Endform... is used for defining the subroutines(functions) in the program. The utility of writing codes in FORM - ENDFORM is that the visibility of code block is local to form...

Cheers,

Simha.

Read only

Former Member
0 Likes
541

Hi srinivasa,

do .. enddo is an loop with will be execute several times:

do 3 times. write: sy-index. enddo.

*

form .. endform is an suroutine wich will be execute via:

perform test.

form test.

write: 'Test'.

endform.

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
541

Hi

Between form-endform we will define the subroutines which is called with perform.

do-enddo is a loop like while etc.

Regards,

kumar

Read only

Former Member
0 Likes
541

Srinivas,

do .. enddo is similar to loop endloop.....

form .. endform is to define subroutines.

Sujatha.

Read only

Former Member
0 Likes
541

Actually there is no similarity between them to compare fr differences.

do-endo id an endless loop.

the statements in between the do-enddo will be executed until and uless it encounters an exit statement.

form-end-form is the part of code that can be called using a perform statement.

the code insode the form-endf-rm will be executed as many times as the number of times the perform statement is used in the program.

P.S: Please use a meaningful subject in your posts.

Regards,

Ravi