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: 

Subroutine in Enhancement

Former Member
0 Kudos

Hi all,

I am using enhancement EXIT_SAPMQEVA_010 for QA11 transction,

In that function Exit i have developed code in Include ZXQEVU12.

In that include, some part of code is repeating 10 times, how can i make it once instead of writing 10 times.

Here subroutine and another include is not working and display the following error

<b>Incorrect nesting: Before the statement "FORM", the structure introduced by "FUNCTION" must be concluded by "ENDFUNCTION". -</b>

suggest me any other option

Regards

Prabhu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Prabhakar,

Dont write the Form..EndForm in another include , expand the subroutinues in the same include .

<i>Hope This Info Helps YOU</i>.

Regards,

Raghav

4 REPLIES 4

Former Member
0 Kudos

Hi Prabhakar,

Dont write the Form..EndForm in another include , expand the subroutinues in the same include .

<i>Hope This Info Helps YOU</i>.

Regards,

Raghav

Former Member
0 Kudos

hi prabhakara,

1. EXIT_SAPMQEVA_010 is as FM.

2. It has got block

FUNCTION...ENDFUNCTION.

3. It will not allow to write any subroutine

form/perform inside it.

4. One way is to

make another z program, (ZPROG)

and write form definition in it.

5. Then from your user exit call

perform abc in program ZPROG.

regards,

amit m.

former_member188685
Active Contributor
0 Kudos

Hi,

yes it is better to Go for in porgram option.

<b>perform Get_data in program Z_FORM.</b>

here you need to create one separate Zporgam there you can have that FORM and ENDFORM.

this will not give any errors.

Regards

vijay

0 Kudos

use something like this:

PERFORM customer_exit_pbo_b(zhsp0001) USING i0001 ipsyst.

and

and in the zhsp0001 (executable program)

FORM customer_exit_pbo_B USING p_i0001 STRUCTURE p0001

p_ipsyst STRUCTURE psyst.

check sy-binpt eq space.

IF p_ipsyst-massn eq '040'.

LOOP AT SCREEN.

IF screen-name = 'P0001-ZABKRS'.

screen-required = '1'.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDLOOP.

ENDIF.

endform.

reward points if it helps

gunjan