AP_INVOICES_ALL Standard WHO Columns - Urgent help

I created some Invoices(Debit memos), later i approved them in the front end and expected the last_update_date to change, but it didnt.
Is there anything else that could be controlling the update on the standard WHO columns. My program depends on the last_update_date as a driving criteria, i am stuck at this point, wondering if something is preventing the update on the WHO columns.
Can someone help me in this regard.

I see this statement at the end of approval. May you can use this:
UPDATE ap_invoice_distributions D
SET match_status_flag = 'T',
last_update_date = SYSDATE,
last_updated_by = p_user_id,
program_application_id = decode(fnd_global.prog_appl_id,
-1,null,
fnd_global.prog_appl_id),
request_id = decode(fnd_global.conc_request_id,
-1,null, fnd_global.conc_request_id),
program_id = decode(fnd_global.conc_program_id,
-1,null, fnd_global.conc_program_id),
program_update_date = decode(fnd_global.conc_program_id,
-1,null, SYSDATE)
WHERE match_status_flag = 'S'
AND D.invoice_id = p_invoice_id;
Thanks
Nagamohan

Similar Messages

  • R12 AR Invoice raxinv  -Customization (add columns) - need urgent help

    Hi,
    I need urgent help in customization of AR invoice report (raxinv) in R12. I am doing report customization for Brazil. As soon as I add one more column in report common query, build query and main query Q_invoice. Report changes to new variables in report editor q_invoice itself for example from remit_to_address_id to remit_to_address_id1 , previous_customer_id to previous_customer_id1 and start giving error that original variables e.g. remit_to_address_id , previous_customer_id are not defined in the query. Variable names and xml tags are also different from each other. even after trying to fix it, error persist.
    Thanks
    Anju

    Hi,
    I need urgent help in customization of AR invoice report (raxinv) in R12. I am doing report customization for Brazil. As soon as I add one more column in report common query, build query and main query Q_invoice. Report changes to new variables in report editor q_invoice itself for example from remit_to_address_id to remit_to_address_id1 , previous_customer_id to previous_customer_id1 and start giving error that original variables e.g. remit_to_address_id , previous_customer_id are not defined in the query. Variable names and xml tags are also different from each other. even after trying to fix it, error persist.
    Thanks
    Anju

  • Need help with Javascript to get value of standard report column

    Hello All,
    Apex version 3.1
    I have a SQL Query (Updateable report) region where I need to do some validations using an OnDemand Applicaiton Process and javascript. For this validation I need to use the serial number and the item id from the same report row. The function is called when the serial number is changed. I can get the serial number easily because it is a Text field, however the item id is a standard report column (making it a text field or hidden gives me a checksum error, long story). How do I get the value for the standard report column in order to set the value for an Application item to be used in my Application Process along with the serial number? Here is my code below.
    <script>
    function f_ValidateSerial(pThis)
      // The row in the table
      var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
        //alert('Row is '+vRow);
      // Display the serial number
        //alert('The Serial Number is '+html_GetElement('f21_'+vRow).value);
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=ValidateSerial',0);
    get.add('F101_SERIAL_NUMBER',html_GetElement('f21_'+vRow).value);
    get.add('F101_INVENTORY_ITEM_ID',+html_GetElement(?????+vRow).value);   // Here's where I need to get the item id to set application item!!
    gReturn = get.get();
    if (gReturn)
          alert(gReturn);
      if(gReturn)
          html_GetElement('f21_'+vRow).value = '';
    </script>

    jarola wrote:
    Hi,
    Ok, No standard report column do not have name attribute-
    You can add one extra column to report that is your Item Id with different alias.
    Then change that column Display as to "Hidden".
    Now you have hidden input where is your Item Id. Than input have name and id.
    Regards,
    JariBut this puts me back to my initial problem. When making the column hidden I get the checksum error...
    Error in mru internal routine: ORA-20001: Error in MRU: row= 0, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process...
    The item id is NOT in the table which I am updating (I use a subquery to get the data) so I think it has to be a standard report column. Hidden and Text Item (which have an item id) all generate the checksum error.
    So I think I'm back to my original question. Given a standard report column on a row in a sql query (updateable report) region how do I get the value using Javascript?
    Edited by: blue72TA on Aug 2, 2011 12:07 PM

  • Can we use WHO columns in Business Logic implementation

    Hi,
    Can we use WHO columns for business logic implementation..?
    From one table I need to pick up the latest record. I have a ActionDate column in the table which stores the date of the action.
    But on the same day there can be multiple action records. ie Multiple records have same ActionDate.
    Select * from action_table where action_date=(maximum action_date)
    The above query will return more than 1 record.
    Now can I use the Creation_Date which is a WHO column to identify the latest record..?
    Will it introduce any issues if I use creation_date WHO column?
    Usage of WHO column in application logic, Is it against the Standards ?
    Thanks a lot.

    I guess you are talking about populating the value using the history column creation_dt from EO.
    If so, you can use then. We are using them in all our applications to populate WHO columns of our table.
    Infact as far as I know, even Oracle application uses them.
    They generally populate the timestamp, so you may need to format them when doing date comparisons.
    Hope that helps.
    Amit

  • Urgent help needed!! Layout table and Draw layout cell dissapeared.

    I need some urgent help. I'm using CS3 but for a while my
    Layout Table and Draw Layout Cell icons appear greyed and can't use
    them at all. Is there any kind soul out there who knows how to fix
    this? I'm going nuts trying all the possible options but none seem
    to work.
    Help please!!!!!!

    > How would you about designing a page without using html?
    You don't. But I don't recall suggesting that you not use
    HTML. I just
    suggested that you use best-practice HTML, no? Or maybe you
    meant to ask
    how you would go about building your site without learning
    HTML? In that
    case, I think you are outta luck. Using DW without knowing
    HTML is a very
    punishing experience, I'm afraid.
    > PS: A virtual box of 12 bottles of Moet Chandon is
    already on your way!!
    I'd prefer Cristal, please.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Untersberg" <[email protected]> wrote in
    message
    news:g4tj9a$m5o$[email protected]..
    > Ahhhhhh!!!!! They came up!!!! They came up again!!
    > I was on standard mode. Now going back to your
    suggestion, which I really
    > appreciate. How would you about designing a page without
    using html? I'm
    > just
    > redesigning my website at the moment and need it to get
    going urgently,
    > hence
    > the reluctance to start learning HTML at the moment.
    I'll do after but I
    > need
    > to get this up and running fairly quickly.
    >
    > Cheers.
    >
    > PS: A virtual box of 12 bottles of Moet Chandon is
    already on your way!!
    >

  • Who Column - What is best way to put value in who columns

    Hi,
    I have a custom concurrent program that is inserting values in a custom database table. Now I have to update that table to enter *'who columns'*. I have updated table but now get confused when I need to enter values in those 'who columns'.
    Now I have two option: 1) change package body used by concurrent program to insert values of who column. 2) put trigger on the table to put who columns values on insert/update
    Now my question is that which is better and standard option in EBS and why????
    Do we have already existing 'who trigger' in EBS that I can reuse???
    Please help me to find answer.
    Thanks,
    Faried

    Hi Faried,
    It is always suggested to avoid triggers wherever possible. Its easy to implement the logic of updating who columns in the concurrent program and you will have one less thing (trigger) to maintain.
    As far as a prebuilt who trigger is concerned, there isn't anything available for a pl/sql program. If you are coding a custom form through which you want to update a who column of a table, there is a standard api (FND_STANDARD.SET_WHO), that comes from template.fmb which takes care of updating the who columns. However, for a custom concurrent program, there isnt anything like that. You will just have to add these columns in your insert/update statements.
    Thanks
    Vijay

  • URGENT HELP master export setup

    URGENT HELP master export setup
    Hi,
    I tried to search in the forum before I sent this request and I did not find my answer.
    I am using Production suite CS4, Windows 7. I am trying to figure out whatr is the best export setups (codec) to send to the post captioned place who works with Final cut pro. It is a 45 min documentayy shot on hxp170 that will be broadcasted on APTN channel (standard and HD). I shot 720p 24 fps (native) My files are 1.33 pixel ratio.
    I want the best quality possible regardless of the size of the file.
    Can Avid DNxHD codec work? (I googled and did not find a proper answer)
    Also a problem: I tried to export an MXF version and an uncompressed AVI. I used Sapphire plug ins (cartoon, film scratch, glow etc) and with some export setup, it make some clips slide up or left of the screen!!! Anyone had that before?
    Also: should I export 24 fps or 23.976?
    Thanks a lot.

    Is this a Premiere Pro question or an After Effects question? Probably better off in the AE forum...
    http://forums.adobe.com/community/aftereffects_general_discussion
    In reference to your first question, it might be worth asking them what they WANT. They may have a preferred pre-broadcast format, and if you can supply that, it may save your material from being transcoded (again).
    MP

  • Sqlplus SPOOL broken.  Urgent help.

    I have never seen this before.
    I am running a spool of a small query. It returns 7 rows and they are displayed. I go to look at the .lst file and the first row is gone from the spooled .lst file. I have tried this multiple times, and the results vary- sometimes it removes the first row and sometimes it removes the first column of data form the first row.
    ??????????????? Any idea where to start looking for trouble other than the alert.log?

    > Urgent help.
    My usual soapbox response (again).
    Please do not call your problem urgent. Why?
    Because you are saying that your problem is more important and more deserving attention than other people who post problems here. That is just a rude and arrogant thing to do. Your problem is by no means more important than any other person's problem in this forum - as you are in no position to compare and judge that.
    You are also demanding a quick response from those here that assist people like you. You have no right to demand anything as paid professionals are giving you their free time in assisting you. How can you claim that they must be "quick-quick" in spending their free time, without any payment, to assist you?
    So, practice some netiquette and remember that this is a PUBLIC forum and "staffed" by volunteers.

  • Urgent help needed... PL/SQL Insert statement

    Hi...
    I need some urgent help on this project. I have a 2 column table with values that need to be inserted into another existing table which has a sequence.
    This is the 2 column table:
    FUND YEAR
    29587 05
    29587 07
    Existing table:
    Name Null? Type
    LIST_ID NOT NULL NUMBER(6) -- This is a sequence
    WEB_USER_ID NOT NULL VARCHAR2(10)
    RESOURCE_TYPE NOT NULL VARCHAR2(8)
    LIST_TYPE NOT NULL VARCHAR2(10)
    LIST_NAME NOT NULL VARCHAR2(50)
    LIST_CODE_1 NOT NULL VARCHAR2(6) -- FUND from table above
    LIST_CODE_2 NOT NULL VARCHAR2(6) -- YEAR from table above
    LIST_CODE_3 NOT NULL VARCHAR2(6)
    LAST_UPDATED_DT NOT NULL DATE
    LAST_UPDATED_BY NOT NULL VARCHAR2(10)
    LIST_CODE_4 NOT NULL VARCHAR2(20)
    The columns from table 1 (FUND, YEAR) correspond to columns (LIST_CODE_1, LIST_CODE_2) in table 2. The column LIST_ID is a sequence. I can put in sysdate for LAST_UPDATED_DT and my initials SN for LAST_UPDATED_BY. This is going to be for 2 unique WEB_USER_IDs which would be in the WHERE clause. I will be inserting 2200 rows for each id. A single insert statement would look like this -
    INSERT INTO EXISTING_TBL (list_id,web_user_id,resource_type,list_type,list_name,list_code_1,list_code_2,list_code_3,list_code_4,last_updated_dt,last_updated_by) VALUES ('470027','WEBUSER','GL','FUNDFYF',' FUND BALANCE SUM','12010','01',' ',' ',{ts '2010-5-19 10:16:9'},'SN')
    How would I do this to insert the 2200 values from my 2 column table to the existing table?
    All help is greatly appreciated!!
    SN

    Hello ,
    I think this will work
    INSERT INTO TABLE2
         LIST_ID,
         WEB_USER_ID,
         RESOURCE_TYPE,
         LIST_TYPE,
         LIST_NAME,
         LIST_CODE_1,
         LIST_CODE_2,
         LIST_CODE_3,
         LIST_CODE_4,
         LAST_UPDATED_DT,
         LAST_UPDATED_BY
    SELECT
         SEQ.NEXTVAL,
         FUND,
         YEAR,
         <VALUE FOR RESOURCE_TYPE>,
         <VALUE FOR LIST_TYPE>,
         <VALUE FOR LIST_NAME>,
         <VALUE FOR LIST_CODE_1>,
         <VALUE FOR LIST_CODE_2>,
         <VALUE FOR LIST_CODE_3>,
         <VALUE FOR LIST_CODE_4>,
         SYSDATE,
         'SN'
    FROM
         TABLE1
    REGARDS
    Rahul Sharma

  • Urgent help needed to get this home page up!

    Hi,
    I need urgent help with this and it is driving me crazy. For
    some reason my animation starts at its fastest and won't stop until
    you click the area then it works properly. I have no clue why it is
    doing this and only seems to do it on a PC browser not on a Mac.
    Can anyone help please!!!!!
    Link to sample:
    http://www.totalamber.com/test.html
    Link to fla:
    http://www.totalamber.com/flash/homepage.fla
    Thanks so much for anyone who can help or tries to help me.
    Neil
    Ps this is urgent and i can't find a solution by searching on
    here

    Thanks to anyone who has looked at this but i have found the
    answer.
    It is due to what many of the users on here will already know
    and can be explained in this link:
    http://blog.deconcept.com/swfobject/
    I had forgot about the legal patent going on with microsoft!
    Hope it helps anyone else as bad as i am.
    Neil

  • Urgent  help needed(java frames)

    Hi,
    I need urgent help for correcting a piece of code.
    I have written a piece of code for building a gui with some buttons, drawing some geometric shapes.The code consists of two files called Graph and Frame.
    The problem I suppose in the last part of the Graph file, which Rectangle and Circle are called together, the only shape that the program draws is rectangle.Here is the code:
    //Graph
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import java.util.*;
    public class Graph extends JPanel {
    LinkedList color;
    LinkedList figures;
    public Graph() {
    setBackground(Color.white);
    figures = new LinkedList();
    color = new LinkedList();
    int z;
    class Point {
    int x;
    int y;
    public Point(int x, int y) {
    this.x = x;
    this.y = y;
    public Point(Point p) {
    x = p.x;
    y = p.y;
    public String toString() {
    return "(" + x + ", " + y + ")";
    public void move(Point dist) {
    x += dist.x;
    y += dist.y;
    abstract class GeomFigur {
    public abstract void move(Point p);
    class Line extends GeomFigur {
    Point p1, p2;
    public Line(Point p1, Point p2) {
    this.p1 = new Point(p1);
    this.p2 = new Point(p2);
    public String toString() { return "Line from " + p1 + " to " + p2;  }
    public void move(Point dist) {
    p1.move(dist);
    p2.move(dist);
    class Rectangle extends Line {
    public Rectangle(Point p1, Point p2) {
    super(p1, p2);
    public String toString() { return "Rectangle from " + p1 + " to " + p2; }
    class Circle extends GeomFigur{
    Point centre;
    int radius;
    public Circle(Point centre, int radius) {
    this.centre = new Point(centre);
    this.radius = radius;
    public String toString() {
    return "Circle, centre " + centre + ", radius " + radius;
    public void move(Point dist) { centre.move(dist); }
    public void addRectangle(int x, int y, Color col) {
    Rectangle r =new Rectangle(new Point(x,y),new Point(x+20,y+20));
    figures.addLast(r);
    color.addLast(col);
    repaint();
    public void addCircle(int x, int y, Color col) {
    Circle c =new Circle(new Point(x,y), 1 );
    figures.addLast(c);
    color.addLast(col);
    repaint();
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    for (int i=0;i < figures.size();i++) {
    Rectangle rect = (Rectangle)figures.get(i);
    //Circle circ = (Circle)figures.get(i);
    g.setColor(Color.black);
    g.drawRect(rect.p1.x,rect.p1.y,20,20);
    g.setColor((Color)color.get(i));
    g.fillRect(rect.p1.x,rect.p1.y,20,20);
    //g.setColor(Color.black);
    // g.drawOval(circ.centre.x,circ.centre.y,20,20);
    // g.setColor((Color)color.get(i));
    // g.fillOval(circ.centre.x, circ.centre.y, 20, 20);
    //Frame
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class Frame extends JFrame implements ActionListener {
    JButton button1, button2, button3, button4, button5 ;
    Graph gr;
    JComboBox cbx;
    JComboBox cby;
    JComboBox col;
    JMenu filemenu;
    JMenuItem quit;
    JMenuBar menubar;
    int x=10;
    int y=10;
    Color color=Color.red;
    public Frame() {
    menubar = new JMenuBar();
    filemenu = new JMenu("File");
    filemenu.setMnemonic('F');
    quit = new JMenuItem("Quit");
    quit.addActionListener(this);
    quit.setMnemonic('Q');
    quit.setAccelerator(KeyStroke.getKeyStroke('Q',Event.CTRL_MASK,false));
    filemenu.add(quit);
    menubar.add(filemenu);
    setJMenuBar(menubar);
    button1 = new JButton("Rectangle");
    button1.addActionListener(this);
    button2 = new JButton("Circle");
    button2.addActionListener(this);
    button4 = new JButton("Ellipse");
    button4.addActionListener(this);
    button5 = new JButton("Triangle");
    button5.addActionListener(this);
    button3 = new JButton("Reset");
    button3.addActionListener(this);
    String[] elements_x= {"10","20","30","40","50","60","70"};
    cbx = new JComboBox(elements_x);
    cbx.addActionListener(this);
    cbx.setActionCommand("cbx");
    String[] elements_y= {"10","20","30","40","50","60","70"};
    cby = new JComboBox(elements_y);
    cby.addActionListener(this);
    cby.setActionCommand("cby");
    String[] elements_color = {"Red","Blue","Green","Orange","Yellow" };
    col = new JComboBox(elements_color);
    col.addActionListener(this);
    col.setActionCommand("col");
    gr = new Graph();
    JPanel top = new JPanel(new BorderLayout());
    JPanel inputs = new JPanel(new GridLayout(6,1));
    inputs.add(button1);
    inputs.add(button2);
    inputs.add(button3);
    inputs.add(button4);
    inputs.add(button5);
    inputs.add(cbx);
    inputs.add(cby);
    inputs.add(col);
    top.add(gr,BorderLayout.CENTER);
    top.add(inputs,BorderLayout.WEST);
    getContentPane().add(BorderLayout.CENTER, top);
    setSize(500,300);//set window size
    //take care of actions
    public void actionPerformed(ActionEvent e) {
    String command = e.getActionCommand();
    if (command.equals("Quit")){
    System.exit(0);//terminate program
    else if (command.equals("Rectangle")){
    //add Rectangle to graph at
    //position x,y and with certain color
    gr.addRectangle(x,y,color);
    else if (command.equals("Circle")){
    gr.addCircle(x,y,color);
    else if (command.equals("Reset")){
    else if (command.equals("Triangle")){
    else if (command.equals("Ellipse")){
    else if (command.equals("cbx")){
    x=Integer.valueOf((String)((JComboBox)e.getSource()).getSelectedItem()).intValue();
    else if (command.equals("cby")){
    y=Integer.valueOf((String)((JComboBox)e.getSource()).getSelectedItem()).intValue();
    else if (command.equals("col")){
    String temp=(String)((JComboBox)e.getSource()).getSelectedItem();
    if (temp=="Red") color=Color.red;
    else if (temp=="Blue") color=Color.blue;
    else if (temp=="Green") color=Color.green;
    else if (temp=="pink") color=Color.pink;
    else if (temp=="lightGray") color=Color.lightGray;
    //main program
    public static void main(String [] args) {
    Frame appl = new Frame();
    appl.setVisible(true);
    Thanks in advance
    Marina

    Hi,
    You are very lucky that I'm currently boored. You should never tag a question as urgent. It might be urgent to you, but not to us who answer. And you should also use code formatting when you post code (see the formatting tips, or use the code-button).
    I made some changes to your Graph class. The most important thing is the abstract draw method that I added to the GeomFigur class.
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class Graph extends JPanel {
        LinkedList figures;
        public Graph() {
            setBackground(Color.white);
            figures = new LinkedList();
        int z;
        abstract class GeomFigur {
            protected Color color;
            public GeomFigur(Color color) {
                this.color = color;
            public abstract void move(Point p);
            public abstract void draw(Graphics g);
        abstract class Line extends GeomFigur {
            Point p1, p2;
            public Line(Color c, Point p1, Point p2) {
                super(c);
                this.p1 = new Point(p1);
                this.p2 = new Point(p2);
            public String toString() {
                return "Line from " + p1 + " to " + p2;
            public void move(Point dist) {
                p1.move(dist.x, dist.y);
                p2.move(dist.x, dist.y);
        class Rectangle extends Line {
            public Rectangle(Color c, Point p1, Point p2) {
                super(c, p1, p2);
            public String toString() {
                return "Rectangle from " + p1 + " to " + p2;
            public void draw(Graphics g) {
                System.out.println("Draw rectangle at " + p1 + " with color " + color);
                g.setColor(Color.black);
                g.drawRect(p1.x, p1.y, 20, 20);
                g.setColor(color);
                g.fillRect(p1.x, p1.y, 20, 20);
        class Circle extends GeomFigur {
            Point centre;
            int radius;
            public Circle(Color c, Point centre, int radius) {
                super(c);
                this.centre = new Point(centre);
                this.radius = radius;
            public String toString() {
                return "Circle, centre " + centre + ", radius " + radius;
            public void move(Point dist) {
                centre.move(dist.x, dist.y);
            public void draw(Graphics g) {
                System.out.println("Draw circle at " + centre + " with color " + color);
                g.setColor(Color.black);
                g.drawOval(centre.x, centre.y, 20, 20);
                g.setColor(color);
                g.fillOval(centre.x, centre.y, 20, 20);
        public void addRectangle(int x, int y, Color col) {
            System.out.println("x,y,col " + x + ":" + y + ":" + col);
            Rectangle r = new Rectangle(col, new Point(x, y), new Point(x + 20, y + 20));
            figures.addLast(r);
            repaint();
        public void addCircle(int x, int y, Color col) {
            System.out.println("x,y,col" + x + ":" + y + ":" + col);
            Circle c = new Circle(col, new Point(x, y), 1);
            figures.addLast(c);
            repaint();
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            for (int i = 0; i < figures.size(); i++) {
                GeomFigur drawable = (GeomFigur)figures.get(i);
                drawable.draw(g);
    }/Kaj

  • Urgent help needed in achieving below ADF 11g flow

    Hi, I am using JDEV 11.1.1.2.0 with ADF 11g.
    I have a below requirement.
    Say in below eg. I am getting col1, col2, col3 from a single tbl in screen 1. On clicking col1's row I should go to screen 2
    Screen1
    Col1     Col2     Col3
    Nm1     Code1     10
    Nm1     Code1     30
    Nm2     Code1     30
    Nm1     Code2     20
    Here in screen 2 I will have a calculated field as shown below. Besides this In the same screen I will have a list showing distinct of col2 for the value cliked in col1. So here in this eg. it will be for Nm1 I will have 2 values in the list Code1 and Code2.      
    Screen 2          
    Col1     Nm1     
    Col2     Code1     
    Tot     *40*     
    Col2     Select     
    Code1     X     
    Code2          
    Now here if user selects the radio of 'Code2' Then my above data should change as below
    Col1     Nm1     
    Col2     Code2     
    Tot     *20*
    Col2     Select     
    Code1          
    Code2     X
    I do this by passing the col1 value as a param to a query VO.
    I have tried this using different VOs like a VO with query, VO with user defined column... nothing helps.
    I am just unable to reach to screen 2. I am either getting invalid column OR missing in out parameters.
    Can any one help on how and what should be done? This is not even master-details stuff. master-details seems easier than this.
    Urgent help is needed.
    Thanks in advance

    I have resolved your problem and build a sample application.
    You have to create 2 views and use master detail.
    First view will be a simple view for the page 1 and second view will be readonly using group by. Then create a view link between them.
    Let me know your email id. I will email you the sample application.
    SID
    Edited by: manieshsailoz on Apr 26, 2010 5:12 PM

  • Urgent HELP required on forming the Matrix of data using PL/SQL

    Hi All,
    I'm new to this thread and require your urgent help in this regard.
    I've got a requirement for building a 5000 X 5000 matrix using PL/SQL. My original data tables have 5000 rows each and I need to do a correlation analysis using this data and need to store in a physical table and not in-memory. Is this feat achievable using mere PL/SQL? I understand that Oracle DB has a limitation of 1000 columns(but not sure) and hence I'd like to know whether there is any work-around for such scenarios. If not, what are the other alternative method(s) to achieve this feat? Do I need to use any 3rd party tools to get this done? An early reply from the experts is highly appreciated.
    Thanking you all Gurus in advance.
    Rgds
    Sai

    Welcome to OTN!
    I'll get to your quesiton in a moment, but first some welcome information. Many OTN posters consider it impolite to mark threads as "urgent". We are volunteers and have jobs of our own to do without people we don't know making demands. You are brand new and deserve some patience but please understand this. It is very likely before I finish this post someone will complain about the word "urgent" in your subject.
    On to more interesting things :)
    You can do the matrix, but are out of luck with a 5000 x 5000 table because Oracle only allows 1000 columns per table. There are ways to work around this.
    How do do the matrix depends on what you want to do. You can do this different ways. You can create a table beforehand and use PL/SQL or simple SQL to populate it, or use the CREATE TABLE AS syntax to create and populate it in one step if you can get the underlying SQL to work the way you want, something like
    create table my_table as
      select a.*, b.*
        from table1 a, table2 bcan populate a matrix from 2 tables with an intentional cartesian join (the WHERE clause was left out intentionally, provided your data is already in the data base.
    If not you can use a PL/SQL routine to populate the data.
    There are a couple of ways to solve the 1000 column limit. The easiest way might be to have 5 collections of 1000 columns each. A more complicated but more elegant soltion would be to have nested collections, allowing 2 colliections that you can loop through - a collection of collections. Nested collections can be hard to work with. A third way would be to use nested tables in the database but I personally do not like them and the insert, update, and delete statements for nested tables are hard to use.
    I'm not going to give a code example because I am not sure which solution is best for you. If you have further questions post them.

  • Urgent Help Required for Connect Four Game

    Hi all,
    I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the internet which helped me little bit. But there are lot of problems I am facing developing the whole game. I have drawn the Board and the two players can play. The players numbers can fill the board, but I have problem implementing the winner for the game. I need to implement the hasWon() method for Horizontal win, Vertical win and Diagonal win. I also found some code examples on the net but I was unable to make it working. I have 5 classes and one interface which I m implementing. The main problem is how to implement the hasWon() method in the PlayGame class below with Horizontal, vertical and diagonal moves.
    Sorry there is so much code.
    This the interface I must implement, but now I am only implementing the int move() of this interface. I will implement the rest later after solving the winner problem with your help.
    Interface code..............
    interface Player {
    void init (Boolean color);
    String name ();
    int move ();
    void inform (int i);
    Player1 class......................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player1 implements Player
    public Player1()
    public int move()
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player1;
    System.out.println ("What is your Number, player 1?");
    player1 = scan.nextInt();
    System.out.println ("Hey number"+player1+" are you prepared to CONNECT FOUR");
    System.out.println();
    return player1;
    //Player.move();
    //return player1;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "Koonda";
    }//end player1 class
    Player2 class...........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player2 implements Player
    public int move()
    //int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    // cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
    //int num1, num2;
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player2;
    System.out.println ("What is your Number, player 2?");
    player2 = scan.nextInt();
    System.out.println ("Hey "+player2+" are you prepared to CONNECT FOUR");
    System.out.println();
    //return player1;
    return player2;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "malook";
    }//end player1 class
    PlayGame class which contains all the functionality.........................................................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class PlayGame
    //Player player1;
    //Player player2;
    int [][]ConnectFourArray;
    boolean status;
    int winner;
         int player1;
         int player2;
         public PlayGame()
              //this.player1 = player1;
              //this.player2 = player2;
         public void StartGame()
         try{
         // int X = 0, Y = 0;
         //int value;
         int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
         int[][] ConnectFourArray = new int[6][7];
         int num1, num2;
         for(int limit=21;limit!=0;limit--)
    BufferedReader selecter = new BufferedReader (new InputStreamReader(System.in));
    String column1;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=1;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=1;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=1;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=1;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=1;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=1;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=1;
    cup6=cup6-1;
    System.out.println();
    BufferedReader selecter2 = new BufferedReader (new InputStreamReader(System.in));
    String column2;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=2;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=2;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=2;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=2;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=2;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=2;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=2;
    cup6=cup6-1;
    System.out.println();
    System.out.println();
    catch (Exception E){
    System.out.println("Error with input");
    System.out.println("Would you like to play again");
    try{
    String value;
    BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
    // Scanner scan = new Scanner(System.in);
    System.out.println("Enter yes to play or no to quit");
    // value = scan.nextLine();
    // String value2;
    value = reader.readLine();
    //value2 = reader.readLine();
    if (value.equals("yes"))
    System.out.println("Start again");
    StartGame(); // calling the StartGame method to play a game once more
    else if (value.equals("no"))
    System.out.println("No more games to play");
    // System.exit(0);
    else
    System.exit(0);
    System.out.println();
    catch (Exception e){
    System.out.println("Error with input");
    finally
    System.out.println(" playing done");
    //StartGame();
    //check for horizontal win
    public int hasWon()
    int status = 0;
    for (int row=0; row<6; row++)
    for (int col=0; col<4; col++)
    if (ConnectFourArray[col][row] != 0 &&
    ConnectFourArray[col][row] == ConnectFourArray[col+1][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+2][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+3][row])
    //status = true;//int winner;
    if(status == player1)
    System.out.println("Player 1 is the winner");
    else if(status == player2)
    System.out.println("Player 2 is the winner" );
    }//end inner for loop
    }// end outer for loop
    } // end method Winner
    return status;
    }//end class
    ClassConnectFour which designs the board........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class ClassConnectFour
         //Player player1;
         //Player player2;
         public ClassConnectFour()
              //this.player1 = player1;
    public void DrawBoard()
    int[][] ConnectFourArray = new int[6][7] ;
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    }//end class
    TestConnetFour class which uses most of the above class..................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class TestConnectFour
    public static void main(String[] args)
    ClassConnectFour cf = new ClassConnectFour();
    cf.DrawBoard();
    Player1 player1 = new Player1();
    Player2 player2 = new Player2();
    player1.move();
    player2.move();
    System.out.println("Number 1 belongs to player " + player1.name());
    System.out.println("Number 2 belongs to player " + player2.name());
    PlayGame pg = new PlayGame();
    pg.StartGame();
    pg.hasWon();
    //pg.Play();
    //System.out.println(player.name());
    //System.out.println(player2.name());
    }// end main
    }//end class
    I am sorry for all this junk code but I only understand it this way. Your urgent help is required. Looking forward to your reply.
    Thanks in advance.
    Koonda
    //

    Hi,
    Thanks for your help but I really don't understand the table lookup algorithm. Could you please send me some code to implement that.
    I will send you the formatted code as well
    Thanks for your help.
    looking forward to your reply.
    Koonda
    Hi all,
    I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the internet which helped me little bit. But there are lot of problems I am facing developing the whole game. I have drawn the Board and the two players can play. The players numbers can fill the board, but I have problem implementing the winner for the game. I need to implement the hasWon() method for Horizontal win, Vertical win and Diagonal win. I also found some code examples on the net but I was unable to make it working. I have 5 classes and one interface which I m implementing. The main problem is how to implement the hasWon() method in the PlayGame class below with Horizontal, vertical and diagonal moves.
    Sorry there is so much code.
    This the interface I must implement, but now I am only implementing the int move() of this interface. I will implement the rest later after solving the winner problem with your help.
    Interface code..............
    interface Player {
    void init (Boolean color);
    String name ();
    int move ();
    void inform (int i);
    Player1 class......................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player1 implements Player
    public Player1()
    public int move()
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player1;
    System.out.println ("What is your Number, player 1?");
    player1 = scan.nextInt();
    System.out.println ("Hey number"+player1+" are you prepared to CONNECT FOUR");
    System.out.println();
    return player1;
    //Player.move();
    //return player1;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "Koonda";
    }//end player1 class
    Player2 class...........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player2 implements Player
    public int move()
    //int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    // cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
    //int num1, num2;
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player2;
    System.out.println ("What is your Number, player 2?");
    player2 = scan.nextInt();
    System.out.println ("Hey "+player2+" are you prepared to CONNECT FOUR");
    System.out.println();
    //return player1;
    return player2;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "malook";
    }//end player1 class
    PlayGame class which contains all the functionality.........................................................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class PlayGame
    //Player player1;
    //Player player2;
    int [][]ConnectFourArray;
    boolean status;
    int winner;
    int player1;
    int player2;
    public PlayGame()
    //this.player1 = player1;
    //this.player2 = player2;
    public void StartGame()
    try{
    // int X = 0, Y = 0;
    //int value;
    int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
    int[][] ConnectFourArray = new int[6][7];
    int num1, num2;
    for(int limit=21;limit!=0;limit--)
    BufferedReader selecter = new BufferedReader (new InputStreamReader(System.in));
    String column1;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=1;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=1;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=1;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=1;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=1;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=1;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=1;
    cup6=cup6-1;
    System.out.println();
    BufferedReader selecter2 = new BufferedReader (new InputStreamReader(System.in));
    String column2;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=2;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=2;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=2;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=2;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=2;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=2;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=2;
    cup6=cup6-1;
    System.out.println();
    System.out.println();
    catch (Exception E){
    System.out.println("Error with input");
    System.out.println("Would you like to play again");
    try{
    String value;
    BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
    // Scanner scan = new Scanner(System.in);
    System.out.println("Enter yes to play or no to quit");
    // value = scan.nextLine();
    // String value2;
    value = reader.readLine();
    //value2 = reader.readLine();
    if (value.equals("yes"))
    System.out.println("Start again");
    StartGame(); // calling the StartGame method to play a game once more
    else if (value.equals("no"))
    System.out.println("No more games to play");
    // System.exit(0);
    else
    System.exit(0);
    System.out.println();
    catch (Exception e){
    System.out.println("Error with input");
    finally
    System.out.println(" playing done");
    //StartGame();
    //check for horizontal win
    public int hasWon()
    int status = 0;
    for (int row=0; row<6; row++)
    for (int col=0; col<4; col++)
    if (ConnectFourArray[col][row] != 0 &&
    ConnectFourArray[col][row] == ConnectFourArray[col+1][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+2][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+3][row])
    //status = true;//int winner;
    if(status == player1)
    System.out.println("Player 1 is the winner");
    else if(status == player2)
    System.out.println("Player 2 is the winner" );
    }//end inner for loop
    }// end outer for loop
    } // end method Winner
    return status;
    }//end class
    ClassConnectFour which designs the board........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class ClassConnectFour
    //Player player1;
    //Player player2;
    public ClassConnectFour()
    //this.player1 = player1;
    public void DrawBoard()
    int[][] ConnectFourArray = new int[6][7] ;
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    }//end class
    TestConnetFour class which uses most of the above class..................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class TestConnectFour
    public static void main(String[] args)
    ClassConnectFour cf = new ClassConnectFour();
    cf.DrawBoard();
    Player1 player1 = new Player1();
    Player2 player2 = new Player2();
    player1.move();
    player2.move();
    System.out.println("Number 1 belongs to player " + player1.name());
    System.out.println("Number 2 belongs to player " + player2.name());
    PlayGame pg = new PlayGame();
    pg.StartGame();
    pg.hasWon();
    //pg.Play();
    //System.out.println(player.name());
    //System.out.println(player2.name());
    }// end main
    }//end classI am sorry for all this junk code but I only understand it this way. Your urgent help is required. Looking forward to your reply.
    Thanks in advance.
    Koonda

  • Urgent help need

    hi friends,
      Help me how to do this
    REPORT  ZINTERFACE_SAMPLE.
    type-pools:SLIS.
    TABLES:knb1, "Customer Master (Company Code)
           kna1,
           knvp. "Customer Master Partner Functions
    TYPES:BEGIN OF T_knb1,
          kunnr like knb1-kunnr,
          bukrs like knb1-bukrs,
          akont like knb1-akont,
          END OF T_knb1.
    TYPES:BEGIN OF T_kna1,
          kunnr like kna1-kunnr, "customer number
          NAME1 like KNA1-NAME1, "customer name
          stras like KNA1-STRAS, "Customer address
          ort01 like KNA1-ORT01, "Customer city
          stcd1 like KNA1-STCD1, "Tax id
          pstlz like KNA1-PSTLZ, "Postal code
          END OF   T_kna1.
    TYPES:BEGIN OF T_knvp,
          kunnr like knvp-kunnr, "customer number
          parvw like knvp-parvw,
          kunn2 like knvp-kunn2, "Customer number of business partner
          END OF T_KNVP.
    TYPES:BEGIN OF T_final,
          Record_type      TYPE c,
          Sold_to_cust(10) TYPE c,
          Payer(10)        TYPE c,
          Sequence(5)      TYPE n,
          Cust_name(35)    TYPE c,
          Cust_adreess(35) TYPE c,
          Cust_city(35)    TYPE c,
          Tax_id(16)       TYPE c,
          Postal_code(5)   TYPE c,
          Branch           TYPE c,
          Delivery(3)      TYPE c,
          END OF T_final.
    *Internal table declaration
    DATA:I_knb1  TYPE STANDARD TABLE OF t_knb1  initial size 0,
         i_kna1  TYPE STANDARD TABLE OF t_kna1  initial size 0,
         i_knvp  TYPE STANDARD TABLE OF t_knvp  initial size 0,
         i_final TYPE STANDARD TABLE OF t_final initial size 0.
    DATA: t_fieldcat_tab TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    *Work area declaration
    DATA:wa_knb1  TYPE t_knb1,
         wa_kna1  TYPE t_kna1,
         wa_knvp  TYPE t_knvp,
         wa_final TYPE t_final.
               *variable declaration
    data:sequence TYPe n,
         g_line TYPE i.
                    selection screen                        *
    SELECTION-screen begin of block b1 with frame title text-001.
    parameters:p_bukrs like knb1-bukrs, "Company code
               p_akont like knb1-akont .
    selection-screen end of block b1.
    SELECTION-screen begin of block b2 with frame title text-002.
    PARAMETERS:R1 RADIOBUTTON GROUP G1,
               R2 RADIOBUTTON GROUP G1.
    Parameters:p_file like rlgrap-filename.
                                       "Recon Account in General Ledger
    selection-screen end of block b2.
    *AT selection-screen ON VALUE-REQUEST FOR P_FILE.
    CALL FUNCTION 'F4_FILENAME'
       IMPORTING
         FILE_NAME = P_FILE.
    START-OF-selection.
    PERFORM f_fetchdata.
    PERFORM f_prepare_fieldcat.
    PERFORM f_display_report.
    *END-OF-SELECTION.
    *IF R1 EQ 'X'.
    *perform F_DOWNLOAD.
    *ENDIF.
    *IF R2 EQ 'X'.
    *OPEN DATASET P_FILE FOR OUTPUT IN text mode ENCODING DEFAULT.
    *LOOP AT i_final INTO WA_final.
    *TRANSFER WA_final TO P_FILE.
    *ENDLOOP.
    *CLOSE DATASET P_FILE.
    *ENDIF.
    *&      Form  f_fetchdata
    FORM f_fetchdata .
    select kunnr
           bukrs
           akont
           from knb1
           into table i_knb1
           where bukrs = p_bukrs
           AND   akont = p_akont.
    DESCRIBE TABLE i_knb1 LINES g_line.
    LOOP AT i_knb1 INTO wa_knb1.
    SELECT single KUNNR
                  NAME1
                  STRAS
                  ORT01
                  STCD1
                  PSTLZ
                  FROM kna1
                  INTO wa_kna1
                  where kunnr = wa_knb1-kunnr.
    if sy-subrc <> 0.
    *Error KNA1 record not found.
    endif.
    SELECT single kunnr
                  parvw
                  kunn2
                  FROM KNVP
                  INTO wa_knvp
                  where kunnr = wa_knb1-kunnr
                  AND parvw = 'RG'.
    if sy-subrc <> 0.
    *Error KNA1 record not found.
    endif.
    sequence = sequence + 1.
    MOVE: 'c'              TO    wa_final-Record_type,
          wa_knvp-kunnr    TO    wa_final-Sold_to_cust,
          sequence         TO    wa_final-Sequence,
          wa_KNA1-NAME1    TO    wa_final-Cust_name,
          wa_kna1-STRAS    TO    wa_final-Cust_adreess ,
          wa_kna1-ort01    TO    wa_final-Cust_city,
          wa_kna1-STCD1    TO    wa_final-Tax_id,
          wa_kna1-PSTLZ    TO    wa_final-Postal_code,
          '1'              TO    wa_final-branch,
          'abc'            TO    wa_final-Delivery.
    INSERT wa_final INTO TABLE i_final.
    endloop.
    ENDFORM.                    " f_fetchdata
    FORM f_prepare_fieldcat.
      t_fieldcat_tab-col_pos = 1.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'Record_type'.
      t_fieldcat_tab-seltext_l = 'Record type'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 2.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'Sold_to_cust'.
      t_fieldcat_tab-seltext_l = 'Sold to cust'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 3.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'payer'.
      t_fieldcat_tab-seltext_l = 'Payer'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 4.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'Sequence'.
      t_fieldcat_tab-seltext_l = 'sequence'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 5.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'Cust_name'.
      t_fieldcat_tab-seltext_l = 'Cust name'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 6.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'Cust_adreess'.
      t_fieldcat_tab-seltext_l = 'Cust adreess'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 7.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'Cust_city'.
      t_fieldcat_tab-seltext_l = 'Cust city'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 8.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'Tax_id'.
      t_fieldcat_tab-seltext_l = 'Tax id'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 9.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'Postal_code'.
      t_fieldcat_tab-seltext_l = 'Postal code'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 10.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'Branch'.
      t_fieldcat_tab-seltext_l = 'Branch'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 11.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'KWMENG'.
      t_fieldcat_tab-seltext_l = 'Order Qty'.
      APPEND t_fieldcat_tab.
      t_fieldcat_tab-col_pos = 12.
      t_fieldcat_tab-tabname  = 'i_final'.
      t_fieldcat_tab-fieldname  = 'Delivery'.
      t_fieldcat_tab-seltext_l = 'Delivery'.
      APPEND t_fieldcat_tab.
      ENDFORM.                    " f_prepare_fieldcat
    *&      Form  f_display_report
    *To display the ALV Report
    FORM f_display_report.
      DATA: l_repid LIKE sy-repid.
      l_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                   I_CALLBACK_PROGRAM  = l_repid
                   i_buffer_active     = 'X'
                   IT_FIELDCAT         = t_fieldcat_tab[]
                   I_DEFAULT           = 'X'
                   I_SAVE              = 'A'
             TABLES
                   T_OUTTAB            = i_final[].
            EXCEPTIONS
                  PROGRAM_ERROR                  = 1
                  OTHERS                         = 2
              IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             ENDIF.
              ENDFORM." f_display_report
    *&      Form  F_DOWNLOAD
          text
    -->  p1        text
    <--  p2        text
    FORM F_DOWNLOAD .
    *CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      FILENAME                      = p_file
      FILETYPE                      = 'ASC'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
    TABLES
       DATA_TAB                      = i_final
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_WRITE_ERROR              = 2
      INVALID_FILESIZE              = 3
      INVALID_TYPE                  = 4
      NO_BATCH                      = 5
      UNKNOWN_ERROR                 = 6
      INVALID_TABLE_WIDTH           = 7
      GUI_REFUSE_FILETRANSFER       = 8
      CUSTOMER_ERROR                = 9
      NO_AUTHORITY                  = 10
      OTHERS                        = 11
    *IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ENDFORM.                    " F_DOWNLOAD
    for this one when i given the proper input
    it showing the Runtime error.
    Could u please tell me what mistake i have done
    Urgent help
    Regards
    harshavi N.

    HI,
    Run this program..
    REPORT ZINTERFACE_SAMPLE.
    type-pools:SLIS.
    TABLES:knb1, "Customer Master (Company Code)
    kna1,
    knvp. "Customer Master Partner Functions
    TYPES:BEGIN OF T_knb1,
    kunnr like knb1-kunnr,
    bukrs like knb1-bukrs,
    akont like knb1-akont,
    END OF T_knb1.
    TYPES:BEGIN OF T_kna1,
    kunnr like kna1-kunnr, "customer number
    NAME1 like KNA1-NAME1, "customer name
    stras like KNA1-STRAS, "Customer address
    ort01 like KNA1-ORT01, "Customer city
    stcd1 like KNA1-STCD1, "Tax id
    pstlz like KNA1-PSTLZ, "Postal code
    END OF T_kna1.
    TYPES:BEGIN OF T_knvp,
    kunnr like knvp-kunnr, "customer number
    parvw like knvp-parvw,
    kunn2 like knvp-kunn2, "Customer number of business partner
    END OF T_KNVP.
    TYPES:BEGIN OF T_final,
    Record_type TYPE c,
    Sold_to_cust(10) TYPE c,
    Payer(10) TYPE c,
    Sequence(5) TYPE n,
    Cust_name(35) TYPE c,
    Cust_adreess(35) TYPE c,
    Cust_city(35) TYPE c,
    Tax_id(16) TYPE c,
    Postal_code(5) TYPE c,
    Branch TYPE c,
    Delivery(3) TYPE c,
    END OF T_final.
    *Internal table declaration
    DATA:I_knb1 TYPE STANDARD TABLE OF t_knb1 initial size 0,
    i_kna1 TYPE STANDARD TABLE OF t_kna1 initial size 0,
    i_knvp TYPE STANDARD TABLE OF t_knvp initial size 0,
    i_final TYPE STANDARD TABLE OF t_final initial size 0.
    DATA: t_fieldcat_tab TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    *Work area declaration
    DATA:wa_knb1 TYPE t_knb1,
    wa_kna1 TYPE t_kna1,
    wa_knvp TYPE t_knvp,
    wa_final TYPE t_final.
    *variable declaration
    data:sequence TYPe n,
    g_line TYPE i.
    selection screen *
    SELECTION-screen begin of block b1 with frame title text-001.
    parameters:p_bukrs like knb1-bukrs, "Company code
    p_akont like knb1-akont .
    selection-screen end of block b1.
    SELECTION-screen begin of block b2 with frame title text-002.
    PARAMETERS:R1 RADIOBUTTON GROUP G1,
    R2 RADIOBUTTON GROUP G1.
    Parameters:p_file like rlgrap-filename.
    "Recon Account in General Ledger
    selection-screen end of block b2.
    *AT selection-screen ON VALUE-REQUEST FOR P_FILE.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    FILE_NAME = P_FILE.
    START-OF-selection.
    PERFORM f_fetchdata.
    PERFORM f_prepare_fieldcat.
    PERFORM f_display_report.
    *END-OF-SELECTION.
    *IF R1 EQ 'X'.
    *perform F_DOWNLOAD.
    *ENDIF.
    *IF R2 EQ 'X'.
    *OPEN DATASET P_FILE FOR OUTPUT IN text mode ENCODING DEFAULT.
    *LOOP AT i_final INTO WA_final.
    *TRANSFER WA_final TO P_FILE.
    *ENDLOOP.
    *CLOSE DATASET P_FILE.
    *ENDIF.
    *& Form f_fetchdata
    FORM f_fetchdata .
    select kunnr
    bukrs
    akont
    from knb1
    into table i_knb1
    where bukrs = p_bukrs
    AND akont = p_akont.
    DESCRIBE TABLE i_knb1 LINES g_line.
    LOOP AT i_knb1 INTO wa_knb1.
    SELECT single KUNNR
    NAME1
    STRAS
    ORT01
    STCD1
    PSTLZ
    FROM kna1
    INTO wa_kna1
    where kunnr = wa_knb1-kunnr.
    if sy-subrc <> 0.
    *Error KNA1 record not found.
    endif.
    SELECT single kunnr
    parvw
    kunn2
    FROM KNVP
    INTO wa_knvp
    where kunnr = wa_knb1-kunnr
    AND parvw = 'RG'.
    if sy-subrc <> 0.
    *Error KNA1 record not found.
    endif.
    sequence = sequence + 1.
    MOVE: 'c' TO wa_final-Record_type,
    wa_knvp-kunnr TO wa_final-Sold_to_cust,
    sequence TO wa_final-Sequence,
    wa_KNA1-NAME1 TO wa_final-Cust_name,
    wa_kna1-STRAS TO wa_final-Cust_adreess ,
    wa_kna1-ort01 TO wa_final-Cust_city,
    wa_kna1-STCD1 TO wa_final-Tax_id,
    wa_kna1-PSTLZ TO wa_final-Postal_code,
    '1' TO wa_final-branch,
    'abc' TO wa_final-Delivery.
    INSERT wa_final INTO TABLE i_final.
    endloop.
    ENDFORM. " f_fetchdata
    FORM f_prepare_fieldcat.
    t_fieldcat_tab-col_pos = 1.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'RECORD_TYPE'.
    t_fieldcat_tab-seltext_l = 'Record type'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 2.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'SOLD_TO_CUST'.
    t_fieldcat_tab-seltext_l = 'Sold to cust'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 3.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'PAYER'.
    t_fieldcat_tab-seltext_l = 'Payer'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 4.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'SEQUENCE'.
    t_fieldcat_tab-seltext_l = 'sequence'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 5.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'CUST_NAME'.
    t_fieldcat_tab-seltext_l = 'Cust name'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 6.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'CUST_ADREESS'.
    t_fieldcat_tab-seltext_l = 'Cust adreess'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 7.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'CUST_CITY'.
    t_fieldcat_tab-seltext_l = 'Cust city'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 8.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'TAX_ID'.
    t_fieldcat_tab-seltext_l = 'Tax id'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 9.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'POSTAL_CODE'.
    t_fieldcat_tab-seltext_l = 'Postal code'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 10.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'BRANCH'.
    t_fieldcat_tab-seltext_l = 'Branch'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 11.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'KWMENG'.
    t_fieldcat_tab-seltext_l = 'Order Qty'.
    APPEND t_fieldcat_tab.
    t_fieldcat_tab-col_pos = 12.
    t_fieldcat_tab-tabname = 'I_FINAL'.
    t_fieldcat_tab-fieldname = 'DELIVERY'.
    t_fieldcat_tab-seltext_l = 'Delivery'.
    APPEND t_fieldcat_tab.
    ENDFORM. " f_prepare_fieldcat
    *& Form f_display_report
    *To display the ALV Report
    FORM f_display_report.
    DATA: l_repid LIKE sy-repid.
    l_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = l_repid
    IT_FIELDCAT = t_fieldcat_tab[]
    I_DEFAULT = 'X'
    I_SAVE = 'A'
    TABLES
    T_OUTTAB = I_FINAL[].
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM." f_display_report
    *& Form F_DOWNLOAD
    text
    --> p1 text
    <-- p2 text
    FORM F_DOWNLOAD .
    *CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = p_file
    FILETYPE = 'ASC'
    MODE = ' '
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    COL_SELECT = ' '
    COL_SELECTMASK = ' '
    NO_AUTH_CHECK = ' '
    IMPORTING
    FILELENGTH =
    TABLES
    DATA_TAB = i_final
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_WRITE_ERROR = 2
    INVALID_FILESIZE = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    NO_AUTHORITY = 10
    OTHERS = 11
    *IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ENDFORM. " F_DOWNLOAD
    It is perfectly working for me..
    I made the field name and table name as CAPs in the field catalog internal table.
    I removed the buffer paramter in the ALV FM.
    Thanks,
    Naren

Maybe you are looking for