Regarding creation of document number for user defined form

Hi all,
we had created a form , but we don't no how to generate document number as in sap
we created but it is not creating automatically
after adding only it is showing that number in series
but i need that number at the time of opening only

hi srvanth
Use this code in a data binding of the form to load automatically the doc numbers
    ds = oform.DataSources.DBDataSources.Add("@TODACT")
        oform = oapp.Forms.ActiveForm
        Dim reset As SAPbobsCOM.Recordset
        Dim qsr As String
        reset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
        qsr = "SELECT max(T0.DocNum) as c  FROM [dbo].[@TODACT]  T0"
        reset.DoQuery(qsr)
        If reset.Fields.Item("c").Value <= 0 Then
            a = 1
        Else
            a = (reset.Fields.Item("c").Value) + 1
        End If
        oitem = oform.Items.Item("doct")
        oedit = oitem.Specific
        oedit.DataBind.SetBound(True, "@TODACT", "DocNum")
        oedit.Value = a
this will load document number everytime you load the form at the edit box with unique id "doct"
hope this helpful
you have to bind this edit box with DocNum Userfield of the table.
report back if there is any error
Regards
Cool Ice
Edited by: Cool Ice on Aug 19, 2008 7:20 AM

Similar Messages

  • Base Document and Target Document Menu for User Defined Forms

    Hi Experts,
    I am facing a problem regarding enabling the menu "Base Document" Menu UID="5898" and "Target Document" Menu UID="5899" . Both of these menu Items are not enabled for User Defined Form .Actually I have developed a user Defined form for Purchase Requisition that targets Purchase Order . User can Copy Line Items From Purchase Requisition to Purchase Order and I am tracking the DocEntry and LineId of PR into PO Item's using UDS . I want to Open this PR Document upon Click of BaseDocument Menu .I have tried all the options. I have used Form.enableMenu() method also . But none of those options work for this menu . I ahve also searched about this problem i this forum also but there is no soultion so far posted regarding this.
    I really want to confirm whether it is possible or not using SDK for User Defined Forms . Is there any possiblity of implementing any WorkArounds and Having this feature implemented .
    I am Expecting a true solutions as this Forum has so many Experienced Experts .
    Thanks and Regards,
    Pooja Singh.

    Hello Poja,
    It is not possible, because the requested menus are depending on the forms, and the are not exists,
    WorkAround:
    add the menus to the User Defined forms, and use right click to activate them:
    oForm.Menu.Add("5898", "Base Document", BoMenuType.mt_STRING, oForm.Menu.Count)
    oForm.EnableMenu("5898", True)
    And hanle the menu event when you clicked them and the form is your custom form.
    Regards,
    János

  • Manual document number in User-Defined Object

    Hi Experts,
    I have a user-defined object of document type.  I am trying to post a document using the General Service. However, I cannot assign manual document number.  There is no handwritten property available.  Is it possible to assign manual document number in user-defined objects using the DI API?
    Thanks.
    Melvin

    Hi,
    This issue has been resolved.  For the benefit of those who will be encountering this error, it was resolved by manually assigning the Handwrtten field to 'Y'.  Here is the code fragment:
    shipmentHeader.SetProperty("Handwrtten", 'Y')';

  • SQL Query for user defined form

    Hi experts,
    I want query to update some fields in my user defined form using stored procedure on clicking of ADD button.
    Explanation:
    I have User Defined form call "DC request" with Object 'DCLM'..On click of Add button, it is saving my record info into the form. But in one field if value in not entered then it is saving as 'Null'.
    Addon is already made, can not change in coding.
    I want to update this field with '0' value through query in stored procedure on click of Add Button. Can anyone help me out to achieve this.
    Thanks

    Hi Team Bone.
    Please try below Transaction Notification which will Restrict User to ADD if Field_Name is NULL and then User Need to Enter ZERO i.e. 0 for Adding.
    IF @OBJECT_TYPE = 'DCLM' AND (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U')
    BEGIN
    If Exists (Select T0.DocEntry from [Table_Name] T0 Where ( T0.Field_Name is null  OR  T0.Field_Name = ' ' ) AND T0.DocEntry  = @lisT_of_cols_val_Tab_del )
    begin
    SET @error = -100000
    SET @error_message = 'Filed_Name is NULL then So, Please enter ZERO Value i.e. 0 in Filed_Name'
    End
    End
    Please change Table_Name and Field_Name with with UDO field.
    Hope this help
    Regards::::
    Atul Chakraborty

  • How to get document number in user  created form?

    Hi All,
             I am creating a form.In that i want to maintain Document number for each form(each order)(like in sales order form (Document  No. field)).
                   Please help me to maintain the document number either manually or by system generated.If u have code example   please send.
            I tried for Manage series and all.But i couldn't get.
    Expecting ur reply soon
    Thanks
    V.Rangarajan

    Hi V.Rangarajan,
    I haven't used this code yet, but herewith an extract from the SBO SDK Training material which I think is related to your problem.
    // create a combo box for the series oItem=oForm.Items.Add("SeriesName",SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
    // fill the combo with relevant series
    oComboBox.ValidValues.FillWithSeries(True, False, 0) new method
    oComboBox.DataBind.SetBound(True, "@MATH", "Series")
    // edit text to hold the numbering of the series
    oItem = oForm.Items.Add("SrValue", SAPbouiCOM.BoFormItemTypes.it_EDIT)
    oEditText.DataBind.SetBound(True, "@MATH", "DocNum")
    // get the next series number in add mode
    lNum = oForm.BusinessObject.GetNextSeriesNumber(CLng(str))
      oEditText = oForm.Items.Item("SrValue").Specific()
       oEditText.String = lNum
    I don't know if this will solve your problem, but hopefully it will put you on the right track.
    Hope it helps,
    Adele

  • Type property for user defined forms

    Hi,
    When creating a user defined form using Screen Painter,
    how can we assign Type property for the form so that we are sure it will not clash with system forms in the future?
    Thanks,
    Satish.

    Thanks Juli
    Just one last question. It it be alright to assign a text value(Partner namespace in front) for the form type property.Does it have any drawbacks?
    Thanks,
    Satish

  • Problem When Try to add Master data record for User define form

    Hi,
    I have made one user define form. And assign UDO and fields proerly in form.
    But when I try to add the record from the form it will give me error
    Invalid Code [Operation Master  -Code] [Message 173-36]
    I have already bind the code field of the table to one field in the screen painter.
    Please give me the reply.
    Regards,
    Gunjan Shukla.

    Dear Shukla
    Can you please try to do the binding in the code (after loading the from).
    Doing that, do you still have the problem?
    Best regards,
    Miki

  • Document numbering for User Define Object

    Hi,
    Anyone know how to use numbering series in UDO?
    I've created 3 doc series for the object. one off the series is the default. When i select other doc series on my form, after I add the doc, the series code is captured but the the number is wrong. it took the default number.
    eg..
    Series A: 1-999 as default
    Series B: 1000 -1999
    I pick B and add, Series code is ok but the number taken is from series A.
    Q.

    Hi Andy,
    The system is supposed to get the correct number as you would expect. However there is a bug in  SAP Business One 2007 A Release.
    If you have access to the Note 1266379 you can see the detailed scenario as described by you.
    Currently the issue is planned for fixing in February 2009 patch for 2007A. You can check the info.txt file to see if the fix was included.
    Kind Regards,
    Friederike
    SAP Business One Forums Team

  • Authorizations For User Defined Forms

    Hi Experts !!!
    I have created a user form , and would like to apply authorization for that user form.
    Whether it is possible.I tried using standard method,but it seems that no such provision available ,
    And also I have created UDT . and would like to provide series for that UDT . My client wants that particulat UDT should be by 2 different users .and they need Series for that .
    Suggestions are appreciated
    Regards
    Krishna Vamsi

    Hi,
    You Can give authorizations to your customized (user developed) screens.
    Administration --> System Initialization --> Authorizations --> Additional Authourization Creator
    In right hand side you can find the structur.
    There defaultly XL reporter autorization will be there select the any one and click add same level button in bottom of the screen.
    Then in Right hand Side
    Authorization ID - give some unique id
    Name --> Description of Authorization
    In Option --> Select Full/read/None
    Item --> Tick as Item
    Then Come down you can find big text box, near to that you can find edit button, just click that it will open a popup window.
    In that window you please enter the Form Id of your user form
    to find the form id --> Just Enable the system information menu in menu bar and move the cursor to any item in your user screen, you can find the form id.
    Just type that form id in that pop up box.
    then Add the window.
    now Open the General Authorization.
    There in last row you can find the user authorization. just expand that you can find your authorization id and name there which you have created.
    Give your authorization there.
    thats it.
    There is no need for SDK Developement for Authorization.

  • How to handle form close event or escape key press event for user defined f

    Experts,
    Please let me know how to handle form close event or escape key press event for user defined form...
    Thanks & Regards,
    Pravin.

    Hi
    You can catch the form close event like this
    If ((pVal.FormType = 139 And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)) And (pVal.Before_Action = True)) Then
          Try
                   SBO_Application.SetStatusBarMessage(pVal.EventType.ToString())
          Catch ex As Exception
                    SBO_Application.SetStatusBarMessage(ex.Message)
            End Try
          End If
    Hope this helps
    Regards
    Arun

  • Err in PO creation-Sales document item is not defined for this transaction

    Dear Consultants the errror  occurs when we process  Individual Purchase Order scenario.
    Err in PO creation-Sales document item is not defined for this transaction  
    Thanks&Regards,
    SanthaRam

    This error because the item category is not determined correctly in the sales order.
    Check the item category in Sales order line item, for Individual Purchase order scenario its TAB.
    If its not TAB, then check the assignement for Item category in VOV4.
    This thread is more of the SD part, so also put it in SD forum for better solutions.
    Regards,
    Sheetal

  • Badi: for user defined fields in Budget Entry Document

    HI,
    I am implmenting BADI for user defined field in budget entry document definatin name 'FMBW_CUSTOMER' . I have created two fields in include 'CI_FMBH' and also created a sub screen and assign this subscreen to badi. I have called get data and put data methods in PBO and PAI. like this.
    <b>
    PBO
    create object grid1.
      CALL METHOD grid1->if_ex_fmbw_customer~get_data_from_screen
      importing doc_header = doc_header.</b>
    <b>PAI
      CALL METHOD grid1->if_ex_fmbw_customer~put_data_to_screen
        EXPORTING
          doc_header = doc_header
          processing_mode = 'CRE'.</b>
    But the system is not saving these fields in database.
    What could be the problem .

    Hi, did you have any advance on this issue?

  • Maximum number of User defined dimensions in Planning v11.1.2

    Hi guys,
    I am new to Hyperion Planning version 11.1.2, just wanted to clarify what is the maximum number of User defined dimensions that can be added in a planning application.
    I've also learnt that the number of Alias tables is more than the previous versions. What is the maximum number of Alias tables in Planning version 11.1.2 ?
    Regards.

    Maximum number of alias tables is 10 including the default alias table
    As for custom dimensions then I wouldn't expect you to hit a maximum unless you want to design a planning application destined to fail.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • What is the Object Type for User Define table ?

    Dear All Experts,
    I create one of the User Define Table with no. of UDF's
    I already register User Define Table with Unique ID.
    As per my knowledge, Unique ID is our Object type for that User Define Table.
    I want to add Transaction Notification Code for created Used Define Table.
    This Transaction Notification prevents user to must enter name in that form.
    IF (@object_type = 'Z_Roto' AND (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U'))
    BEGIN
    If not Exists (Select T0.DocEntry from [@Z_ROTO] T0 Where ( T0.Name is null  OR  T0.Name = ' ' ) AND T0.Code  = @list_of_cols_val_tab_del )
    begin
    SET @error = 1
    SET @error_message = 'Name is NULL then So, Please enter ZERO Value i.e. 0 in Filed_Name'
    End
    End
    Please help me for this problem.
    Thanks & Regards,
    Nishit Makadia

    Hi All,
    Thanks for your replay.
    Below code is working for User Define Table's Transaction Notification
    IF (@transaction_type = 'A' OR @transaction_type = 'U') AND @object_type = 'Z_Roto'
    BEGIN
    If Exists (Select T0.Code from [@Z_ROTO] T0 Where ( T0.Name is null  OR  T0.Name = ' ' ) AND T0.Code  = @list_of_cols_val_tab_del)
    begin
    select @error = 10
    select @error_message = 'Name is NULL then So, Please enter ZERO Value i.e. 0 in Filed_Name'
    End
    End
    Necessary to Remember 4 Things. That are mentioned below.
    1) Register User Define Table (UDT) with using "Object Registration Wizard". For Example : @object_type = 'Z_Roto'
    2) When you define selection criteria then it must be compulsory for use Code Field. For Example : Select T0.Code from [@Z_Roto]
    3) When you define selection criteria then it must be compulsory for use Code for @list_of_cols_val_tab_del.
    4) Use error code as 10 Number
    Thanks & Regards,
    Nishit Makadia

  • Alphanumeric Document number for Sales order

    Dear Experts,
    I got a requirement, The sales order number after saving the document the SO document number should be SO ( Alphabetic) 00012074 (Numeric) ie. SO00012074,
    The numeric portion will come from the number range assigned for that document and Alphabatic portion should come depending on the transaction code and document type.
    in SAPMV45AFZZ  User-exit
    FORM USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN.
    This exit triggers before call function 'NUMBER_GET_NEXT'  that generates document number for the current document and return to the field vbak-vbeln and finally this is the document number, In the debug mode if I change the number for example 0000012074 to SO00012074 runtime I can get the expected number and also it is saved in the system. But in the real time it is not possible as this coding in not any user-exit.
    So I can't use this user-exit for the to get alphanumeric number in the document.
    FORM USEREXIT_SAVE_DOCUMENT
    This exit triggers after the generation of document number. In this user exit if we change the document number for example 0000012074 to SO00012074, it shows the expected number after saving the sales order but it is not actually saving in the database. Means if we try to open the same SO for example SO00012074 in va02/va03 it is showing
    SD document SO00012074 is not in the database or has been archived but if we try open 0000012074 in va02/va03, we can get the document.
    We can use this user-exit but if we change the value of vbak-vbeln in this user-exit finally it is not saving in the system.
    Can anybody help me how I can achieve the requirement ?

    bro...
    You have got an option to copy the program the standard program into zprogram....
    goto se38 and copy the program into a z program....and in doing so copy everything from the ctandard program ie vaients,documentation and function module etc.
    now change this z program to meet your need....
    both way if you dont make lot of changes you will get same performance with your work done
    regards

