Need you help !!! -- Which ECC table stores Function Area?

Dear experts:
I am new to Finance and here has one question need your help:
We need to get Function Area in one of our report. Is function area master data or transaction data? Which table stores this field? To get this field, which fields should be the primary keys while reading in the table (like cost center or some other fields)?
Any post would be appreciated and thank you all in advance!
Best Regards.
Tim
Moderator: Please, read the rules of SDN and search before posting

You can refer to table EKKO and field WKURS. This field in purchase order header table stores the exchange rate for the GR made against this Purchase order.
Amit G

Similar Messages

  • Which ECC table stores shipment # condition type level data?

    Hi all:
    Here I have a requirement to get freight data at condition type level for each shipment number.
    Does anybody know which ECC table/field maintain such data?
    Any post would be appreciated and thank you all in advance!
    Tim

    hi,
    this is to infrom you that,
    please try these tables:
    Tables for Shipping/Delivery document
    VTTK : SD Doc: Shipment Header
    VTTP - TKNUM: SD Doc : Shipment Item
    please check and confirm
    i have checked from my end.
    regards,
    balajia
    Edited by: balaji timmampalli achari on Nov 24, 2010 8:17 AM

  • Which SAP table stores the ABAP program Source Code

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

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

  • Which CRM table stores the release quantity and target quantity

    I found one table named CRMD_SCHEDLIN, one field is Quantity, is it the target quantity or not? If not, which CRM tables stores this info?
    Thanks!

    H Tracy,
    As far as i could find the table CRMD_SCHEDLIN is the only table which stores quantity. the sum quantities of each line item gives you the target quantity of the order i think.
    Please check the source code of function module CRM_SCHEDLIN_I_GET_ORD_QTY_OW you may get soem idea.
    Thanks,
    Rajini A.

  • Please I need some help with a table

    Hi All
    I need some help with a table.
    My table needs to hold prices that the user can update.
    Also has a total of the column.
    my question is if the user adds in a new price how can i pick up the value they have just entered and then add it to the total which will be the last row in the table?
    I have a loop that gets all the values of the column, so I can get the total but it is when the user adds in a new value that I need some help with.
    I have tried using but as I need to set the toal with something like total
        totalTable.setValueAt(total, totalTable.getRowCount()-1,1); I end up with an infinite loop.
    Can any one please advise on some way I can get this to work ?
    Thanks for reading
    Craig

    Hi there camickr
    thanks for the help the other day
    this is my full code....
    package printing;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.text.DecimalFormat;
    public class tablePanel
        extends JDialog  implements Printable {
      BorderLayout borderLayout1 = new BorderLayout();
      private boolean printing = false;
      private Dialog1 dialog;
      JPanel jPanel = new JPanel();
      JTable table;
      JScrollPane scrollPane1 = new JScrollPane();
      DefaultTableModel model;
      private String[] columnNames = {
      private Object[][] data;
      private String selectTotal;
      private double total;
      public tablePanel(Dialog1 dp) {
        dp = dialog;
        try {
          jbInit();
        catch (Exception exception) {
          exception.printStackTrace();
      public tablePanel() {
        try {
          jbInit();
        catch (Exception exception) {
          exception.printStackTrace();
      private void jbInit() throws Exception {
        jPanel.setLayout(borderLayout1);
        scrollPane1.setBounds(new Rectangle(260, 168, 0, 0));
        this.add(jPanel);
        jPanel.add(scrollPane1, java.awt.BorderLayout.CENTER);
        scrollPane1.getViewport().add(table);
        jPanel.setOpaque(true);
        newTable();
        addToModel();
        addRows();
        setTotal();
    public static void main(String[] args) {
      tablePanel tablePanel = new  tablePanel();
      tablePanel.pack();
      tablePanel.setVisible(true);
    public void setTotal() {
      total = 0;
      int i = table.getRowCount();
      for (i = 0; i < table.getRowCount(); i++) {
        String name = (String) table.getValueAt(i, 1);
        if (!"".equals(name)) {
          if (i != table.getRowCount() - 1) {
            double dt = Double.parseDouble(name);
            total = total + dt;
      String str = Double.toString(total);
      table.setValueAt(str, table.getRowCount() - 1, 1);
      super.repaint();
      public void newTable() {
        model = new DefaultTableModel(data, columnNames) {
        table = new JTable() {
          public Component prepareRenderer(TableCellRenderer renderer,
                                           int row, int col) {
            Component c = super.prepareRenderer(renderer, row, col);
            if (printing) {
              c.setBackground(getBackground());
            else {
              if (row % 2 == 1 && !isCellSelected(row, col)) {
                c.setBackground(getBackground());
              else {
                c.setBackground(new Color(227, 239, 250));
              if (isCellSelected(row, col)) {
                c.setBackground(new Color(190, 220, 250));
            return c;
        table.addMouseListener(new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() == 2) {
            if (e.getClickCount() == 1) {
              if (table.getSelectedColumn() == 1) {
       table.setTableHeader(null);
        table.setModel(model);
        scrollPane1.getViewport().add(table);
        table.getColumnModel().getColumn(1).setCellRenderer(new TableRenderDollar());
      public void addToModel() {
        Object[] data = {
            "Price", "5800"};
        model.addRow(data);
      public void addRows() {
        int rows = 20;
        for (int i = 0; i < rows; i++) {
          Object[] data = {
          model.addRow(data);
      public void printOut() {
        PrinterJob pj = PrinterJob.getPrinterJob();
        pj.setPrintable(tablePanel.this);
        pj.printDialog();
        try {
          pj.print();
        catch (Exception PrintException) {}
      public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
        Graphics2D g2 = (Graphics2D) g;
        g2.setColor(Color.black);
        int fontHeight = g2.getFontMetrics().getHeight();
        int fontDesent = g2.getFontMetrics().getDescent();
        //leave room for page number
        double pageHeight = pageFormat.getImageableHeight() - fontHeight;
        double pageWidth =  pageFormat.getImageableWidth();
        double tableWidth = (double) table.getColumnModel().getTotalColumnWidth();
        double scale = 1;
        if (tableWidth >= pageWidth) {
          scale = pageWidth / tableWidth;
        double headerHeightOnPage = 16.0;
        //double headerHeightOnPage = table.getTableHeader().getHeight() * scale;
        //System.out.println("this is the hedder heigth   " + headerHeightOnPage);
        double tableWidthOnPage = tableWidth * scale;
        double oneRowHeight = (table.getRowHeight() +  table.getRowMargin()) * scale;
        int numRowsOnAPage = (int) ( (pageHeight - headerHeightOnPage) / oneRowHeight);
        double pageHeightForTable = oneRowHeight *numRowsOnAPage;
        int totalNumPages = (int) Math.ceil( ( (double) table.getRowCount()) / numRowsOnAPage);
        if (pageIndex >= totalNumPages) {
          return NO_SUCH_PAGE;
        g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    //bottom center
        g2.drawString("Page: " + (pageIndex + 1 + " of " + totalNumPages),  (int) pageWidth / 2 - 35, (int) (pageHeight + fontHeight - fontDesent));
        g2.translate(0f, headerHeightOnPage);
        g2.translate(0f, -pageIndex * pageHeightForTable);
        //If this piece of the table is smaller
        //than the size available,
        //clip to the appropriate bounds.
        if (pageIndex + 1 == totalNumPages) {
          int lastRowPrinted =
              numRowsOnAPage * pageIndex;
          int numRowsLeft =
              table.getRowCount()
              - lastRowPrinted;
          g2.setClip(0,
                     (int) (pageHeightForTable * pageIndex),
                     (int) Math.ceil(tableWidthOnPage),
                     (int) Math.ceil(oneRowHeight *
                                     numRowsLeft));
        //else clip to the entire area available.
        else {
          g2.setClip(0,
                     (int) (pageHeightForTable * pageIndex),
                     (int) Math.ceil(tableWidthOnPage),
                     (int) Math.ceil(pageHeightForTable));
        g2.scale(scale, scale);
        printing = true;
        try {
        table.paint(g2);
        finally {
          printing = false;
        //tableView.paint(g2);
        g2.scale(1 / scale, 1 / scale);
        g2.translate(0f, pageIndex * pageHeightForTable);
        g2.translate(0f, -headerHeightOnPage);
        g2.setClip(0, 0,
                   (int) Math.ceil(tableWidthOnPage),
                   (int) Math.ceil(headerHeightOnPage));
        g2.scale(scale, scale);
        //table.getTableHeader().paint(g2);
        //paint header at top
        return Printable.PAGE_EXISTS;
    class TableRenderDollar extends DefaultTableCellRenderer{
        public Component getTableCellRendererComponent(
          JTable table,
          Object value,
          boolean isSelected,
          boolean isFocused,
          int row, int column) {
            setHorizontalAlignment(SwingConstants.RIGHT);
          Component component = super.getTableCellRendererComponent(
            table,
            value,
            isSelected,
            isFocused,
            row,
            column);
            if( value == null || value .equals("")){
              ( (JLabel) component).setText("");
            }else{
              double number = 0.0;
              number = new Double(value.toString()).doubleValue();
              DecimalFormat df = new DecimalFormat(",##0.00");
              ( (JLabel) component).setText(df.format(number));
          return component;
    }

  • JAXB  I realy need you help

    JAXB I realy need you help
    Dear friend
    We have next structure of XML file
    <order>
    <entities>
    <entity>1</entity>
    <entity>2</entity>
    <entity>3</entity>
    </entities>
    </order>
    according to xml we generate XSD
    after that use xjc.exe for generate JAXB Objects
    Class Order
    Entities entities
    Class Entities
    List<Entity> entity
    but I would like to be like that
    Class Order
    List<Entity> entity
    Class Entities make transient or use JAXB Custome mapping or other decision
    Thanks

    that is the standard way jaxb generates the model classes. i believe there is some sort of experimental "use simple mappings" switch (probably a vendor extension) which makes the xml files cleaner (similar to your desired implementation), but i don't have much experience with it.

  • I need you help urgently my job is on the line

    I really need you help it is very urgent as my job is in trouble! In may my I phone got lost I had all back up on my me account and Managed to save my contact list on my I pad however the next day after my I phone got stolen , the mobile me was closed and when I started using I cloud I could not find my list.
    I never update my I pad to I tunes but recently when I got my I phone 5 and my mini I pad by mistake when I was synchronizing all the list got deleted ! Please help me I need to get it bk! If you can manage to find it somewhere please help me find the contact list.
    Thank you

    If you were syncing your contacts with your computer via MobileMe then your contacts should be in the contact manager you sync with on your computer.
    If not, and you haven't maintained offline backups of your contacts, or didn't move your account to iCloud before last June, and haven't ever synced your devices to your computer then your data is gone. It can't be retrieved because it doesn't exist anywhere else, as you haven't followed Apple's directions for backing up and syncing.

  • My ipad says : this ipad cannot be backed up because there is not enough icloud storage available . you can manage your storage in sttings ..... i dont understand .. i need you help me please

    my ipad says : this ipad cannot be backed up because there is not enough icloud storage available . you can manage your storage in sttings ..... i dont understand .. i need you help me please

    Hi jasmin,
    Did you read what Demo wrote? He wasn't saying he had a problem. He was responding to the OP who had a problem, and was providing a solution. Follow what Demo said to do....
    Cheers,
    GB

  • Please help me... I reset the setting of my ipadmini then it turned black for 4hours now and it never came back to the way it was before. i need you help quick. thanks in advance.

    Please help me... I reset the setting of my ipadmini then it turned black for 4hours now and it never came back to the way it was before. i need you help quick. thanks in advance.

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.
    Message was edited by: Diavonex

  • HT1937 my apple iphone 3g.unlock iphone,i need you help me how to back normal ios

    my apple iphone 3g.unlock iphone,i need you help me how to back normal ios...pls answer me urgent.thank you

    Sorry, but your post is unclear. I don't know what you mean by "back to normal iOS". Do you mean that you jailbroke your iPhone? If that's what you mean and you now wish to remove the jailbreak, you can try putting the iPhone into DFU mode and see if that will let you restore and remove the jailbreak:
    http://osxdaily.com/2010/06/24/iphone-dfu-mode-explained-and-how-to-enter-dfu-mo de-on-your-iphone/
    Some jailbreaks cannot be removed and in some cases will permanently disable your iPhone. If that happens to you, then you will have to buy a new iPhone; Apple will provide no support, warranty or out-of-warranty, for a jailbroken iPhone. You're on your own from here. We can provide no further help with a jailbroken iPhone in these forums.
    If that's not what you mean, please post back and clarify. You may wish to try posting in your native language so that your question is more clear.
    Regards.

  • How to get app.processId from Guided Procedures? Please I need You help

    Hi everyone, I need your help, I need to recover the processId once time the Procees was started in Guided Procedures
    I found this link from maintenance process in Guided Porcedures administration
    http://host:port/webdynpro/dispatcher/sap.com/cafeugpui~rt/Runtime?app.processId=IDnumber
    the parameter I need is IDnumber, I dont know if it is possible with web dynpros or with web services please I need you help
    How Can I do this?
    Thank you very much my friends
    Regards from Mexico
    Atte Israel

    Hi,
    I am not sure about the version. But you can follow the steps below.
    1. Create a Web Dynpro Poroject (Ideally create a DC , but if you don't have NWDI setup a project will do).
    2. Add reference to com.sap.security.api.jar and sap.comcafeugpapi.jar
    3. Under WebDynpro References -> Library References add sap.com/cafeugp~api
    4. Put following code in wdDoInit()
    public void wdDoInit()
        //@@begin wdDoInit()
         IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
         IWDMessageManager msgMgr= wdComponentAPI.getMessageManager();
         try{
         IWDClientUser wdUser = WDClientUser.getCurrentUser();
         IUser user = wdUser.getSAPUser();
         IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(user);
         Date startDate = new Date(110,1,1); // Start date as 01-Jan-2010
         Date endDate= new Date(111,12,31); // End date as 31-Dec-2011
         IGPProcessInstanceInfo[] array = rtm.getRunningInstances(GPSearchRole.SEARCH_ROLE_OWNER, startDate, endDate, userContext);
         for (int i=0; i<array.length; i++){
         String instanceId = array<i>.getProcessInstanceID();
    //        Write logic to pass the instance ID to the RFC
    msgMgr.reportSuccess("Instance id =" + instanceId);
         catch(Exception ex)
         msgMgr.reportException(ex.getLocalizedMessage(),false);     
        //@@end
    Let me know if you face any issues.
    Thanks
    Prashant

  • Hi i need you help, I have lost my iphone yesterday . Still my mobile is ringing. I want to know the location of my phone.

    Hi i need you help,
    I have lost my iphone yesterday .
    Still my mobile is ringing. I want to know the location of my phone.
    I did't installed the Findmyiphone App.
    I have purcheased last month only.
    Please Please Please help me.

    Hi I have't sync my device with Icloud till now.
    so I am not able to login with Apple id.
    Any other posibilities?

  • Need some help understanding the way materialized views are applied through

    Hi, I need some help understanding the way materialized views are applied through adpatch.
    In patch 1, we have a mv with build mode immediate. When applying it PTS hang due to pool performance of mv refresh.
    So we provide patch 2, with that mv build mode deferred, hoping it'll go through. But patch 2 hang too on the same mv.
    How does this work? Is that because mv already exists in the database with build immediate, patch 2 will force it to refresh first before changing build mode? How to get over this?
    Thanks,
    Wei

    Hi Hussein,
    Thank you for the response.
    Application release is 11.5.10.
    Patch 1 is MSC11510: 8639586 ASCP ENGINE RUP#38 PATCH FOR 11.5.10 BRANCH
    Patch 2 is MSC11510: 9001833 APCC MSC_PHUB_CUSTOMERS_MV WORKER IS STUCK ON "DB FILE SEQUENTIAL READ" 12 HOURS
    The MV is APPS.MSC_PHUB_CUSTOMERS_MV
    This happens at customer environment but not reproducable in our internal environment, as our testing data is much smaller.
    Taking closer look in the logs, I saw actually when applying both patch 1 and patch 2, MV doesn't exist in the database. So seems my previous assumption is wrong. Still, strange that patch 2 contains only one file which is the MV.xdf, it took 7 hours and finally got killed.
    -- patch 1 log
    Materialized View Name is MSC_PHUB_CUSTOMERS_MV
    Materialized View does not exist in the target database
    Executing create Statement
    Create Statement is
    CREATE MATERIALIZED VIEW "APPS"."MSC_PHUB_CUSTOMERS_MV"
    ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 10 MAXTRANS 255 LOGGING
    STORAGE(INITIAL 4096 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 4 FREELIST GROUPS 4 BUFFER_POOL DEFAULT)
    TABLESPACE "APPS_TS_SUMMARY"
    BUILD IMMEDIATE
    USING INDEX
    REFRESH FORCE ON DEMAND
    WITH ROWID USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE
    AS select distinct
    from
    dual
    AD Worker error:
    The above program failed. See the error messages listed
    above, if any, or see the log and output files for the program.
    Time when worker failed: Tue Feb 02 2010 10:01:46
    Manager says to quit.
    -- patch 2 log
    Materialized View Name is MSC_PHUB_CUSTOMERS_MV
    Materialized View does not exist in the target database
    Executing create Statement
    Create Statement is
    CREATE MATERIALIZED VIEW "APPS"."MSC_PHUB_CUSTOMERS_MV"
    ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 10 MAXTRANS 255 LOGGING
    STORAGE(INITIAL 4096 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 4 FREELIST GROUPS 4 BUFFER_POOL DEFAULT)
    TABLESPACE "APPS_TS_SUMMARY"
    BUILD DEFERRED
    USING INDEX
    REFRESH COMPLETE ON DEMAND
    WITH ROWID USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE
    AS select distinct
    from dual
    Start time for statement above is Tue Feb 02 10:05:06 GMT 2010
    Exception occured ORA-00028: your session has been killed
    ORA-00028: your session has been killed
    ORA-06512: at "APPS.AD_MV", line 116
    ORA-06512: at "APPS.AD_MV", line 258
    ORA-06512: at line 1
    java.sql.SQLException: ORA-00028: your session has been killed
    ORA-00028: your session has been killed
    ORA-06512: at "APPS.AD_MV", line 116
    ORA-06512: at "APPS.AD_MV", line 258
    ORA-06512: at line 1
    Exception occured :No more data to read from socket
    AD Run Java Command is complete.
    Copyright (c) 2002 Oracle Corporation
    Redwood Shores, California, USA
    AD Java
    Version 11.5.0
    NOTE: You may not use this utility for custom development
    unless you have written permission from Oracle Corporation.
    AD Worker error:
    The above program failed. See the error messages listed
    above, if any, or see the log and output files for the program.
    Time when worker failed: Tue Feb 02 2010 19:51:27
    Start time for statement above is Tue Feb 02 12:44:52 GMT 2010
    End time for statement above is Tue Feb 02 19:51:29 GMT 2010
    Thanks,
    Wei

  • Need you help !!! -- datasource field to ECC table mapping for 0material

    Dear experts:
    Recently we need to get a quick turnaround on the fields we would be bringing into BW through standard extractors for the tables MARC and MBEW. My idea is to look at those master data extractors like 0MATERIAL, 0PLANT and then try to find how fields in datasource mapped to ECC table.
    So now I have 2 questions need your suggestion:
    1. Is my way above feasible or any other way to get the fields mapping information for one specific table (Not datasource) ?
    2. For 0MATERIAL_ATTR, I can neither find the table of origin for those datasource fields in SAP Library, nor in Tcode LBWE (Seems LBWE only for transaction data?). Can anybody give me a link for the fields mapping of 0MATERIAL and 0PLANT? or let me know where I can find those mapping information?
    Any reply would be appreciated and thank you all in advance !
    Best Regards
    Tim

    Well, the idea is simple. If you are using master data, then the easiest way is to find out which table is the master data stored. For eg. Material master data is stored in MARA table. Therefore 0MATERIAL_ATTR fetches data from the MARA table.
    The next option is to check the function module.
    1) Goto RSO2, and enter the data source name->display. The system wil throw a warning giving you the FM.
    2) For eg. 0MATERIAL_ATTR will throw the error "DataSource 0MATERIAL_ATTR is extracted using functional module MDEX_MATERIAL_MD".
    3)Go to SE37, and put the FM->display. Then go to the tables tab. You will see tables like BIW_MARA_S. The middle term is usually the table.
    Another option is go to table RSGENFIELDMAP and put the field in the field selection. This would give the mapping.
    Regards.

  • Need some help with the Table Function Operator

    I'm on OWB 10gR2 for Sun/Solaris 10 going against some 10gR2 DB's...
    I've been searching up and down trying to figure out how to make OWB use a Table Function (TF) which will JOIN with another table; allowing a column of the joined table to be a parameter in to the TF. I can't seem to get it to work. I'm able to get this to work in regular SQL, though. Here's the setup:
    -- Source Table:
    DROP TABLE "ZZZ_ROOM_MASTER_EX";
    CREATE TABLE "ZZZ_ROOM_MASTER_EX"
    ( "ID" NUMBER(8,0),
    "ROOM_NUMBER" VARCHAR2(200),
    "FEATURES" VARCHAR2(4000)
    -- Example Data:
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (1,'Room 1',null);
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (2,'Room 2',null);
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (3,'Room 3','1,1;2,3;');
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (4,'Room 4','5,2;5,4;');
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (5,'Room 5',' ');
    -- Destination Table:
    DROP TABLE "ZZZ_ROOM_FEATURES_EX";
    CREATE TABLE "ZZZ_ROOM_FEATURES_EX"
    ( "ROOM_NUMBER" VARCHAR2(200),
    "FEATUREID" NUMBER(8,0),
    "QUANTITY" NUMBER(8,0)
    -- Types for output table:
    CREATE OR REPLACE TYPE FK_Row_EX AS OBJECT
    ID NUMBER(8,0),
    QUANTITY NUMBER(8,0)
    CREATE OR REPLACE TYPE FK_Table_EX AS TABLE OF FK_Row_EX;
    -- Package Dec:
    CREATE OR REPLACE
    PACKAGE ZZZ_SANDBOX_EX IS
    FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX;
    END ZZZ_SANDBOX_EX;
    -- Package Body:
    CREATE OR REPLACE
    PACKAGE BODY ZZZ_SANDBOX_EX IS
    FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX
    AS
    RETURN_VALUE FK_Table_EX := FK_Table_EX();
    i NUMBER(8,0) := 0;
    BEGIN
    -- TODO: Put some real code in here that will actually read the
    -- input string, parse it out, and put data in to RETURN_VALUE
    WHILE(i < 3) LOOP
    RETURN_VALUE.EXTEND;
    RETURN_VALUE(RETURN_VALUE.LAST) := FK_Row_EX(4, 5);
    i := i + 1;
    END LOOP;
    RETURN RETURN_VALUE;
    END UNFK;
    END ZZZ_SANDBOX_EX;
    I've got a source system built by lazy DBA's and app developers who decided to store foreign keys for many-to-many relationships as delimited structures in driving tables. I need to build a generic table function to parse this data and return it as an actual table. In my example code, I don't actually have the parsing part written yet (I need to see how many different formats the source system uses first) so I just threw in some stub code to generate a few rows of 4's and 5's to return.
    I can get the data from my source table to my destination table using the following SQL statement:
    -- from source table joined with table function
    INSERT INTO ZZZ_ROOM_FEATURES_EX(
    ROOM_NUMBER,
    FEATUREID,
    QUANTITY)
    SELECT
    ZZZ_ROOM_MASTER_EX.ROOM_NUMBER,
    UNFK.ID,
    UNFK.QUANTITY
    FROM
    ZZZ_ROOM_MASTER_EX,
    TABLE(ZZZ_SANDBOX_EX.UNFK(ZZZ_ROOM_MASTER_EX.FEATURES)) UNFK
    Now, the big question is--how do I do this from OWB? I've tried several different variations of my function and settings in OWB to see if I can build a single SELECT statement which joins a regular table with a table function--but none of them seem to work, I end up getting SQL generated that won't compile because it doesn't see the source table right:
    INSERT
    /*+ APPEND PARALLEL("ZZZ_ROOM_FEATURES_EX") */
    INTO
    "ZZZ_ROOM_FEATURES_EX"
    ("ROOM_NUMBER",
    "FEATUREID",
    "QUANTITY")
    (SELECT
    "ZZZ_ROOM_MASTER_EX"."ROOM_NUMBER" "ROOM_NUMBER",
    "INGRP2"."ID" "ID_1",
    "INGRP2"."QUANTITY" "QUANTITY"
    FROM
    (SELECT
    "UNFK"."ID" "ID",
    "UNFK"."QUANTITY" "QUANTITY"
    FROM
    TABLE ( "ZZZ_SANDBOX_EX"."UNFK2" ("ZZZ_ROOM_MASTER_EX"."FEATURES")) "UNFK") "INGRP2",
    "ZZZ_ROOM_MASTER_EX" "ZZZ_ROOM_MASTER_EX"
    As you can see, it's trying to create a sub-query in the FROM clause--causing it to just ask for "ZZZ_ROOM_MASTER_EX"."FEATURES" as an input--which isn't available because it's outside of the sub-query!
    Is this some kind of bug with the code generator or am I doing something seriously wrong here? Any help will be greatly appreciated!

    Hello Everybody!
    Thank you for all your response!
    I had changes this work area into Internal table and changed the select query. PLease let me know if this causes any performance issues?
    I had created a Z table with the following fields :
    ZADS :
    MANDT
    VKORG
    ABGRU.
    I had written a select query as below :
    I had removed the select single and insted of using the Structure it_rej, I had changed it into Internal table 
    select vkorg abgru from ZADS into it_rej.
    Earlier :
    IT_REJ is a Work area:
    DATA : BEGIN OF IT_REJ,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    Now :
    DATA : BEGIN OF IT_REJ occurs 0,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    I guess this will fix the issue correct?
    PLease suggest!
    Regards,
    Developer.

Maybe you are looking for