First row is empty in draft document

I have created a DI addon for posting a draft delivery document.  However, in each document there's a empty blank row.  I know that you only need to invoke the lines.add function for second plus rows so I have already made sure that I am not adding a new line on first add.  Any advice for you would much be appreciated.
Regards
       Dim retVal As Object
        Dim i As Integer = 0
        Dim oDeliveryDoc As SAPbobsCOM.Documents
        oDeliveryDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts)
        oDeliveryDoc.DocObjectCode = SAPbobsCOM.BoObjectTypes.oDeliveryNotes
        oDeliveryDoc.CardCode = selectedBPCode
        oDeliveryDoc.DocDueDate = Today
        Dim row As Object
        While i < CType(DataGrid1.DataSource, DataTable).Rows.Count
            If DataGrid1.IsSelected(i) Then
                If i > 0 Then
                    oDeliveryDoc.Lines.Add()
                End If
                oDeliveryDoc.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
                oDeliveryDoc.Lines.BaseEntry = CInt(DataGrid1.Item(i, 8))
                oDeliveryDoc.Lines.BaseLine = DataGrid1.Item(i, 9)
            End If
            i = i + 1
        End While
        retVal = oDeliveryDoc.Add
        If retVal <> 0 Then
            oCompany.GetLastError(lErrCode, sErrMsg)
            MsgBox(lErrCode & " " & sErrMsg)
        End If

Hi Alan,
The blank row that you are referring to, where is that line? Is it the last line in the document? If so, that is standard SBO practice. I tested your code and did the same in SBO itself. I create a Delivery draft with 3 lines and 4 lines are added to the document. The fourth line is the new line that is created automatically when you press tab. The reason is that you can add more lines to a draft document. As soon as you save that draft as an actual document, the last line gets deleted.
Hope it helps,
Adele
Message was edited by: Adele le Roux
Didn't read properly... see that it's the first row that's empty... Should your code not read:
If i > 1 Then

