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: 

How to perform subroutine form in an include program?

Former Member
0 Kudos

Hi all,

I would like to perform an external subroutine form residing in an include program from a customer function user exit. I tried using the following code, but it dumps:

PERFORM <form name> IN PROGRAM (lv_program)

TABLES <a> <b> USING <c>.

In the dump analysis I see that "Program <include name> is type I and therefore cannot be generated" and "The current ABAP/4 program attempts to call the program <include name> but this program cannot be executed. Therefore,the current program had to be terminated. "

If the include can't be generated, is there another way or method I could directly call the form without needing to copy the standard code to an own function or form?

Best regards,

Mikko

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Mikko,

U need to provide with the main program name instead of include then it wil not give a dump or error. Find the main program name and use it.

14 REPLIES 14

FredericGirod
Active Contributor
0 Kudos

Hi,

include <name_of_the_include>.

perform <name_of_the_form>.

(simple way is the better way )

Fred

Former Member
0 Kudos

Hi

You have to insert that include in a program, so or you convert the include in a program or you create a program where you'll insert it.

Max

Former Member
0 Kudos

Hello Mikko,

U need to provide with the main program name instead of include then it wil not give a dump or error. Find the main program name and use it.

0 Kudos

Hi Abhijit,

thanks for the tip. I checked the where used list of the include program but couldn't unfortunately find any references of this include (LHRWPC_TO_REMOTEF01).

Others, the inclusion of the include in my code doesn't work because I'm working inside a user exit. Putting in the include form makes the system give an error to place the inclusion after the function module (which is a modification then).

Any more tips?

-Mikko

ps. You were the first to give the correct answer so 10p for you

Message was edited by: Mikko Mäki-Rahkola

Former Member
0 Kudos

have u included the include in the program

hymavathi_oruganti
Active Contributor
0 Kudos

PERFORM <form name> IN PROGRAM (lv_program)

TABLES <a> <b> USING <c>.

lv_program should be program name but not include name.

give the program name

or include that include in the current program

Former Member
0 Kudos

use include

and submit

former_member188685
Active Contributor
0 Kudos

Hi,

take this example..

     perform idoc_status_record_write in program sapmsed7 using
                                                x_edidc-docnum
                                                c_idoc_status_ready
                                                space
                                                space
                                                space
                                                space
                                                space
                                                space.

in this the from is in include, but while calling you need to call with the help of main program.

in this case <b>SAPMSED7</b> main program, but form is in include <b>MSED7F05</b>

Regards

vijay

Former Member
0 Kudos

Hi mikko,

1. what i understood is that :

2. customer exi

--> an FM

-


> an include

-


FORM subroutine (inside the include)

3. in such case, how can we write

FORM subroutine inside the include of the customer exit FM ?

BCOS it will give error.

Incorrect nesting: Before the statement "FORM", the structure introduced by "FUNCTION" must be concluded by "ENDFUNCTION" . . . . . .

regards,

amit m.

0 Kudos

Yes, that's exactly why I can't put the form simply as an include inside the customer exit. I would need to find some way of calling the existing external form (before copying the code to a custom fm or other..)

-Mikko

0 Kudos

hi,

try this instead of include program give this <b>SAPLHRWPC_TO_REMOTE</b>.

Regards

vijay

0 Kudos

Yes, it works now! How did you find this, by guessing?

-Mikko

0 Kudos

hi,

<b>SAPLHRWPC_TO_REMOTE</b> is the main program of include, this is function pool of the function module.

Regards

vijay

0 Kudos

Ah yes..found it now, too..(blush blush)

I tried getting the where used list by clicking on the include header label field while I should have clicked the button on the row beginning with "***INCLUDE LHRWPC_TO_REMOTEF01".

Thanks again!

-Mikko