How to add a blank row into a datatable

i hava adatatable which contains the datas from database.i need to add a new data so that i need a blank row which contain the same number of columns in the existing datatable.
Pls Help..

sorry i am a beginner in jsf..
In the crud Example i saw a code in MyCrudBean.java.i wrote the code like that but the same stage only one row is coming i cant add n items .
* Department.java
* Created on Nov 22, 2007, 4:43:12 PM
package datatable;
import Item.DeptDatabase;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Body;
import com.sun.webui.jsf.component.Form;
import com.sun.webui.jsf.component.Head;
import com.sun.webui.jsf.component.Html;
import com.sun.webui.jsf.component.Link;
import com.sun.webui.jsf.component.Page;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.faces.FacesException;
import javax.faces.component.html.HtmlDataTable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
public class Department extends AbstractPageBean {
Connection con = null;
PreparedStatement StmtRateSel = null;
ResultSet rs = null;
private List<DeptDatabase> list = new ArrayList();
private int addCount = 1;
private HtmlDataTable myDataTable;
private static final int DEFAULT_TABLE_ROWS = 10;
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
* <p>Automatically managed component initialization. <strong>WARNING:</strong>
* This method is automatically generated, so any user-specified code inserted
* here is subject to being replaced.</p>
private void _init() throws Exception {
private Page page1 = new Page();
public Page getPage1() {
return page1;
public void setPage1(Page p) {
this.page1 = p;
private Html html1 = new Html();
public Html getHtml1() {
return html1;
public void setHtml1(Html h) {
this.html1 = h;
private Head head1 = new Head();
public Head getHead1() {
return head1;
public void setHead1(Head h) {
this.head1 = h;
private Link link1 = new Link();
public Link getLink1() {
return link1;
public void setLink1(Link l) {
this.link1 = l;
private Body body1 = new Body();
public Body getBody1() {
return body1;
public void setBody1(Body b) {
this.body1 = b;
private Form form1 = new Form();
public Form getForm1() {
return form1;
public void setForm1(Form f) {
this.form1 = f;
// </editor-fold>
* <p>Construct a new Page bean instance.</p>
public Department() {
public void deptsave() throws SQLException{
connection();
StmtRateSel      = con.prepareStatement("execute prcPnsDepartmentIns");
rs = StmtRateSel.executeQuery();
con.close();
@Override
public void init() {
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// before managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
// Note - this logic should NOT be modified
try {
_init();
} catch (Exception e) {
log("Department Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
// </editor-fold>
// Perform application initialization that must complete
// after managed components are initialized
// TODO - add your own initialization code here
* <p>Callback method that is called after the component tree has been
* restored, but before any event processing takes place. This method
* will <strong>only</strong> be called on a postback request that
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
@Override
public void preprocess() {
* <p>Callback method that is called just before rendering takes place.
* This method will <strong>only</strong> be called for the page that
* will actually be rendered (and not, for example, on a page that
* handled a postback and then navigated to a different page). Customize
* this method to allocate resources that will be required for rendering
* this page.</p>
@Override
public void prerender() {
* <p>Callback method that is called after rendering is completed for
* this request, if <code>init()</code> was called (regardless of whether
* or not this was the page that was actually rendered). Customize this
* method to release resources acquired in the <code>init()</code>,
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
@Override
public void destroy() {
* <p>Return a reference to the scoped data bean.</p>
* @return reference to the scoped data bean
protected SessionBean1 getSessionBean1() {
return (SessionBean1) getBean("SessionBean1");
* <p>Return a reference to the scoped data bean.</p>
* @return reference to the scoped data bean
protected RequestBean1 getRequestBean1() {
return (RequestBean1) getBean("RequestBean1");
* <p>Return a reference to the scoped data bean.</p>
* @return reference to the scoped data bean
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1) getBean("ApplicationBean1");
private void connection() {
try{
Context ctx = new InitialContext();
System.out.println("context"+ctx);
if(ctx == null )
throw new Exception("Boom - No Context");
DataSource ds = (DataSource)ctx.lookup("BiteRiteJNDI");
if (ds != null) {
con = ds.getConnection();
System.out.println("connnn"+con);
catch(Exception e)
{System.out.println(e);}
public void addDataItem() {
while (addCount-- > 0) {
DeptDatabase myNewDataItem = new DeptDatabase();
//myNewDataItem.setEditMode(true);
list.add(myNewDataItem);
//log(myDataList);
// Reset counter and go to last page.
addCount = 1;
// log(myDataList);
// Reset counter and go to last page.
//addCount = DEFAULT_ADD_COUNT;
pageLast();
System.out.println("in add itm");
// list.add(new DeptDatabase());
public List getListtt(){
return list;
public HtmlDataTable getMyDataTable() {
if (myDataTable == null) {
myDataTable = new HtmlDataTable();
myDataTable.setRows(DEFAULT_TABLE_ROWS);
return myDataTable;
private static void log(Object object) {
System.out.println("bejoy"+new Exception().getStackTrace()[1].getMethodName() + ": " + object);
public void pageLast() {
System.out.println("in Page last");
int count = myDataTable.getRowCount();
System.out.println("count"+count);
int rows = myDataTable.getRows();
System.out.println("rows"+rows);
if (rows != 0) { // Prevent ArithmeticException: / by zero.
System.out.println("not equals zero");
myDataTable.setFirst(count - ((count % rows != 0) ? count % rows : rows));
log(new Integer(myDataTable.getFirst()));
public void setListtt(List<DeptDatabase> list) {
this.list = list;
* CRUD table: set datatable.
* @param myDataTable The datatable.
public void setMyDataTable(HtmlDataTable myDataTable) {
this.myDataTable = myDataTable;
jsp
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : Department
Created on : Nov 22, 2007, 4:43:11 PM
Author : Administrator
-->
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<webuijsf:page binding="#{Department.page1}" id="page1">
<webuijsf:html binding="#{Department.html1}" id="html1">
<webuijsf:head binding="#{Department.head1}" id="head1">
<webuijsf:link binding="#{Department.link1}" id="link1" url="/resources/stylesheet.css"/>
</webuijsf:head>
<webuijsf:body binding="#{Department.body1}" id="body1" style="-rave-layout: grid">
<webuijsf:form binding="#{Department.form1}" id="form1">
<h:dataTable binding="#{Department.myDataTable}" id="myDataTable" value="#{Department.listtt}" var="dataItem">
<h:column>
<f:facet name="header">
<h:outputText value="Departments"/>
</f:facet>
<h:inputText value="#{dataItem.department}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="StockItem"/>
</f:facet>
<h:inputText value="#{dataItem.stockItem}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="StockUnit"/>
</f:facet>
<h:inputText value="#{dataItem.stockUnit}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="MaxStock"/>
</f:facet>
<h:inputText value="#{dataItem.maxStock}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="MinStock"/>
</f:facet>
<h:inputText value="#{dataItem.minStock}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="ReorderLevel"/>
</f:facet>
<h:inputText value="#{dataItem.reorderlevel}"/>
</h:column>
</h:dataTable>
<h:commandButton action="#{Department.addDataItem}" value="Add"/>
</webuijsf:form>
</webuijsf:body>
</webuijsf:html>
</webuijsf:page>
</f:view>
</jsp:root>
i dont know wats the problem??
pls send a sample code to add n items

Similar Messages

  • How to add a Blank row ?

    Hello Experts
    I probably have a very simple question - but i just need to kno :
    What is an option if i want to leave a blank row as a seperator between data sets in my report output ?
    I have to report on the portal and this would be a BI 7.0 Query.
    Please suggest
    Regards
    Shweta

    well - I was looking for an option to use the query designer to do this. so i created a structure in the rows and added a Key figure to it and after that i wanted to blank out the values by using cell definition and saying hide results there.
    However ; i see some issues here
    1. the cell definition box on my query is grayed out - any idea why ?
    2. what if i want to add key figures in columns - since i am using them in a structure in the rows - i can not use them in columns - but actually - i will want key figs in columns - so then the alternative that i am using is not feasible - so what can i do then ?
    I don't think i will use WAD or web template.
    what do you suggest ?
    Regards
    Shweta

  • How to add a blank row in a report structure ?

    Hi,
    I have a report which uses a structure in both the rows and the columns. It also using cell definitions to define some cells in the report.
    What I want to do is to format the report a bit more and insert a blank line at various points in the row structure.
    Can this be done and if so how?

    Are you creating report on InfoCUbe or ODS?
    Are you aware of any characteristics for which value will never be ZERO in the Dataprovider?
    If yes, then remove the formula and create the selection with description .(dot) and restrict that characteristics by #. That would pullout space for all the KFs.
    - Danny

  • Html tags - how to add a blank line

    Hi there,
    can anyone tell me how to add a blank line into a page using one of the html tags ?
    thanks,
    Malcolm.

    You can use the <br> tag for a line break. Also   for space.
    Regards,
    Arun

  • How to add entire new row at the top of table in pdf report from c# windows forms using iTextSharp

    Hi for past 3 days i was thinking and breaking my head on how to add entire new at top table created in pdf report from c# windows forms with iTextSharp.
    First: I was able to create/export sql server data in form of table in pdf report from c# windows forms. Given below is the code in c#.
    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Text;
    using System.Data;
    using System.IO;
    using System.Data.SqlClient;
    using System.Windows.Forms;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    namespace DRRS_CSharp
    public partial class frmPDFTechnician : Form
    public frmPDFTechnician()
    InitializeComponent();
    private void btnExport_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(7);
    table.TotalWidth=585f;
    table.LockedWidth = true;
    PdfPTable inner = new PdfPTable(1);
    inner.WidthPercentage = 115;
    PdfPCell celt=new PdfPCell(new Phrase(new Paragraph("Institute/Hospital:AIIMS,NEW DELHI",FontFactory.GetFont("Arial",14,iTextSharp.text.Font.BOLD,BaseColor.BLACK))));
    inner.AddCell(celt);
    Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
    para.Alignment = iTextSharp.text.Element.TITLE;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(95f, 95f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("ID");
    table.AddCell("First Name");
    table.AddCell("Middle Name");
    table.AddCell("Last Name");
    table.AddCell("DOB" );
    table.AddCell("Gender");
    table.AddCell("Designation");
    while (dr.Read())
    table.AddCell(dr[0].ToString());
    table.AddCell(dr[1].ToString());
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString());
    table.AddCell(dr[4].ToString());
    table.AddCell(dr[5].ToString());
    table.AddCell(dr[6].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(inner);
    doc.Add(table);
    doc.Close();
    The code executes well with no problem and get all datas from tables into table in PDF report from c# windows forms.
    But here is my problem how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    As the problem i am facing is my title or Header(DCS Clinical Report-Technician wise) is at top of my image named:logo5.png and not coming to it's center position of my image.
    Second the problem i am facing is how to add new entire row to top of existing table in pdf report from c# windows form using iTextSharp?.
    given in below is the row and it's data . So how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    as you can see how i create my columns in table in pdf report and populate it with sql server data. Given the code below:
    Document doc = new Document(PageSize.A4.Rotate());
    var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(7);
    table.TotalWidth=585f;
    table.LockedWidth = true;
    Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
    para.Alignment = iTextSharp.text.Element.TITLE;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(95f, 95f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("ID");
    table.AddCell("First Name");
    table.AddCell("Middle Name");
    table.AddCell("Last Name");
    table.AddCell("DOB" );
    table.AddCell("Gender");
    table.AddCell("Designation");
    while (dr.Read())
    table.AddCell(dr[0].ToString());
    table.AddCell(dr[1].ToString());
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString());
    table.AddCell(dr[4].ToString());
    table.AddCell(dr[5].ToString());
    table.AddCell(dr[6].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    So my question is how to make my column headers in bold?
    So these are my questions.
    1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    3.how to make my column headers in bold?
    I know that i have to do some modifications to my code but i dont know how to do it. Can anyone help me please.
    Any help or guidance in solving this problem would be greatly appreciated.
    vishal

    Hi,
    >>1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    3.how to make my column headers in bold?<<
    I’m sorry for the issue that you are hitting now.
    This itextsharp is third party control, for this issue, I recommended to consult the control provider directly, I think they can give more precise troubleshooting.
    http://sourceforge.net/projects/itextsharp/
    Thanks for your understanding.
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do i insert a row into Numbers

    I'm new to numbers - how do i insert a row into a spreadsheet please?  The spreadshet started life in excel and was imported and saved as numbers.  I did try the help option but didn't seem to get the answer.

    right click on the row tab then select the "Add Row Above" or "Add Row Below"

  • How to add A single row at the middle of the table in a Webi report

    Hi,
         I created a Webi report using Universe(Created universe using bex query).Now i have a requirement to display a row at the middle of a report. Can you please tell me ,how to add a sigle row at the middle of a Webi report.
                                                    Thanks in advance
    Regards
    Monika

    Hi Monika,
    It is not really possible to add a row (I assume you mean of unrelated data) to the middle of a table in a report. You can add a new table with a single row between two tables. For instance you could add a new one row table, or even single cells which are positioned relatively between two tables. Possibly a block on top of another. But this gets tricky.
    Can you explain in more detail what you are trying to do?
    Thanks

  • How to add more disk space into /   root file system

    Hi All,
    Linux  2.6.18-128
    can anyone please let us know how to add more disk space into "/" root file system.
    i have added new hard disk with space of 20GB, 
    [root@rac2 shm]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda1             965M  767M  149M  84% /
    /dev/hda7             1.9G  234M  1.6G  13% /var
    /dev/hda6             2.9G   69M  2.7G   3% /tmp
    /dev/hda3             7.6G  4.2G  3.0G  59% /usr
    /dev/hda2              18G   12G  4.8G  71% /u01
    LABLE=/               2.0G     0  2.0G   0% /dev/shm
    /dev/hdb2             8.9G  149M  8.3G   2% /vm
    [root@rac2 shm]#

    Dude! wrote:
    I would actually question whether or not more disks increase the risk of a disk failure. One disk can break as likely as one of two of more disks.
    Simple stats.  Buying 2 lottery tickets instead of one, gives you 2 chances to win the lottery prize. Not 1. Even though the odds of winning per ticket remains unchanged.
    2 disks buy you 2 tickets in The-Drive-Failure lottery.
    Back in the 90's, BT (British Telecom) had a 80+ node OPS cluster build with Pyramid MPP hardware. They had a dedicated store of scsi disks for replacing failed disks - as there were disk failure fairly often due to the number of disks. (a Pryamid MPP chassis looked like a Xmas tree with all the scsi drive LEDs, and BT had several)
    In my experience - one should rather expect a drive failure sooner, than later. And have some kind of contingency plan in place to recover from the failure.
    The use of symbolic links instead of striping the filesystem protects from the complete loss of the enchilada if a volume member fails, but it does not reduce the risk of loosing data.
    I would rather buy a single ticket for the drive failure lottery for a root drive, than 2 tickets in this case. And using symbolic links to "offload" non-critical files to the 2nd drive means that its lottery ticket prize is not a non-bootable server due to a toasted root drive.

  • How to add my own pdf into "Kobo Books"?

    Anyone knows how to add my own PDFs into "Kobo Books"?
    The "Adobe Reader" in playbook doesn't have bookmark function.

    Because the Adobe Reader pre-installed in Playbook doesn't have Bookmark function, while kobo has it.

  • How to add a Totals row in a dashboard

    Oracle Business Intelligence 11.1.1.6.4
    Hi there gurus,
    I would like to know how to add a totals row at the end of a pivot table within a dashboard. Notice that the column I need to sum up is a measure column and not a dimension one.
    Thank a lot.

    Alejandro Trejo wrote:
    Oracle Business Intelligence 11.1.1.6.4
    Hi there gurus,
    I would like to know how to add a totals row at the end of a pivot table within a dashboard. Notice that the column I need to sum up is a measure column and not a dimension one.
    Thank a lot.What do you mean? That's what you would always expect to aggregate. Click the sigma sign on the Rows section and it will sum up the measures column. If not, add the aggregation rule to the measure column. Otherwise, explain IN DETAIL what you did, don't assume that what you did was correct.

  • How can I display the rows into columns.

    How can I display the rows into columns. I mean
    Create table STYLE_M
    (Master varchar2(10), child varchar2(10));
    Insert itno style_m
    ('MASTER1','CHILD1');
    Insert itno style_m
    ('MASTER2','CHILD1');
    Insert itno style_m
    ('MASTER2','CHILD2');
    Insert itno style_m
    ('MASTER3','CHILD1');
    Insert itno style_m
    ('MASTER3','CHILD2');
    Insert itno style_m
    ('MASTER3','CHILD3');
    Note : The Master may have any number of childs.
    I want to display like this..
    Master child1, child2, child3, .......(dynamic)
    MASTER1 CHILD1
    MASTER2 CHILD1 CHILD2
    MASTER3 CHILD1 CHILD2 CHILD3
    Sorry for disturbing you. Please hlp me out if you have any slution.
    Thanks alot.
    Ram Dontineni

    Here's a straight SQL "non-dynamic" approach.
    This would be used if you knew the amount of children.
    SELECT
         master,
         MAX(DECODE(r, 1, child, NULL)) || ' ' || MAX(DECODE(r, 2, child, NULL)) || ' ' || MAX(DECODE(r, 3, child, NULL)) children
    FROM
         SELECT
              master,
              child,
              ROW_NUMBER() OVER(PARTITION BY master ORDER BY child) r
         FROM
              style_m
    GROUP BY
         master
    MASTER     CHILDREN                        
    MASTER1    CHILD1                          
    MASTER2    CHILD1 CHILD2                   
    MASTER3    CHILD1 CHILD2 CHILD3             Since you said that the number of children can vary, I incorporated the same logic into a dynamic query.
    SET AUTOPRINT ON
    VAR x REFCURSOR
    DECLARE
            v_sql           VARCHAR2(1000) := 'SELECT master, ';
            v_group_by      VARCHAR2(200)  := 'FROM (SELECT master, child,  ROW_NUMBER() OVER(PARTITION BY master ORDER BY child) r FROM style_m) GROUP BY master';
            v_count         PLS_INTEGER;
    BEGIN
            SELECT
                    MAX(COUNT(*))
            INTO    v_count
            FROM
                    style_m
            GROUP BY
                    master;
            FOR i IN 1..v_count
            LOOP
                    v_sql := v_sql || 'MAX(DECODE(r, ' || i || ', child, NULL))' || ' || '' '' || ';
            END LOOP;
                    v_sql := RTRIM(v_sql, ' || '' '' ||') ||' children ' || v_group_by;
                    OPEN :x FOR v_sql;
    END;
    PL/SQL procedure successfully completed.
    MASTER     CHILDREN
    MASTER1    CHILD1
    MASTER2    CHILD1 CHILD2
    MASTER3    CHILD1 CHILD2 CHILD3I'll point your other thread to this one.

  • How to add a ChartOfAccounts object into the database.

    how to add a ChartOfAccounts object into the database. please shows sample code
    thanks

    Dim CoA As SAPbobsCOM.ChartOfAccounts
                CoA = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oChartOfAccounts)
                CoA.Code = 11223344
                CoA.ExternalCode = "a1234"
                CoA.ForeignName = "f Test Account"
                CoA.Name = "Test Account"
                CoA.AccountType = SAPbobsCOM.BoAccountTypes.at_Other
                CoA.ActiveAccount = SAPbobsCOM.BoYesNoEnum.tYES
                CoA.FatherAccountKey = 100001
                If CoA.Add <> 0 Then
                    MessageBox.Show(oCompany.GetLastErrorDescription)
                Else
                    MessageBox.Show("Added Account")
                End If
    Remember the father account key must be a valid account number in the company where you are trying to add the new account.  (The G/L Account code seen in the SBO client)

  • How to add or delete rows in tablecontrol?

    Hi,
    I am using a tablecontrol to enter data records.
    I want to use 2 buttons, one to insert a row into a tablecontrol and another to delete a selected row of a tablecontrol.
    How do I insert or delete rows of a tablecontrol?
    Thanks.

    Hi Kumar,
    Please look at the below sections......
    ADDING BLANK LINES
    To add blank lines to table control we do not need to change any of the fields of the structure CXTAB_CONTROL simply adding blank lines to the internal table will do.
    INSERT INITIAL LINE INTO itab.
    DELETING SELECTED ROWS
    Deletion of selected rows is simple. To delete selected rows first we will determine the rows which have been selected through selection column .
    FOR SINGLE ROW SELECTION
    IF mark EQ 'X' .             "mark is the name of selection column field
    DELETE itab FROM workarea . 
    ENDIF.
    FOR MULTIPLE ROW SELECTION
    *To deetermine the rows selected we will use the selection column field to loop
    *through the internal table.
    LOOP AT itab WHERE mark EQ 'X'.  "mark is the name of selection column field
    DELETE itab                                    " and is part of the internal table .
    ENDLOOP.
    Thanks,
    Ravi Kanth

  • How to add a blank entr in dropdown list...??

    Hi all,
    I want to add a blank entry along with the datas into a drop down list for some purpose.
    Can anyone please sugeest how to do this task.
    Thanks in advance,
    Sekhar

    Hi,
    I think the blank value in a filter is same as showing All, and not only the rows which has value blank. Nevertheless both can be achieved as below.
    "Blank Value to show everything in Table as if no filter provided"
    value-key = '*'.
    value-value = 'All'.             " This will show up the text as All and work as if no filter is given and it will show all.
    APPEND value to set.
    "Blank Value to show the rows which has the value as space"
    value-key = space.
    value-value = 'None'.             " This will show up the text as None and work as if filter is given to show value as space
    APPEND value to set.
    Hope this help!
    Regards
    Vineet

  • How to add a function field into the existing matrix report

    Hi,
    I have a matrix report , now i wanted to add one moe field into the matrix which is getting the value from a function , this function is a part of the ref cursor query(group) , i'm able to get the value from the function but it cannot display on the existing matrix report. i wanted to add this in the repeating frame which is printing down. how could i do this , looking for your help. thanks . bcj

    Here the scenario like,
    Data from Table_1
    NAME UNITS DAYS RATE
    AAA 10 1 1.2
    BBB 12 2 3.1
    AAA 20 2 4.1
    CCC 23 1 5.2
    Here, In the matrix report the NAME and UNITS are row fields and 'DAYS' is column field , RATE would be the cell field, and
    Data from Table_2 ,
    NAME BASIC
    AAA 2
    AAA 2
    BBB 2
    CCC 3
    In the report i have to display the 'BASIC' along with the NAME in row level ( repeating frame printing down),
    To get the multiple 'Basic' for each 'Name' using a ref cursor .
    and, using a function to do further calculation based on the basic value
    begin
    select basic into v_basic where name =:name;
    return(caluculated_value);
    end;
    and return the calculated value to the report. But at that time cannot accommodate the value in the matrix report with other groups frequency.
    looking for your valuable help. Thanks Bcj

Maybe you are looking for

  • Connection lost

    I have two computers that were on wireless, but lost its connection.  I didn't have any problem for over 2 years.  But I just lost my wireless connections few days ago.  I've called my local cable provided that provides the internet service, but told

  • Space between slices

    When I export and place my image map in Dreamweaver CS6, my map is showing up with a space between the slice and unsliced section. I've never had this happen before. I've tried exporting with and withouth a spacer. Any ideas? As usual, I'm under the

  • How much space is required on C:\ when installing Illustrator CC on a different drive?

    I have Creative Cloud > [Settings] > Preferences Apps > Installation Location set to a folder on a standard disk drive on my system that has oceans of space on it.  All of my Creative Cloud apps have installed just fine on it except for Illustrator C

  • PE13 where is the music panel

    I cannot find the music panel in PE13 64 bit. That term is specifically used in the manual. I have an Audio dialog box, but no Music Panel. I wanted to try SmartSounds, but I can't get at them because I can't find the Music Panel. The manual tells me

  • Applying PL19 for SAP J2EE 6.20  for a Single Node

    We are trying to upgrade from EP6 SP2 patch 2 to patch 3. A pre-req for applying Patch3 is that we need to be at PL19. Turns out we are in between PL16 and  PL17 from a SAP J2EE 6.20 standpoint. We managed to download SAPJ2EE620C_19-10001433.SAR the