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: 

regarding insert report statement

Former Member
0 Kudos

Hi All,

Is there any Function Module to insert the source code in the program.

I know we have Insert Report statement..

I have the source code in an internal table...

If I pass this itab into FM then this has to create the program...

I Like to know whether there is any FM to do the same functionality..

regards

phani

7 REPLIES 7

Former Member
0 Kudos

hi,

You can use fm <b>CIF_PROGRAM_INSERT</b>

Pass the internal table which is populated with code to the tables parameters, give program name, package, title name etc in the importing parameters. This creates the new program.

Regards,

Sailaja.

0 Kudos

Hi Sailaja,

Thanks for sending me the information...

Is there any FM to insert the source code in the FM...

Iam creating a FM Using the text files...

AM able to upload all the data like import, export parameters etc...except the source code...

Will you pls tell me if is there any FM do this...

thanks and regards

phani

0 Kudos

Hi,

check this

READ - Read a program

Basic form

READ REPORT prog INTO itab.

Related

INSERT REPORT, DELETE REPORT, SYNTAX-CHECK, GENERATE REPORT

All standard commands are used to read and generate report etc

0 Kudos

Hi Phani,

The function Module you need for inserting code into Function Module source code is

<b>RS_FUNCTIONMODULE_INSERT</b>.

Just give the FM name , FM group and the short text as exporting parameters . In the tables parameter there is a field named SOURCE.

Just create an internal table of type rssource and give the source code in the table.Pass this table as tables parameter SOURCE.

This will work.

Regards,

SP.

Former Member
0 Kudos

Hi Phani,

Try this if you want to generate a source code. Let me know whether this si fine.

Data : o_pgeditor type ref to cl_wb_pgeditor,

progname like TRDIR-NAME,

source type SEDI_SOURCE .

CALL METHOD o_pgeditor->read_source

EXPORTING

source_name = program_name

IMPORTING

SOURCE_TAB = source[]

EXCEPTIONS

CANCELLED = 1

NOT_FOUND = 2

READ_PROTECTED = 3

others = 4.

Regards,

Sanjiv

Former Member
0 Kudos

Hai Phani

go through this document

this will help your requirement

INSERT REPORT prog FROM itab.

Effect

Inserts the program prog from the internal table itab into the library. The internal table itab contains the source code; the lines of the table cannot be more than 72 characters long. The program attributes (type, date, ...) are set by the system, but you can change them manually or in the program (table TRDIR ).

Note

Runtime errors

INSERT_PROGRAM_INTERNAL_NAME :

The program name prog is reserve internally; it begins with '%_T' .

INSERT_PROGRAM_NAME_BLANK :

The program name prog must not contain any blanks characters.

INSERT_PROGRAM_NAME_TOO_LONG :

The program name prog is too long; it cannot be more than 8 characters long.

INSERT_REPORT_LINE_TOO_LONG :

One of the source code lines is longer than 72 characters

Thanks & regards

Sreenivasulu P

Former Member
0 Kudos

Hi,

Why are you unable to upload sourcecode when you are uploading the import, export, table parameters?

which function module are you using to populate them?

Regards,

Sailaja.