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
Similar Messages
-
Remarks info from marketing document to journal
Hi All
I need a solution for displaying the remarks info from marketing documents in the journal entry.
Regards
BonganiHi,
To achieve this you have to use SP , You may try this:
-- FOR SALES A/R INVOICE JE
IF @object_type = '15' AND (@transaction_type = 'A' OR @transaction_type = 'U')
BEGIN
UPDATE OJDT
SET U_BD_Remarks = (SELECT Comments FROM ODLN WHERE DocEntry = @list_of_cols_val_tab_del)
WHERE TransID = (SELECT TransId FROM ODLN WHERE DocEntry = @list_of_cols_val_tab_del)
END
U_BD_Remarks, UDF in my case.
For every other document you have to change the code accordingly.
Thanks
Ashutosh T -
How to get Data from SAP B1 through Journal Entries objects (Excel VBA)
Hi Genius
i had try to login SAB B1 thorugh MS Excel VBA code and it worked well. but i need some questions regards getting the data from after login. that means i want the Posting date, Transaction No, account code, debit and credit amount from Journal entries posted in a particular day through MS excel VBA into excel sheets 1 cell A1:E1
how i get it if any possible ways to do that
here my code to login
Public Sub login()
Sheets("Login").Select 'access the login tab
Worksheets("Login").Range("B1").Activate 'put focus on cell B1 (manager)
B1UserID = Trim(ActiveCell.Value2) 'set Businsss One user
ActiveCell.Offset(1, 0).Activate
B1Password = Trim(ActiveCell.Value2) 'set Business One password
ActiveCell.Offset(1, 0).Activate
sqluser = Trim(ActiveCell.Value2) 'set SQL user
ActiveCell.Offset(1, 0).Activate
sqlpass = Trim(ActiveCell.Value2) 'set SQL password
ActiveCell.Offset(1, 0).Activate
Db = Trim(ActiveCell.Value2) 'set Database name
ActiveCell.Offset(1, 0).Activate
Server = Trim(ActiveCell.Value2) 'set Server name
Set company1 = New SAPbobsCOM.Company 'initialate DI company object
company1.DbServerType = dst_MSSQL2005
company1.Server = Server
company1.DbUserName = sqluser
company1.DbPassword = sqlpass
company1.CompanyDB = Db
company1.UserName = B1UserID
company1.Password = B1Password
'connect to the database
lRetCode = company1.Connect
If lRetCode <> 0 Then
sErrMsg = company1.GetLastErrorDescription
MsgBox (sErrMsg)
Else
MsgBox ("Connected to: " & company1.CompanyName)
End If
End Sub
pls help me
advance thanks to solversGordons way is the easiest - just query the OJDT table for journal entry headers and JDT1 for journal entry lines if needed.
But if you want to work with the business objects:
'Journal entry
Dim oJE As SAPbobsCOM.JournalEntries
Set oJE = company1.GetBusinessObject(oJournalEntries)
oJE.GetByKey(1234)
Dim postingDate as String
postingDate = oJE.DueDate
'etc etc -
How to update Ref fields in JDT1 for Journal Entries update
Hi Forum,
I am this situation:
While Creating Journal Entries using DTW:
==================================
I can create Ref1 and Ref2 data at JE Header level using OJDT DTW template.
I can not update Ref1 and Ref2 (different from Ref1 and Ref2 data at header level) at line level using JDT1 template. No error in DTW, all successful, however, the Ref1 and Ref2 data at line level is copied from header level.
While updating using JDT1 DTW Template:
===================================
I thought may be DTW can update since the entries are present. It does not even do that. That is DTW does not update Ref1 and Ref2 data on JDT1 line level even with update DTW. Just to ensure I am using right template etc. I tried to update the due date and it seems to work.
Note: While entering manual Journal Entires directly on SAP B1, I could put different Ref1 and Ref2 at header and line levels.
Thanks for you help.hi
u may use the follwing fields to do it
RecordKey LineNum AccountCode ContraAccount CostingCode Credit Debit DueDate LineMemo ShortName
RecordKey LineNum AccountCode ContraAccount CostingCode Credit Debit DueDate LineMemo ShortName
1 0 3274426 20110430 Basic 520010
1 1 1344031 20110430 Hra 520020
1 2 229251 20110430 Convey 520030
1 3 631301 20110430 Bonus 525020
1 4 2128839 20110430 Spl All 520040
1 5 44003 20110430 CCA/Outlocation 520050
Regards
Manish -
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 -
How to update Records from Internal table to u2018Zu2019 table?
Hi Friends,
How to update Records from Internal table to u2018Zu2019 table.
I have records in Internal table , that records want to update on u2018Zmarau2019 Table.
( my internal table & u2018 Zu2019 table structures are same.)
Thanking you.
Regards,
SubashHi,
loop at internal table.
modify <Z- table > from values < internal table Workarea>.
if sy-subrc = 0.
COMMIT work.
else.
ROLLBACK waork.
endif.
endloop.
or
UPDATE <Z- table > from table < internal table Workarea>.
if sy-subrc = 0.
COMMIT work.
else.
ROLLBACK waork.
endif.
Prabhudas -
HT1338 how to update software from 10.5 to 10.7?
how to update software from 10.5 to 10.7?
You need to buy a Mac OS X 10.6 DVD from the online Apple Store, and phone them and order a download code for Mac OS X 10.7. Mac OS X 10.7 requires a Mac with a Core 2 Duo(not Core Duo) or better CPU and at least 2GB of RAM.
(77981) -
How to do an incoming payment based on journal entry whit SDK ?
Hello
Somebody have the code for SDK of Business One, how to do an incoming payment based on journal entry?
TksHello Julio,
Here some example code from the SDK helpfile.
Private Sub cmdTest_Click()
On Error GoTo ErrorHandler
Dim vCompany As SAPbobsCOM.Company
'create company object
Set vCompany = New SAPbobsCOM.Company
'set paras for connection
vCompany.CompanyDB = "SBODemo_US"
vCompany.Password = "manager"
vCompany.UserName = "manager"
vCompany.Server = "(local)"
'connect to database server
If (0 <> vCompany.Connect()) Then
MsgBox "Failed to connect"
Exit Sub
End If
Dim nErr As Long
Dim errMsg As String
'Set the object's properties
Dim vPay As SAPbobsCOM.Payments
Set vPay = vCompany.GetBusinessObject(oIncomingPayments)
vPay.Address = "622-7"
vPay.ApplyVAT = 1
vPay.CardCode = "D10006"
vPay.CardName = "Card D10004"
vPay.CashAccount = "288000"
vPay.CashSum = 0
'vPay.CheckAccount = "280001"
vPay.ContactPersonCode = 1
vPay.DocCurrency = "Eur"
vPay.DocDate = Now
vPay.DocRate = 0
vPay.DocTypte = 0
vPay.HandWritten = 0
vPay.JournalRemarks = "Incoming - D10004"
vPay.LocalCurrency = tYES
vPay.Printed = 0
vPay.Reference1 = 8
vPay.Series = 0
vPay.SplitTransaction = 0
vPay.TaxDate = Now
vPay.TransferAccount = "10100"
vPay.TransferDate = Now
vPay.TransferSum = 0
vPay.Invoices.AppliedFC = 0
vPay.Invoices.AppliedSys = 0
vPay.Invoices.DocEntry = 8
vPay.Invoices.DocLine = 0
vPay.Invoices.DocRate = 0
vPay.Invoices.InvoiceType = 13
vPay.Invoices.LineNum = 0
vPay.Invoices.SumApplied = 5031.2
Call vPay.Invoices.Add
Call vPay.Invoices.SetCurentLine(1)
vPay.Invoices.AppliedFC = 0
vPay.Invoices.AppliedSys = 1089.65
vPay.Invoices.DocEntry = 11
vPay.Invoices.DocLine = 1
vPay.Invoices.DocRate = 0
vPay.Invoices.InvoiceType = it_Invoice
vPay.Invoices.LineNum = 1
vPay.Invoices.SumApplied = 1000
vPay.CreditCards.AdditionalPaymentSum = 0
vPay.CreditCards.CardValidUntil = CDate("10/31/2004")
vPay.CreditCards.CreditAcct = "295000"
vPay.CreditCards.CreditCard = 3
vPay.CreditCards.CreditCardNumber = "884848448"
vPay.CreditCards.CreditCur = "EUR"
vPay.CreditCards.CreditRate = 0
vPay.CreditCards.CreditSum = 5031.2
vPay.CreditCards.CreditType = 1
vPay.CreditCards.FirstPaymentDue = CDate("11/29/2002")
vPay.CreditCards.FirstPaymentSum = 5031.2
vPay.CreditCards.LineNum = 0
vPay.CreditCards.NumOfCreditPayments = 1
vPay.CreditCards.NumOfPayments = 1
vPay.CreditCards.OwnerIdNum = "3993939"
vPay.CreditCards.OwnerPhone = "383838888"
vPay.CreditCards.PaymentMethodCode = 1
Call vPay.CreditCards.Add
Call vPay.CreditCards.SetCurentLine(1)
vPay.CreditCards.AdditionalPaymentSum = 0
vPay.CreditCards.CardValidUntil = CDate("10/31/2004")
vPay.CreditCards.CreditAcct = "295000"
vPay.CreditCards.CreditCard = 3
vPay.CreditCards.CreditCardNumber = "884848448"
vPay.CreditCards.CreditCur = "EUR"
vPay.CreditCards.CreditRate = 0
vPay.CreditCards.CreditSum = 1000
vPay.CreditCards.CreditType = 1
vPay.CreditCards.FirstPaymentDue = CDate("11/29/2002")
vPay.CreditCards.FirstPaymentSum = 1000
vPay.CreditCards.LineNum = 1
vPay.CreditCards.NumOfCreditPayments = 1
vPay.CreditCards.NumOfPayments = 1
vPay.CreditCards.OwnerIdNum = "3993939"
vPay.CreditCards.OwnerPhone = "383838888"
vPay.CreditCards.PaymentMethodCode = 1
If (vPay.Add() <> 0) Then
MsgBox ("Failed to add a payment")
End If
'Check Error
Call vCompany.GetLastError(nErr, errMsg)
If (0 <> nErr) Then
MsgBox ("Found error:" + Str(nErr) + "," + errMsg)
Else
MsgBox ("Succeed in payment.add")
End If
'disconnect the company object, and release resource
Call vCompany.Disconnect
Set vCompany = Nothing
Exit Sub
ErrorHandler:
MsgBox ("Exception:" + Err.Description)
End Sub
HTH Regards Teun
Edited by: Teun Aben on Aug 4, 2010 9:00 PM -
How can I know if a manually created Journal Entries has not been paid yet?
Hi There.
I'm passing through the following situation: I need to find out which Journal Entries that have been manually created ( TransType = 30 ) don't have an Outgoing Payment record associated
Lets suppose that I manually created a Journal Entry. Let's call it OJDT_MAN
Then, I went to the Outgoing Payments Form ( Modules -> Banking -> Outgoing Payments -> Outgoing Payments ) and paid OJDT_MAN.
This process will create another Journal Entry. Let's call it OJDT_AUTO.
I can't find in the database anything that indicates that OJDT_MAN has already been paid. I tried looking for a Status field; Checking if OJDT_AUTO had some code that could get me to OJDT_MAN ( I found BaseRef and TransType = 46, that can guide me to the new OVPM record ); Tried looking at the new OVPM record for some field that could lead me to OJDT_MAN, but I had no success at all...
So, in resume, and again, how can I know if a manually created Journal Entry hasn't been paid?
(When I go to the Outgoing Payments Form and select a Business Partner, it B1 shows me only the not paid ones... How does he knows it? )Just to make it more clear, the SQL we were looking for is this:
Select
From
OJDT
Where
OJDT.TransId Not In ( Select VPM2.DocEntry From VPM2 Where VPM2.InvType = 30 )
And
OJDT.TransType = 30 -
How to add a petty cash payment in journal entry
HI, I was just wondering if anybody could help me with regards to making a petty cash payment, for example if i went to the shop for and spent £15.00 on stationary etc, how would i post this payment in the journal entry screen?
many thanks.Hello RWCS...welcome to the forums...
OK, first things first - the definition of petty cash. Petty cash is a function inside any company which allows employees to purchase products out of their own pocket and allows the Petty Cash Person to pay/reimburse for some item or services under a certain amount (say $25). Petty Cash is generally a sum of money maintained in the company in a box or drawer - that is what the accounts says - petty cash. The WHOLE purpose of petty cash is to avoid cutting a check for each and every minor purchase or payment - so there would be no payment created at all until it is time to replenish Petty Cash with more money.
So in essence, if you are using Petty Cash, there is no journal entry or SAP B1 payment for individual transactions until it is time to replenish. The Petty Cash Clerk (person having the box or drawer) would collect receipts as the money is being paid out.
At a certain point in time (usually at month-end or when the cash is low in the Petty Cash drawer), a journal entry is made Crediting Petty Cash and Debiting the various Expense Accounts by using the receipts collected.
Then an AP "Service Type" Invoice and an outgoing payment is made to the Petty Cash Person where the clerk goes to the bank and gets more money for the drawer. While creating the AP Invoice, the Petty Cash GL Account is selected on the line. That will create an automatic journal entry of credit to Operating Cash and debit to the Petty Cash.
If you are not doing this procedure, you do not have Petty Cash. So hopefully that describes what you are doing...
Regards - Zal -
Script to update UDF in document to journal entries
Hi,
Customer is using 2007A PL30. In SAP B1, there is only 2 global analysis codes(ie Project and Profit Center) but customer has more information to analyse. We add UDF in document row(eg UDF=Customer)but after adding such UDF did not automatically flow to journal entries.
May I know how to update those additional UDF in document row into journal entries as well so that the "Financial people" will be able to analyse company position by pulling these information in journal entries rather than from AR, AP, Incoming & outgoing payment etc?
Regards
ThomasThomas,
Out of the box the system is designed to take User field defined in the marketing document from the base marketing document to the target document when you use a Copy from or Copy to function.
This will not work for JE's as JE is not a marketing document. Updating JE through Transaction Notification might be possible but it is not supported by SAP as it is in violation of their Support agreement.
Leaving the choice finally to create a SDK solution
Suda -
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 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 -
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
Maybe you are looking for
-
How to change text + links in footer of existing template
Hello, I need to change the text and links on the template footer that goes to all TABs. (Home, Articles, About Bluemont, BCA, Contact Us).The file is named NavigationBlank.dwt." This footerwas created to link visitors to our "join or contribute" pag
-
Where are the iPhone backups stored?
I am completely reformatting my aging iMac in order to clean the years worth of stale data... However, although the applications can all be re-installed, I need to be sure I save all my iTunes info. I have saved off all of the folders contained withi
-
Add Device issue with Bluetooth!
Hi, Earlier, my laptop could not detect any Bluetooth device, however; reading a post on MS community on the subject, I uninstalled all the devices under Bluetooth as shown in the Device Manager. After restart my Bluetooth could detect my devices and
-
I just did this, and ran into a couple of minor things that perhaps could be clearer in docs. XP Pro SP3. First, the uninstall did not remove all files. I had shutdown the db before doing the uninstall, so I'm guessing the Microsoft DTC or something
-
Trouble with Preview not using embedded fonts in a PDF
I have a client I'm working with that is generating PDF reports for various organizations in various languages. They are using an Arial Unicode font but are using different encoding for some of the more unique languages. To ensure the report will be