Making a VO with programmatic attributes and rows

Dear Guru's!!!
May I have your opinion on the following requirement...
One database table with the following attributes:
ID_COLUMN, NM_COLUMN, TYPE
If I execute this statement:
SELECT ID_COLUMN
, NM_COLUMN
FROM MASTER_TABLE
WHERE TYPE = 'EMPLOYEES';
I get the result:
EMPLOYEE_ID
EMPLOYEE_NAME
SALARY
The requirement is that I have to build now a RichTable use the attributes returned by this query (EMPLOYEE_ID, EMPLOYEE_NAME and SALARY).
I suppose that I have to create a ViewObject wich attributes and rows are populated at runtime (unknow columns at design time).
Anyone have any idea about how to do that??? Maybe a best practice or something like that...
I was reading this Oracle Tutorial http://docs.oracle.com/cd/E21043_01/web.1111/b31974/bcadvvo.htm#sm0341
but there is only two lines (39.1.8 Creating Dynamic Attributes to Store UI State) of how to create dynamic attributes.
Using JDeveloper 11.1.2 and Windows 7 x64.
Thanks in advance!
Renan.

You may go through this blog
http://jobinesh.blogspot.com/2010/06/model-driven-approach-for-building.html
which explains your use case.
Thanks,
TK

Similar Messages

  • I'm making a DVD with my iMOVIE and when I tried to burn a DVD I got an error message that said "ERROR IN PROJECT

    I'm making a DVD with my iMOVIE and when I tried to burn a DVD I got an error message that said
    "ERRORS IN PROJECT
    There were errors during the project validation that have to be fixed before burning the project."
    What does this mean and how do I fix it.
    jim

    Hi
    Do You have a NEW Mac ?
    Does it really have iDVD ? New ones Don't.
    Please tell much more
    • Mac used
    • Program used (versions)
    • Material used (Codecs, file formats etc)
    Yours Bengt W

  • I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    Can you supply a link?

  • Has anyone been able to create a HtmlDataTable with dynamic col and rows?

    Has anyone been able to create a HtmlDataTable with dynamic col and rows?
    If so please explain. I am successfully able to dynamically add columns using the getChildren method of the htmldatatable object
    BUT for each new column created no data is displayed.
    I am only able to display data for columns originally created when i clicked and dragged the dataTable icon from the pallette in netbeans visual web kit.
    Any help on this is greatly appreciated. I have been searching the web and these forums for around 8 hours and no one seems to have a working example of this. Lots of similar posts asking how to do it though :(
    Thanks in advance.

    This might be useful: http://balusc.xs4all.nl/srv/dev-jep-dat.html

  • Problems while making a MovieMaker with different transition and music.

    Hi..I am making a MovieMaker in flash.I dont have much of experince in flash ,There are some problems which I am facing.kindly guide me..Thanks.
    There are 4 things in my project.
    1)Uploading Images-First of all User will Upload the images,Based on those uploads there will be one xml generated which will be stored in a disc and by that xml the images uploaded be the users will be get in the flash.
    Problem1-How to generate an xml file that would be stored in disc or localhost through which we can get the path of images?
    2)Theme Selection-After the images have been uploaded and xml file have been generated then then the images would be loaded in one window.This is for the purpose of viewing those images that has been uploaded by users.After that there is one button below the window "Select Theme".In clicking that Button there is simply another frame opens (by removing child of the previous frames) in which there are some dummy animationswhich are already made .Like in oneAnimation there are 9 Transition effects fading,fly,spiral etc etc and in another Animation there are another 9 effects like zoom,blend  and so onetc.User can select one theme out of suppose 9 themes then that theme is the theme of their movie.There is one file called themes.xml tahat containes all the information of the themes.After the theme is selected ,There is button in ThemeSelection called Select Music.
    3)Music Selection-There are categories of songs like sad,instrumental,slow,pop etc,In each category there are some songs that are stored in server.Whatever the user will select that will be the theme song.songs are also fetching from xml.After selecting the song there is Make Movie Option in the music frame.
    4)Make Movie-Finally based on the above selection the movie is generated which should create new swf dynamically and user can download that movie also with above theme and music selection and those images should play that theme with the background music as selected by user.
    Problem2:-How to generate new swf that donot take images.xml,transition.xml and songs.xml.First of all i dont know how to create new swf at run time while using the file operations.and
    Problem 3-secondly if i made some swf supposingly movie.swf then whatever the user selected then based on those images,theme and songs selection i called the movieClip object of the movie.swf and all those images with the selected transition and background music are playing in it BUT they need the xml files and images.But i want to give the user one independant swf which dont use xml files and images folder.How can i do that?
    The Project is similar to this one
    http://pmdvd.kodak.com/
    Regards
    Ankur

    It looks like there is lack of fundamental understanding of flash/ActionScript capabilities.
    Your post covers too many topics - forum works the best if questions are focused. You may need to polish your knowledge which will allow you to have answers to some of the problems.
    The main thing you should know before proceeding is that one cannot generate swf files at runtime in Flash. And it doesn't matter if you go with Flash or Flex. Should swf generation be a centerpiece of your application, you may want to consider server side compiler.
    Otherwise you may not need to generate swfs at all but allow users to see results of their work with help of dynamic content generation including database. In any case, you probably will need and extensive server side application.

  • Selection generated with Navigational Attribute and store forecast profile

    Hi,
    Our business has a requirement that will require for the solution a Forecast Profile to be stored against a selection which was generated with a navigational attribute in the selection. I have found two SAP Notes 329707 and 394076 shown below which point to BAdi /SAPAPO/SDP_FCST5 method SEL_CHANGE to do the job. Can anyone help me in understanding what coding we need to do within the BAdi to get this to work. Does anyone have an example?
    SAP Note 329707
    Method:
        SEL_CHANGE  (as of SCM 4.1)
        This method can be used to change the selection to be stored in
        in the generated selection table. Navigation attributes can be
        removed, such as the function of assigning a forecast
        profile to the selection can also be allowed for selections with
        navigation attribute without a basic characteristic.
        Parameter
         IV_PAREAID      Importing  Type /SAPAPO/TS_PAREAID
         CT_SELECTION    Changing   Type /SAPAPO/TS_IOBJ_SELECTION_TAB
    Sample code:
        DATA: lv_tabix     TYPE sytabix.
        DATA: lt_chars     TYPE /sapapo/dm_int_chars_tab.
        DATA: ls_chars     TYPE /sapapo/dm_int_chars.
        DATA: ls_selection Type /SAPAPO/TS_IOBJ_SELECTION.
        IF iv_pareaid = 'PAREA1'.
          CALL FUNCTION '/SAPAPO/TS_PAREA_SINGLE_GET'
            EXPORTING
              iv_pareaid   = iv_pareaid
            IMPORTING
              et_chars     = lt_chars
            EXCEPTIONS
              not_found    = 1
              OTHERS       = 2.
          CHECK sy-subrc EQ 0.
          LOOP AT ct_selection INTO ls_selection
                              WHERE iobjnm NE '9AVERSION'.
            lv_tabix = sy-tabix.
            READ TABLE lt_chars INTO ls_chars
                                WITH KEY iobjnm = ls_selection-iobjnm.
            IF sy-subrc EQ 0 AND NOT ls_chars-atrnavfl IS INITIAL.
               DELETE ct_selection INDEX lv_tabix.
            ENDIF.
          ENDLOOP.
        ENDIF.
    SAP Note 394076
    As of Release SCM 4.1, you can use the method SEL_CHANGE of the BadI /SAPAPO/SDP_FCST5 to process the selection before saving it to the generated selection tables. This allows you to save selections with navigation attributes, for example, where the selections do not have a specified basis characteristic. You simply need to delete the navigation attributes from the selection.

    Is all the Navigational attribute checked for display during cube creatiion?
    Prathish

  • Problem with settype, attribute and DDIC COMT_PROD_MAT_MAINTAIN_API

    Hello,
    I want to implement the BADI IDSSI_DISPLAY_TO_POD in CRM. The OSS Note number 573078 specify the code that must be integrated in the program of implementation of this BADI.
    I want to insert a specifical set type with several attributes.
    Before using the set type in my program, i have to transport this set in order to assure that the fields of this new set type would be include in the structure DDIC COMT_PROD_MAT_MAINTAIN_API. I did it.
    There is my problem : in the generated code of the OSS Note, there is :
    ISU_CUST01_TAB = SETTYPE-ISU_CUST01.
    with :
    SETTYPE a table like structure COMT_PROD_MAT_MAINTAIN_API
    ISU_CUST01_TAB TYPE ISU_CUST01_MAINT_T,
    ISU_CUST01 TYPE ISU_CUST01_MAINTAIN
    After creating settype, I verify that ISU_CUST01_MAINT_T and ISU_CUST01_MAINTAIN exist. this structure are generated when creating a settype.
    during the control of the program, I obtain this message :
    Field ISU_CUST01 can't be found in table settype.
    I don't understand how I can use my settype, like it is specified in the OSS Note.
    I will appreciate any help about this topic.
    Regards,
    Vincent UNGER

    Hi ,wyee .
       I  do it but not through your FMs , i think you can do it by the FM :
    create/change the material  CALL FUNCTION 'COM_PRODUCT_MAINTAIN_MULT_API'  
    IMPORTING  
       ET_BAPIRETURN  = LT_RETURN[]   
    CHANGING  
       CT_PRODUCT     = LT_PRODUCT
       EXCEPTIONS  
       INTERNAL_ERROR = 1     
       OTHERS         = 2.
    This FM can create or  change the material in the crm ,and can maitain data except conditions , like basic data ,like relationship .

  • Problem with f:attribute and EL.

    Hello ppl,
    Im trying to add a atribute a component, with EL, but when i try to get the components atrributes, this parameter isent there. The JSF spec says that the f:param accepts expressions but its not working.
    Help please.
    <rich:dataTable id="tableMetas"
              value="#{encaminhamentosManager.encaminhamentos}"
              var="encaminhamento" style="width:100%;"
              onRowMouseOver="this.style.backgroundColor='#CCDDEE'"
              onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
              <rich:column>
                   <h:commandLink value="#{encaminhamento.candidato.nome}"
                        actionListener="#{consultaAlunoManager.avancar}" >
                        <f:attribute name="nextMapping" value="buscar_avaliacao"/>
                        <f:attribute id="candidato"  name="candidato"
                        value="#{encaminhamento.candidato}"/>
                   </h:commandLink>
              </rich:column>
    </rich:dataTable>And my ActionListener try to acess like this:
      public void avancar(ActionEvent event) {
        FacesContext faces = FacesContext.getCurrentInstance();
        Application app = faces.getApplication();
        HtmlCommandLink link = (HtmlCommandLink) event.getComponent();
        String nextMapping = (String) link.getAttributes().get("nextMapping");
        //NULL
        Candidato candidato = (Candidato) link.getAttributes().get("candidato");
      }the String nextMapping is right, but the Candidato isent in the atrributes.
    Thanks for the help
    Ferry

    You're passing an out-of-scope datatable row to the f:attribute value. The f:attribute is component-specific, not row-specific.
    Rather use HtmlDataTable#getRowData() inside the action method to retrieve the current row from the datatable.
    I don't know how to do it in the rich:dataTable (check the API spec yourself), so I'll give a basic example with h:dataTable:<h:dataTable binding="#{myBean.table}" value="#{myBean.rows}" var="row">
        <h:column><h:commandLink value="click here" action="#{myBean.action}" /></h:column>
    </h:dataTable>MyBeanprivate HtmlDataTable table;
    private List<RowObject> rows;
    // + getters + setters
    public void action() {
        RowObject currentRow = (RowObject) table.getRowData();
        // Handle.
    }Also see http://balusc.xs4all.nl/srv/dev-jep-dat.html for some new insights.

  • Print JTable with Multiple pages and rows

    I took the printing example at http://java.sun.com/developer/onlineTraining/Programming/JDCBook/advprint.html#pe and modified it a bit to include the following:
    1) To Print Multiple pages
    2) To wrap lines that is too long for the column
    3) To print with a more proffesional style, so that it doesn't look like a screen capture is printed
    4) To align the numbers to the right and center column headings
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.print.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.Dimension;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import java.text.*;
    public class Report implements Printable
         private final int LEFT_ALIGN = -1;
         private final int CENTER_ALIGN = 0;
         private final int RIGHT_ALIGN = 1;
         private JFrame frame;
         private JTable tableView;
         private String lastPrintDate;
         private Font defaultFont;
         private Font headerFont;
         private Font footerFont;
         private int headerHeight;
         private int footerHeight;
         private int cellBuffer = 5;
         private boolean first_pass;
         private ArrayList pages;
         public Report()
              frame = new JFrame("Sales Report");
              frame.addWindowListener(new WindowAdapter()
                   public void windowClosing(WindowEvent e)
                        System.exit(0);
              final String[] headers =
                   "ID",
                   "Description",
                   "open price",
                   "latest price",
                   "End Date",
                   "Quantity"
              int count = 0;
              final Object[][] data =
                   {new Integer(count++), "Box of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of Biros ppppppppppppppp", "1.00", "4.99", new Date(), new Integer(200000)},
                   {new Integer(count++), "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++), "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++), "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++), "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++), "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
                   {new Integer(count++), "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++), "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++), "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++), "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++), "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
                   {new Integer(count++), "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++), "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++), "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++), "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++), "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
                   {new Integer(count++), "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++), "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++), "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++), "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
                   {new Integer(count++),  "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++),  "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
                   {new Integer(count++),  "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++),  "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)}
              TableModel dataModel = new AbstractTableModel()
                   public int getColumnCount() { return headers.length; }
                   public int getRowCount() { return data.length;}
                   public Object getValueAt(int row, int col)
                        return data[row][col];
                   public String getColumnName(int column)
                        return headers[column];
                   public Class getColumnClass(int col)
                        return getValueAt(0,col).getClass();
                   public boolean isCellEditable(int row, int col)
                        return (col==1);
                   public void setValueAt(Object aValue, int row, int column)
                        data[row][column] = aValue;
              tableView = new JTable(dataModel);
              JScrollPane scrollpane = new JScrollPane(tableView);
              scrollpane.setPreferredSize(new Dimension(500, 80));
              frame.getContentPane().setLayout(new BorderLayout());
              frame.getContentPane().add(BorderLayout.CENTER,scrollpane);
              frame.pack();
              JButton printButton= new JButton();
              printButton.setText("print me!");
              frame.getContentPane().add(BorderLayout.SOUTH,printButton);
              // for faster printing turn double buffering off
              RepaintManager.currentManager(frame).setDoubleBufferingEnabled(false);
              printButton.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent evt)
                        doPrint();
              frame.setVisible(true);
          * Reset variables before printing
         private void prepareForPrint()
              pages = new ArrayList();
              first_pass = true;
          * Display a print dialog with some hardcoded defaults
          * The print fonts are also hardcoded
         public void doPrint()
              try
                   String jobName = "Java Report";
                   defaultFont = new Font("Arial", Font.PLAIN, 8);
                   footerFont = new Font("Arial", Font.PLAIN, 6);
                   headerFont = new Font("Arial", Font.BOLD, 10);
                   PrinterJob prnJob = PrinterJob.getPrinterJob();
                   prnJob.setPrintable(this);
                   PrintRequestAttributeSet prnSet = new HashPrintRequestAttributeSet();
                   prnSet.add(new Copies(1));
                   prnSet.add(new JobName(jobName, null));
                   prnSet.add(MediaSizeName.ISO_A4);
                   PageFormat pf = prnJob.defaultPage();
                   pf.setOrientation(java.awt.print.PageFormat.PORTRAIT);
                   prnJob.setJobName(jobName);
                   PrintService[] services = PrinterJob.lookupPrintServices();
                   if (services.length > 0)
                        if (prnJob.printDialog(prnSet))
                              * Get print date
                             String dateFormat = "dd/MM/yyyy HH:mm:ss";
                             DateFormat m_DateFormat = new SimpleDateFormat(dateFormat);
                             lastPrintDate = m_DateFormat.format(new Date()).toString();
                             prepareForPrint();
                             prnJob.print(prnSet);
                   else
                        JOptionPane.showMessageDialog(frame, "No Printer was found!!", "Printer Error", JOptionPane.ERROR_MESSAGE);
                        return;
              catch (PrinterException e)
                   e.printStackTrace();
         public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException
               * Check if this is the first time the print method is called for this print action.
               * It is not guaranteed that the print will be called with synchronous pageIndex'es,
               * so we need to calculate the number of pages and which rows appear on which pages.
               * Then the correct page will be printed regardless of which pageIndex is sent through.
              if (first_pass)
                   calcPages(g, pageFormat);
              first_pass = false;
              // Stop printing if the pageIndex is out of range
              if (pageIndex >= pages.size())
                   return NO_SUCH_PAGE;
              Graphics2D     g2 = (Graphics2D) g;
              g2.setColor(Color.black);
              // The footer will be one line at the bottom of the page, cater for this.
              g2.setFont(footerFont);
              footerHeight = g2.getFontMetrics().getHeight() + g2.getFontMetrics().getDescent();
              g2.setFont(defaultFont);
              FontMetrics fontMetrics = g2.getFontMetrics();
              int fontHeight = fontMetrics.getHeight();
              int fontDescent = fontMetrics.getDescent();
              double pageHeight = pageFormat.getImageableHeight() + pageFormat.getImageableY();
              double pageWidth = pageFormat.getImageableWidth();
              double tableWidth = (double) tableView.getColumnModel().getTotalColumnWidth();
              // Shrink or expand the table to fit the page width
              double scale = pageWidth / (tableWidth+ (cellBuffer * tableView.getColumnCount()));
              // Calculate the width in pixels for each column
              double[] columnWidths = new double[tableView.getColumnCount()];
              for(int i = 0; i < tableView.getColumnCount(); i++)
                   columnWidths[i] = (double)tableView.getColumnModel().getColumn(i).getWidth() * scale;
              // Reset the view to the start of the page
              g2.translate(0, 0);
              // Draw a rectangle to see the printable area
              g2.draw3DRect((int)pageFormat.getImageableX(),
                        (int)pageFormat.getImageableY(),
                        (int)pageFormat.getImageableWidth(),
                        (int)pageFormat.getImageableHeight(),
                        false);
              // Calculate the header height
              g2.setFont(headerFont);
              fontMetrics = g2.getFontMetrics();
              // Print the headers and retreive the starting position for the data
              int next_row = printLine(g2, pageFormat, fontMetrics, -1, (int)pageFormat.getImageableY() + fontHeight, columnWidths);
              g2.setFont(defaultFont);
              fontMetrics = g2.getFontMetrics();
              // Start printing the detail
              ArrayList page = (ArrayList)pages.get(pageIndex);
              int start = ((Integer)page.get(0)).intValue();
              int end = ((Integer)page.get(1)).intValue();
              for (int i = start; i <= end; i++)
                   next_row = printLine(g2, pageFormat, fontMetrics, i, next_row, columnWidths);
              // Print the footer
              g2.setFont(footerFont);
              String pageFooter = "Page " + (pageIndex + 1) + " - " + lastPrintDate;
              g2.drawString(pageFooter,
                             (int)pageFormat.getWidth() / 2 - (fontMetrics.stringWidth(pageFooter) / 2),
                             (int)(pageHeight - fontDescent));
              return PAGE_EXISTS;
          * We can't guarantee that the same amount of rows will be displayed on each page,
          * the row heights are dynamic and may wrap onto 2 or more lines.
          * Thus we need to calculate the height of each row and then test how may rows
          * fit on a specific page. eg. Page 1 contains rows 1 to 10, Page 2 contains rows 11 to 15 etc.
         public void calcPages(Graphics g, PageFormat pageFormat) throws PrinterException
              Graphics2D     g2 = (Graphics2D) g;
              g2.setColor(Color.black);
              // The footer will be one line at the bottom of the page, cater for this.
              g2.setFont(footerFont);
              footerHeight = g2.getFontMetrics().getHeight() + g2.getFontMetrics().getDescent();
              g2.setFont(defaultFont);
              FontMetrics fontMetrics = g2.getFontMetrics();
              int fontHeight = fontMetrics.getHeight();
              int fontDescent = fontMetrics.getDescent();
              double pageHeight = pageFormat.getImageableHeight() - fontHeight;
              double pageWidth = pageFormat.getImageableWidth();
              double tableWidth = (double) tableView.getColumnModel().getTotalColumnWidth();
              // Shrink or expand the table to fit the page width
              double scale = pageWidth / (tableWidth+ (cellBuffer * tableView.getColumnCount()));
              // Calculate the width in pixels for each column
              double[] columnWidths = new double[tableView.getColumnCount()];
              for(int i = 0; i < tableView.getColumnCount(); i++)
                   columnWidths[i] = (double)tableView.getColumnModel().getColumn(i).getWidth() * scale;
              // Calculate the header height
              int maxHeight = 0;
              g2.setFont(headerFont);
              fontMetrics = g2.getFontMetrics();
              for (int j = 0; j < tableView.getColumnCount(); j++)
                   String value = tableView.getColumnName(j).toString();
                   int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                   if (numLines > maxHeight)
                        maxHeight = numLines;
              headerHeight = g2.getFontMetrics().getHeight() * maxHeight;
              g2.setFont(defaultFont);
              fontMetrics = g2.getFontMetrics();
              int pageNum = 0;
              int bottom_of_page = (int)(pageFormat.getImageableHeight() + pageFormat.getImageableY()) - footerHeight;
              int prev_row = 0;
              int next_row = (int)pageFormat.getImageableY() + fontHeight + headerHeight;
              int i = 0;
              ArrayList page = new ArrayList();
              page.add(new Integer(0));
              for (i = 0; i < tableView.getRowCount(); i++)
                   maxHeight = 0;
                   for (int j = 0; j < tableView.getColumnCount(); j++)
                        String value = tableView.getValueAt(i, j).toString();
                        int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                        if (numLines > maxHeight)
                             maxHeight = numLines;
                   prev_row = next_row;
                   next_row += (fontHeight * maxHeight);
                   // If we've reached the bottom of the page then set the current page's end row
                   if (next_row > bottom_of_page)
                        page.add(new Integer(i - 1));
                        pages.add(page);
                        page = new ArrayList();
                        page.add(new Integer(i));
                        pageNum++;
                        next_row = (int)pageFormat.getImageableY()
                                       + fontHeight
                                       + ((int)pageFormat.getHeight() * pageNum)
                                       + headerHeight;
                        bottom_of_page = (int)(pageFormat.getImageableHeight()
                                            + pageFormat.getImageableY())
                                            + ((int)pageFormat.getHeight() * pageNum)
                                            - footerHeight;
                        //Include the current row on the next page, because there is no space on this page
                        i--;
              page.add(new Integer(i - 1));
              pages.add(page);
          * Print the headers or a row from the table to the graphics context
          * Return the position of the row following this one
         public int printLine(Graphics2D g2,
                                       PageFormat pageFormat,
                                       FontMetrics fontMetrics,
                                       int rowNum,
                                       int next_row,
                                       double[] columnWidths)
                   throws PrinterException
              int lead = 0;
              int maxHeight = 0;
              for (int j = 0; j < tableView.getColumnCount(); j++)
                   String value = null;
                   int align = LEFT_ALIGN;
                   if (rowNum > -1)
                        Object obj = tableView.getValueAt(rowNum, j);
                        if (obj instanceof Number)
                             align = RIGHT_ALIGN;
                        value = obj.toString();
                   else
                        align = CENTER_ALIGN;
                        value = tableView.getColumnName(j);
                   int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                   if (numLines > maxHeight)
                        maxHeight = numLines;
                   if (fontMetrics.stringWidth(value) < columnWidths[j])
                        // Single line
                        int offset = 0;
                        // Work out the offset from the start of the column to display alignment correctly
                        switch (align)
                             case RIGHT_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)); break;
                             case CENTER_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)) / 2; break;
                             default: offset = 0; break;
                        g2.drawString(value,
                                       lead + (int)(pageFormat.getImageableX() + offset),
                                       next_row);
                   else
                        for(int a = 0; a < numLines; a++)
                             //Multi-Line
                             int x = 0;
                             int width = 0;
                             for(x = 0; x < value.length(); x++)
                                  width += fontMetrics.charWidth(value.charAt(x));
                                  if (width > columnWidths[j])
                                       break;
                             int offset = 0;
                             // Work out the offset from the start of the column to display alignment correctly
                             switch (align)
                                  case RIGHT_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)); break;
                                  case CENTER_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)) / 2; break;
                                  default: offset = 0; break;
                             g2.drawString(value.substring(0, x),
                                            lead + (int)(pageFormat.getImageableX() + offset),
                                            next_row + (fontMetrics.getHeight() * a));                    
                             value = value.substring(x);
                   lead += columnWidths[j] + cellBuffer;
              // Draw a solid line below the row
              g2.draw(new Line2D.Double(pageFormat.getImageableX(),
                             next_row + (fontMetrics.getHeight() * (maxHeight - 1)) + fontMetrics.getDescent(),
                             pageFormat.getImageableY() + pageFormat.getImageableWidth(),
                             next_row + (fontMetrics.getHeight() * (maxHeight - 1)) + fontMetrics.getDescent()));
              // Return the position of the row following this one
              return next_row + (fontMetrics.getHeight() * maxHeight);
         public static void main(String[] args)
              new Report();
    }

    Fixed some bugs and added a title. Just pass in a JTable and the class will do the rest.
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.print.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import java.text.*;
    import java.math.*;
    public class PrintJTable implements Printable
         private final int LEFT_ALIGN = -1;
         private final int CENTER_ALIGN = 0;
         private final int RIGHT_ALIGN = 1;
         private JFrame m_parent;
         private String m_title;
         private JTable tableView;
         private String lastPrintDate;
         private Font defaultFont;
         private Font headerFont;
         private Font footerFont;
         private int headerHeight;
         private int footerHeight;
         private int cellBuffer = 5;
         private boolean first_pass;
         private ArrayList pages;
         public PrintJTable(JFrame parent, JTable table)
              m_parent = parent;
              tableView = table;
              doPrint();
         public PrintJTable(JFrame parent, String title, JTable table)
              m_parent = parent;
              m_title = title;
              tableView = table;
              doPrint();
          * Reset variables before printing
         private void prepareForPrint()
              pages = new ArrayList();
              first_pass = true;
          * Display a print dialog with some hardcoded defaults
          * The print fonts are also hardcoded
         public void doPrint()
              try
                   String jobName = "Java Report";
                   defaultFont = new Font("Arial", Font.PLAIN, 8);
                   footerFont = new Font("Arial", Font.PLAIN, 6);
                   headerFont = new Font("Arial", Font.BOLD, 8);
                   PrinterJob prnJob = PrinterJob.getPrinterJob();
                   prnJob.setPrintable(this);
                   PrintRequestAttributeSet prnSet = new HashPrintRequestAttributeSet();
                   prnSet.add(new Copies(1));
                   prnSet.add(new JobName(jobName, null));
                   prnSet.add(MediaSizeName.ISO_A4);
                   PageFormat pf = prnJob.defaultPage();
                   pf.setOrientation(java.awt.print.PageFormat.PORTRAIT);
                   prnJob.setJobName(jobName);
                   PrintService[] services = PrinterJob.lookupPrintServices();
                   if (services.length > 0)
                        if (prnJob.printDialog(prnSet))
                              * Get print date
                             String dateFormat = "dd/MM/yyyy HH:mm:ss";
                             DateFormat m_DateFormat = new SimpleDateFormat(dateFormat);
                             lastPrintDate = m_DateFormat.format(new Date()).toString();
                             prepareForPrint();
                             prnJob.print(prnSet);
                   else
                        JOptionPane.showMessageDialog(m_parent, "No Printer was found!!", "Printer Error", JOptionPane.ERROR_MESSAGE);
                        return;
              catch (PrinterException e)
                   e.printStackTrace();
         public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException
               * Check if this is the first time the print method is called for this print action.
               * It is not guaranteed that the print will be called with synchronous pageIndex'es,
               * so we need to calculate the number of pages and which rows appear on which pages.
               * Then the correct page will be printed regardless of which pageIndex is sent through.
              if (first_pass)
                   calcPages(g, pageFormat);
              first_pass = false;
              // Stop printing if the pageIndex is out of range
              if (pageIndex >= pages.size())
                   return NO_SUCH_PAGE;
              Graphics2D     g2 = (Graphics2D) g;
              g2.setColor(Color.black);
              // The footer will be one line at the bottom of the page, cater for this.
              g2.setFont(footerFont);
              footerHeight = g2.getFontMetrics().getHeight() + g2.getFontMetrics().getDescent();
              g2.setFont(defaultFont);
              FontMetrics fontMetrics = g2.getFontMetrics();
              int fontHeight = fontMetrics.getHeight();
              int fontDescent = fontMetrics.getDescent();
              double pageHeight = pageFormat.getImageableHeight() + pageFormat.getImageableY();
              double pageWidth = pageFormat.getImageableWidth();
              double tableWidth = (double) tableView.getColumnModel().getTotalColumnWidth();
              // Shrink or expand the table to fit the page width
              double scale = (pageWidth - (cellBuffer * tableView.getColumnCount())) / tableWidth;
              // Calculate the width in pixels for each column
              double[] columnWidths = new double[tableView.getColumnCount()];
              double test = 0;
              for(int i = 0; i < tableView.getColumnCount(); i++)
                   columnWidths[i] = (double)Math.floor(tableView.getColumnModel().getColumn(i).getWidth() * scale);
                   test += columnWidths;
              // Reset the view to the start of the page
              g2.translate(0, 0);
              // Draw a rectangle to see the printable area
              g2.draw3DRect((int)pageFormat.getImageableX(),
                        (int)pageFormat.getImageableY(),
                        (int)pageFormat.getImageableWidth(),
                        (int)pageFormat.getImageableHeight(),
                        false);
              // Calculate the header height
              g2.setFont(headerFont);
              fontMetrics = g2.getFontMetrics();
              // Print the headers and retreive the starting position for the data
              int next_row = (int)pageFormat.getImageableY() + fontMetrics.getHeight();
              if ((m_title != null) && (!m_title.equalsIgnoreCase("")))
                   g2.drawString(m_title,
                                       (int)(pageFormat.getImageableX()),
                                       next_row);
                   Color current_color = g2.getColor();
                   g2.setColor(Color.lightGray);
                   int y = next_row + fontMetrics.getDescent();
                   g2.draw(new Line2D.Double(pageFormat.getImageableX(),
                                  y,
                                  (pageFormat.getImageableY() + pageFormat.getImageableWidth()),
                                  y));
                   g2.setColor(current_color);
                   next_row += fontMetrics.getHeight();
              next_row = printLine(g2, pageFormat, fontMetrics, -1, next_row, columnWidths);
              g2.setFont(defaultFont);
              fontMetrics = g2.getFontMetrics();
              // Start printing the detail
              ArrayList page = (ArrayList)pages.get(pageIndex);
              int start = ((Integer)page.get(0)).intValue();
              int end = ((Integer)page.get(1)).intValue();
              for (int i = start; i <= end; i++)
                   next_row = printLine(g2, pageFormat, fontMetrics, i, next_row, columnWidths);
              // Print the footer
              g2.setFont(footerFont);
              String pageFooter = "Page " + (pageIndex + 1) + " - " + lastPrintDate;
              g2.drawString(pageFooter,
                             (int)pageFormat.getWidth() / 2 - (fontMetrics.stringWidth(pageFooter) / 2),
                             (int)(pageHeight - fontDescent));
              return PAGE_EXISTS;
         * We can't guarantee that the same amount of rows will be displayed on each page,
         * the row heights are dynamic and may wrap onto 2 or more lines.
         * Thus we need to calculate the height of each row and then test how may rows
         * fit on a specific page. eg. Page 1 contains rows 1 to 10, Page 2 contains rows 11 to 15 etc.
         public void calcPages(Graphics g, PageFormat pageFormat) throws PrinterException
              Graphics2D     g2 = (Graphics2D) g;
              g2.setColor(Color.black);
              // The footer will be one line at the bottom of the page, cater for this.
              g2.setFont(footerFont);
              footerHeight = g2.getFontMetrics().getHeight() + g2.getFontMetrics().getDescent();
              g2.setFont(defaultFont);
              FontMetrics fontMetrics = g2.getFontMetrics();
              int fontHeight = fontMetrics.getHeight();
              int fontDescent = fontMetrics.getDescent();
              double pageHeight = pageFormat.getImageableHeight() - fontHeight;
              double pageWidth = pageFormat.getImageableWidth();
              double tableWidth = (double) tableView.getColumnModel().getTotalColumnWidth();
              // Shrink or expand the table to fit the page width
              double scale = (pageWidth - (cellBuffer * tableView.getColumnCount())) / tableWidth;
              // Calculate the width in pixels for each column
              double[] columnWidths = new double[tableView.getColumnCount()];
              for(int i = 0; i < tableView.getColumnCount(); i++)
                   columnWidths[i] = (double)Math.floor(tableView.getColumnModel().getColumn(i).getWidth() * scale);
              // Calculate the header height
              int maxHeight = 0;
              g2.setFont(headerFont);
              fontMetrics = g2.getFontMetrics();
              headerHeight = 0;
              if ((m_title != null) && (!m_title.equalsIgnoreCase("")))
                   headerHeight = fontMetrics.getHeight();
              for (int j = 0; j < tableView.getColumnCount(); j++)
                   String value = tableView.getColumnName(j).toString();
                   int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                   if (numLines > maxHeight)
                        maxHeight = numLines;
              headerHeight += g2.getFontMetrics().getHeight() * maxHeight;
              g2.setFont(defaultFont);
              fontMetrics = g2.getFontMetrics();
              int pageNum = 0;
              int bottom_of_page = (int)(pageFormat.getImageableHeight() + pageFormat.getImageableY()) - footerHeight;
              int prev_row = 0;
              int next_row = (int)pageFormat.getImageableY() + fontHeight + headerHeight;
              int i = 0;
              ArrayList page = new ArrayList();
              page.add(new Integer(0));
              for (i = 0; i < tableView.getRowCount(); i++)
                   maxHeight = 0;
                   for (int j = 0; j < tableView.getColumnCount(); j++)
                        String value = formatObject(tableView.getValueAt(i, j));
                        int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                        if (numLines > maxHeight)
                             maxHeight = numLines;
                   prev_row = next_row;
                   next_row += (fontHeight * maxHeight);
                   // If we've reached the bottom of the page then set the current page's end row
                   if (next_row > bottom_of_page)
                        page.add(new Integer(i - 1));
                        pages.add(page);
                        page = new ArrayList();
                        page.add(new Integer(i));
                        pageNum++;
                        next_row = (int)pageFormat.getImageableY()
                                       + fontHeight
                                       + ((int)pageFormat.getHeight() * pageNum)
                                       + headerHeight;
                        bottom_of_page = (int)(pageFormat.getImageableHeight()
                                            + pageFormat.getImageableY())
                                            + ((int)pageFormat.getHeight() * pageNum)
                                            - footerHeight;
                        //Include the current row on the next page, because there is no space on this page
                        i--;
              page.add(new Integer(i - 1));
              pages.add(page);
         * Print the headers or a row from the table to the graphics context
         * Return the position of the row following this one
         public int printLine(Graphics2D g2,
                                       PageFormat pageFormat,
                                       FontMetrics fontMetrics,
                                       int rowNum,
                                       int next_row,
                                       double[] columnWidths)
                   throws PrinterException
              int lead = 0;
              int maxHeight = 0;
              for (int j = 0; j < tableView.getColumnCount(); j++)
                   String value = null;
                   int align = LEFT_ALIGN;
                   if (rowNum > -1)
                        Object obj = tableView.getValueAt(rowNum, j);
                        if (obj instanceof Number)
                             align = RIGHT_ALIGN;
                        value = formatObject(obj);
                   else
                        //align = CENTER_ALIGN;
                        value = tableView.getColumnName(j);
                   int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                   if (numLines > maxHeight)
                        maxHeight = numLines;
                   if (fontMetrics.stringWidth(value) < columnWidths[j])
                        // Single line
                        int offset = 0;
                        // Work out the offset from the start of the column to display alignment correctly
                        switch (align)
                             case RIGHT_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)); break;
                             case CENTER_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)) / 2; break;
                             default: offset = 0; break;
                        g2.drawString(value,
                                       lead + (int)(pageFormat.getImageableX() + offset),
                                       next_row);
                   else
                        for(int a = 0; a < numLines; a++)
                             //Multi-Line
                             int x = 0;
                             int width = 0;
                             for(x = 0; x < value.length(); x++)
                                  width += fontMetrics.charWidth(value.charAt(x));
                                  if (width > columnWidths[j])
                                       break;
                             int offset = 0;
                             // Work out the offset from the start of the column to display alignment correctly
                             switch (align)
                                  case RIGHT_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value.substring(0, x))); break;
                                  case CENTER_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value.substring(0, x))) / 2; break;
                                  default: offset = 0; break;
                             g2.drawString(value.substring(0, x),
                                            lead + (int)(pageFormat.getImageableX() + offset),
                                            next_row + (fontMetrics.getHeight() * a));                    
                             value = value.substring(x);
                   lead += columnWidths[j] + cellBuffer;
              // Draw a solid line below the row
              Color current_color = g2.getColor();
              g2.setColor(Color.lightGray);
              int y = next_row + (fontMetrics.getHeight() * (maxHeight - 1)) + fontMetrics.getDescent();
              g2.draw(new Line2D.Double(pageFormat.getImageableX(),
                             y,
                             (pageFormat.getImageableY() + pageFormat.getImageableWidth()),
                             y));
              g2.setColor(current_color);
              // Return the position of the row following this one
              return next_row + (fontMetrics.getHeight() * maxHeight);
         public String formatObject(Object obj)
              String value = (obj == null) ? "" : obj.toString();
              return value;

  • Master Detail with programmatic ViewObjects and writeXML

    Hi,
    Using jdev 11.1.1.3.
    I created two programmatic ViewObjects related by a ViewLink (1to*).
    From an application module method, I create a row in the master ViewObject. Then using the accessor obtain the RowIterator for the detail, and create a row on that detail.
    If then I use the writeXML method on the master ViewObject, the output is only representing the master, not the detail.
    Here is the code:
            VO_MasterImpl voMaster = getVO_Master2();
            //create the master row
            VO_MasterRowImpl rowMaster = (VO_MasterRowImpl)voMaster.createRow();
            String id = "unique";
            rowMaster.setAtt1(id);
            rowMaster.setAtt2("something");
            //obtain the rowIterator for the detail
            RowIterator detail = rowMaster.getVO_Detail();
            //create the detail row
            VO_DetailRowImpl rowDetail = (VO_DetailRowImpl)detail.createRow();
            rowDetail.setAtt1(id);
            rowDetail.setAtt2("sth2");
            //insert the detail row
            detail.insertRow(rowDetail);
            //insert the master row
            voMaster.insertRow(rowMaster);
            //obtain the xml
            Node node = voMaster.writeXML(-1,XMLInterface.XML_OPT_ALL_ROWS);master.att1 is key for Master.
    detail.att1 is foreign key to Master.
    This is the contents of node:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <VO_Master><VO_MasterRow><Att1>unique</Att1><Att2>something</Att2></VO_MasterRow></VO_Master>What I would expect is that the detail row (<VO_DetailRow>) appears within the <VO_MasterRow>.
    Anyone knows what I'm missing here?
    Thanks
    Roger B
    Edited by: RogerB on 30-Dec-2010 02:16

    Hi,
    After some more tests...
    As said before, I tried with SQL VOs (Dept and Employees). No differences between the VL Dept and Emp, and the VL VO_Master and VO_Detail. They have same relationship (1 to *) and also same (changing names) SQL where (source and destination).
    I debuged the code, using ADF source code, and noticed the following:
    When iterating the rows to write the XML, at ViewRowImpl, it takes the AttributeDef and perform different actions depending on mKind (ATTR_ASSOCIATED_ROW or ATTR_ASSOCIATED_ROWITERATOR). Second one is for ViewLink.
    Once inside ATTR_ASSOCIATED_ROWITERATOR, I can see that the default RowSetIterator, has no rows (getRowCount = 0). So no child rows (for the VO_Detail), are added to the XML Node.
    On the other hand, the Dept and Employees, I can see that the default RowSetIterator has rows.
    Could this be related to the fact that Programatic ViewObjects are not persisted anywhere?
    any other clues appreciated? Does anyone tried this before (programatic master detail relationship writing to XML) ?
    Regards,
    Roger

  • Making a CD with audio tracks and a "bonus" video- how to?

    Dear folk,
    I have seen this before (notably a Shaggy album from waaaay back but no longer have access to it to study its "breakdown")- a regular audio CD which functions normally in your CD player etc and then, when placed into a DVD player or onto your computer lets you view the video which is on the same disk.
    I am looking at getting my daughter's EP of original material done but would like to add a video which I am making as well, in this manner.
    Not sure that iTunes IS the right category but I don't use Pro Logic (though I own it and could get someone else to do it, if required)- help please?

    OK, thanks to Roger I had good info to take away and now know that mixed mode CDs would possibly evidence issues as in this process the data file (ie the video) would most likely be the first file on the finished CD which would give you that horrible squealing noise as you play it on a conventional CD player but that "enhanced" CDs will burn them (data video and audio tracks) as separate sessions, ensuring that each appliance only need deal with that which it CAN deal with.
    Toast will do this but, apparently, so will something called Dragonburn: http://dragon-burn.en.softonic.com/mac
    I haven't tested this yet (the audio I need to work with has still to be completed and I have to shoot the video) but hope to report back.
    Hope this helps anyone seeking to do something similar.

  • Making file desin with elements and attributes implementation

    hello
    this is an FILE to IDOC
    I have an xml file that need to be enter to the XI. the XML has attributes and elements.
    I would like to know how can I make an element with some attributes and below there should be a subelement.
    for example, in delivery there will be all the attributes, and I would like to make it an array so there will be below subelemnt in the name of carrier for example.
    (if any one has other ways to implement this file feel free to suggest.)
    - <delivery number="1234567890" shipment-type="Y014" shipping-point="1910" ifm-reference="125" status="final">
    - <!-- status initial, change or final
      -->
      <carrier>123456</carrier>
    - <!--  This will be the SAP vendor code
      -->
      <scheduled-departure>200810011000</scheduled-departure>
    - <!--  Precalculated departure date and time format YYYYMMDDHH24MI
      -->
      <scheduled-arrival>200810031600</scheduled-arrival>
    - <!--  Precalculated delivery date and time
      -->
      <actual-departure>200810011015</actual-departure>
    - <!--  Actual departure reported by carrier
      -->
      <actual-arrival>200810031545</actual-arrival>
    - <!--  Actual arrival reported by carrier
      -->
      </delivery>

    >>that what I thought, but after I do the attributes for the element, I dont have the option to write for the element sub-element.
    I guess the current row that is selected would be an attribute thus the option insert subelement is disabled. Always select the element and insert either attribute or subelement to it.
    Thanks
    SaNv...

  • Unable to create Instance with Object Editor and Attachment Pattern

    Hi Experts,
    I created a simple entity service with some attributes and a document reference.
    I also configured an object editor pattern and assigned a attachment pattern. The created object editor works as long as I don't attach a file. But if I attach a file and want to save it I get an error message "cannot create"
    In the default log.trc I have some entries
    Cannot read associated instance with MOF ID 105D8E0C4F02D45AFFD5B9D6A09EFB7A of MOF Layer 2 for (6DC24B80F6004CDBF4FA6C560AEDD33C,<null>)
    and
    refPackageM1(com.sap.ip.bi.sdk.dac.olap.query) failed RepositoryDBMemory. Using generic one.
    I configured the j2ee engine according the tutorial "Integrating KM with CAF UI Patterns"
    So what is wrong?
    Best regards Manuel

    Hi,
    From the stacktrace I assume that the following happens (please correct me, if I'm wrong):
    <b>*</b> Some time based event mechanism sends an event to your custom event handler code. That code is execute in some system context.
    <b>*</b> Your handler uses the RF API to create a collection. All this is perfectly OK. Here my assumptions end, the next steps are solid facts.
    <b>*</b> Within the RF all property filters are informed that a resource is about to be created. One of the filters is trying to obtain a lock from a system provided Locking Service.
    <b>*</b> That service refuses to grant the lock, telling that system users are not allowed to do so.
    Most proably you cannot do anything to solve this problem by yourself. When I ran into the same Exception once, I could avoid to have my code run in a system thread. Well you might try to do the same.
    Otherwise please open a customer message and complain about the restiction in the locking behaviour.
    Best regards,
    Michael

  • Marketing Attributes and Communication info in pdf fact sheet.

    Hi,
    I have a requirement to get the communication details and marketing attributes in the pdf fact sheet.
    Smartform CRM_ACC_ACCOUNT_OVERVIEW_PRN has no coding for these info, although both informations are available in online version.
    There is a program CRM_MKTBP_ATTR_HISTORY availble to diplay attributes, but i have no clue how to bring the entire program in smartform. Can anyone help on this how to fetch these info in pdf?
    Regards,
    Neel

    Hi Neel,
       You can create a custom smart form for this . take the help of a ABAP programmer.
    You can use tables ADRC for communication details .
    For marketing attributes : you can use function module CRM_MKTBP_READ_BP_LIST giving the BP guid in table IT_BP_LIST. This will give you the attribute set along with the attributes and their values assigned to the BP.
    Example call:
    Test for function group CRM_MKTBP_DB
    Function module CRM_MKTBP_READ_BP_LIST
    Import parameters Value
    IV_LANGU EN
    Tables Value
    IT_BP_LIST 1 Entry
    Result: 1 Entry
    ET_BP_ALLOCLIST 1 Entry
    Result: 2 Entries
    ET_RETURN 0 Entries
    Result: 0 Entries
    One you get these values you can pass this to your smart form.
    Hope this helps
    Best regards
    Sourabh
    Edited by: Sourabh Verma on Apr 9, 2009 9:31 AM

  • Tables for marketing attributes and relationship

    Hi anyone!
    I'm creating InfoSets in CRM and I need the tables containing marketing attributes and relationship for BPs. Does anyone of you know which tables this data is stored in???
    Regards Camilla

    Hi Camilla,
    Another option to reading tables : you can use function module CRM_MKTBP_READ_BP_LIST giving the BP guid in table IT_BP_LIST. This will give you the attribute set along with the attributes and their values assigned to the BP.
    Example call:
    Test for function group      CRM_MKTBP_DB           
    Function module              CRM_MKTBP_READ_BP_LIST 
      Import parameters               Value             
      IV_LANGU                        EN                                                                               
    Tables                          Value             
      IT_BP_LIST                         1 Entry        
                       Result:           1 Entry        
      ET_BP_ALLOCLIST                    1 Entry        
                       Result:           2 Entries      
      ET_RETURN                          0 Entries      
                       Result:           0 Entries

Maybe you are looking for

  • How to get a week number  for the year using oracle sql query?

    hi everyone, i have the requirement to find the week number for the calender.. so that week number should start with 01 when the year starts and it should end with week end date(that is first saturday of the january month).. so next week number start

  • Songs ending too early

    It seems that since the last update to I Tunes some songs are ending too early (30 to 1:30 too ealry).  The get info button does not indicate the songs should end early.  When i download the song again, the problem stops.

  • ITunes Match:  iTunes has stopped working

    I don't see any other reports of this problem on the Apple Support Communities forum.  Am I the only person having this problem? I subscribed to iTunes Match last weekend.  I have not been able to upload/match all of my songs.  Most of the songs that

  • Photoshop, multi-monitor setup has wobbly lines at left of monitors

    Hi All I'm having a problem with jagged, wobbly lines in Photoshop CS5.1.  This has nothing to do with Smoothing or anything (the wobble is more pronounched with smoothing off however). I believe it has something to do with my 3 monitor setup in Wind

  • CD doesnt show up in "artist" but does in album

    hello. For some reason my ipod has selected a few cd's where it only displays them in the "album" list but not "artist". for example... if i want to listen to My Chemical Romance i have to go to an album search because they are not filed under "M" in