Application Development 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: 

interview questions.

Former Member
0 Kudos

Hi All,

Can any one help me in answering the below questions.

1. How can we update the database table with this format, AcCeNtUrE. i want to update this field as it is. I know about checking of uppercase & lowercase. I think it dont works in this case. So how can we do this type of update.

2. what is the use of Exit, Stop, Cancel. how these three will work with in the loop and outside the loop.

Thanks in Advance,

Regards,

Ramana Prasad.

1 ACCEPTED SOLUTION

marcelo_ramos
Active Contributor
0 Kudos

Hi,

<b>STOP</b>

The statement is only intended for use in the INITIALIZATION,

AT SELECTION-SCREEN, START-OF-SELECTION, and GET events. It

terminates the current processing block in an executable

program and triggers the END-OF-SELECTION event. In all other

processing blocks, or when you do not want to trigger the

END-OF-SELECTION event, you must use EXIT.

<b>EXIT</b>

- Within a loop structure:

Terminates looop processing (DO, WHILE, LOOP, SELECT).

- Within subroutines and other modularization units (but not

in a loop structure):

Leaves the subroutine or modularization unit (FORM, MODULE,

FUNCTION, TOP-OF-PAGE, END-OF-PAGE).

- Outside loop structures and modularization units (report

processing):

Terminates report processing and triggers list display.

DATA: SAP_COUNT TYPE I,

WA_T100 TYPE T100.

SELECT * FROM T100 INTO WA_T100 WHERE SPRSL = SY-LANGU AND

ARBGB = 'DS'.

WRITE / WA_T100-TEXT.

IF WA_T100-TEXT CS 'SAP'.

ADD 1 TO SAP_COUNT.

IF SAP_COUNT = 3.

EXIT.

ENDIF.

ENDIF.

ENDSELECT.

If you have a set of nested loops, EXIT only terminates the

current loop, and processing continues after the corresponding

END... statement in the next-highest loop.

<b>CONTINUE</b>

Within loop structures like

- DO ... ENDDO

- WHILE ... ENDWHILE

- LOOP ... ENDLOOP

- SELECT ... ENDSELECT

CONTINUE terminates the current loop pass, returns the

processing to the beginning of the loop and starts the next

loop pass, if there is one.

DO loop: Omit an area (10 ... 20)

DO 100 TIMES.

IF SY-INDEX >= 10 AND SY-INDEX <= 20.

CONTINUE.

ENDIF.

...

ENDDO.

Regards.

Marcelo Ramos

4 REPLIES 4

Former Member
0 Kudos

HI,

1) Let us say have a field called company in ur table and you want to upload 'AcCeNtUrE' into this field.. First ensure that the domain for the data element that this field is taking referece of should have Lower Case Check box( At domain level) checked.

2) Exit will take you out of loop, if no loop take you out of the program

stop will take you to end of selection event , this will always take you to end of selection irrespective of with in or out side of the loop.

continue will continue the loop by skipping the statments after it. This has no importance out of the loop

Thanks

mahesh

0 Kudos

Hi Mahesh,

Thanks for your response.

But if i check this Lower case check box, i think it will update as 'accenture'. but my requirement is to update the same like AcCeNtUrE.

so how can we do this.

Regards,

Ramana Prasad.

0 Kudos

HI,

if you check this box. it means that take as it is.. normally field values will be converted into upper case automaticall.. if you check this box it will ensure that the data is saved as it is.

Thanks

Mahesh

marcelo_ramos
Active Contributor
0 Kudos

Hi,

<b>STOP</b>

The statement is only intended for use in the INITIALIZATION,

AT SELECTION-SCREEN, START-OF-SELECTION, and GET events. It

terminates the current processing block in an executable

program and triggers the END-OF-SELECTION event. In all other

processing blocks, or when you do not want to trigger the

END-OF-SELECTION event, you must use EXIT.

<b>EXIT</b>

- Within a loop structure:

Terminates looop processing (DO, WHILE, LOOP, SELECT).

- Within subroutines and other modularization units (but not

in a loop structure):

Leaves the subroutine or modularization unit (FORM, MODULE,

FUNCTION, TOP-OF-PAGE, END-OF-PAGE).

- Outside loop structures and modularization units (report

processing):

Terminates report processing and triggers list display.

DATA: SAP_COUNT TYPE I,

WA_T100 TYPE T100.

SELECT * FROM T100 INTO WA_T100 WHERE SPRSL = SY-LANGU AND

ARBGB = 'DS'.

WRITE / WA_T100-TEXT.

IF WA_T100-TEXT CS 'SAP'.

ADD 1 TO SAP_COUNT.

IF SAP_COUNT = 3.

EXIT.

ENDIF.

ENDIF.

ENDSELECT.

If you have a set of nested loops, EXIT only terminates the

current loop, and processing continues after the corresponding

END... statement in the next-highest loop.

<b>CONTINUE</b>

Within loop structures like

- DO ... ENDDO

- WHILE ... ENDWHILE

- LOOP ... ENDLOOP

- SELECT ... ENDSELECT

CONTINUE terminates the current loop pass, returns the

processing to the beginning of the loop and starts the next

loop pass, if there is one.

DO loop: Omit an area (10 ... 20)

DO 100 TIMES.

IF SY-INDEX >= 10 AND SY-INDEX <= 20.

CONTINUE.

ENDIF.

...

ENDDO.

Regards.

Marcelo Ramos