Similar Messages

  • We can able to load master data through manually FIRST ROW IS EMPTY

    Hi,
        we can able to load master data through manually without loading but in that screen where we we type the data FIRST ROW IS EMPTY.PLZ tell me why that is empty

    Becasue SAP BW already creates a Blank Line, it cannot create a new one again for you.
    So, when you loaded the Blank like with description, it uses the existing blank line and creates test for it.
    Each row in the table will have a SID.
    e.g.,
    12345 text1
    23446 text2
    You cannot have
    12345 text1
    12345 text2
    If you load the above, you will have "12345 text2" in the table.
    Same way, you cannot have two SIDs for the same key, so your new text is used for the existing Blank Key value.
    SAP creates this:
    Key, Description
    when you loaded the Master Data, you have:
    " ", "whatever you loaded".
    Edited by: Ananda Theerthan on Apr 27, 2010 7:03 AM

  • Why first row is empty?

    I've used the below code to populate 3 rows , but at run time first row will be empty after that next 3 rows will be populated.
    Why its not starting from the first row?
    IPrivateLogin_DCView.IEmpNode node1=wdContext.nodeEmp();
             int count=3;
         for(int i=0;i<count;i++){
                      IPrivateLogin_DCView.IEmpElement ele= wdContext.nodeEmp().getEmpElementAt(i);
                        ele=node1.createEmpElement();
                      if(i==0){
                         //  ele=node1.createEmpElement();
                           ele.setEmp_name("Deepa");
                           ele.setEmp_age("35");
                           ele.setEmp_no("1");
                           node1.addElement(ele);
                        if(i==1){
                         //  ele=node1.createEmpElement();
                           ele.setEmp_name("Raju");
                           ele.setEmp_age("32");
                           ele.setEmp_no("INFO 1");
                           node1.addElement(ele);
                        if(i==2){
                          // ele=node1.createEmpElement();
                           ele.setEmp_name("Rose");
                           ele.setEmp_age("42");
                           ele.setEmp_no("454 ");
                           node1.addElement(ele);

    Hi Rajashekhar,
    Try this.
    IPrivateLogin_DCView.IEmpNode node1=wdContext.nodeEmp();
    int count=4;
    for(int i=0;i<count;i++){
    IPrivateLogin_DCView.IEmpElement ele= wdContext.nodeEmp().getEmpElementAt(i);
    ele=node1.createEmpElement();
    if(i==0){
    ele.setEmp_name("");
    ele.setEmp_age("");
    ele.setEmp_no("");
    node1.addElement(ele);
    if(i==1){
    ele.setEmp_name("Deepa");
    ele.setEmp_age("35");
    ele.setEmp_no("1");
    node1.addElement(ele);
    if(i==2){
    ele.setEmp_name("Raju");
    ele.setEmp_age("32");
    ele.setEmp_no("INFO 1");
    node1.addElement(ele);
    if(i==3){
    ele.setEmp_name("Rose");
    ele.setEmp_age("42");
    ele.setEmp_no("454 ");
    node1.addElement(ele);
    Regards,
    Mithu

  • Issue with empty value of LOV of first row after clicking on add row button

    JDeveloper 11.1.14
    I have a page with table-form layout.
    In the form I have two detail tables on the same page (tabbed).
    I have an issue with using model-choicelist LOV's in the detail tables.
    I am able to add a new row in the detail table, select a value from the model-choiceList LOV (which is required) and save the new row.
    After adding another row in this table the value of the model-choiceList LOV in the previous row is suddenly empty on the screen. It is not empty in the database,
    I have checked it in the datbase. Only the value of the LOV of the first row on the page is being cleared after clicking on the add row button.
    After saving the new row I get the following error on the screen:
    Error: a selection is required. --> first row
    Does anyone have a suggestion how to solve this issue?

    After adding another row in this table the value of the model-choiceList LOV in the previous row is suddenly empty on the screen. It is not empty in the database, Is the complete LOV blank or only the selected value .. can you try putting autoSubmit=true in the LOV and try ? Also check if you have any partialTriggers on the LOV from the add button ?

  • RowKeySet is Empty for first row

    Hi all,
    I am trying to get a table's current row(row is selected with mouse click or arrow down/up) in a bean.With my current code, it works except that if the first row is selected, rowKeySet is null. Any ideas why is it so?
    Any pointers are appreciated.
    Table code
    <af:table value="#{bindings.Department.collectionModel}" var="row"
    rows="#{bindings.Department.rangeSize}"
    emptyText="#{bindings.Department.viewable ? 'No rows yet.' : 'Access Denied.'}"
    fetchSize="#{bindings.Department.rangeSize}"
    selectedRowKeys="#{bindings.Department.collectionModel.selectedRow}"
    selectionListener="#{GetRowBean.selectedRow}"
    rowSelection="single" binding="#{GetRowBean.table}">
    Bean code(GetRowBean)
    public void selectedRow(SelectionEvent SelectionE){
    RowKeySet rowKeySet = table.getAddedSet();
    if(rowKeySet != null){
    if(rowKeySet.isEmpty() == false){
    for(Object tableRowKey: rowKeySet){
    table.setRowKey(tableRowKey);
    FacesCtrlHierNodeBinding rowData =
    (FacesCrtlHierNodeBinding)this.table.getRowData();
    Row currRow = rowData.getRow();
    DepartmentId = (Integer)currRow.getAttribute("DepartmentId");
    Thank you for your time.

    Hi Frank,
    I am using ADF BC. In my current implementation, I believe that I want the selected row instead of the current row.
    May be there are better alternatives to implement the code to retrieve the selected row(mouse click or arrow up/bottom)? Why is the rowKeySet empty if the first row is selected?
    Any pointers are appreciated.
    Thank you for your time.

  • Last Row not added to XML Document

    Hi,
    I've created a transaction extracting data from SAP, trying to convert the data into a MII XML Document. But when i try to add the rows with the repeater block, it does not include the last record from the extracted SAP data.
    Description of the transaction:
    SAP function call
    MII XML Document
    Repeater (repeats on all items in the SAP output)
    ->MII XML Row
    ->Assign data to MII XML Row
    Assing XML Document to Transaction output property
    I have inserted a logger at the assignment action block, and the last SAP record is treated by the repeater block, but when i do a count on the SAP item elements and the converted Rows in the MII XML Document there is missing one record..
    Has any body had a similar problem and solved it some how??
    BR
    Jens

    Hi
    I think it is something to do with the technique you are using to add the rows.
    What you are doing is adding a blank row to the document, then populating the row action block (NOT the row in the document) with the first row from your repeater.
    You then run the row action block the second time, it has the data from the first repeater row, and then you populate the row action block with the second repeater row.
    So at the end you will have a rowset with 1 empty row and all but the last populated row from your repeater, plus a Row action populated with the last row from the repeater, but not added to your document.
    What you can do is either - move all your assignments into the Row object (definitely recommend this), or append the final row object to the document rowset before you assign it to your output.
    Hope this makes sense!
    Nick

  • How do I set only the first row of a DataGrid as the selected row?

    I have a "Go" button on a search form that fetches data into an already data bound grid.  After the data is fetched, I want to make the first row in the Datagrid the selected row, as if the user clicked on it.  If the result set is empty, I don't want the code to crash.  (I only want one row to be able to be selected at a time)
                protected function btnGo_clickHandler(event:MouseEvent):void
                    getSBJsResult.token = baa_data_svc.getSBJs(cmbSrch.text);
                    grdSBJs. //  ?????  What goes here to select the first row?

    This should do it.
    If this post answered your question or helped, please mark it as such.
    if(myDataGrid.dataProvider.length > 0){
      myDataGrid.selectedIndex = 0;

  • How to freeze the column edit in Draft document?

    Hi,
    I try the following code and want to freeze the column edit in Item code, Item description and quantity.  However, it just work in Sales Order or PUrchase Order those normal marketing document.  it doesn't work in Draft document.  Anyone can help?
      If BusinessObjectInfo.FormTypeEx = "133" And BusinessObjectInfo.Type = 112 And BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD Then
                    If BusinessObjectInfo.BeforeAction = True Then
                        oForm = SBO_Application.Forms.Item(BusinessObjectInfo.FormUID)
                        oboDS = oForm.DataSources.DBDataSources.Item("ODRF")
                        oGenvalue = oboDS.GetValue("U_InvoiceFlag", 0)
                        Dim oOrderMat As SAPbouiCOM.Matrix = oForm.Items.Item("38").Specific  'Content Row'
                        Dim oColumns As SAPbouiCOM.Columns = oOrderMat.Columns
                        Dim oItemColumn As SAPbouiCOM.Column = oColumns.Item("1")       'Item No
                        Dim oItemColumn3 As SAPbouiCOM.Column = oColumns.Item("3")
                        Dim oItemColumn11 As SAPbouiCOM.Column = oColumns.Item("11")
                        If oGenvalue.Trim = "Y" Then
                            'Set Itemcode and Quantity to non-editable
                            oItemColumn3.Editable = False
                            oItemColumn.Editable = False
                            oItemColumn11.Editable = False
                        Else
                            oItemColumn3.Editable = True
                            oItemColumn.Editable = True
                            oItemColumn11.Editable = True
                        End If
                    End If
                End If

    Hi Anna,
    Thanks for posting your code - that helps a lot isolating the issue!
    While your code could work, if the SDK would have been implemented differently, it won't do what you want it to:
    - There is no et_FORM_DATA_LOAD event fired when a draft is loaded (use EventLogger from the B1DE tools - it would have told you that you are looking at an event that doesn't get fired...).
    - Not sure how "BusinessObjectInfo" is defined, but oForm.BusinessObject.Type = "112" does not occurr:
    The business object behind the form is the "real" business object - an Invoice ("13") in your case.
    Thus your code never reaches the lines where you disable the relevant columns... - you could e.g. use .NET Profiler form B1TE to get at least a better idea of what is happening inside the add-on, if you don't like to step through you add-on code.
    - oForm.BusinessObject.Type is a string (remember UDOs!) - not a number.
    - Table "ODRF" is not a datasource behind form "133" - please check the form's XML!
    If you would like to run that check you have to do it differently - using DI API...
    HTH,
    Frank
    Edited by: Frank Moebius on Aug 3, 2009 4:28 PM

  • How to ignore the first row in a csv import

    Hello
    This is the file we want to  add to the datamodel:
    https://www.mediafire.com/?a9xrwrwu79whu18
    (BTW this is the csv output from a neat & free software called Jstock)
    Here is an image of the problem:
    As you can see they add automatically a timestamp in the A1 cell ruining the possibility of a clean import.
    Can anyone help with a query to fix this and get the real headers?

    Hi NicoPer,
    To follow your M code. You have  this lines  #"First Row as Header" = Table.PromoteHeaders(Source).
    This mean you use first line ( the line include "timestamp=1415926728041" ) to make
    table header. So you no need to use Table.Skip function. You just use one more Table.PromoteHeaders to make second line to your table header. Below is your code:
    let
        Source = Csv.Document(File.Contents("C:\PATH\JSTOCK.csv"),null,null,null,1252),
        #"First Row as Header" = Table.PromoteHeaders(Source),
        #"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"timestamp=1415926728041", type text}}),
        FirstRowAsHeader = Table.PromoteHeaders(#"Changed Type")
    in
        FirstRowAsHeader
    Regards,

  • Dynamic Table in PDF - only first row passed to the WD Java

    Hi Experts,
    I'm working with Web Dynpro for Java on WAS 2004s SP13, ADS for SP13 and LiveCycle Designer 7.1
    I am facing a problem related to PDF-dynamic table generation.
    I am creating the PDF form with a dynamic table, an empty row will be added, when ADD button is clicked, the row will be deleted when DELETE button is clicked. After form submit, only first row of the table is passed to the Web Dynpro. I'v tried to use different dataSource Context node structure without results. The structure diescribed in the thread [Dynamic Table -  same data repeating in all rows;  doesnt works for me. The same happend if i try to folow the advise from Wiki https://wiki.sdn.sap.com/wiki/display/WDJava/Creating%20Table%20in%20Interacting%20form%20using%20Web%20Dynpro.
    Beside this,  my DropDown list in the table column is not populated. I know how to populate the DropDown list outside of table. That's working fine. But the DropDown in the table just not respond on the click (is not going open). I'm pretty sure that this is a result of a Context node structure/binding issue. 
    Please suggest me how can i implement dynamic table and populate the data in table dropdown column.
    Edited by: A. Mustacevic on Sep 7, 2009 12:18 AM

    Hi Prabhakar,
    You describe exactly my situation. The node which is bound to the table row has cardinality 1..n. Exactly Context structure is:
    node dataSource (cardinality 1..1/ Singleton true) ======> dataSource of the Interactive Form
    subnode TableList (cardinality 1..1/ Singleton true) ======> bound to the table in the Interactive Form
    subnode TableWrapper (cardinality 1..n/ Singleton true) ======> bound to the table row in the Interactive Form
    subnode TableData (cardinality 0..1/ Singleton false) ======> table data
    attribute 1  ====>     Context nodeattribute bound to the table row field   
    attribute 2
    This structure is recommanded in the post that I found on the Forum (see the firs hyperlink in my firs post).
    Is this structure correct? Why is not working?
    Your link is not working. Can you post the correct one.
    Thanks in advance.
    Regards
    Adnan
    Edited by: A. Mustacevic on Sep 8, 2009 1:56 PM
    Edited by: A. Mustacevic on Sep 8, 2009 1:57 PM
    Edited by: A. Mustacevic on Sep 8, 2009 2:00 PM
    Edited by: A. Mustacevic on Sep 8, 2009 2:01 PM
    Edited by: A. Mustacevic on Sep 8, 2009 2:02 PM

  • FCC..how to remove first row

    Hello experts,
    I have configured a end to end sccenario fo csv files, Im using fcc for the sender file adapter
    The first row has all the field names such as name,number and the rest of the rows have the values.
    when I run the scenario the xml being formed has the field names and the vales..
    example
    <name>name</name>
    <number>number</number>
    <name>Teja</name>
    <number>10</number>
    what i want in the xml is just
    <name>Teja</name>
    <number>10</number>
    could any one pls help me out on this?
    I have used fieldNames,fielsSeparaor and ignorerecorstSetName as the content conversion parameters..
    do i have to add any more?
    Regards,
    Teja

    Hi,
    You should achieve this by using Document Offset parameter on the Sender side.  Set Document Offset to 1 in order  to ignore the first line.
    "●      Under Document Offset, specify the number of lines that are to be ignored at the beginning of the document.
    This enables you to skip comment lines or column names during processing. If you do not make an entry, the default value is zero lines."
    http://help.sap.com/saphelp_nw70/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm
    Thanks,
    Pooja

  • How to ignore the first row  in sender file

    I would like to ignore the first row in each file in the sender channel - how can i do it?

    Hi
    Check this,
    As he said give Document Offset = 1
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    Also check this forum
    Re: Supress Column Heading - File Content Conversion in Sender Adapter
    Thanks,
    Prakash

  • Tabular Form - Setting a default value just on first row.

    Hi all,
    how to set a tabular form default value only in the first row?
    When I click on "add row" I want the new row have a blank value.
    Thanks in advance.

    Hi,
    When you add a new row to the tabular form, any existing rows should be saved to the database. You can, therefore, check for the existence of such records and set the value of a hidden page item accordingly. The default value for a tabular form item can then be based on this hidden item.
    This can be done by setting the Source Used to "Always, ..." on the hidden item called, say, P1_DEPTNO_DEFAULT, and the Source to something like:
    DECLARE
    X NUMBER;
    BEGIN
    SELECT COUNT(*) INTO X FROM EMP WHERE DEPTNO = :P1_DEPTNO;
    IF X > 0 THEN
      RETURN '';
    ELSE
      RETURN :P1_DEPTNO;
    END IF;
    END;This is a "PL/SQL Function Body" Source Type.
    In this example, we are checking if there are any EMP records with a DEPTNO value that matches P1_DEPTNO. If there are, then the tabular form must contain at least one row already, so we return an empty string. If there are no records, the tabular form must be empty, so we return the P1_DEPTNO value.
    The Default settings on the DEPTNO column in the tabular form would then be:
    Default Type: Item (application or page item name)
    Default: P1_DEPTNO_DEFAULT
    Andy

  • Display rows for empty and mesure values

    Hi,
    We are building live office objects charts on top of WEBI documents and facing an issue while refreshing the data in live office object for empty measure and empty dimension values. Charts are pointed to the data cells in the live office table and if there is no data for the given selections for any measure or dimension the data cell range will change and charts are not working properly. So, we want show the measures as zero and show rows with empty dimension values even if the data doesnu2019t exists.
    I believe we should have some setting in WEBI or live office. Would be appreciated your help.
    Best Regards,
    Satya

    To get zero : Change the measure object formula
    To get empty rows: Check "Show dimensions with empty rows and columns and rows/columns" all three options.
    Hope this will helps you...!!
    Thank You.

  • Current VO row is empty for flexfield

    I am implementing "Address Location" DFF and I am getting the below error message when testing.
    Current VO row is empty for flexfield
    I made sure that the VO is initialized. Populated the VO instance and segment list too
    vo.setMaxFetchSize(0);
    vo.executeQuery();
    vo.insertRow(vo.createRow());
    OARow row = (OARow)vo.first();
    Any suggestions?

    hi,
    Please share more details and put some SOPs to check values for OARow row = (OARow)vo.first(); and other places.

Maybe you are looking for

  • Is apple going to fix the boot camp problem in yosemite?

    I was told to wait on my install because of loss of data problems with boot camp and Yosemite? Is apple working on this problem or do I just have to forget ever updating to Yosemite? Just kidding they probably are looking at all the time. Thanks for

  • One line item missing from PO created using Shopping cart

    Hello Team, we have raised a shopping cart with 6 line items, having the same vendor and account assignment details. Once the shopping cart was approved the PO was created but the 3rd line item was missing in the PO. When we checked in BBP_PD, the 3r

  • Nokia Belle FP1 Pros and Bugs.

    I have FP1 installed  on my 701. I must say this update is significant improvement from the old belle in terms of features and functionality. I'm happy that Nokia solved most of the problems that I have mentioned earlier. /t5/Nseries-and-Symbian-Smar

  • Is Pages a good 'reader' app for Word documents ?

    In doing a few searches in this forum on the subject I find some conflicting reports ( what a surprise ) so I am compelled to ask : How good a job does Pages do in reading Word documents particularly Word documments from PCs? Most of our word proc ne

  • Is this junk mail for real?

    Mails from this email address: [email protected] asking to verify apple/cloud id. for KYC legislation otherwise my account will be closed. can anyone tel me if this is spam or not. Thanks