<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Function Module to create a program in SE38 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124313#M986103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create an ABAP program dynamically. The program name(to be created) will be provided in the selection screen and the logic of the program will be available in an internal table &amp;amp; also in a local PC file. Is there any Function Module available in SAP to create the program dynamically by using the code which is available in the internal table. The program should be saved in the Local Object.&lt;/P&gt;&lt;P&gt;Can someone help me on this issue. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Paddu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jul 2008 12:11:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-08T12:11:49Z</dc:date>
    <item>
      <title>Function Module to create a program in SE38</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124313#M986103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create an ABAP program dynamically. The program name(to be created) will be provided in the selection screen and the logic of the program will be available in an internal table &amp;amp; also in a local PC file. Is there any Function Module available in SAP to create the program dynamically by using the code which is available in the internal table. The program should be saved in the Local Object.&lt;/P&gt;&lt;P&gt;Can someone help me on this issue. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Paddu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 12:11:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124313#M986103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T12:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to create a program in SE38</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124314#M986104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this: [http://help.sap.com/saphelp_nw04/helpdata/en/9f/db996e35c111d1829f0000e829fbfe/frameset.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 12:15:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124314#M986104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T12:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to create a program in SE38</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124315#M986105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U need to use only INSERT REPORT statament:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT REPORT &amp;lt;REPORT NAME&amp;gt; FROM &amp;lt;ITAB&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 12:20:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124315#M986105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T12:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to create a program in SE38</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124316#M986106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT REPORT &amp;lt;prog&amp;gt; FROM &amp;lt;itab&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nikunj Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 12:46:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124316#M986106</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-08T12:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to create a program in SE38</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124317#M986107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Paddu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code fullfills your requirement. Only has the resctriction that all the file names must be in uppercase.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zcreate_report.

* TYPES
TYPES: BEGIN OF ty_code,
         line TYPE char255,
       END OF ty_code.

* CLASSES
CLASS cl_gui_frontend_services DEFINITION LOAD.

* INTERNAL TABLES
DATA: data_tab TYPE STANDARD TABLE OF file_info.
DATA: wa TYPE file_info.
DATA: ti_code TYPE STANDARD TABLE OF ty_code.

* VARIABLES
DATA: name TYPE PROGNAME.
DATA: count TYPE i.
DATA: bytecount TYPE i.
DATA: filename TYPE string.

* SELECTION-SCREEN
PARAMETERS: p_dir TYPE string OBLIGATORY DEFAULT 'C:\test\'.

*** START-OF-SELECTION
START-OF-SELECTION.

  CLEAR count.
  CALL METHOD cl_gui_frontend_services=&amp;gt;directory_list_files
    EXPORTING
      directory        = p_dir
      files_only       = 'X'
      directories_only = space
    CHANGING
      file_table       = data_tab
      count            = count.
  IF count EQ 0.
    MESSAGE i000(zsd1) WITH 'No files found'.
    EXIT.
  ENDIF.

  LOOP AT data_tab INTO wa.

    CALL FUNCTION 'AIPC_CONVERT_TO_UPPERCASE'
      EXPORTING
        i_input  = wa-filename
      IMPORTING
        e_output = wa-filename.

    CONCATENATE p_dir wa-filename INTO filename.

    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = filename
        filetype                = 'ASC'
      IMPORTING
        filelength              = bytecount
      TABLES
        data_tab                = ti_code
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    CHECK sy-subrc EQ 0.
    READ TABLE ti_code TRANSPORTING NO FIELDS INDEX 1.
    CHECK sy-subrc EQ 0.

    name = wa-filename.
    INSERT REPORT name FROM ti_code.

  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2008 14:01:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-a-program-in-se38/m-p/4124317#M986107</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-07-08T14:01:42Z</dc:date>
    </item>
  </channel>
</rss>

