cancel
Showing results for 
Search instead for 
Did you mean: 

query on write perform in a form

Former Member
0 Kudos

hi

i am writing a perform in a form

perform in program ztest

endperform

now in program ztest i have a code check if that becomes false i dont want the remaingin part of code to execute and want the cursor return to the form or next program as per normal flow

wht should i give Exit or continue if condtion is false or sth else in need to give..i want the cursor to return to the form next line as if my perform was not there..

regards

arora

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

In the form you have to call subroutine as follows.

/: Perform sub in program Ztest

/: using &field_check&

/: changing &return_value&

/:endperform.

in the subroutine program you have to code as follows.

Form sub tables intab structure itcsy

outtab structure itcsy.

read table intab with key name = 'FIELD_CHECK'.

if sy-subrc = 0.

check input-value = 'TRUE VALUE'.

read table outtab with key name = 'RETURN VALUE'.

if sy-subrc = 0.

outtab-value = 'RETURN VALUE'.

outtab-name = 'RETURN VALUE'.

modify outtab index sy-tabix.

endif.

endif.

Former Member
0 Kudos

*****************SUB-ROUTINE USING USING VALUE****************************

DATA : A TYPE I VALUE 10.

PERFORM SUB USING A.

WRITE : A.

&----


*& Form SUB

&----


  • text

----


  • -->P_A text

----


form SUB using VALUE(P_A).

P_A = P_A * 10.

WRITE : P_A.

endform. " SUB

ARUN REDDY I

Former Member
0 Kudos
                                  • A SAMPLE SUBROUTINE************************

DATA : A TYPE I VALUE 10.

PERFORM SUB.

&----


*& Form SUB

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form SUB .

WRITE : A.

endform. " SUB

*************************A SUB-ROUTINE USING USING EXTENSION************

DATA : A TYPE I VALUE 10.

PERFORM SUB USING A.

WRITE : A.

&----


*& Form SUB

&----


  • text

----


  • -->P_A text

----


form SUB using p_a.

P_A = P_A * 10.

WRITE : P_A.

endform. " SUB

ARUN REDDY I

former_member609120
Contributor
0 Kudos

why dont you use using and changing parameters?

On false condition, pass some variable back to the form, so it will continue execution just after the perform..

Former Member
0 Kudos

IT WORKS SIMILAR TO CALL-BY-RFERENCE.THE VALUES RETURNED WILL BE SAME FOR FORM AND PERFORM.

****************************SUB-ROUTINE USING CHANGING VALUE****************************

DATA : A TYPE I VALUE 10.

PERFORM SUB CHANGING A.

WRITE : A.

&----


*& Form SUB

&----


  • text

----


  • <--P_A text

----


form SUB changing VALUE(p_a).

P_A = P_A * 10.

WRITE : P_A.

endform. " SUB

Former Member
0 Kudos

PARAMETERS USED IN THE CALLING SUB-ROUTINES ARE CALLED ACTUAL PARAMETERS.

PARAMETRS USED IN THE CALLED SUB-ROUTINES ARE CALLED FORMAL PARAMETERS.

CALL-BY-REFERNCE:

SAME MEMORY WILL BE ALLOCATED FOR ACTUAL AND FORMAL PARAMETERS.

CALL-BY-VALUE:

DIFFERENT MEMPRY WILL BE ALLOCATED FOR ACTUAL AND FORMAL PARAMETERS.

ARUN REDDY I