Batch Nos and UDFs in Marketing Documents.

Dear Experts,
I am adding some documents like Purchase Invoice, Sales INv..etc, in SAP B1 using DI,  Now the problem is I am adding some Batch information like Batch Nos, Batch Quantity etc. Now in the same table OBTN, I want to fill up some values in the UDF. How do i do this as  oPurchaseInvoice.Lines.BatchNumbers.UserFields.Fields.Item("U_lsp").Value is not possible.
Thanks in advance,
Vasu Natari.

Vasu,
Unfortunatelly the UserFields collection of BacthNumbers is not implemented in  DI API.
You may try:
1. Create a Purchase invoice over SAP B1 GU using bacthes.
2. Enter Defining bacthes screen and fill one the UDFs
3. Issue the Purchase invoice
4. save the last issued Purchase Invoice as xml via DI API,using GetAsXml method
5. Analyze the XML File, and check how the UFD-s are handled in xml
You will see the following in the bacthes area
if you prepare your Puchase Invoice as XML File, and load it from xml, you can manage the User Defined Fields in Batches.
Regards
János

Similar Messages

  • How to update UDF from marketing documents to Journal Entry UDF

    Hi Experts,
    I have a UDF in the marketing documents and I want to save the value to Journal Entry UDF.
    Regards,
    Jummie

    Hello Jummie,
    If I understand correctly, the scenario is that copy the value of UDF from marketing document to the UDF its target JE from when the marketing document is created.
    if so, just listen to FormDataAdd Event for the marketing document, copy the value of udf when document is created.
    Here is the sample code.
    Private Sub FormDataEventHandler( _
        ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, _
        ByRef BubbleEvent As Boolean) Handles oApp.FormDataEvent
            'You may add the target documents, 133 - A/R invoice.
            'Before action = true, start the transation
            If BusinessObjectInfo.FormTypeEx = "133" _
                    And BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD _
                    And BusinessObjectInfo.BeforeAction = True Then
                oCompany.StartTransaction()
                'BubbleEvent = False
            End If
            'Before Action = false,
            'Update product item tree
            'Succeed, commit, otherwise rollback
            If BusinessObjectInfo.FormTypeEx = "133" _
            And (BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD) Then
                If BusinessObjectInfo.BeforeAction = False And BusinessObjectInfo.ActionSuccess Then
                    Dim objectKey As String = String.Empty
                    oCompany.GetNewObjectCode(objectKey)
                    MsgBox(BusinessObjectInfo.Type)
                    Dim oInvoice As SAPbobsCOM.Documents = Nothing
                    oInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
                    If oInvoice.GetByKey(CInt(objectKey)) Then
                        'Retrieve the UDF value in documents
                        Dim udfValueInDoc As String = oInvoice.UserFields.Fields.Item("***").Value
                        Dim oJE As SAPbobsCOM.JournalEntries = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
                        'Retrieve the JE for the document
                        oJE.GetByKey(CInt(oInvoice.JournalMemo))
                        Dim succeeded = True
                        'add you code to copy the UDF from document into JE
                        If succeeded Then
                            'update the production tree succesfully,
                            oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
                        Else
                            oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                        End If
                    End If
                End If
            End If
        End Sub
    Regards, Yatsea

  • Need SP_TN for specific user must use specific document series and warehouse in Marketing Documents

    Hi experts,
       I need SP_TN for specific user must use specific document series and warehouses in Marketing Documents SAP B1.
       Kindly give solution ASAP.
    Thanks in advance

    Hi Nagarajan,
       It show (1) Not allowed to add PO.
       I used the following SP
    IF  @object_type = '22' AND @transaction_type IN (N'A',N'U')
    BEGIN
    IF Exists
    (SELECT T0.DocEntry FROM POR1 T0 INNER JOIN OPOR T1 ON T0.DocEntry = T1.DocEntry
    WHERE  T1.DocType = 'I' AND T1.Series = '142' OR T1.Series = '145' AND T0.[WhsCode] = 'STEX-01'
    or T0.[WhsCode] = 'STNEX-01' and T1.[UserSign] ='1'
    and T1.docentry = @list_of_cols_val_tab_del)
    BEGIN
    SELECT @error = 1
    SELECT @error_message = 'Not allowed to add PO'
    END
    END
    warm regards,
    Guhan

  • UDF In Marketing Document At Title Level - Display/Activate

    Can you display an UDF in a Marketing Document and if so how do you make it visible and active?  I see how to do this for the rows but not the title.

    Go to menu - View - User Field.  Or simply CtrlShiftU.
    It will be visible and active by default unless you manually uncheck the boxes under setting.
    Thanks,
    Gordon

  • Hi all visible false udf in marketing document

    hi all,
    i want to visible false udf in the marketing document.but field not show in the forms object.
    how is possible.

    thanks to replr but i haven't got udf in the active form event.
    If pVal.FormType = "142" Then 'Purchase Order Form
                    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD And BubbleEvent = True And FLAG = False Then
                                       oFormAPOrder = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
                            'Form = SBO_Application.Forms.ActiveForm
                            Dim oItem As SAPbouiCOM.Item
                            oItem = oForm.Items.Item("U_UIN")
                            oItem.Visible = False
    end if
    end if
    i read in forum that u have to catch form with -142 then u get the udf of the form.
    but i tried my problem not solved.
    Regards
    Rajkumar

  • Using UDF in Marketing documents

    Dear All,
    I made two UDF in Marketing docs rows and the same rows in Accounting - Journal transaction rows
    The goal is: Every time when the user creates a marketing docs, I'd like to insert the corresponding data to accounting. What should I do for this? Could this be automatically somehow? Is it a simple way to capture all of the events which modifies the journal entries?

    well,
    i would do it so:
    use et_VALIDATE and/or et_LOST_FOCUS in the matrix and make one procedure for all documents.
    to be sure the code only works for your documents filter it like
    if (pval.FormType = 139 or pval.Formtype = 133 or ...) then
    anyway, it will be very tricky, because you will get troubles when more documents are opened
    regards
    David

  • Limiting Authorization of one of many UDF in marketing documents

    Hi
    I have created a Additional Authorization Creator for limiting the user from changing the values of  UDF Field and its working fine,  but the issue is i need to block only one UDF which i have created.
    For Eg.
    There are some 5 UDF (Header Level UDF) in a marketing document, namely
    UDF 1 - Transport Name
    UDF 2 - Transport Type
    UDF 3 - Vehicle Number
    UDF 4 - Driver Number
    UDF 5 - Driver Name
    I need to block only the UDF 5 from changing and the other UDF's can be changed.
    The Additional Authorization Creator which i created block's me from changing all the five UDF Values instead of only that UDF 5 .
    What could be reason?  Should i need to give any  Form Number like what i give  63771 which is for Form Settings?

    Hi
    you can open the document , open the user defined field
    go to tools---customization tools ---settings
    you will see the list of UDF you can just select which UDF you want to update
    you can mark 4 UDF as active and the 5-th UDF as not active but visible
    shachar

  • UDF in marketing documents

    Hi Experts,
    The UDFs and FMS which are working fine in A/R INV, not working in Sales ORder (Whenever trying to attach FMS, it shows internal error occurred)

    Hi,
    Most FMS if structured correctly should work across all marketing documents as the table structures are the same.
    The FMS's will not work however, if you are including table names in the queries, e.g. $\[ORDR.CardCode\] instead of $\[$-4.CardCode\] or $\[RDR1.ItemCode.0\] instead of $\[$38.1.0\]
    If you are unsure how to replace the table names with the form references, simply change the table names in your query, save it with a different name and apply that query to the different screen.
    There are some instances where using the table name is necessary, for example if you need to pick up header level UDFs $\[ORDR.U_UDF\].
    If you are a SAP partner or customer, there is a useful e-learning session in the education section that will help you.
    Post your query here if you have further problems.
    Regards,
    Adrian

  • UDFs in Marketting Documents

    Hi,
    When I add an UDF in the Marketting Documents -> Row/Title it appears in all the marketting related documents.
    How can I add it only for say AR Invoice.
    I tried defining Category for the user defined fields. But then I will have to do it for all the documents one by one seperately as this category definitions are not available when I go to the next document type.
    How shall I handle this ?
    Thanx in advance.
    With Regards,
    Ram.

    Hi Ram,
    The UDF is correctly designed to apply to apply to all marketing documents in the event that say you start using the field in a sales quotation the informations will automatically carry forward to the sales orders, an automatically created purchase order and A/R Invoice etc.
    For your issue you simply need to adjust the form settings in all documents where you will not be using the field.
    It's a little work but just the way it is!
    Jake

  • Image UDF on Marketing Documents for Signature

    Hi,
    I'm using SAP B1 2007A (PL48) with B1DE 1.4
    SCENARIO:
    For certain Marketing Document Forms (AR Invoice, Sales Order etc) , I need to capture a physical signature via an ePad and save the resulting jpeg with the Marketing Document.
    I've created a UDF on the Marketing Documents Title of type Image.
    I've added a button to the form (for example AR Invoice) which lets the user capture a signature and saves it to a file.
    QUESTION:
    How can I programatically load the saved jpg file to the Image UDF?
    Please advise.

    Hi Ben,
    Unfortunately, because you are doing this on a system form it isn't easy. The PictureBox control is what you need to set the picture but I gave it a quick test and although I can create an instance of the PictureBox control and set it to an image UDF field, any value I set to the Picture property is not saved to the UDF.
    An alternative approach:
    1) Create a separate UDT. In this table you'll need columns for DocType and DocEntry (so you can link a record back to a marketing document) and an Image UDF.
    2) Create a simple form that just has a PictureBox control on it. Bind the control to the image UDF on your table.
    3) Add a button (in the form load event) to each of the marketing documents that need a signature.
    4) Trap the event of the user clicking on the button in the marketing document form and open your new form. Use conditions in the DBDataSource to show the correct signature image.
    To import the scanned image you'll need to do the following:
    1) Copy the image file to the Pictures folder (as set in the General Settings path tab).
    2) Add an entry to the UDT for the correct document type and entry. For the image UDF you should set just the image file name and not the full path.
    Hope that all makes sense!
    Kind Regards,
    Owen

  • Prevent marketing document entry if BP has past due invoices

    Does anyone know a way to prevent users from entering a marketing document if the BP has past due invoices? Only solution I can come up with is to create code in the Transactions Notifications stored procedure. But is there a way to do this in B1?
    Thanks

    Hello Friend,
    May be SP_Notification is the best option but think about your user will fill all the invoice data including with batch info and UDF info now he will goto add then SAP show error that Customer have open balance ,means users have spend about 5 min every day for invoice.
    SAP has  another option make FMS(Formatted search) and set in A/P invoice(CardName field or Name field) ,from where user will select customer list.FMS logic depend on party balace
    And train user accordingly so now whenever user will select FMS option it will show only those customer who have no balance.
    One more think some time our management say dispatch the materails i have discussed for balance then user select tab option in the same field.
    Or if you are using SP then first you goto SQL then Alter the Procedure.
    So I think FMS is the best option.
    Thanks
    Manvendra Singh Niranjan

  • Marketing Documents through B1if

    We are implemented a integration between Business One and other sys and need send Marketing Documents to B1.
    To DI API and DI Server, the XML Schema these objects its kind:
    <BOM>
      <BO>
         <AdmInfo>
           <Object>13</Object>
           <Version>2</Version>
          </AdmInfo>
          <Document
    In B1if we have problems to conclude tests. The XML Schema to Mark. Documents are the same?
    I receive a error message {"ResultCode":"-1", "ErrorMsg":""}
    Some one can help?

    Hi Gordon,
    Thanks for the answer.
    Sorry for delay in reply, I was out of the office.
    This is my Sale Invoice XML. But the error persist. I'm in B1 8.81 PL10.
    The general schema is ok? My doubt is only it.
    Because this is the exactly same xml that I use in my add-on aplication to import external invoices from the POS system.
    <BOM>
         <BO>
              <AdmInfo>
                   <Object>13</Object>
                   <Version>2</Version>
              </AdmInfo>
              <Documents>
                   <row>
                        <DocNum/>
                        <DocType>dDocument_Items</DocType>
                        <HandWritten>tNO</HandWritten>
                        <DocDate>20120113</DocDate>
                        <DocDueDate>20120113</DocDueDate>
                        <CardCode>C999</CardCode>
                        <DocCurrency>R$</DocCurrency>
                        <DocTotal>3.66</DocTotal>
                        <Reference1/>
                        <Comments/>
                        <JournalMemo>Cupom fiscal PDV - B1if - C999 - 484</JournalMemo>
                        <PaymentGroupCode>-1</PaymentGroupCode>
                        <DocTime>0903</DocTime>
                        <ContactPersonCode/>
                        <Series/>
                        <TaxDate>20120113</TaxDate>
                        <DocObjectCode>13</DocObjectCode>
                        <Indicator/>
                        <SequenceCode>-2</SequenceCode>
                        <SubSeriesString/>
                        <SequenceSerial>485</SequenceSerial>
                        <SequenceModel>24</SequenceModel>
                        <DiscountPercent>0</DiscountPercent>
                        <POSCashierNumber>1</POSCashierNumber>
                        <POSEquipmentNumber>EPSON TM T81 FBII</POSEquipmentNumber>
                        <POSManufacturerSerialNumber>EP081010000000003717</POSManufacturerSerialNumber>
                   </row>
              </Documents>
              <Document_Lines>
                   <row>
                        <LineNum>1</LineNum>
                        <ItemCode>A005</ItemCode>
                        <Quantity>1</Quantity>
                        <ShipDate/>
                        <LineTotal>1.76</LineTotal>
                        <Currency>R$</Currency>
                        <Usage>5</Usage>
                   </row>
              </Document_Lines>
         </BO>
    </BOM>

  • Print BP Address udf's on Marketing Documents

    We have created two udf's with the Business Partner Bill and Ship To Address's (crd1).
    We need to print these on marketing documents with the rest of the address. The udf's don't carry over from the BP to
    the marketing document when it is created and I can't seem to get to them through the tables in pld. I have the OCRD table available in pld, but not the CRD1.
    Does anyone have any thoughts? Can this be done?
    Thank You

    hi,
    Create database field,Press Alt Key + mouse,Select Table name CRD1 -Business Partners - Addresses,
    Select column type - user defined field,Align field to top with address.
    Jeyakanthan

  • Marketing Document Header Level UDF - Table Holding the Categories

    Hi All,
    I need the name of the table where categories of udf at header level of marketing document is stored.
    I cheked the table CPRF but it does not show the category code in which the udf will be displayed in the form,
    please help,
    Thanx in advance,,,,

    Hi
    If you need category codes and descriptions, they are stored in the CUDC.
    Thanks,
    Gordon

  • How to apply group settings of UDF and UserDefinedValues to all documents ?

    I have made many User Defined Fields, category group settings of UDF, and User Defined Values (Formatted search) in a marketing document.
    And I want to apply them to all of the marketing documents, that is Sales and Purchase documents,,, all the same.
    Is there any way to achieve it?
    Thanks in advance...

    Thanks,,
    This thread it not about setting for different users but for different type of documents.
    And is there any way to configure the category settings of UDF for document types by SDK coding?
    Edited by: Sung-Su Beck on Nov 29, 2011 7:27 AM

Maybe you are looking for