PSobject Has table to PStables

Hi Guys,
I having real hard time to figure out why same code used by me in tow different scripts result into two different views of psobject table
$states = @{"Name" = "$N"; "SourceDatabase" = "$so"; TargetDatabase = "$TG";"Status" = "$ST"}
$Psobj = new-object -TypeName PSObject -Property $states
$Psobj
cause : ( View 1)
SourceDatabase : XYX-10
Name           : X.Y
TargetDatabase : XYZ-10
Status         : Failed
SourceDatabase : XYX-10
Name           : A.B
TargetDatabase : MTLDAG04-DB4
Status         : XYZ-10
and In other script it gives me ( View -2 )
$hash = @{"Displayname" = "$ds" ; "ItemCount" = "$itc" ; "TotalItemSize" = "$itz" ; "EmailAddress" = "$EL" }
$Table = New-Object -TypeName Psobject -Property $hash
$table
Displayname                   ItemCount                     TotalItemSize                
EmailAddress
A.b                  113                          
1.626 MB (1,704,471 bytes)    [email protected]
C.d                  5234                          452.5
MB (474,456,513 bytes)  [email protected]
E.f                  24693                         2.506
GB (2,690,950,345 by... [email protected]
The difference can be seen on same server , same shell session as well
Thanks in Advance .
I am looking to get second view consistently

jrv is correct that it's the formatting system at work. Its trying to show you your objects in a way that's readable most of the time. So, it will show an object with less than five properties as a table if you don't tell it how to display it. It will show
your object as a list if it has five or more properties. You can force it to a certain view by piping the results to 'Format-List' or 'Format-Table' (be careful, though, because this will make it so you can't usefully pipe those results to anything else; the
Format-* cmdlets will make it so your objects are pretty much only good for looking at in the host).
Now, that's how it works when you're interactively displaying one item at a time. If more than one object is coming out at a time, the formatting system doesn't follow the previous rules (it still follows rules, though). If two objects come out, it will
format them both the way that it formatted the first one. This means that if an object that PS would normally format as a list comes out, and an object that it would normally format as a table comes out right after it, they will both be formatted as a list.
To see this in action, open an ISE session and run the following lines one at a time (or in the console paste the lines in one at a time):
# Run these first two commands to define two objects
$List = New-Object PSObject -Property @{ a = 1; b = 2; c = 3; d = 4; e = 5 }
$Table = New-Object PSObject -Property @{ a = 1; b = 2; c = 3; d = 4 }
# Run this by itself, it will show as a list b/c there are at least
# five items:
$List
# Run this by itself, it will show as a table b/c there are less than
# five items:
$Table
# If you run this they will both show as a table b/c the first object
# comes out as a table. You will also be missing the 'e' column since
# the first object didn't show that
$Table; $List
# If you run this, they will both show as a list b/c the first object
# comes out as a list. All properties will show for each object
$List; $Table
So, if you're not interested in keeping your objects as true objects that can be worked with later (using ForEach-Object, Where-Object, Export-Csv, etc), then you could do this to force the output as a table:
$Objects | Format-Table

Similar Messages

  • How to call a stored procedure that has Table Of data types in VB6?

    Hi everyone,
    I need to call a stored procedure that has a Table Of data type as an input parameter (possibly even several Table Of input parameters). I can't seem to find any example of how to do this in VB6 using ODBC. Is this even possible?
    Thanks you!
    Steve

    Thanks,
    but I need to test stored procedures that uses type defined in the package.
    e.g.
    if I have s.p.
    PROCEDURE get_risultati_squadra
    ( in_squadra IN VARCHAR2,
    out_serie OUT tab_varchar2_5,
    out_tiporisultato OUT tab_varchar2_5,
    out_n_giornata OUT tab_varchar2_5,
    out_squadre OUT tab_varchar2_200,
    out_risultato OUT tab_varchar2_10,
    out_marcatore OUT tab_varchar2_50,
    out_punti OUT tab_varchar2_3,
    out_rimbalzista OUT tab_varchar2_50,
    out_rimbalzi OUT tab_varchar2_3,
    out_esito OUT tab_varchar2_2);
    I have to define every type external to the package, in this case five new TYPE !!
    Is there another way to solve this problem?
    Thanks

  • In Smartforms can i use table type which has table inside table

    Hi ,
    I would like to know whether in Form Interface can we declare table type which has a table and one of its field is again a table( Nested tables)..
    Can we declare like that ?? Need your suggestions please...
    Rgds.,
    subash

    Yes, we can.
    Check Smartform LB_BIL_INVOICE
    Importing parameter IS_BIL_INVOICE TYPE LBBIL_INVOICE
    Regards,
    Naimesh Patel

  • Replacing "" from scripts which has table DDLs

    HI,
    I use an oracle version of Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production.
    I have few scripts consisting of DDLs for table. But  almost all CREATE TABLE syntax  consist of double quotes "" for the column name and table name like below example:
    After architecture review, we came to know that we need to remove all the double quotes from all scripts for column names and table names making sure other double quote usage are not impacted in any part of those scripts. But doing it manually by going through all scripts/tables seems to be huge effort. So am seeking suggestion if there is any way we can achieve this in a simpler way.
    Thanks

    After architecture review, we came to know that we need to remove all the double quotes from all scripts for column names and table names making sure other double quote usage are not impacted in any part of those scripts. But doing it manually by going through all scripts/tables seems to be huge effort. So am seeking suggestion if there is any way we can achieve this in a simpler way.
    Yes, there are at least two much simpler ways:
    1. Replace the architecture review team with people who use logic and reason as the basis for the standards that they adopt.
    2. Replace the 'remove all the double quotes' requirement from the standards list.
    If you plan to adopt a standard then you should adopt an industry standard. If you use any other standard then there should not only be a rational justification for NOT using the industry standard (in this case Oracle's) but there should also be some rational, and demonstrable, value to the standard that you adopt. I cannot think of any justification for NOT using the Oracle standard not am I aware of any value whatsoever to removing all double quotes from scripts.
    In addition, in almost 30 years of working in the field I am not aware of ANY organization that has adopted such a standard.
    Oracle both provides, and uses, extensive functionality for creating and using DDL. The DBMS_METADATA package is used by Oracle for both export and import and the standard used by that package is to enclose object names in double quotes. The reasons for this standard have already been stated by others. One example is the possible use of mixed-case for object names. But mixed-case is also used for path names in DIRECTORY objects, TABLESPACE objects, database links and for extracted passwords.
    Any extraction of DDL your org does will likely etiher use the DBMS_METADATA package or a tool that follows the Oracle standard.
    So your teams 'standard' not only contravenes the industry standard but imparts a substantial penalty in terms of the resources needed to constantly identify and correct the any DDL extracted from your systems.
    Here is a trivial example of using the Oracle package to extract DDL for the SCOTT.EMP table.
    select dbms_metadata.get_ddl('TABLE', 'EMP', 'SCOTT') from dual
    CREATE TABLE "SCOTT"."EMP"
    ( "EMPNO" NUMBER(4,0),
    "ENAME" VARCHAR2(10),
    "JOB" VARCHAR2(9),
    "MGR" NUMBER(4,0),
    "HIREDATE" DATE,
    "SAL" NUMBER(7,2),
    "COMM" NUMBER(7,2),
    "DEPTNO" NUMBER(2,0),
    CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS" ENABLE,
    CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO")
    REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE
    ) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS"
    If this were me I would use ALL of my political capital to fight the battle against this non-sensical 'standard'. There is simply no rhyme or reason for it, it will waste a lot of valuable personal resources and the cost/benefit ratio simply can't justify it.
    Those resources would be MUCH better used on other tasks.

  • Trying to execute a STP which has TABLE TYPES.

    Hi,
    I wrote a program with the below specification inside a pkg :
    pl/sql varray declaration inside the pkg,
    TYPE varray_tnb IS TABLE OF CHAR(10) INDEX BY BINARY_INTEGER;
    TYPE varray_act_cd IS TABLE OF CHAR(15) INDEX BY BINARY_INTEGER;
    TYPE varray_sts_cd IS TABLE OF CHAR(10) INDEX BY BINARY_INTEGER;
    TYPE varray_sts_txt IS TABLE OF CHAR(250) INDEX BY BINARY_INTEGER;
    PROCEDURE re_STP_u(
    a_order_num IN re.nbr_order%TYPE,
    a_tnb IN varray_tnb,
    a_action_code IN varray_act_cd,
    a_status_code IN varray_sts_cd,
    a_status_txt IN varray_sts_txt);
    When I try to run a test script to test if the above STP, I get the below error:
    DECLARE
    TYPE V_TNB iS TABLE OF CHAR(10) INDEX BY BINARY_INTEGER;
    TYPE V_ACT iS TABLE OF CHAR(15) INDEX BY BINARY_INTEGER;
    TYPE V_STS iS TABLE OF CHAR(10) INDEX BY BINARY_INTEGER;
    TYPE V_TXT iS TABLE OF CHAR(250) INDEX BY BINARY_INTEGER;
    a_OrdN rehome_migration_ord.nbr_order%TYPE := '789';
    a_tnb V_TNB := V_TNB(7192340129,7192340128);
    a_ac V_ACT := V_ACT('ACT CDE','BGE CDE');
    a_sc V_STS := V_STS('INITIATED','INITIATED');
    a_st V_TXT := V_TXT('TExt for Status','status text');
    begin
    tds_upd_pkg.re_STP_u(a_OrdN,a_tnb,a_ac,a_sc,a_st);
    exception
    WHEN OTHERS THEN
    RAISE;
    end;
    ORA-06550: line 7, column 16:
    PLS-00222: no function with name 'V_TNB' exists in this scope
    ORA-06550: line 7, column 7:
    PL/SQL: Item ignored
    ORA-06550: line 8, column 15:
    PLS-00222: no function with name 'V_ACT' exists in this scope
    ORA-06550: line 8, column 6:
    PL/SQL: Item ignored
    ORA-06550: line 9, column 15:
    PLS-00222: no function with name 'V_STS' exists in this scope
    ORA-06550: line 9, column 6:
    PL/SQL: Item ignored
    ORA-06550: line 10, column 15:
    PLS-00222: no function with name 'V_TXT' exists in this scope
    ORA-06550: line 10, column 6:
    PL/SQL: Item ignored
    ORA-06550: line 12, column 44:
    PLS-00320: the declaration of the type of this expression is incomplete or
    malformed
    ORA-06550: line 12, column 1:
    PL/SQL: Statement ignored
    Can somebody look at the script and see where I am wrong.
    If I do not assign any value to the varray variables I am able to go past the above error and getting "PLS-00306: wrong number or types of arguments in call to..".

    I can't recall the exact wording Oracle uses but you are mixing the two different types of Collections that Oracle allows. One is where Oracle manages the size of the entry for you automatically. The other is where you have to .EXTEND the collection to increase the number of entries. Using "INDEX BY BINARY_INTEGER" tells Oracle to automanage the collection size. "V_TNB(7192340129,7192340128)" can only be used on those collections where you manage the size. See my modified example that doesn't error out until line 10 (a_sc) with the errors you listed. Note what I commented out on line 2, line 9, and added on lines 13 and 14 to replace line 9.
    DECLARE
      TYPE V_TNB iS TABLE OF CHAR(10); -- INDEX BY BINARY_INTEGER;
      TYPE V_ACT iS TABLE OF CHAR(15) INDEX BY BINARY_INTEGER;
      TYPE V_STS iS TABLE OF CHAR(10) INDEX BY BINARY_INTEGER;
      TYPE V_TXT iS TABLE OF CHAR(250) INDEX BY BINARY_INTEGER;
      a_OrdN VARCHAR2(3) := '789';
      a_tnb V_TNB := V_TNB(7192340129,7192340128);
      a_ac V_ACT;-- := V_ACT('ACT CDE','BGE CDE');
      a_sc V_STS := V_STS('INITIATED','INITIATED');
      a_st V_TXT := V_TXT('TExt for Status','status text');
    begin
      a_ac(1) := 'ACT CDE';
      a_ac(2) := 'BGE CDE';
      NULL;
    end;Here is the Oracle documentation I was thinking of. http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/collections.htm#sthref1153

  • How to increas the width of the Table in OBIEE Report

    Hi ,
    I am creating a OBIEE report, the report has table and 30 column in it. When I am viewing the report in an excel file , its appearing good but the width of the table is so small if I am viewing the same in internet explorer/PDF .I dont know how to increase the width of the table. Could you please sort this issue out.
    Thanks
    Govindan P

    - you can increase the width of a column -> column format values -> Additional Formatting Options
    increase the width:
    - Report level:
    result tab -> Click on Format container of Table -> Additional Formatting Options
    u can assign value width : 500 height:.....
    - dashboard level:
    Edit options -> section -> Format section -> Additional Formatting Options
    here also u can change the width
    u can assign value width : 500 height:.....
    pls mark it helps....
    Edited by: 979481 on Feb 6, 2013 1:25 AM

  • How to export and import dependent tables from 2 different schema

    I have a setup where schema1 has table 1 and schema 2 has table2. And table 1 from schema1 depends upon table 2 from schema 2.
    I would like to export and import these tables only and not any other tables from these 2 schemas with all information like grants,constraints.
    Also will there be same method for Oracle 10g R1,R2 and Oracle 11G.
    http://download.oracle.com/docs/cd/B12037_01/server.101/b10825/dp_export.htm#i1007514
    Looking at this For table mode it says
    Also, as in schema exports, cross-schema references are not exported
    Not sure what this means.
    As I am interested in only 2 tables I think I need to use table mode. But if I try to run export with both tables names, it says table mode support only one schema at a time. Not sure then How would the constraints would get exported in that case.
    -Rohit

    worked for my 1st time I tried
    exp file=table2.dmp tables="dbadmin.temp1,scott.emp"
    Export: Release 10.2.0.1.0 - Production on Mon Mar 1 16:32:07 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Username: / as sysdba
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Export done in US7ASCII character set and AL16UTF16 NCHAR character set
    server uses WE8ISO8859P1 character set (possible charset conversion)
    About to export specified tables via Conventional Path ...
    Current user changed to DBADMIN
    . . exporting table                          TEMP1         10 rows exported
    EXP-00091: Exporting questionable statistics.
    Current user changed to SCOTT
    . . exporting table                            EMP         14 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    Export terminated successfully with warnings.

  • Table footer issue in body page of adobe form

    Form has 1 master page and 1 body page. Body page has table within which there is a footer header and detail (2 footers) in the form. My intention is to make footer (both the footers) appear in the last page of the form. For most of the scenarios, footer is displayed at the last page or if it has only 1 page to display, it shows in the first page itself.
    But issue arises when number of rows reaches the maximum length of body page. Let's say, body page can accommodate 11 rows, then footer header is displayed in 1st page but footer detail is shown in next page (2nd page).  I want to show both of these in the last page with 11th record in the last page without any break.
    I've tried below options:
    1. Group both footers as a section and check "Include footer row in final page" in pagination tab.
    2. Mark both the footers individually with check "Include footer row in final page" in pagination tab.
    Is there any other option that I need to look for to solve this issue?

    Thank you Norbert. That solved the problem.
    I've one more question relating to this. Let's say I can only display 11 records in one page with these 2 footer. For 12 records, 2nd page shows last record with these 2 footers. 10 records will be displayed in one page properly. But when it comes to 11 records, 1st page shows all of 11 records and 2 footers with a page header will be shown in 2nd page. Is there a way to control this dynamically so that whenever 11th record needs to be shown, even though body page(or subform) can accommodate 11 records, show the 11th in 2nd page with footers?
    Thanks,
    Phani

  • I can't fathom the reasoning behind ID CS5 tables. Can you help?

    I can make ID CS5 tables work, but I don't understand how they work. I should mention that I'm a heavy FrameMaker user, so I'm sure I've got some faulty preconceptions.
    In FrameMaker, I'm accustomed to using table styles to automate table formatting. All table formatting info -- e.g., text styles for table titles, headings, and body; rules; cell padding; etc -- is built into the table style and applied with a single click. The text styling information is drawn from preexisting paragraph styles that are associated with the table style. All very straightforward. But in InDesign, things seem a lot more complicated.
    InDesign has Table Styles and Cell Styles. I'm unclear on the relationship between the two. You can specify ruling and shading styles in both. I don't understand this. 
    I've gotten more predictable results with Cell Styles, so I've built most of my formatting info into them. But Cell Styles aren't stand-alone entities. Even though you have to create them, then add them to the Table Style, they have to be associated with a preexisting paragraph style. This seems like a duplication of effort -- two separate styles (cell and paragraph) applying the same text formatting info. The Cell Style does include ruling and shading info, but that shouldn't be necessary since that information theoretically can be entered in the Table Style.
    Also, using Cell Styles limits you to one paragraph style per cell. In some cases I need two -- data or text, followed by some bullet points. When this happens I've had to strip out the Cell Style and apply a paragraph style directly. Seems funky.
    I don't want to get too deep into the weeds with specific puzzles I've encountered; suffice to say I don't understand how Table Styles and Cell Styles interact and how best to use them to create and format tables efficiently. Do any of you understand the thinking behind ID tables? Can you point to a source that explains it? There's got to be a system there, a set of coherent operating principles, but I haven't been able to discern them.
    Sincere thanks,
        --Donna Reynolds

    semiwool wrote:
    I'm not clear how you're able to automate the next-format behavior in FrameMaker. Are you saying that populating a FrameMaker table by importing text from a source, using the convert-to-table option does this because the incoming content has paragraph styles that match existing FrameMaker formats, and that you can't get this in InDesign? InDesign's import options are quite rich. If you need details, search Google for "InDesign text import options" without quotes.
    My apologies. I must have done a poor job of explaining the problem, which is: If you apply a Cell Style to a cell, that cell will only permit one paragraph style. If you need to use two styles in the cell, you have to change the Cell Style to None, then do your formatting with a regular paragraph style.
    These tables were imported as RTF, which has worked reasonably well. Actually, yesterday I was thinking about the discussion we had re: Frame > ID conversions. The first draft of the tutorial I worked up is done. If interested, I'd be happy to send a copy.
    Many thanks for your assistance,
       -dr
    Try this:
    * Create a small table, say four rows by four columns.
    * Create a paragraph style named noStyle, based on No Style.
    * Create a paragraph style with text color cyan, for the second paragraph in the cel; call it cyan. Leave Next Style as Same Style.
    * Create a paragraph style with text color magenta, for the first paragraph in the cell; call it magenta. Set Next style to cyan.
    * Create a cell style whose paragraph style is magenta.
    * In a table cell, create two paragraphs that use the style noStyle.
    * Copy the two paragraphs to another cell.
    * In the first cell, apply the magenta style to the first paragraph.
    * Select both paragraphs in the cell, or select the cell.
    * In the paragraph styles panel, Right-Click the magenta style name.
    * In the context menu that appears, click Apply "magenta" then Next Style. The first paragraph remains magenta, and the second paragraph changes to cyan.
    * Select  the second cell.
    * Apply the cell style magentaCell. Both paragraphs are tagged with the magenta paragraph style.
    * Select the cell and in the Paragraph Styles panel, Right-Click the paragraph style magenta, and select Apply "magenta," then Next Style. Like the two paragraphs selected in the cell that has no cell style applied, the first paragraph remains magenta, and the second paragraph changes to cyan.
    * Copy two paragraphs tagged with noStyle and paste to all the cells in the table.
    * Select the whole table.
    * Apply the magenta paragraph style to all cells.
    * * In the paragraph styles panel, Right-Click the magenta style name.
    * In the context menu that appears, click Apply "magenta" then Next Style. The first paragraph remains magenta, and the second paragraph changes to cyan. All the cells have the first paragraph tagged magenta and the second tagged cyan.
    * Undo these last steps until all cells have reverted to containing two noStyle paragraphs.
    * Select the whole table and apply the magenta cell style.
    * In the paragraph styles panel, Right-Click the magenta style name.
    * In the context menu that appears, click Apply "magenta" then Next Style. The first paragraph remains magenta, and the second paragraph changes to cyan.
    So, with or without cell styles, the Apply Next Style feature efficiently formats multiple-style table cells.
    [EDIT] Yes, I'd like to see your tutorial. Click on my name in the sidebar to send a private message, if you don't have my email address already. Thanks for the offer.[/EDIT]
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices
    Message was edited by: peter at knowhowpro

  • Issue on Number of Rows in table bean

    Hi,
    I have a table with the columns column name,edit image...
    Like this ,i have 100 columns and i set the no of rows to display as 30
    Suppose when i am at the 55th row in the table by clicking on next...i clicked on edit image for that particular row, it opens new page. And now if i select cancel button on this new page.. i am going to the previous screen which has table.
    But what my problem is it is displaying rows from the starting of table...not the page (55th row) from where i went to the new page.Is there any way to go to previously visited set of rows in the table?
    Please resolve my issue.

    Hi,
    when you navigate out of the page you can capture the range index of the
    current row selected in the View Object attached to the table and store it
    in the session
    OAViewObject oaviewobject = (OAViewObject)oaapplicationmodule.findViewObject("YourVOName")
    int l = oaviewobject.getRangeStart();
    pageContext.putSessionValue("range",l);
    then when you come back to the page and in process request you can reset the range index as selected earlier.
    String range = (String)pageContext.getSessionValue("range");
    int k = (int)Integer.parseInt(range);
    oaviewobject.setRangeStart(k);
    Thanks,
    Gaurav

  • Dynamic Table selection

    Hi All,
    Please help me to resolve this Issue.
    Internal table - IT which has table name like
    KOTH600 
    KOTH601 
    KOTH602 
    KOTH603   , All these table has field KNUMH.
    Loop at IT into WA. ( which has table name in it )
    select * from (WA-TABNAME) into (New_WA)
                where KNUMH = '100010'.
    write:/ New_WA - NAME.
    Endloop.
    Here issue is table name is dynamic and depending upon this New_WA will change. How can I give both table name and work-area dynamic.  ( I do not wish to define 4 new work-area, one for each to handle this situation as number of tables will increase going further ).
    Thanks in advance,
    Regards,
    Mayank Rajguru.

    In this example you have what you are looking for. Create dinamyc tables.
    REPORT Z_DUMMY_ATG NO STANDARD PAGE HEADING MESSAGE-ID SAPLWOSA.
    *=======================================================================
    Variables*
    *=======================================================================
    DATA DESCR_STRUCT_REF TYPE REF TO CL_ABAP_STRUCTDESCR.
    DATA WA_FCAT TYPE LVC_S_FCAT.
    DATA IT_FIELDCATALOG TYPE LVC_T_FCAT.
    DATA DATAREF TYPE REF TO DATA.
    DATA: ONE  LIKE PCFILE-DRIVE,
          TWO  LIKE PCFILE-PATH,
          LONG TYPE I,
          FLAG TYPE C,
          FILEPATH(128) TYPE C,
          FILE_TAB TYPE STRING,
          TABNAME LIKE DD02L-TABNAME.
    *=======================================================================
    Field-Symbols.*
    *=======================================================================
    FIELD-SYMBOLS:
                  <ROW> TYPE ANY TABLE,
                  <TABLE> TYPE STANDARD TABLE,
                  <COMPONENT> TYPE ABAP_COMPDESCR,
                  <FS>  TYPE ANY.
    *=======================================================================
    Selection screen*
    *=======================================================================
    SELECTION-SCREEN BEGIN OF BLOCK DATA WITH FRAME TITLE TEXT-T01.
    PARAMETERS:
        TABNAM(128) TYPE C,
        FUNCTION(1) TYPE C OBLIGATORY,
        LISTNAME LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN END OF BLOCK DATA.
    *=======================================================================
    At Selection screen*
    *=======================================================================
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR LISTNAME.
      PERFORM GET_FILENAME CHANGING LISTNAME.
    *=======================================================================
    Start-of-selection*
    *=======================================================================
    START-OF-SELECTION.
      CLEAR FLAG.
      PERFORM LOAD_DATA USING TABNAM.
      PERFORM VERIFY_TABLE USING TABNAM CHANGING FLAG.
      IF FLAG NE 'X'.
        IF FUNCTION EQ 'D'.
          PERFORM CREATE_TABLE USING TABNAM.
          PERFORM DOWNLOAD_TABLE USING TABNAM.
        ELSE.
          PERFORM CREATE_TABLE USING TABNAM.
          PERFORM UPLOAD_TABLE USING TABNAM.
        ENDIF.
      ELSE.
        MESSAGE S000 WITH 'The proposed table doesn''t exist.'.
      ENDIF.
          FORM GET_FILENAME                                             **
          Name of the directory.*
    FORM GET_FILENAME CHANGING LISTNAME.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                DEF_FILENAME     = LISTNAME
                DEF_PATH         = 'C:\downloads\list'
                MASK             = ',.,.. '
                MODE             = 'S'
                TITLE            = 'Save as'
           IMPORTING
                FILENAME         = LISTNAME
           EXCEPTIONS
                INV_WINSYS       = 1
                NO_BATCH         = 2
                SELECTION_CANCEL = 3
                SELECTION_ERROR  = 4
                OTHERS           = 5.
    ENDFORM.
          FORM LOAD_DATA                                                **
          Specifies the path and table name*
    FORM LOAD_DATA USING MY_TAB.
      DATA: W_FILE LIKE PCFILE-PATH.
      W_FILE = LISTNAME.
      CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
           EXPORTING
                COMPLETE_FILENAME = W_FILE
           IMPORTING
                DRIVE             = ONE
                PATH              = TWO
           EXCEPTIONS
                INVALID_DRIVE     = 1
                INVALID_EXTENSION = 2
                INVALID_NAME      = 3
                INVALID_PATH      = 4
                OTHERS            = 5.
      CONCATENATE ONE ':' TWO INTO FILEPATH.
      CONCATENATE FILEPATH MY_TAB '.txt' INTO FILE_TAB.
    ENDFORM.
          FORM DOWNLOAD_TABLE                                           **
          Downloads the table data.*
    FORM DOWNLOAD_TABLE USING MY_TAB.
      *SELECT **
      INTO TABLE <ROW>
      FROM (MY_TAB).
      ASSIGN <ROW> TO <TABLE>.
      CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
                FILENAME                = FILE_TAB
                FILETYPE                = 'ASC'
           TABLES
                DATA_TAB                = <TABLE>
           EXCEPTIONS
                FILE_WRITE_ERROR        = 1
                NO_BATCH                = 2
                GUI_REFUSE_FILETRANSFER = 3
                INVALID_TYPE            = 4
                NO_AUTHORITY            = 5
                UNKNOWN_ERROR           = 6.
      IF SY-SUBRC EQ 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  TITEL = 'Successful Download'
                  TXT1  = 'All the data from the table'
                  TXT2  = 'was correctly downloaded.'.
      ELSE.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  TITEL = 'Download Error!'
                  TXT1  = 'The data of the table'
                  TXT2  = 'couldn''t be downloaded.'.
      ENDIF.
    ENDFORM.
          FORM UPLOAD_TABLE                                           **
          Table Upload.*
    FORM UPLOAD_TABLE USING MY_TAB.
      ASSIGN <ROW> TO <TABLE>.
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                FILENAME                = FILE_TAB
                FILETYPE                = 'ASC'
           IMPORTING
                FILELENGTH              = LONG
           TABLES
                DATA_TAB                = <TABLE>
           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.
      MODIFY (MY_TAB) FROM TABLE <TABLE>.
      IF SY-SUBRC EQ 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  TITEL = 'Successful Upload'
                  TXT1  = 'All the data from the table'
                  TXT2  = 'was correctly uploaded.'.
      ELSE.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  TITEL = 'Upload Error!'
                  TXT1  = 'The data of the table'
                  TXT2  = 'couldn''t be uploaded.'.
      ENDIF.
    ENDFORM.
          FORM CREATE_TABLE                                             **
          Creates a dynamic internal table.*
    FORM CREATE_TABLE USING MY_TAB.
      CREATE DATA DATAREF TYPE (MY_TAB).
      ASSIGN DATAREF-> TO <FS>.*
      DESCR_STRUCT_REF ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( <FS> ).
      LOOP AT DESCR_STRUCT_REF->COMPONENTS ASSIGNING <COMPONENT>.
        WA_FCAT-FIELDNAME     = <COMPONENT>-NAME.
        WA_FCAT-REF_TABLE     = MY_TAB.
        WA_FCAT-REF_FIELD     = <COMPONENT>-NAME.
        APPEND WA_FCAT TO IT_FIELDCATALOG.
      ENDLOOP.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
         EXPORTING
           IT_FIELDCATALOG           = IT_FIELDCATALOG
         IMPORTING
           EP_TABLE                  = DATAREF
         EXCEPTIONS
           GENERATE_SUBPOOL_DIR_FULL = 1
           OTHERS                    = 2.
      ASSIGN DATAREF-> TO <ROW>.*
    ENDFORM.
    *&      Form  VERIFY_TABLE
          The table must exist!*
    FORM VERIFY_TABLE USING TABNAM CHANGING FLAG.
      SELECT SINGLE TABNAME
      INTO (TABNAME)
      FROM DD02L
      WHERE TABNAME EQ TABNAM.
      IF SY-SUBRC NE 0.
        FLAG = 'X'.
      ENDIF.
    ENDFORM.

  • CALS tables as external file entities

    Hi,
    I'm struggling with a problem while reading in XML fileset through importing XSL transformation (defined in structapps).
    I've got a main xml document + bunch of separate cals tables, each in it's own file.The location of those tables in the main document are marked with special element.
    My import xsl converts those elements to entities and makes local entity declarations creating something like (skipping xml decls etc..):
    <!DOCTYPE x [<!ENTITY table1 SYSTEM 'table1.xml']>
    <X ...all schema + namespace declarations..>
    <para>zzz</para>
    &table1;
    </X>
    file entity table1 has <table> as root element.
    XSLT goes fine and FM does not generate any validation errors against the schema. I've checked the tmp-file (created by XSLT) and it looks ok.
    But FM refuses to create the tables and flags errors like "Cannot create a new table for the FrameMaker element (table)" and same for every element in cals table.
    Tables that are in the main document already cause no hick ups. Also, if I change the content of the file entity to , say, <para>, it works.
    BR, Martti

    Hi Michael,
    I use the table model in Frame where table is the actual table and tgroup gets unwrapped by r/w-rules. Tables already in the main xml document (not from file entities) have been working ok all the time.
    Funny thing is that wrapping table into para in file entity solved the issue (my schema allows tables in para's too, so not a problem from that side). But I'm curious to understand why this happens.
    My understanding of frame's internal behaviour during xml read is that the XSL processing happens outside of frame, frame invokes xalan and passes the xml "as-is" to it and takes the result, parses and validates it. Then into framemaker through r/w rules.
    Could it be that that when parser hits a file entity reference and replaces it with actual content, this interferes how frame interpretes the result. Addinf a wrapping element seems to "help" frame to recognize the table. I tested briefly with file entities having just para-type content and frame ate then with no sweat.
    Martti

  • JSP, BC4J, AM: where/when are the PCST tables created

    Hi all.
    I am currently needing to access a second database instance from my BC4J JSP application, and so I have added a new Application Module to my project.
    For some reason that I don't understand, the wizard doesn't ask you what connection to use. So I have changed it by going into Configuration for the AM and setting it.
    Now I want to go into the Test AM. Even though I right-click on the AM and choose Test, the "Oracle Business Component Browser" still can't figure out which module I want to test (??), so I choose my new module. It then correctly chooses the JDBC connection I have assigned and I connect. The browser opens fine although there is nothing to see because I haven't created any components yet.
    If I now choose File/Save, I get an error. First it does appear to successfully create the PCOLL_CONTROL table (assuming your connection has table creation rights - Doh!). No problems. However the error I get is "Could not update row into table PCST_TXN, id 1" and the details of that are "table or view does not exist" which is true - the PCST_TXN table doesn't exist. Does anyone know why? I assume that both tables should have been created automatically. What happened to my PCST_TXN table?? There is almost nothing in the help on these two tables, when they are created, how they are used etc. Can anyone give me a greater insight into them and the process I am failing to go through???
    Thanks a lot,
    Simon Cullen
    null

    Each application module configuration can use a different connection. You need to create a new configuration and select this configuration in the ApplicationModule Tag of your jsp application.

  • Create stored procedure with table from another schema throws PLS-00201

    Oracle 10g. I'm new to procedures, so maybe I'm missing something obvious.
    Schema owner ABC has table T2001_WRITEOFF. The SYSDBAs granted SIUD to Some_Update_Role, and granted that role to developer user IJK. User IJK then created a private synonym T2001_WRITEOFF for ABC.T2001_WRITEOFF. This worked with normal SQL DML commands. 
    When I try to create a simple procedure as follows, it throws PLS-00201 identifier 'T2001_WRITEOFF' must be declared, and points to the 2nd line.
    create or replace procedure woof1(
      fooname in T2001_WRITEOFF.territory%TYPE,  <=== error points here
      bardesc IN T2001_WRITEOFF.ind_batch_submit%TYPE) IS
    BEGIN
       INSERT into T2001_WRITEOFF
       VALUES ( fooname, bardesc);
    END woof1;
    What am I doing wrong?
    Thanks
    JimR

    Hi,
    The reason I've heard has to do with knowing when a procedure becomes invalid due to privileges being revoked.  Any time a grant to a role is revoked, you would have to check all procedures that depended on that role to know if they were still valid.  Even worse, since roles can be granted to other roles, every time a role is revoked from another role, you would have to check all procedures that depended on anything to see if they were still valid.
    Oracle 11 behaves the same as earlier versions in this regard, and I don't expect this to change.
    This whole thread applies only to AUTHID DEFINER stored procedures (which is the default).  If you can make the procedure AUTHID CURRENT_USER, then you can run it with privileges granted through roles.  Usually, however, you really want AUTHID DEFINER, and granting the necessary privileges directly to the procedure owner (or to PUBLIC)  isn't too hard.

  • Space in the Table Name

    I was writing a program to move data from an Access database on to a different database.
    The existing access data base has table names with spaces and SQL queries do not recognize such names! Any suggestions?

    i think single quotes ' is the generally accepted way
    of doing this. [] may work in access but other
    databases not so well.Not at all!
    Single quotes are used to identify string literals inside a SQL statement. The double quotes are used to quote object names which either contain special characters (e.g. spaces) or would otherwise be rejected because they are reserved words (e.g. using SELECT as a column name only works with double quotes).
    Thomas

Maybe you are looking for

  • Time to upgrade to 802.11g???

    Any views would be appreciated - I'm running a 802.11b wireless router with an iMac and PB connected. Basically, is it worth investing in 802.11g (AirPort Extreme Base Station)? Thanks

  • How to change the Busy tone of WIC-2FXS in 2610

    My local FXS card is connected to my office PBX CO port. When a far end caller disconnects a VoIP session, my local FXS generates a very strange tone to my PBX so that the AA of my PBX cannot detect such busy tone and hence cannot drop the call. The

  • Downloading output as pdf file

    hello all, i have one doubt...how to download one report's output as PDF file.

  • Moutain Lion sluggish on 2008 macbook

    I have a late 2008 macbook unibody with 4GB of RAM installed and upgraded to Moutain Lion from Snow Leopard. The mac has been very sluggish in opening new apps, waking up from sleep and overal general use. 1. The initial index is complete ( i upgrade

  • Please i really need your help...

    where can i buy an hp 110 tri color cartridge? here in the philippines since i bought my printer in singapore, can i buy a cartridge here?