04-21-2006 10:01 AM
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
04-21-2006 10:10 AM
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.
04-21-2006 10:40 AM
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
04-21-2006 12:40 PM
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
04-21-2006 1:07 PM
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.
04-21-2006 10:12 AM
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
04-21-2006 10:14 AM
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
04-21-2006 1:08 PM
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.