Monday, January 18, 2010

How to hide unnecessary column in SAP B1

Yes, of course we can set by own what information that we want to show.
For example, when you on screen A/P Invoice, you want to hide discount column, coz currently your company not have discount rules.

Here are the steps:

  1. Make sure you already on A/P invoice Screen
  2. Right click On grid/table
  3. Popup Menu will show and click on form setting
  4. Click Table format and find discount title. After found, just delete mark in visible column
  5. Click OK then you will see discount column already hide.
To restore or show again, just follow the steps and make sure you already mark visibility of discount column.

Tuesday, January 12, 2010

How to Create A/P Invoice SAP B1 using SDK

What is an A/P Invoice?
A/P Invoice is abbreviations from Account Payable Invoice. Its account or the bill must be paid to vendor based on the goods we buy. Many vendor allowing to pay after product or service already been received.
To generate document A/P Invoice in SAP B1 is using oPurchaseInvoice object.
Here is the code:
Dim oAPInvoice As sapbobscom.Documents
Set oAPInvoice = oCompany.GetBusinessObject(sapbobscom.BoObjectTypes.oPurchaseInvoices)
With oAPInvoice
‘Header area
.CardCode = your vendor code
.NumAtCard = your reference no
.DocDate = your posting date
.TaxDate = your document date
.DocType = sapbobscom.BoDocumentTypes.dDocument_Items
.Comments = your remarks
‘Detail area
.Lines.SetCurrentLine (detail rows)
.Lines.itemCode = your item code
.Lines.WarehouseCode = your warehouse code
.Lines.Quantity = your qty
.Lines.VatGroup = "ZI"
.Lines.UnitPrice = F_Price
.Lines.LineTotal = F_Amount
LngErr = .Add()
If LngErr <> 0 Then
oCompany.GetLastError(LngErr, sErrMsg)
Msgbox SErrMsg
Else
MsgBox “Create A/P Invoice Data Success”
End with
Note: If your vendor use Tax amount, you can setup first on Business partner master - allowed tax

Monday, January 11, 2010

How to know a field name in SAP B1

SAP B1 developer absolutely must to know what a fieldname that used to insert data or used as parameter.
I will share this beginner function below.

Example, you active screen is Item Master Data and you want to know fields name of Purchase Item classification.
Below are the steps:

  1. Move your mouse to Menu Bar View and give mark on System information
  2. Bring your cursor on text “Purchase Item” and watch your bottom bar, you will see a description of that field, table name and field name
Result:
First row: Purchase Item [Yes/No]
Second row: Y[Form =xx Item =xx Pane =0 Variable = x OITM,prchseItem]

Explanation:
Table name: OITM
Field name: prchseItem

It is so easy and enjoys. J

Friday, January 8, 2010

How to Connect SAP with Visual Basic

SAP Business One able integrates with another software development such as Visual Basic 6 and .Net.
Now, I will share to you how to connect SAP B1 using visual basic.
First you must be installing SDK SAP B1, after that you must add SAP business one DI API version on Visual basic Reference.
Below is the source code.

Public oCompany as SAPbobsCOM.Company
Public lerr As Long, sErr As String
    Set oCompany = New SAPbobsCOM.Company
    With oCompany
        .Server = your SAP Server name
        .CompanyDB = your SAP Database name
        .UserName = your SAP user
        .Password = your SAP password
        .DbServerType = dst_MSSQL2005
        .language = ln_English
        .UseTrusted = False
        .DbUserName = your SQL database user name
        .DbPassword = your SQL database password name
   
    lerr = oCompany.Connect()
        If lerr <> 0 Then
            Call oCompany.GetLastError(lerr, sErr)
            MsgBox sErr           
        Else
            Msgbox “Connected to SAP B1”
        End If
       
    End With
Note: Make sure your user id and password set correctly. System will lock your user id if you input invalid login until 3 times

How to Manage Vendor Tax group in SAP B1

SAP Business One lets you to manage what kind of tax that wants you use. So you can add tax group based on your company needs and set to your vendors. Below I will share step by step to add tax group and attached to vendor.
Adding Tax Group
Go to Administration à Setup à Financial à Tax à Tax Groups
To add new tax group, write on table based on your company needs then click OK to Saved into database.
Table name of tax Group: OVTG
Setup Tax to Vendor
Go to Business Partner à Business Partner Master Data
Click on Accounting Tab à Tax Tab
Give mark on check box Subject to Withholding Tax
And to setup what kind tax that allowed for vendor just click button “…” next to wTax Code Allowed.
Listing tax group will appear and you just select tax group that allowed to selected vendor
Click OK to saved setup tax of vendor into database
Click Update to saved change Business partner master data into database
Table name of Business Partner: OCRD