Maybe you are looking for

  • Problem while running a DDT

    Hi When i press the run button while mapping the tables I get the following errors. "Table has more than one role ignoring all the roles." Culd you please help me out in resolving this. Thanks & Regards, Suji

  • Using expdp/impdp to backup schemas to new tablespace

    Hello, I have tablespace A for schemas A1 and A2, and I wish back up these schemes to tablespace B using schema names B1 and B2 (so the contents of schemas A1 and A2 are copied into schemas B1 and B2, respectively, to use as backups in case something

  • **ERROR**: CCPMSG_InCall: ChannelID IE invalid 100(0x64) in SIP voice gateway

    Hi all, I am configuring a SIP voice gateway. After finsihing the config, the outbound calls are working properly. But I met some issue for inbound calls. There is no debug log for show ccsip message and show voice dialpeer command. Only q931 has the

  • No planning files for backflush components- MRP V1

    experts, no planning file is generated for the compoent with MRP type V1- material backflush with 261 mvmt. pls advice! here then to incluse this component to generate planning file what necessary setting needs to be done?

  • Does Adobe read these forums and comments?

    For many years I was a Windows OS user, and I used Photoshop Elements 2.  It was a little difficult to learn, but once I got the hang of it I thought it was great: simple, bright, easy and well organized.  A few months ago I made the switch to Apple