How to find the First block....in a multi block form

hi
How i can find which is the first block in a multi block form....
( there are n number of forms with multi blocks...so
i need to generalise the code to find the first block in all of
the forms)
regards
Kris

If you searched in the on-line help for "First", you would find that the Get_Form_Property built-in provides two: First_Block and First_Navigation_Block.

Similar Messages

  • How to find the cause ofan error at runtime in forms (10g)

    hi
    can u please tell me how to find the cause ofan error at runtime.
    in forms 6i, the shortcut key is shift+f1
    i needthe shotcut key in 10g forms.
    thanx

    or just look in you menu help, -- last error or you can find the list of shortcut keys there ...
    \Erwin

  • How to find the application type fora Script based on Form name?

    Hi Guys,
                can anybody tell me how to find the Application Type and output type based on Form name and print program name?
    I am having form name as: ZINVENT (INVENT is the actual) and program name as RM07IDRU.How can i find the Appliction ntype and OutType for entering into the NACE tr code.
                    i tried thru TNAPR table but i was not able to find the Entry in the TNAPR with form Name and printprogram name
                   Th Script is about Phsical inventory Documents.
    Thanks,
    Gopi.

    You can use this...
    REPORT  Z_DUMMY_ATG NO STANDARD PAGE HEADING.
    *======================================================================
    * Tablas
    *======================================================================
    TABLES: TTXFP.
    *======================================================================
    * Tablas Internas
    *======================================================================
    DATA: T_TTXFP TYPE STANDARD TABLE OF TTXFP WITH HEADER LINE.
    *======================================================================
    * Selection-Screen
    *======================================================================
    SELECTION-SCREEN BEGIN OF BLOCK SCRIPT WITH FRAME.
    SELECT-OPTIONS:
                  PRINTNAM FOR TTXFP-PRINT_NAME,
                  TDFORM   FOR TTXFP-TDFORM.
    SELECTION-SCREEN END OF BLOCK SCRIPT.
    *======================================================================
    * Start-of-selection
    *======================================================================
    START-OF-SELECTION.
      PERFORM SELECT_DATA.
      PERFORM PRINT_DATA.
    *&      Form  SELECT_DATA
    *       Seleccionamos los datos del reporte.
    FORM SELECT_DATA.
      SELECT TDFORM PRINT_NAME LAST_PROG
      INTO TABLE T_TTXFP
      FROM TTXFP
      WHERE PRINT_NAME IN PRINTNAM
        AND TDFORM IN TDFORM
      ORDER BY TDFORM.
    ENDFORM.                    "SELECT_DATA
    *&      Form  PRINT_DATA
    *       Imprimimos el resultado del reporte.
    FORM PRINT_DATA.
      FORMAT COLOR 3.
      WRITE: 'Programa', 18 'Formulario', 50 'Flag de Ultimo programa'.
      FORMAT COLOR OFF.
      SKIP 1.
      IF NOT T_TTXFP[] IS INITIAL.
      SORT T_TTXFP BY PRINT_NAME.
        LOOP AT T_TTXFP.
          IF T_TTXFP-LAST_PROG EQ 'X'.
          FORMAT COLOR 4.
          WRITE:/ T_TTXFP-PRINT_NAME, 18 T_TTXFP-TDFORM, 60 T_TTXFP-LAST_PROG.
          FORMAT COLOR OFF.
          ELSE.
          WRITE:/ T_TTXFP-PRINT_NAME, 18 T_TTXFP-TDFORM, 60 T_TTXFP-LAST_PROG.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "PRINT_DATA
    Greetings,
    Blag.

  • How to find the First Modified record

    Hi,
    I have one table with the fields ID, branch and modified_date.
    here nothing is unique. How can I modify a record with new
    branch name of a perticular id(will have multiple) where
    modified date is oldest.
    here date is time stamp.
    Though I created with date and time it is showing only date not
    time when I query.
    Ex:
    1, Eng, 10-10-1999 10:10:10('mm-dd-yyyy hh:mi:ss')
    1, Mat, 10-10-1999 10:10:09
    is there any way to get this (1, Mat, 10-10-1999 10:10:09)
    record.
    Thanks in advance,
    Srini.

    There are a few ways to do this ...
    i) Start by writing code to identify the lowest modified_date
    for each ID ...
    select ID, min(modified_date)
    from my_table group by ID
    Then, since the result of a query is logically the same as a
    table, you could do either ...
    select * from my_table where (ID, modified_date) in
    select ID, min(modified_date)
    from my_table group by ID
    ... or ...
    select t1.ID, t1.branch, t1.modified_date
    from my_table t1,
    select ID, min(modified_date) min_modified_date
    from my_table group by ID
    ) t2
    where t1.ID = t2.ID and t1.modified_date =
    t2.min_modified_date
    ii) You could create the requirement that no lower
    modified_date should exist for a particular ID ...
    select t1.ID, t1.branch, t1.modified_date
    from my_table t1
    where not exists (
    select 0 from my_table t2 where t2.ID = t1.ID and
    t2.modified_date < t1.modified_date)
    iii) if you can guarantee the existence of an index defined on
    the ID and modified_date columns (called my_index in this
    example) you could do ...
    select t1.ID, t1.branch, t1.modified_date
    from my_table t1
    where t1.modified_date = (
    select /*+ index_asc (my_table my_index) */
    t2.modified_date from my_table t2 where t2.ID = t1.ID and
    rownum = 1)
    You should test each of these options with your own data
    set and see which works best for you. Some of them will
    return the first matching rows of data very quickly but take
    longer to return all of them, while others take a long time to
    return the first rows but find the full set faster.
    Make sure you run ANALYZE on your table whatever you do.

  • How to find the first occurrence of a string2 in string1

    Hello
    I've got a string, and I want to know where '-' occurs
    the first time. I mean, in 'hello-world', the first
    one is position 5.
    In C++, I've got:
    Result      = strcspn(string1, string2);
    How can I do it in Java?
    Thank you very much.

    String.indexOf()...read the API.

  • How to find the row being deleted in a Tabular Form?

    version 3.2.1
    How do I find out what row is being deleted in a Tabular Form (SQL Query (updateable report) )?
    I have a process to delete records from another table when the record in the report is deleted. I need to capture the primary key to pass to the process that deletes the record from the other table.
    Thanks,
    Joe

    Hm,
    The best thing is to do this using triggers before delete. Looping through the list of checked checkboxes is not an optimal solution. If the standard MRD process fails for whatever reason, your delete process for the rows in the other table will still delte the records with the selected primary key.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How to find the avg salary of first 3 employees based on each department?

    how to find the avg salary of first 3 employees based on each department?

    Hi,
    Do you mean something like this?
    with a as
    select
      deptno
      ,sal
      ,row_number() over ( partition by deptno order by sal desc) rn
    from
      emp
    select
      deptno
      ,round(avg(sal)) avg_sal_of_top_3
    from
      a
    where
      rn <= 3
    group by
      deptno
    order by
      deptno
    DEPTNO AVG_SAL_OF_TOP_3
        10             2917
        20             2992
        30             1983
    If not please give more details.
    Regards,
    Peter

  • Reg - how to find the purpose of methods in a class

    hi everyone,
               can u plz help me with how to find the purpose of methods in a class???????
    a description abt the methods in a class??????
                        thx in advance,
    regards,
    balaji.s

    Hi Balaji
    Pls find some stuff.
    reward pts if help.
    The following statements define the structure of a class:
    ·        A class contains components
    ·        Each component is assigned to a visibility section
    ·        Classes implement methods
    The following sections describe the structure of classes in more detail.
    Class Components
    The components of a class make up its contents. All components are declared in the declaration part of the class. The components define the attributes of the objects in a class. When you define the class, each component is assigned to one of the three visibility sections, which define the external interface of the class. All of the components of a class are visible within the class. All components are in the same namespace. This means that all components of the class must have names that are unique within the class.
    There are two kinds of components in a class - those that exist separately for each object in the class, and those that exist only once for the whole class, regardless of the number of instances. Instance-specific components are known as instance components. Components that are not instance-specific are called static components.
    In ABAP Objects, classes can define the following components. Since all components that you can declare in classes can also be declared in interfaces, the following descriptions apply equally to interfaces.
    Attributes
    Attributes are internal data fields within a class that can have any ABAP data type. The state of an object is determined by the contents of its attributes. One kind of attribute is the reference variable. Reference variables allow you to create and address objects. Reference variables can be defined in classes, allowing you to access objects from within a class.
    Instance Attributes
    The contents of instance attributes define the instance-specific state of an object. You declare them using the DATAstatement.
    Static Attributes
    The contents of static attributes define the state of the class that is valid for all instances of the class. Static attributes exist once for each class. You declare them using the CLASS-DATA statement. They are accessible for the entire runtime of the class.
    All of the objects in a class can access its static attributes. If you change a static attribute in an object, the change is visible in all other objects in the class.
    The technical properties of instance attributes belong to the static properties of a class. It is therefore possible to refer in a LIKE addition to the visible attributes of a class – through the class component selector or through reference variables, without prior creation of an object.
    Methods
    Methods are internal procedures in a class that define the behavior of an object. They can access all of the attributes of a class. This allows them to change the data content of an object. They also have a parameter interface, with which users can supply them with values when calling them, and receive values back from them The private attributes of a class can only be changed by methods in the same class.
    The definition and parameter interface of a method is similar to that of function modules. You define a method meth in the definition part of a class and implement it in the implementation part using the following processing block:
    METHOD meth.
    ENDMETHOD.
    You can declare local data types and objects in methods in the same way as in other ABAP procedures (subroutines and function modules). You call methods using the CALL METHOD statement.
    Instance Methods
    You declare instance methods using the METHODSstatement. They can access all of the attributes of a class, and can trigger all of the events of the class.
    Static Methods
    You declare static methods using the CLASS-METHODSstatement. They can only access static attributes and trigger static events.
    Special Methods
    As well as normal methods, which you call using CALL METHOD, there are two special methods called constructor and class_constructor that are automatically called when you create an object or when you first access the components of a class.
    reward pts if help.
    deepanker

  • How to get the original record Number in Multi-Record Block

    Hello Everyone,
    I know how to find the duplicate item in the multi-Record block,
    For Ex:
    Line_Num            Item_Name             Quantity
    1                           AA                      10
    2                           BB                      20
    3                           AA Here 3rd record Item_name is duplicated, I can able to check and display the message that 'Item is duplicated' ,I found from [sheikyerbouti.developpez.com/duplicates/duplicates.htm] .
    but I want to show along with original line number i.e 1 when the item_name is entered .
    Here I want to check the original Line_Num and want to display the message
    'Item is duplicated,Update quantity in Original Line 1'
    Can anyone help me to get this?
    Thank You.
    Regards,
    Guru.

    Hi Francois,
    Actually I want to check and show the message when the item_name is entered i.e WHEN-VALIDATE-ITEM TRIGGER.
    I put the following code in WHEN-VALIDATE-ITEM TRIGGER
    Declare
         curnum number;
         dupnum number;
         cur_item varchar2(100);
         v_alert_no number;
         p_linerec varchar2(100);
    Begin
    curnum := TO_NUMBER(:System.Trigger_Record);
    cur_item := :Lines.Item_number;
    First_Record;
    p_linerec := :Lines.Item_number;
    LOOP
    If p_linerec = cur_item then
         dupnum := :Lines.Line_num;
         set_alert_property('ALERT_STOP',ALERT_MESSAGE_TEXT,
    'Duplicate Item Found,Update QTY in Original line number '||dupnum);
       V_ALERT_NO := show_alert('ALERT_STOP');
       :LINES.ITEM_NUMBER := NULL;
    :LINES.ITEM_DESCRIPTION:= NULL;
    :LINES.ITEM_REVISION:= NULL;
    :LINES.ITEM_CATEGORY:= NULL;
    elsIF (:System.Last_Record = 'TRUE') THEN
         Go_Record(curnum);
         EXIT;
      ELSE
         Next_Record;
      END IF;
    END LOOP;
    End; But I am getting the following error,
    FRM-40737:Illegal Restricted Procedure
    FIRST_RECORD in WHEN-VALIDATE-TRIGGERand then
    its showing for first line itself.
    Duplicate Item found.Update QTY in Original line number 1so I put the condition
    If :Lines.Line_num > 1 then --Only to check when the block having more than one record.but now it checking from second record and displaying,
    Duplicate Item found.Update QTY in Original line number 2 --(instead of Update QTY in Original line number 1)Can you tell me how can I change the above code for my requirement?
    Thank you.
    Edited by: Gurujothi on 27 Mar, 2013 5:20 PM

  • How to find the number of users  connected to database from OS level(Linux)

    Hi All,
    Could anyone know , how to find the number of users connected to database without connecting with sql*plus
    is there any command to find it?
    example we have 10 databases in one server, how to find the number of users connected to particular database without connecting to database(v$session)?
    oracle version:- 10g,11g
    Operating System:- OEL4/OEL5/AIX/Solaris
    any help will be appreciated.
    Thanks in advance.
    Thank you.
    Regards,
    Rajesh.

    Excellent.
    Tested, works as long as you set the ORACLE_SID first ( to change databases )
    ps -ef | grep $ORACLE_SID | grep "LOCAL=NO" | awk '{print $2}' | wc -l
    Thanks!
    select OSUSER
        from V$SESSION
    where AUDSID = SYS_CONTEXT('userenv','sessionid')
        and rownum=1;Best Regards
    mseberg

  • How to find the number of references created for a given  object ??

    How to find the number of references created for a given object in a big application environment.
    That means, if i give any object name (of my application) as input, then how can i find the[b] number of references created for that particular object ??

    Please do not post the same question multiple times.
    As for your original question, there is no direct way to do it.
    Especially not the way you phrased it,
    since objects don't have "names".
    Applications also don't have "names".
    They have classes and instances.
    Also, there are 2 related issues, and I'm not sure which one is the one you asked.
    #1. Finding the number of references to the same object.
    Eg.
    Map<String,String> a = new HashMap<String,String>();
    Map<String,String> b = new HashMap<String,String>();
    Map<String,String> c = a;In this case, there are only 2 objects.
    The first object has (at least) 2 references pointing to it.
    The second object has (at least) 1 reference pointing to it.
    (There may be more, if the HashMap library keeps
    references to these things, or if the HashMap object has
    some internal cyclic references...)
    If you're asking this, then it can't be done.
    It's an active research topic in universities
    and software research labs, called "alias analysis".
    Type it in google, and you'll see people are working hard
    and having little success so far.
    #2. Finding the number of instances created from a class.
    In this case, what you have to do is to add a counter to
    the constructor of the class. Every time an object is constructed,
    you increment the counter. Like this:
       class MyClass
           public static int counter = 0;
           public MyClass( )  { counter++; }
        // Then later in your program, you can do this:
        MyClass a = new MyClass();
        MyClass b = new MyClass();
        System.out.println(MyClass.counter); // It should show 2Note: you won't be able to do this to every class in the system.
    For every class you care about, you have to modify its constructor.
    Also: when an object is deleted, you won't always know it
    (and thus you won't always be able to decrement the counter).
    Finalizers cannot always work (read Joshua Bloch's
    "Effective Java" book if you don't believe me), but basically
    (1) finalizers will not always be called, and
    (2) finalizers can sometimes cause objects to not be deleted,
    and thus the JVM will run out of memory and crash

  • How to find the value of a variable in other program

    How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
    Regards
    Vin

    Hi Vinayak,
         you will be having your first program values in internal table or some variables,
        when you are calling the second program you wii use like this,
        SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
                           WITH s_emp(second program select-options)   IN t_emp(first program variables)
                           WITH p_chk   EQ t_chk
                           WITH p_r1    EQ t_r1
                           WITH p_month EQ t_month
                           WITH s_cust1 IN t_cust1
                           WITH p_r2    EQ t_r2
                           WITH s_cust2 IN t_cust2
                           WITH s_week  IN t_week
                           AND RETURN.
    you have pas like this to get your first program details.

  • How to find the list of existing tables in a schema using DB link?

    Hi
    I know how to find the list of existing tables in a schema using the following query
    SQL> select * from tab;
    but, how to list the tables using a DB link?
    For Example
    SQL> select * from tab@dblink_name;
    why this doesn't work?
    Pl advice me
    Thanks
    Reddy.

    ORA-02019: connection description for remote database not foundHave you used this database link successfully for some other queries?
    The error posted seems to indicate that the DB Link is not functional at all. Has it worked for any other type of DML operation or is this the first time you ever tried to use the link?

  • How to find the level of each child table in a relational model?

    Earthlings,
    I need your help and I know that, 'yes, we can change'. Change this thread to a answered question.
    So: How to find the level of each child table in a relational model?
    I have a relacional database (9.2), all right?!
         O /* This is a child who makes N references to each of the follow N parent tables (here: three), and so on. */
        /↑\ Fks
       O"O O" <-- level 2 for first table (circle)
      /↑\ Fks
    "o"o"o" <-- level 1 for middle table (circle)
       ↑ Fk
      "º"Tips:
    - each circle represents a table;
    - red tables no have foreign key
    - the table in first line of tree, for example, has level 3, but when 3 becomes N? How much is N? This's the question.
    I started thinking about the following:
    First I have to know how to take the children:
    select distinct child.table_name child
      from all_cons_columns father
      join all_cons_columns child
    using (owner, position)
      join (select child.owner,
                   child.constraint_name fk,
                   child.table_name child,
                   child.r_constraint_name pk,
                   father.table_name father
              from all_constraints father, all_constraints child
             where child.r_owner = father.owner
               and child.r_constraint_name = father.constraint_name
               and father.constraint_type in ('P', 'U')
               and child.constraint_type = 'R'
               and child.owner = 'OWNER') aux
    using (owner)
    where child.constraint_name = aux.fk
       and child.table_name = aux.child
       and father.constraint_name = aux.pk
       and father.table_name = aux.father;Thinking...
    Let's Share!
    My thanks in advance,
    Philips
    Edited by: BluShadow on 01-Apr-2011 15:08
    formatted the code and the hierarchy for readbility

    Justin,
    Understood.
    Nocycle not work in 9.2 and, even that would work, would not be appropriate.
    With your help, I decided a much simpler way (but there is still a small problem, <font color=red>IN RED</font>):
    -- 1
    declare
      type udt_roles is table of varchar2(30) index by pls_integer;
      cRoles udt_roles;
    begin
      execute immediate 'create user philips
        identified by philips';
      select granted_role bulk collect
        into cRoles
        from user_role_privs
       where username = user;
      for i in cRoles.first .. cRoles.count loop
        execute immediate 'grant ' || cRoles(i) || ' to philips';
      end loop;
    end;
    -- 2
    create table philips.root1(root1_id number,
                               constraint root1_id_pk primary key(root1_id)
                               enable);
    grant all on philips.root1 to philips;
    create or replace trigger philips.tgr_root1
       before delete or insert or update on philips.root1
       begin
         null;
       end;
    create table philips.root2(root2_id number,
                               constraint root2_id_pk primary key(root2_id)
                               enable);
    grant all on philips.root2 to philips;
    create or replace trigger philips.tgr_root2
       before delete or insert or update on philips.root2
       begin
         null;
       end;
    create table philips.node1(node1_id number,
                               root1_id number,
                               node2_id number,
                               node4_id number,
                               constraint node1_id_pk primary key(node1_id)
                               enable,
                               constraint n1_r1_id_fk foreign key(root1_id)
                               references philips.root1(root1_id) enable,
                               constraint n1_n2_id_fk foreign key(node2_id)
                               references philips.node2(node2_id) enable,
                               constraint n1_n4_id_fk foreign key(node4_id)
                               references philips.node4(node4_id) enable);
    grant all on philips.node1 to philips;
    create or replace trigger philips.tgr_node1
       before delete or insert or update on philips.node1
       begin
         null;
       end;
    create table philips.node2(node2_id number,
                               root1_id number,
                               node3_id number,
                               constraint node2_id_pk primary key(node2_id)
                               enable,
                               constraint n2_r1_id_fk foreign key(root1_id)
                               references philips.root1(root1_id) enable,
                               constraint n2_n3_id_fk foreign key(node3_id)
                               references philips.node3(node3_id) enable);
    grant all on philips.node2 to philips;
    create or replace trigger philips.tgr_node2
       before delete or insert or update on philips.node2
       begin
         null;
       end;                          
    create table philips.node3(node3_id number,
                               root2_id number,
                               constraint node3_id_pk primary key(node3_id)
                               enable,
                               constraint n3_r2_id_fk foreign key(root2_id)
                               references philips.root2(root2_id) enable);
    grant all on philips.node3 to philips;
    create or replace trigger philips.tgr_node3
       before delete or insert or update on philips.node3
       begin
         null;
       end;                          
    create table philips.node4(node4_id number,
                               node2_id number,
                               constraint node4_id_pk primary key(node4_id)
                               enable,
                               constraint n4_n2_id_fk foreign key(node2_id)
                               references philips.node2(node2_id) enable);
    grant all on philips.node4 to philips;
    create or replace trigger philips.tgr_node4
       before delete or insert or update on philips.node4
       begin
         null;
       end;                          
    -- out of the relational model
    create table philips.node5(node5_id number,
                               constraint node5_id_pk primary key(node5_id)
                               enable);
    grant all on philips.node5 to philips;
    create or replace trigger philips.tgr_node5
       before delete or insert or update on philips.node5
       begin
         null;
       end;
    -- 3
    create table philips.dictionary(table_name varchar2(30));
    insert into philips.dictionary values ('ROOT1');
    insert into philips.dictionary values ('ROOT2');
    insert into philips.dictionary values ('NODE1');
    insert into philips.dictionary values ('NODE2');
    insert into philips.dictionary values ('NODE3');
    insert into philips.dictionary values ('NODE4');
    insert into philips.dictionary values ('NODE5');
    --4
    create or replace package body philips.pck_restore_philips as
      procedure sp_select_tables is
        aExportTablesPhilips     utl_file.file_type := null; -- file to write DDL of tables   
        aExportReferencesPhilips utl_file.file_type := null; -- file to write DDL of references
        aExportIndexesPhilips    utl_file.file_type := null; -- file to write DDL of indexes
        aExportGrantsPhilips     utl_file.file_type := null; -- file to write DDL of grants
        aExportTriggersPhilips   utl_file.file_type := null; -- file to write DDL of triggers
        sDirectory               varchar2(100) := '/app/oracle/admin/tace/utlfile'; -- directory \\bmduhom01or02 
        cTables                  udt_tables; -- collection to store table names for the relational depth
      begin
        -- omits all referential constraints:
        dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'REF_CONSTRAINTS', false);
        -- omits segment attributes (physical attributes, storage attributes, tablespace, logging):
        dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'SEGMENT_ATTRIBUTES', false);
        -- append a SQL terminator (; or /) to each DDL statement:
        dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'SQLTERMINATOR', true);
        -- create/open files for export DDL:
        aExportTablesPhilips := utl_file.fopen(sDirectory, 'DDLTablesPhilips.pdc', 'w', 32767);
        aExportReferencesPhilips := utl_file.fopen(sDirectory, 'DDLReferencesPhilips.pdc', 'w', 32767);
        aExportIndexesPhilips := utl_file.fopen(sDirectory, 'DDLIndexesPhilips.pdc', 'w', 32767);
        aExportGrantsPhilips := utl_file.fopen(sDirectory, 'DDLGrantsPhilips.pdc', 'w', 32767);
        aExportTriggersPhilips := utl_file.fopen(sDirectory, 'DDLTriggersPhilips.pdc', 'w', 32767);
        select d.table_name bulk collect
          into cTables -- collection with the names of tables in the schema philips
          from all_tables t, philips.dictionary d
         where owner = 'PHILIPS'
           and t.table_name = d.table_name;
        -- execution
        sp_seeks_ddl(aExportTablesPhilips,
                     aExportReferencesPhilips,
                     aExportIndexesPhilips,
                     aExportGrantsPhilips,
                     aExportTriggersPhilips,
                     cTables);
        -- closes all files
        utl_file.fclose_all;
      end sp_select_tables;
      procedure sp_seeks_ddl(aExportTablesPhilips     in utl_file.file_type,
                             aExportReferencesPhilips in utl_file.file_type,
                             aExportIndexesPhilips    in utl_file.file_type,
                             aExportGrantsPhilips     in utl_file.file_type,
                             aExportTriggersPhilips   in utl_file.file_type,
                             cTables                  in out nocopy udt_tables) is
        cDDL       clob := null; -- colletion to save DDL
        plIndex    pls_integer := null;
        sTableName varchar(30) := null;
      begin
        for i in cTables.first .. cTables.count loop
          plIndex    := i;
          sTableName := cTables(plIndex);
           * Retrieves the DDL and the dependent DDL into cDDL clob       *      
          * for the selected table in the collection, and writes to file.*
          begin
            cDDL := dbms_metadata.get_ddl('TABLE', sTableName, 'PHILIPS');
            sp_writes_ddl(aExportTablesPHILIPS, cDDL);
          exception
            when dbms_metadata.object_not_found then
              null;
          end;
          begin
            cDDL := dbms_metadata.get_dependent_ddl('REF_CONSTRAINT', sTableName, 'PHILIPS');
            sp_writes_ddl(aExportReferencesPhilips, cDDL);
          exception
            when dbms_metadata.object_not_found2 then
              null;
          end;
          begin
            cDDL := dbms_metadata.get_dependent_ddl('INDEX', sTableName, 'PHILIPS');
            sp_writes_ddl(aExportIndexesPhilips, cDDL);
          exception
            when dbms_metadata.object_not_found2 then
              null;
          end;
          begin
            cDDL := dbms_metadata.get_dependent_ddl('OBJECT_GRANT', sTableName, 'PHILIPS');
            sp_writes_ddl(aExportGrantsPhilips, cDDL);
          exception
            when dbms_metadata.object_not_found2 then
              null;
          end;
          begin
            cDDL := dbms_metadata.get_dependent_ddl('TRIGGER', sTableName, 'PHILIPS');
            sp_writes_ddl(aExportTriggersPhilips, cDDL);
          exception
            when dbms_metadata.object_not_found2 then
              null;
          end;
        end loop;
      end sp_seeks_ddl;
      procedure sp_writes_ddl(aExport in utl_file.file_type,
                              cDDL    in out nocopy clob) is
        pLengthDDL  pls_integer := length(cDDL);
        plQuotient  pls_integer := null;
        plRemainder pls_integer := null;
      begin
          * Register variables to control the amount of lines needed   *
         * for each DDL and the remaining characters to the last row. *
        select trunc(pLengthDDL / 32766), mod(pLengthDDL, 32766)
          into plQuotient, plRemainder
          from dual;
          * Join DDL in the export file.                            *
         * ps. 32766 characters + 1 character for each line break. *
        -- if the size of the DDL is greater than or equal to limit the line ...
        if plQuotient >= 1 then
          -- loops for substring (lines of 32766 characters + 1 break character):
          for i in 1 .. plQuotient loop
            utl_file.put_line(aExport, substr(cDDL, 1, 32766));
            -- removes the last line, of clob, recorded in the buffer:
            cDDL := substr(cDDL, 32767, length(cDDL) - 32766);
          end loop;
        end if;
          * If any remains or the number of characters is less than the threshold (quotient = 0), *
         * no need to substring.                                                                 *
        if plRemainder > 0 then
          utl_file.put_line(aExport, cDDL);
        end if;
        -- record DDL buffered in the export file:
        utl_file.fflush(aExport);
      end sp_writes_ddl;
    begin
      -- executes main procedure:
      sp_select_tables;
    end pck_restore_philips;<font color="red">The problem is that I still have ...
    When creating the primary key index is created and this is repeated in the file indexes.
    How to avoid?</font>

  • How to  find the user exit for a screen..

    Hi,
    plz help me how to find the user exit for a screen..?
    Regards
    Anbu

    Hi,
    check this program this will give you the list of user-exit and BADI for the perticular Tcode.
    REPORT  zuserexit_badi.
    TABLES : tstc,
    tadir,
    modsapt,
    modact,
    trdir,
    tfdir,
    enlfdir,
    sxs_attrt ,
    tstct.
    DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA : field1(30).
    DATA : v_devclass LIKE tadir-devclass.
    PARAMETERS : p_tcode LIKE tstc-tcode,
    p_pgmna LIKE tstc-pgmna .
    DATA wa_tadir TYPE tadir.
    START-OF-SELECTION.
      IF NOT p_tcode IS INITIAL.
        SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
      ELSEIF NOT p_pgmna IS INITIAL.
        tstc-pgmna = p_pgmna.
      ENDIF.
      IF sy-subrc EQ 0.
        SELECT SINGLE * FROM tadir
        WHERE pgmid = 'R3TR'
        AND object = 'PROG'
        AND obj_name = tstc-pgmna.
        MOVE : tadir-devclass TO v_devclass.
        IF sy-subrc NE 0.
          SELECT SINGLE * FROM trdir
          WHERE name = tstc-pgmna.
          IF trdir-subc EQ 'F'.
            SELECT SINGLE * FROM tfdir
            WHERE pname = tstc-pgmna.
            SELECT SINGLE * FROM enlfdir
            WHERE funcname = tfdir-funcname.
            SELECT SINGLE * FROM tadir
            WHERE pgmid = 'R3TR'
            AND object = 'FUGR'
            AND obj_name EQ enlfdir-area.
            MOVE : tadir-devclass TO v_devclass.
          ENDIF.
        ENDIF.
        SELECT * FROM tadir INTO TABLE jtab
        WHERE pgmid = 'R3TR'
        AND object IN ('SMOD', 'SXSD')
        AND devclass = v_devclass.
        SELECT SINGLE * FROM tstct
        WHERE sprsl EQ sy-langu
        AND tcode EQ p_tcode.
        FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
        WRITE:/(19) 'Transaction Code - ',
        20(20) p_tcode,
        45(50) tstct-ttext.
        SKIP.
        IF NOT jtab[] IS INITIAL.
          WRITE:/(105) sy-uline.
          FORMAT COLOR COL_HEADING INTENSIFIED ON.
    Sorting the internal Table
          SORT jtab BY object.
          DATA : wf_txt(60) TYPE c,
          wf_smod TYPE i ,
          wf_badi TYPE i ,
          wf_object2(30) TYPE c.
          CLEAR : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
          LOOP AT jtab INTO wa_tadir.
            AT FIRST.
              FORMAT COLOR COL_HEADING INTENSIFIED ON.
              WRITE:/1 sy-vline,
              2 'Enhancement/ Business Add-in',
              41 sy-vline ,
              42 'Description',
              105 sy-vline.
              WRITE:/(105) sy-uline.
            ENDAT.
            CLEAR wf_txt.
            AT NEW object.
              IF wa_tadir-object = 'SMOD'.
                wf_object2 = 'Enhancement' .
              ELSEIF wa_tadir-object = 'SXSD'.
                wf_object2 = ' Business Add-in'.
              ENDIF.
              FORMAT COLOR COL_GROUP INTENSIFIED ON.
              WRITE:/1 sy-vline,
              2 wf_object2,
              105 sy-vline.
            ENDAT.
            CASE wa_tadir-object.
              WHEN 'SMOD'.
                wf_smod = wf_smod + 1.
                SELECT SINGLE modtext INTO wf_txt
                FROM modsapt
                WHERE sprsl = sy-langu
                AND name = wa_tadir-obj_name.
                FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
              WHEN 'SXSD'.
    For BADis
                wf_badi = wf_badi + 1 .
                SELECT SINGLE text INTO wf_txt
                FROM sxs_attrt
                WHERE sprsl = sy-langu
                AND exit_name = wa_tadir-obj_name.
                FORMAT COLOR COL_NORMAL INTENSIFIED ON.
            ENDCASE.
            WRITE:/1 sy-vline,
            2 wa_tadir-obj_name HOTSPOT ON,
            41 sy-vline ,
            42 wf_txt,
            105 sy-vline.
            AT END OF object.
              WRITE : /(105) sy-uline.
            ENDAT.
          ENDLOOP.
          WRITE:/(105) sy-uline.
          SKIP.
          FORMAT COLOR COL_TOTAL INTENSIFIED ON.
          WRITE:/ 'No.of Exits:' , wf_smod.
          WRITE:/ 'No.of BADis:' , wf_badi.
        ELSE.
          FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
          WRITE:/(105) 'No userexits or BADis exist'.
        ENDIF.
      ELSE.
        FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
        WRITE:/(105) 'Transaction does not exist'.
      ENDIF.
    AT LINE-SELECTION.
      DATA : wf_object TYPE tadir-object.
      CLEAR wf_object.
      GET CURSOR FIELD field1.
      CHECK field1(8) EQ 'WA_TADIR'.
      READ TABLE jtab WITH KEY obj_name = sy-lisel+1(20).
      MOVE jtab-object TO wf_object.
      CASE wf_object.
        WHEN 'SMOD'.
          SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
          CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
        WHEN 'SXSD'.
          SET PARAMETER ID 'EXN' FIELD sy-lisel+1(20).
          CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
      ENDCASE.
    Reagards,
    Bharat.

Maybe you are looking for