Table source code

pls sent to me table source coding.

If you are looking for table reference, it can be found through SDK help file - REFDB.CHM
Thanks,
Gordon

Similar Messages

  • How will get the source code of all the tables in a given schema using SQL?

    Hi All,
    How can we get the source code of all the tables in a given schema using SQL?
    Thanks in Adv.
    Junu

    Try something like...
    set heading off
    set pagesize 0
    col meta_data for a96 word_wrapped
    set long 100000
    SELECT DBMS_METADATA.GET_DDL(object_type, object_name, owner) ||';' AS meta_data
    FROM dba_objects
    WHERE owner = '<SCHEMA NAME>'
      AND object_type not in (<list of stuff you do not want>);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Source Code Longer Than Table --Dump. Wht to do?

    Hi All,
    I have created a Z-subrouitne pool and coded print program with Entry rountines for smartforms in it. When I tried to maintian the output control, stating the name of program and entry rountine of it, it is throwing dump while saving.
    it is saying:
    <b>The ABAP source code lines are longer than the width of the internal</b>
    The detail is:
    An exception occurred. This exception is dealt with in more detail below       
    . The exception, which is assigned to the class 'CX_SY_READ_SRC_LINE_TOO_LONG',
      was neither                                                                   
    caught nor passed along using a RAISING clause, in the procedure               
      "NAST_FORM_EXISTENCE_CHECK" "(FUNCTION)"                                      
    Since the caller of the procedure could not have expected this exception       
      to occur, the running program was terminated.                                 
    The reason for the exception is:                                               
    You tried to read the program "SAPMZMM_PRINT" from the database. The READ      
      REPORT                                                                        
    statement allows you to copy a program's source code into an internal          
    table. The lines of source code must not be longer than the width of the       
      internal table. <b>The internal table is 72 characters wide. The source          
    code line is 87 wide.    </b>                                                      
    But I kept all the line (and re adjusted the longer one) within 72 char. the why am I  facing this error? please suggest how to correct it.
    Rewards point guranteed.
    Anid.

    HI,
    in order to be sure, open the abap editor and click Utilities->Settings and check Downward-Compat. Line Length (72). Then go to SAPMZMM_PRINT and do a pretty print or  just activate it. This should be ok.
    Kostas

  • Dynamic XSLT source code generation based upon internal table

    Hi,
    Is there anyway to generate dynamic XSLT source code based upon final structure of output internal table and call dynamic generated XSLT in program?
    CALL TRANSFORMATION z_transformation
                PARAMETERS
                 p_shared_string = lo_shared_str_nodeset
                SOURCE XML g_sheet_data
                RESULT lt_data = i_data[].
    Source code example of XSLT transformation -
    <xsl:template match="/">
         <asx:abap version="1.0">
           <asx:values>
             <LT_DATA>   "Internal table
               <xsl:for-each select="ss:worksheet/ss:sheetData/ss:row">
                 <xsl:if test="position() &gt; 1">
                   <item>
                     <FIELD1>
                       <xsl:variable name="cell_id" select="concat('A', position())"/>
                       <xsl:variable name="v_index" select="ss:c[@r=$cell_id][@t='s']/ss:v"/>
                       <xsl:if test="$v_index">
                         <xsl:value-of select="$V_SHARED_STRING/sst/si[$v_index + 1]/t"/>
                       </xsl:if>
                       <xsl:if test="not($v_index)">
                         <xsl:value-of select="ss:c[@r=$cell_id]/ss:v"/>
                       </xsl:if>
                     </FIELD1>
                 </item>
                 </xsl:if>
               </xsl:for-each>
             </LT_DATA> "internal table
           </asx:values>
         </asx:abap>
       </xsl:template>
    </xsl:transform>

    In addition,
    We are converting binary data of excel from application server into internal table but currently we created two XSLT transformation to achieve this one for deleting name space and other for converting data into internal table format.
    We want to make our source code for future use also,Is there anyway to generate XSLT source code dynamically?Above mentioned code is snippet of data extracting which we are doing but this transformation is hard coded.
    Any help is appreciated.
    BR,
    Praveen

  • Which table(object) store web dynpro source code?

    Hello Colleague:
    As we are try to copy and rename webdynpro  component,the objects which  are used in the component controller method

    Hi,
    You can search for table name using  WDY_*.  There are so many tables related webdynpro.
    For example.. WDY_APPLICATION  - WD Application details. you can search for more..
    For source code.. check this..
    Need table name used for storing web dynpro methods' code.
    Cheers,
    Kris.

  • Manage table function's source code in OWB metadata

    Hi all,
    please I would like to know if it possible to code a table function in OWB's metadata.
    I'll try to better explain myself; I know how to use a tf in a mapping but I also would like to manage the table function's source code in OWB metadata repository.
    It appears you cant code a table function as procedures/functions: there's no ref_cursor as input , no pipelined option and so on.
    I'm workin on 10.2.0.4 OWB repos.
    Any information will be appreciated, thanks.
    best regards, David

    ... you are right. You cannot write the code of a table function inside owb. You must write the table function external and create it in the database. In owb you only can call the table function.
    Regards,
    Detlef

  • Regards source code table

    Hi Friends
               I know TRDIR is a table, which holds the all ABAP Program names. Even through if the program created by user. Likewise any table holds the source code. If it is can you plz let me know.
    Regards
    Saravanan

    Hi Saravanan,
    SAP does not store ABAP codes in transparent tables, but in cluster tables.
    You can read the code using READ REPORT as a direct query method is not possible.
    I hope this helps.
    Hafeez

  • Source Code (Table)

    Hai Frnd's
        There are tables (TADIR,TRDIR) which contains the details about the devclass and the program.from which table the source code of the particular program can be retrieved.
    Thanks in Advance
    Suganya

    <b>TDXLOADP</b> is used to see the Programs to Load Data into R/3
    Can get only info reg the program using tables not the code.
    <b>D010SINF</b> ABAP: Information about ABAP program source code
    Message was edited by:
            Judith Jessie Selvi

  • Which SAP table stores the ABAP program Source Code

    Hi All,
    Which SAP table stores the ABAP source code .
    Is it possible to retrieve the abap program code from database table
    wherein it is stored .
    Scenario :
    In our project SAP got decommissioned and SAP database is migrated to Oracle . As SAP is decomissioned , we are not able to access the SAP frontend . But we need a program code to service a request . Is it possible to retrieve the program code from the database
    which is migrated to oracle .
    Thanks
    Shikha

    This is an interesting question as the answer is may be different depending on your version.  For example, in new releases the table REPOSRC appears to hold a compress version of the course code in the DATA field, but you would need to be able to decompress it if trying to read this directly out of the DB.  I would assume that it uses gZip to do the compression, and there are ABAP utilities built in to do the compress/decompress.  Of course you can always read the source code by using the READ REPORT statement in any release, but of course this will not help you if you can not log on to your system.  Basically, if you system is corrupt for some reason, the best option is to restore from a backup.
    REgards,
    Rich Heilman

  • Code:10058. Incorrectly defined logical table source

    Hi experts
    I need to create Business model for which i have two fact tables in physical layer and both are connected to each other and one time dimension which is shared by both fact tables in physical layer and one dimension which is connected to fact2 that contain hierarchy. i want to create one fact table in BMM layer which should contain measures from both fact table......
    How to achieve this, any help on this..
    thanks & regards
    Edited by: ObieeUser on 06-May-2010 02:58
    Edited by: ObieeUser on 06-May-2010 03:00

    hi
    Go through this forum thread
    OBIEE: Incorrectly defined logical table source doesn't contain mapping
    try this steps
    Goto Business Model and Mapping Layer. There Fact table is present expend that fact table. You will find Sources option expend that sources option. In that option you will find sone table name that is present in Physical layer.Get the property of first table and there you can see in General tab in downward ADD option is there. click on ADD option new window is open and there three part is . right down contains some table select table from that table which we are joining and then click on select option. Now that table will added. you can change join type also. By default it is inner join. now refresh you page.
    i hope this will help you
    thanks & regards

  • Functional Module:Need  some sample source code.

    Hi All,
    I have created  a customized table   u2018ZStock_Order_Dealeru2019 with the following fields:
    Stock_Order_Dealer
    Dealer Number
    S2D order Number     
    Line item Number     
    Material Number     
    Ordered Quantity     
    Batch Number     
    Received Quantity     
    S2D from D2G     
    Receiving Date
    I need to  create a remote enabled function module in CRM system to fetch the u2018Batch Numberu2019 and u2018Received Quantityu2019 fields when the Material Number is fed to it.Please note that the input and output should be tables.
    Could some one please give some sample source code for this.

    I used table types and select queries to resolve this problem.

  • Sample  PL/SQL Portlet Source Code for Oracle Portal 9ias

    Hi, I'm a newbie of Oracle Portal technology, and I have a problem:
    I would create a PL/SQL portlet that realizes the following functions:
    1) Retrieve the username of the portal user logged from WWCTX_API.GET_USER function.
    2) Insert into an oracle db table two values about two hidden fields in the HTML FORM of the portlet.
    3) Realize the insert commit through the click on the submit button on the Html form of the portlet. I would redirect by the same button to an other page url also.
    I've never developed in Portal, and may be useful if someone could post me the source code of the SHOW MODE SECTION in the PROCEDURE SHOW of a SAMPLE PL/SQL PORTLET that realizes the upper functions.
    Thanks a lot....

    Hi
    Here's the code from Helloworld_Portlet example:
    procedure show
    p_portlet_record wwpro_api_provider.portlet_runtime_record
    is
    l_portlet wwpro_api_provider.portlet_record;
    begin
    if (not is_runnable(
    p_provider_id => p_portlet_record.provider_id
    ,p_reference_path => p_portlet_record.reference_path)
    ) then
    raise wwpro_api_provider.PORTLET_SECURITY_EXCEPTION;
    end if;
    Retrieve the portlet information.
    l_portlet := get_portlet_info(
    p_provider_id => p_portlet_record.provider_id
    ,p_language => p_portlet_record.language
    if (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW) then
    if (p_portlet_record.has_title_region) then
    Draw the portlet header and specify what links are available
    from that header (i.e. details, customize, help, and about).
    The has_title property is set at the page region level.
    wwui_api_portlet.draw_portlet_header
    p_provider_id => p_portlet_record.provider_id
    ,p_portlet_id => p_portlet_record.portlet_id
    ,p_title => l_portlet.title
    ,p_has_details => true
    ,p_has_edit => true
    ,p_has_help => true
    ,p_has_about => true
    ,p_referencepath => p_portlet_record.reference_path
    ,p_back_url => p_portlet_record.page_url
    end if;
    Draw the portlet borders.
    The has_border property is set at the page region level.
    wwui_api_portlet.open_portlet(p_portlet_record.has_border);
    Display the content of the portlet in the show mode.
    Use the wwui_api_portlet.portlet_text() API when
    generating the content of the portlet so that the
    output uses the portlet CSS.
    htp.p(wwui_api_portlet.portlet_text(
    p_string => 'Hello World - Mode Show'
    ,p_level => 1
    if (p_portlet_record.has_border) then
    wwui_api_portlet.close_portlet;
    end if;
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW_ABOUT) then
    Display the about page for the portlet.
    htp.p('Hello World - Mode Show About');
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW_EDIT) then
    Display the edit page for the portlet.
    htp.p('Hello World - Mode Show Edit');
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW_HELP) then
    Display the help page for the portlet.
    htp.p('Hello World - Mode Show Help');
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW_EDIT_DEFAULTS) then
    Display the edit defaults page for the portlet.
    htp.p('Hello World - Mode Edit Defaults');
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW_DETAILS) then
    Display the details page for the portlet.
    htp.p('Hello World - Mode Show Details');
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_PREVIEW) then
    Display the preview page for the portlet.
    htp.p('Hello World - Mode Show Preview');
    end if;
    end show;
    I think you need to add this:
    You can get the values of your html-form with this command:
    v_hidden_1 varchar2(256);
    v_hidden_2 varchar2(256);
    v_hidden_1 := wwpro_api_parameters.get_value('name_of_hidden_1_in_html_form','p');
    v_hidden_2 := wwpro_api_parameters.get_value('name_of_hidden_2_in_html_form','p');
    You can get the actual URL with this command:
    v_url := p_portlet_record.page_url;
    Hope that helps.
    Regards,
    Mark

  • How to get all the column values from a table source

    Hi,
    I have created one table source on a employee table and some customized attributes using global settings>search attributes.
    Now these customized attributes mapped with the table columns through attribute mapping from the sorce tab.
    Using doOracleSearch method i passed last parameter i.e. Integer array of customized attributes.
    After execution of doOracleSearch method i am getting the results but customized attributes are not coming.
    getCustomAttributes method returns null instead of some values.
    Please refer following code for more info:
    Integer[] fetchAttr=new Integer[2];
    fetchAttr[0]=new Integer(137);
    fetchAttr[1]=new Integer(138);
    result =
    stub.doOracleSearch("BTM",
    new Integer(1),
    new Integer(10),
    Boolean.TRUE,
    Boolean.TRUE,
    group,
    "en",
    "en",
    Boolean.TRUE,
    null,
    null,
    fetchAttr);
    ResultElement[] resElements = result.getResultElements();
    for(int i = 0; i < resElements.length; i++)
    System.out.println("Title : " + resElements[0].getTitle());
    System.out.println("Snippet : " + resElements[0].getSnippet());
    System.out.println("URL : " + resElements[0].getUrl());
    System.out.println("non default : " + resElements[0].getCustomAttributes()); // it returns null here
    }

    Confirm the attributes you are asking SES for match those on the data source being searched. One thing to try is to simply tell SES to return all custom attributes for your search. Here is a snippet to build a list of all attribute IDs and pass them to your search...
    // Create and set SOAP URL
    OracleSearchService searchService = new OracleSearchService();
    searchService.setSoapURL("http://myserver:7777/search/query/OracleSearch");
    // Set attributes to fetch (all)
    Attribute[] attributesAll = searchService.getAllAttributes("en");
    ArrayList<Integer> attributeIds = new ArrayList<Integer>();
    for(Attribute a: attributesAll)
    attributeIds.add(a.getId());
    Integer attributeIdArrayAll[] = new Integer[attributeIds.size()];
    attributeIdArrayAll = attributeIds.toArray(attributeIdArrayAll);      
    // Query
    OracleSearchResult result = searchService.doOracleSearch("some text", ..........[other params], attributeIdArrayAll);
    // Print out results
    ResultElement[] resElements = result.getResultElements();
    for(int i = 0; i < resElements.length; i++)
    // Get document
    ResultElement doc = resElements;
    // Print Title
    System.out.println("Title: " + doc.getTitle());
    // Print custom attributes
    CustomAttribute[] attributes = doc.getCustomAttributes();
    for(int j = 0; j < attributes.length; j++)
    CustomAttribute attr = attributes[j];
         System.out.println("[Custom Attribute] " + attr.getName() + ": " + attr.getValue());
    Hope this helps.

  • Upload and Download ABAP Source Code

    This is a program that I have had kicking around for a couple of years in various incarnations.
    Source Code Listing
    Report: ZKBPROGS *
    Function : Up/Download ABAP reports complete with texts *
    - this program does not update TRDIR with the *
    TRDIR entries that are in the program uploaded. Instead, *
    current users stats are used. *
    - this program allows selection of reports from a list or *
    a single report can be tuped in and uploaded *
    - this program also updates TADIR so that a development class*
    is assigned to the program *
    - this program checks to see if the program already has a *
    TRDIR entry, and if it does, warns the user *
    - this program will save/restore the program documenation too*
    REPORT ZKBPROGS
    NO STANDARD PAGE HEADING
    LINE-SIZE 255.
    Declare Database Objects *
    tables:
    DOKIL,
    TRDIR.
    Constants*
    CONSTANTS:
    MC_TRDIR_IDENTIFIER(72) TYPE C VALUE '%&%& RDIR',
    MC_REPORT_IDENTIFIER(72) TYPE C VALUE '%&%& REPO',
    MC_TEXT_IDENTIFIER(72) TYPE C VALUE '%&%& TEXP',
    MC_THEAD_IDENTIFIER(72) TYPE C VALUE '%&%& HEAD',
    MC_DOC_IDENTIFIER(72) TYPE C VALUE '%&%& DOKL',
    MC_TRDIR_SHORT(4) TYPE C VALUE 'RDIR',
    MC_REPORT_SHORT(4) TYPE C VALUE 'REPO',
    MC_TEXT_SHORT(4) TYPE C VALUE 'TEXP',
    MC_THEAD_SHORT(4) TYPE C VALUE 'HEAD',
    MC_DOC_SHORT(4) TYPE C VALUE 'DOKP'.
    Declare Module level data structures *
    DATA: BEGIN OF MTAB_PROGRAM_SOURCE OCCURS 0,
    LINE(72) TYPE C,
    END OF MTAB_PROGRAM_SOURCE.
    DATA: MTAB_PROGRAM_TRDIR LIKE TRDIR OCCURS 0 WITH HEADER LINE.
    DATA: MTAB_PROGRAM_TEXTS LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.
    DATA: MSTR_THEAD LIKE THEAD.
    DATA: BEGIN OF MTAB_PROGRAM_FILE OCCURS 0,
    LINE(275) TYPE C,
    END OF MTAB_PROGRAM_FILE.
    DATA: BEGIN OF MTAB_DIRECTORY OCCURS 0,
    NAME LIKE TRDIR-NAME,
    DESC(72) TYPE C,
    SAVENAME LIKE RLGRAP-FILENAME,
    END OF MTAB_DIRECTORY.
    DATA: BEGIN OF MTAB_PROGRAM_DOCUMENTATION OCCURS 0,
    LINE(255) TYPE C,
    END OF MTAB_PROGRAM_DOCUMENTATION.
    Selection Screen *
    *-- Options for upload/download of programs
    SELECTION-SCREEN BEGIN OF BLOCK FRM_OPTIONS WITH FRAME TITLE TEXT-UDL.
    PARAMETERS:
    RB_DOWN RADIOBUTTON GROUP UDL DEFAULT 'X'. " Download reports
    SELECTION-SCREEN BEGIN OF BLOCK FRM_TRDIR WITH FRAME TITLE TEXT-DIR.
    SELECT-OPTIONS:
    S_NAME FOR TRDIR-NAME, " Program Name
    S_SUBC FOR TRDIR-SUBC " Program Type
    DEFAULT 'F' OPTION EQ SIGN E," Exclude Functions by default
    S_CNAM FOR TRDIR-CNAM " Created by
    DEFAULT SY-UNAME,
    S_UNAM FOR TRDIR-UNAM, " Last Changed by
    S_CDAT FOR TRDIR-CDAT, " Creation date
    S_UDAT FOR TRDIR-UDAT. " Last update date
    SELECTION-SCREEN END OF BLOCK FRM_TRDIR.
    *-- Options for uploading programs
    PARAMETERS:
    RB_UP RADIOBUTTON GROUP UDL. " Upload reports
    SELECTION-SCREEN BEGIN OF BLOCK FRM_UPLOAD WITH FRAME TITLE TEXT-UPL.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(29) TEXT-SNG.
    PARAMETERS:
    RB_FILE RADIOBUTTON GROUP HOW DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 33(42) TEXT-FNA.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS:
    RB_LIST RADIOBUTTON GROUP HOW.
    SELECTION-SCREEN END OF BLOCK FRM_UPLOAD.
    SELECTION-SCREEN END OF BLOCK FRM_OPTIONS.
    *-- Options for up/downloading programs
    SELECTION-SCREEN BEGIN OF BLOCK FRM_FILEN WITH FRAME TITLE TEXT-FIL.
    PARAMETERS:
    RB_DOS RADIOBUTTON GROUP FIL DEFAULT 'X', " Save to local
    RB_UNIX RADIOBUTTON GROUP FIL, " Save to UNIX
    P_PATH LIKE RLGRAP-FILENAME " Path to save files to
    DEFAULT 'c:\temp\'.
    SELECTION-SCREEN END OF BLOCK FRM_FILEN.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-LOW.
    CALL FUNCTION 'F4_PROGRAM'
    EXPORTING
    OBJECT = S_NAME-LOW
    SUPPRESS_SELECTION = 'X'
    IMPORTING
    RESULT = S_NAME-LOW
    EXCEPTIONS
    OTHERS = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-HIGH.
    CALL FUNCTION 'F4_PROGRAM'
    EXPORTING
    OBJECT = S_NAME-HIGH
    SUPPRESS_SELECTION = 'X'
    IMPORTING
    RESULT = S_NAME-HIGH
    EXCEPTIONS
    OTHERS = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-LOW.
    PERFORM GET_NAME USING 'S_UNAM-LOW'
    CHANGING S_UNAM-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-HIGH.
    PERFORM GET_NAME USING 'S_UNAM-HIGH'
    CHANGING S_UNAM-HIGH.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-LOW.
    PERFORM GET_NAME USING 'S_CNAM-LOW'
    CHANGING S_CNAM-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-HIGH.
    PERFORM GET_NAME USING 'S_CNAM-HIGH'
    CHANGING S_CNAM-HIGH.
    TOP-OF-PAGE.
    IF RB_LIST = 'X'.
    FORMAT COLOR COL_HEADING.
    NEW-LINE.
    WRITE: AT 3 TEXT-H01,
    AT 15 TEXT-H03.
    FORMAT COLOR OFF.
    ENDIF.
    AT LINE-SELECTION.
    CHECK RB_LIST = 'X'. " only do in list mode
    READ LINE SY-CUROW FIELD VALUE MTAB_DIRECTORY-SAVENAME.
    *-- Read file into an internal table
    PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
    USING MTAB_DIRECTORY-SAVENAME.
    *-- Split table into TADIR entry, report lines, and report text
    PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
    MTAB_PROGRAM_SOURCE
    MTAB_PROGRAM_TEXTS
    MTAB_PROGRAM_DOCUMENTATION
    CHANGING TRDIR
    MSTR_THEAD.
    *-- Save all of the data
    PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
    MTAB_PROGRAM_TEXTS
    MTAB_PROGRAM_DOCUMENTATION
    USING TRDIR
    MSTR_THEAD.
    Start of processing *
    START-OF-SELECTION.
    FORMAT COLOR COL_NORMAL.
    IF RB_DOWN = 'X'.
    PERFORM DOWNLOAD_REPORTS.
    ELSEIF RB_UP = 'X'.
    PERFORM UPLOAD_REPORTS.
    ENDIF.
    END-OF-SELECTION.
    IF RB_DOWN = 'X'.
    CONCATENATE P_PATH
    'directory.txt'
    INTO P_PATH.
    PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_DIRECTORY
    USING P_PATH.
    ENDIF.
    FORM UPLOAD_REPORTS *
    FORM UPLOAD_REPORTS.
    *-- Can upload a reports entered in selection criteria or
    *-- select from a list. List can be from index.txt in same directory
    *-- (created by the download) or by reading the first line of each file
    *-- in the directory.
    IF RB_FILE = 'X'. " Upload single program from a file
    *-- Read file into an internal table
    PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
    USING P_PATH.
    *-- Split table into TADIR entry, report lines, and report text
    PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
    MTAB_PROGRAM_SOURCE
    MTAB_PROGRAM_TEXTS
    MTAB_PROGRAM_DOCUMENTATION
    CHANGING TRDIR
    MSTR_THEAD.
    *-- Save all of the data
    PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
    MTAB_PROGRAM_TEXTS
    MTAB_PROGRAM_DOCUMENTATION
    USING TRDIR
    MSTR_THEAD.
    ELSEIF RB_LIST = 'X'. " Show list for user to choose from
    *-- get list of report names/descriptions from directory text
    CONCATENATE P_PATH
    'directory.txt'
    INTO P_PATH.
    PERFORM READ_REPORT_FROM_DISK TABLES MTAB_DIRECTORY
    USING P_PATH.
    SORT MTAB_DIRECTORY.
    *-- Write out list of report names/descriptions
    LOOP AT MTAB_DIRECTORY.
    WRITE:
    / MTAB_DIRECTORY-NAME UNDER TEXT-H01,
    MTAB_DIRECTORY-DESC UNDER TEXT-H03,
    MTAB_DIRECTORY-SAVENAME.
    ENDLOOP.
    *-- Process user selections for reports to upload.
    ENDIF.
    ENDFORM. " upload_reports
    FORM DOWNLOAD_REPORTS *
    From the user selections, get all programs that meet the *
    criteria, and save them in ftab_program_directory. *
    Also save the report to disk. *
    FORM DOWNLOAD_REPORTS.
    DATA:
    LC_FULL_FILENAME LIKE RLGRAP-FILENAME.
    *-- The table is put into an internal table because the program will
    *-- abend if multiple transfers to a dataset occur within a SELECT/
    *-- ENDSELCT (tested on 3.1H)
    SELECT * FROM TRDIR
    INTO TABLE MTAB_PROGRAM_TRDIR
    WHERE NAME IN S_NAME
    AND SUBC IN S_SUBC
    AND CNAM IN S_CNAM
    AND UNAM IN S_UNAM
    AND CDAT IN S_CDAT
    AND UDAT IN S_UDAT.
    LOOP AT MTAB_PROGRAM_TRDIR.
    *-- Clear out text and source code tables
    CLEAR:
    MTAB_PROGRAM_FILE,
    MTAB_PROGRAM_SOURCE,
    MTAB_PROGRAM_TEXTS,
    MTAB_PROGRAM_DOCUMENTATION.
    REFRESH:
    MTAB_PROGRAM_FILE,
    MTAB_PROGRAM_SOURCE,
    MTAB_PROGRAM_TEXTS,
    MTAB_PROGRAM_DOCUMENTATION.
    *-- Get the report
    READ REPORT MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_SOURCE.
    *-- Get the text for the report
    READ TEXTPOOL MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_TEXTS.
    *-- Get the documentation for the report
    CLEAR DOKIL.
    SELECT * UP TO 1 ROWS FROM DOKIL
    WHERE ID = 'RE'
    AND OBJECT = MTAB_PROGRAM_TRDIR-NAME
    AND LANGU = SY-LANGU
    AND TYP = 'E'
    ORDER BY VERSION DESCENDING.
    ENDSELECT.
    *-- Documentation exists for this object
    IF SY-SUBRC = 0.
    CALL FUNCTION 'DOCU_READ'
    EXPORTING
    ID = DOKIL-ID
    LANGU = DOKIL-LANGU
    OBJECT = DOKIL-OBJECT
    TYP = DOKIL-TYP
    VERSION = DOKIL-VERSION
    IMPORTING
    HEAD = MSTR_THEAD
    TABLES
    LINE = MTAB_PROGRAM_DOCUMENTATION
    EXCEPTIONS
    OTHERS = 1.
    ENDIF.
    *-- Put the report code and texts into a single file
    *-- Put the identifier line in so that the start of the TRDIR line
    *-- is marked
    CONCATENATE MC_TRDIR_IDENTIFIER
    MTAB_PROGRAM_TRDIR-NAME
    INTO MTAB_PROGRAM_FILE-LINE.
    APPEND MTAB_PROGRAM_FILE.
    *-- Add the TRDIR line
    MTAB_PROGRAM_FILE-LINE = MTAB_PROGRAM_TRDIR.
    APPEND MTAB_PROGRAM_FILE.
    *-- Put the identifier line in so that the start of the report code
    *-- is marked
    CONCATENATE MC_REPORT_IDENTIFIER
    MTAB_PROGRAM_TRDIR-NAME
    INTO MTAB_PROGRAM_FILE-LINE.
    APPEND MTAB_PROGRAM_FILE.
    *-- Add the report code
    LOOP AT MTAB_PROGRAM_SOURCE.
    MTAB_PROGRAM_FILE = MTAB_PROGRAM_SOURCE.
    APPEND MTAB_PROGRAM_FILE.
    ENDLOOP.
    *-- Put the identifier line in so that the start of the report text
    *-- is marked
    CONCATENATE MC_TEXT_IDENTIFIER
    MTAB_PROGRAM_TRDIR-NAME
    INTO MTAB_PROGRAM_FILE-LINE.
    APPEND MTAB_PROGRAM_FILE.
    *-- Add the report texts
    LOOP AT MTAB_PROGRAM_TEXTS.
    MTAB_PROGRAM_FILE = MTAB_PROGRAM_TEXTS.
    APPEND MTAB_PROGRAM_FILE.
    ENDLOOP.
    *-- Put the identifier line in so that the start of the THEAD record
    *-- is marked
    CONCATENATE MC_THEAD_IDENTIFIER
    MTAB_PROGRAM_TRDIR-NAME
    INTO MTAB_PROGRAM_FILE-LINE.
    APPEND MTAB_PROGRAM_FILE.
    MTAB_PROGRAM_FILE = MSTR_THEAD.
    APPEND MTAB_PROGRAM_FILE.
    *-- Put the identifier line in so that the start of the report
    *-- documentation is marked
    CONCATENATE MC_DOC_IDENTIFIER
    MTAB_PROGRAM_TRDIR-NAME
    INTO MTAB_PROGRAM_FILE-LINE.
    APPEND MTAB_PROGRAM_FILE.
    *-- Add the report documentation
    LOOP AT MTAB_PROGRAM_DOCUMENTATION.
    MTAB_PROGRAM_FILE = MTAB_PROGRAM_DOCUMENTATION.
    APPEND MTAB_PROGRAM_FILE.
    ENDLOOP.
    *-- Make the fully pathed filename that report will be saved to
    CONCATENATE P_PATH
    MTAB_PROGRAM_TRDIR-NAME
    '.txt'
    INTO LC_FULL_FILENAME.
    PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_PROGRAM_FILE
    USING LC_FULL_FILENAME.
    *-- Write out message with Program Name/Description
    READ TABLE MTAB_PROGRAM_TEXTS WITH KEY ID = 'R'.
    IF SY-SUBRC = 0.
    MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
    MTAB_DIRECTORY-DESC = MTAB_PROGRAM_TEXTS-ENTRY.
    MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
    APPEND MTAB_DIRECTORY.
    WRITE: / MTAB_PROGRAM_TRDIR-NAME,
    MTAB_PROGRAM_TEXTS-ENTRY(65) COLOR COL_HEADING.
    ELSE.
    MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
    MTAB_DIRECTORY-DESC = 'No description available'.
    MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
    APPEND MTAB_DIRECTORY.
    WRITE: / MTAB_PROGRAM_TRDIR-NAME.
    ENDIF.
    ENDLOOP.
    ENDFORM. " BUILD_PROGRAM_DIRECTORY
    FORM SAVE_TABLE_TO_FILE *
    --> FTAB_TABLE *
    --> F_FILENAME *
    FORM SAVE_TABLE_TO_FILE TABLES FTAB_TABLE
    USING F_FILENAME.
    IF RB_DOS = 'X'. " Save file to presentation server
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = F_FILENAME
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = FTAB_TABLE
    EXCEPTIONS
    OTHERS = 4.
    IF SY-SUBRC NE 0.
    WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
    F_FILENAME COLOR COL_NEGATIVE.
    ENDIF.
    ELSE. " Save file to application server
    OPEN DATASET F_FILENAME FOR OUTPUT IN TEXT MODE.
    IF SY-SUBRC = 0.
    LOOP AT FTAB_TABLE.
    TRANSFER FTAB_TABLE TO F_FILENAME.
    IF SY-SUBRC NE 0.
    WRITE: / 'Error writing record to file;' COLOR COL_NEGATIVE,
    F_FILENAME COLOR COL_NEGATIVE.
    ENDIF.
    ENDLOOP.
    ELSE.
    WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
    F_FILENAME COLOR COL_NEGATIVE.
    ENDIF.
    ENDIF. " End RB_DOS
    ENDFORM. " SAVE_PROGRAM
    FORM READ_REPORT_FROM_DISK *
    Read report into internal table. Can read from local or *
    remote computer *
    FORM READ_REPORT_FROM_DISK TABLES FTAB_TABLE
    USING F_FILENAME.
    DATA:
    LC_MESSAGE(128) TYPE C.
    CLEAR FTAB_TABLE.
    REFRESH FTAB_TABLE.
    IF RB_DOS = 'X'.
    TRANSLATE F_FILENAME USING '/\'. " correct slash for Dos PC file
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    FILENAME = F_FILENAME
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = FTAB_TABLE
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TABLE_WIDTH = 4
    INVALID_TYPE = 5
    NO_BATCH = 6
    UNKNOWN_ERROR = 7
    OTHERS = 8.
    IF SY-SUBRC >< 0.
    WRITE: / 'Error reading file from local PC' COLOR COL_NEGATIVE.
    ENDIF.
    ELSEIF RB_UNIX = 'X'.
    TRANSLATE F_FILENAME USING '\/'. " correct slash for unix
    OPEN DATASET F_FILENAME FOR INPUT MESSAGE LC_MESSAGE IN TEXT MODE.
    IF SY-SUBRC = 0.
    DO.
    READ DATASET F_FILENAME INTO FTAB_TABLE.
    IF SY-SUBRC = 0.
    APPEND FTAB_TABLE.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET F_FILENAME.
    ELSE.
    WRITE: / 'Error reading file from remote computer'
    COLOR COL_NEGATIVE,
    / LC_MESSAGE,
    / F_FILENAME.
    SY-SUBRC = 4.
    ENDIF.
    ENDIF.
    ENDFORM. " READ_REPORT_FROM_DISK
    FORM SPLIT_INCOMING_FILE *
    --> FTAB_PROGRAM_FILE *
    --> FTAB_PROGRAM_SOURCE *
    --> ` *
    --> FTAB_PROGRAM_TEXTS *
    FORM SPLIT_INCOMING_FILE TABLES FTAB_PROGRAM_FILE
    STRUCTURE MTAB_PROGRAM_FILE
    FTAB_PROGRAM_SOURCE
    STRUCTURE MTAB_PROGRAM_SOURCE
    FTAB_PROGRAM_TEXTS
    STRUCTURE MTAB_PROGRAM_TEXTS
    FTAB_PROGRAM_DOCUMENTATION
    STRUCTURE MTAB_PROGRAM_DOCUMENTATION
    CHANGING FSTR_TRDIR
    FSTR_THEAD.
    DATA:
    LC_DATATYPE(4) TYPE C, " Type of data, REPO, TEXP, RDIR
    LC_PROGRAM_FILE LIKE MTAB_PROGRAM_FILE.
    LOOP AT FTAB_PROGRAM_FILE.
    LC_PROGRAM_FILE = FTAB_PROGRAM_FILE.
    CASE LC_PROGRAM_FILE(9).
    WHEN MC_TRDIR_IDENTIFIER.
    LC_DATATYPE = MC_TRDIR_SHORT.
    WHEN MC_REPORT_IDENTIFIER.
    LC_DATATYPE = MC_REPORT_SHORT.
    WHEN MC_TEXT_IDENTIFIER.
    LC_DATATYPE = MC_TEXT_SHORT.
    WHEN MC_DOC_IDENTIFIER.
    LC_DATATYPE = MC_DOC_SHORT.
    WHEN MC_THEAD_IDENTIFIER.
    LC_DATATYPE = MC_THEAD_SHORT.
    WHEN OTHERS. " Actual contents of report, trdir, or text
    CASE LC_DATATYPE.
    WHEN MC_TRDIR_SHORT.
    FSTR_TRDIR = FTAB_PROGRAM_FILE.
    WHEN MC_REPORT_SHORT.
    FTAB_PROGRAM_SOURCE = FTAB_PROGRAM_FILE.
    APPEND FTAB_PROGRAM_SOURCE.
    WHEN MC_TEXT_SHORT.
    FTAB_PROGRAM_TEXTS = FTAB_PROGRAM_FILE.
    APPEND FTAB_PROGRAM_TEXTS.
    WHEN MC_THEAD_SHORT.
    FSTR_THEAD = FTAB_PROGRAM_FILE.
    WHEN MC_DOC_SHORT.
    FTAB_PROGRAM_DOCUMENTATION = FTAB_PROGRAM_FILE.
    APPEND FTAB_PROGRAM_DOCUMENTATION.
    ENDCASE.
    ENDCASE.
    ENDLOOP.
    ENDFORM. " SPLIT_INCOMING_FILE
    FORM INSERT_NEW_REPORT*
    --> FTAB_PROGRAM_SOURCE *
    --> FTAB_PROGRAM_TEXTS *
    --> F_TRDIR *
    FORM INSERT_NEW_REPORT TABLES FTAB_PROGRAM_SOURCE
    STRUCTURE MTAB_PROGRAM_SOURCE
    FTAB_PROGRAM_TEXTS
    STRUCTURE MTAB_PROGRAM_TEXTS
    FTAB_PROGRAM_DOCUMENTATION
    STRUCTURE MTAB_PROGRAM_DOCUMENTATION
    USING FSTR_TRDIR LIKE TRDIR
    FSTR_THEAD LIKE MSTR_THEAD.
    DATA:
    LC_OBJ_NAME LIKE E071-OBJ_NAME,
    LC_LINE2(40) TYPE C,
    LC_ANSWER(1) TYPE C.
    *-- read trdir to see if the report already exists, if it does, prompt
    *-- user to overwrite or abort.
    SELECT SINGLE * FROM TRDIR WHERE NAME = FSTR_TRDIR-NAME.
    IF SY-SUBRC = 0. " Already exists
    CONCATENATE 'want to overwrite report'
    FSTR_TRDIR-NAME
    INTO LC_LINE2 SEPARATED BY SPACE.
    CONCATENATE LC_LINE2
    INTO LC_LINE2.
    CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
    EXPORTING
    DEFAULTOPTION = 'N'
    TEXTLINE1 = 'The selected report already exists, do you'
    TEXTLINE2 = LC_LINE2
    TITEL = 'Report already exists'
    CANCEL_DISPLAY = SPACE
    IMPORTING
    ANSWER = LC_ANSWER
    EXCEPTIONS
    OTHERS = 1.
    ELSE.
    LC_ANSWER = 'J'.
    ENDIF.
    IF LC_ANSWER = 'J'.
    *-- Create the TADIR entry. (TRDIR entry created by INSERT REPORT)
    LC_OBJ_NAME = TRDIR-NAME.
    CALL FUNCTION 'TR_TADIR_POPUP_ENTRY_E071'
    EXPORTING
    WI_E071_PGMID = 'R3TR'
    WI_E071_OBJECT = 'PROG'
    WI_E071_OBJ_NAME = LC_OBJ_NAME
    WI_TADIR_DEVCLASS = '$TMP'
    EXCEPTIONS
    EXIT = 3
    OTHERS = 4.
    IF SY-SUBRC = 0.
    *-- Create Report
    INSERT REPORT FSTR_TRDIR-NAME FROM FTAB_PROGRAM_SOURCE.
    *-- Create Texts
    INSERT TEXTPOOL FSTR_TRDIR-NAME FROM FTAB_PROGRAM_TEXTS
    LANGUAGE SY-LANGU.
    *-- Save Documentation
    CALL FUNCTION 'DOCU_UPDATE'
    EXPORTING
    HEAD = FSTR_THEAD
    STATE = 'A'
    TYP = 'E'
    VERSION = '1'
    TABLES
    LINE = FTAB_PROGRAM_DOCUMENTATION
    EXCEPTIONS
    OTHERS = 1.
    ELSE.
    WRITE: / 'Error updating the TADIR entry' COLOR COL_NEGATIVE,
    'Program' COLOR COL_NEGATIVE INTENSIFIED OFF,
    FSTR_TRDIR-NAME, 'was not loaded into SAP.'
    COLOR COL_NEGATIVE INTENSIFIED OFF.
    ENDIF.
    ELSE.
    WRITE: / FSTR_TRDIR-NAME COLOR COL_NEGATIVE,
    'was not uploaded into SAP. Action cancelled by user'
    COLOR COL_NEGATIVE INTENSIFIED OFF.
    ENDIF.
    ENDFORM. " INSERT_NEW_REPORT
    FORM GET_NAME *
    --> VALUE(F_FIELD) *
    --> F_NAME *
    FORM GET_NAME USING VALUE(F_FIELD)
    CHANGING F_NAME.
    DATA: LTAB_FIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
    LC_PROG LIKE D020S-PROG,
    LC_DNUM LIKE D020S-DNUM.
    TRANSLATE F_FIELD TO UPPER CASE.
    refresh ltab_fields.
    LTAB_FIELDS-FIELDNAME = F_FIELD.
    append ltab_fields.
    LC_PROG = SY-REPID .
    LC_DNUM = SY-DYNNR .
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    DYNAME = LC_PROG
    DYNUMB = LC_DNUM
    TABLES
    dynpfields = ltab_fields
    EXCEPTIONS
    OTHERS = 01.
    read table ltab_fields index 1.
    IF SY-SUBRC EQ 0.
    F_NAME = LTAB_FIELDS-FIELDVALUE.
    refresh ltab_fields.
    ENDIF.
    CALL FUNCTION 'F4_USER'
    EXPORTING
    OBJECT = F_NAME
    IMPORTING
    RESULT = F_NAME.
    ENDFORM. " GET_NAME
    Program Texts
    DIR File Download Options (File Selection)
    FIL File Options
    FNA Enter filename below (under File Options)
    H01 Prog Name
    H03 Program Description
    SNG Upload a single file
    UDL Upload to SAP/Download from SAP
    UPL File Upload Options
    R Backup/Restore program source code with texts
    P_PATH Path to save programs to
    RB_DOS Files on local computer
    RB_DOWN Download Programs
    RB_FILE Upload a single file
    RB_LIST Select program(s) from a list
    RB_UNIX Files on remote computer
    RB_UP Upload Programs to SAP
    S_CDAT Date Created
    S_CNAM Created by UserID
    S_NAME Program Name
    S_SUBC Program Type
    S_UDAT Date Changed
    S_UNAM Last Changed by UserID

    Hi
    you can use SAPLink for this
    http://code.google.com/p/saplink/
    Abhi

  • Question related to Logical table source

    Hi All,
    I have very basic questions -
    (1) When do we create multiple logical table sources within a dimension?
    (2) If a dimension has more than one logical table sources , when do we need to map the underlying table to other underlying table of logical table sources.
    For exp consider these tables XLE_Entity_Profile, XLE_REgistration , AP_Invoice_ALL
    AP_Invoice_All is a fact table. relationship between XLE_Entity_Profile & XLE_REgistration is (1:M).
    Join info is as below -
    (a) XLE_Entity_Profile.Legal_entity_id = AP_Invoice_ALL.Legal_entity_id
    to get the registration of LE the where clause is as below-
    (b) XLE_Entity_Profile..Legal_entity_id = XLE_REgistration.Source_id and XLE_REgistration.Source_table = 'XLE_Entity_Profile'
    I have created the alias of XLE_REgistration as XLE_REgistration_LE.
    With in a dimension , i have 2 logical table source - XLE_Entity_Profile & XLE_REgistration_LE.
    logical table source 'XLE_REgistration_LE' has where clause 'XLE_REgistration.Source_table = 'XLE_Entity_Profile'
    When i query , LE name , LE Registration Name, i get error like -
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14070] Cannot find logical table source coverage for logical columns: [LE_NAME]. Please check more detailed level keys are mapped correctly. (HY000)
    Le Name is from XLE_Entity_Profile and LE Registration Name is from XLE_REgistration_LE.
    But when using the properties of logical table source ' XLE_REgistration_LE' , i map it to 'XLE_Entity_Profile' ,i get the correct result.
    I am not able to understand why am i getting error in first way of modeling.
    Thanks , Ashish

    Hi Ashish,
    first about logical table sources (lts): you can create different lts for aggregation and/or fragmentation. Aggregation means that data is aggregated on another level among different physical tables. Fragmentation means that the content is different over different tables (other rows).
    In your case, I think the problem is that your dimension is not denormalized, which results in a snowflake.
    What I understand is that you have the following (physical diagram):
    Invoice (fact table) >----- Entity (Dim) >----- Registration (Dim)
    You have the following joins:
    invoice.entity_id = entity.entity_id
    and entity.entity_id = registration.source_id and registration.source = 'something'
    First idea:
    I would create the following join (in physical diagram):
    Invoice (fact table) >---- Registration (Dim)
    Where:
    invoice.entity_id = registration.source_id and registration.source = 'something'.
    Then in your Entity dimension you should create a hierarchy:
    Grand Total Level
    Entity
    Registration.
    In your dimension you should create the first lts: Entity
    Set the aggregation content of this lts to Entity.
    This lts contains only one physical table.
    Map only the entity columns to the Entity physical table.
    Then create the second lts:
    Entity and Registration.
    Set the aggregation content of this lts to Registration.
    This lts must contain two physical tables, Entity and Registration.
    Map the entity columns to the Entity physical table and the registration columns to the registration physical table.
    Let me know if it works or not.
    Regards,
    Stijn

Maybe you are looking for

  • Urgent help needed in building an expression

    hi, I am using expression editor to build the following simple expression. "if inputvalue = 0 then 10 else 20" so Far I have used various forms of "IF" and "CASE" statements but could not successfully create the expression.Could not find anything use

  • Want to do a non-destru​ctive restore of XP Profession​al SP3 (Was SP2)

    System:  Presario SR1817cl, as originally configured from factory.  XP Professional 32-bit SP3 (was SP2) 512 MB RAM, onboard card reader, ATI onboard video.  AMD processor.  IE8 installed. System was badly infected with 31 malware, (trojans, exploits

  • Special Periods

    Hi Guys, I could not understand the following. Can anyone elaborate with example- " If you do not need 12 posting periods, you can use the posting periods that are not required as special periods. If you use these additional closing periods, you must

  • LONG TIME FOR SLEEP?

    My 27" iMac haas been going to sleep when instructed, almost straightaway but for the past few days it has taken at least half a minute to do so.   Will anyone give a hint on what may be causing this?   T.I.A.

  • Can you set the print margins in Preview?

    Simple question: Is there a way to set the print margins when printing an image from Preview? Thanks, -ME