Friday, October 16, 2015

SAP - Crystal Report in SAP Business One SDK (.NET)


Hello folks. I'm wondering how you integrate your Crystal Report in your SAP Business One add-on? After of searching on how to do that, we've ended up to create our own style on how we can generate report in our add-on. To do that, you need to install first the Crystal Report, currently we are using Crystal Report 2008 SP3. Too old thou, but its still working. Also, we are using Visual Studio 2005 to create a form that we used in crystal report. I don't know why in Visual Studio 2013 don't have Crystal Report. So what we are doing is, add new form in Visual Studio 2005 and drag the Crystal Report Viewer and copy the .VB file and add it to Visual Studio 2013. After you done that tricks, you may proceed to source code.


  1. In your "SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED" event type and identify the "pval.ItemUID". For example "bt_Print".
  2. Example:
  3. In the "Your code here" you can call your VB.NET form that has the Crystal Report Viewer. 
    Example:
  4. In "_frmRPaymentSched.vb", you need to import all the necessary DLLs that need by Crystal Report.
  5. For "Form_Load".
    Example:
    • In the part of "cryRpt.Load(xPath & "\Rpt\App_Payment.rpt")" you need to define the path of the Crystal Report.
That's how we view the crystal report in our add-on. It is just a normal Visual Basic form.

Do you have your alternative solution? You might want to share that to us. :). Please leave comment below.

Monday, October 5, 2015

Creating and Registering add-on package SAP 9.1


Most of the SDK developer of SAP Business One are using 3rd party tool or Installshield to compile their add-on. But in the new version of SAP Business One 9.1, one the highlights for this version is the Enhanced lifecycle management for extension. This is the new light-weight approach for add-on deployment. The benefits of this update are:
  1. Simplified extension development and lifecycle management including add-ons and extreme apps.
  2. Remote control the extension lifecycle management easily without end-user interaction or system administration privilege.
    • Imagine, there's no more hustle in the end user part as they install and uninstall the add-on.
    • You don't need to call any support as the add-on failed to install in the end user part.
  3. Less time to compile the add-on less hustle to deploy the package.
To make sure that you that this things work is that:
  • Check your SLDModel.SLDData database.
    • The Identity Specification for Tasks and TaskProperties tables are set to 'No'
    • If the Identity Specification is set to 'Yes' then you should reinstall your SLD.
    Many user complain that they cannot import their add-on package in the System LandScape(SLD), the reason why is that their SLDModel.SLDData database is not updated. Their SLDModel.SLDData database came from SAP Business One 8.82 below. Though if you upgrade your SLDModel.SLDData database from SAP Business One 8.82 to SAP Business One 9.1 expect the same error as mine "Cannot reserve ID for invalid name 'TaskProperty'". To fix this error, you need to reinstall your SLD and use the SAP Business 9.1 installer.

    So lets get started.
    1. Make sure that the SAP Business One SDK is installed in your machine.
    2. Go to: "C:\Program Files (x86)\SAP\SAP Business One SDK\Tools\ExtensionPackage"
    3. Open "ExtensionPackage.exe"
    Walk through with the ExtensionPackage:


    Basic Information:
    • Extension Name is mandatory, this is your add-on name.
    • Extension Version: your add-on version
    • Extension Provider: you can input your company name
    • Extension Namespace: you can input your company name or your initials
    • Supported Database: choose platform where you deploy your add-on package
    • Contact Data: you can input your company name
    Extension File:
    • In the Open Exe file, browse your add-on exe file.
      • If  your client is using SAP Business One 32-bit then select the SBO 32-Bit Client add-on
      • If  your client is using SAP Business One 64-bit then select the SBO 64-Bit Client add-on
      • If your client is using SAP Business One for HANA then select the App for the version for SAP HANA
    • Select all the necessary files that you need in your package.
      • For example, if your add-on used .srf form.
    Deployment Steps:

    • Select all the necessary library files(DLLs) the you need in your package.
      • If  your client is using SAP Business One 32-bit then select the Register 32-Bit Microsoft COM DLLs
      • If  your client is using SAP Business One 64-bit then select the Register 64-Bit Microsoft COM DLLs
    • Common DLLs that need to include are:
      • Interop.SAPbobsCOM.dll
      • Interop.SAPbobsuiCOM.dll
    • If you created your own library kindly select it.
    SBO Compatibility:
    • Your package is compatible with SAP Business One
      • From - To
        • Example 9.0 to 9.1
    Parameters:
    • Honestly, I really don't know how to use this function.
    For the buttons:
    • Export - export your file as .ard file
    • Import - import your .ard file
    • Package - export your file as 1 file (zip) file
      • This package used in the Extension Manager of SLD. 
    If you are done with those simple steps, you may now proceed to import your add-on package to SAP Business One Extension Manager.

    To access the SAP Business One Extension Manager.
    1. Open your SAP Business One Service manager by double clicking it in your notification area.
    2. Select License Manager in Service drop down selection.
    3. Click Settings
    4. Configure Security
      • It will open your default browser. The link looks like: https://<server-name>:30010/ControlCenter/
    5. If you encounter a Certificate error, just click Continue.
    6. Login your SLD credentials. Default username: B1SiteUser
    7. If you are successfully login change the ControlCenter to ExtensionManager
    Importing your package:
    1. In the Extensions tab, kindly click Import button and browse your add-on package.
    2. After you successfully select your add-on package, click Upload.
      • If your received an error "Cannot reserve ID for invalid name 'TaskProperty'". Kindly scroll up this post.
    3. Click Next
    4. If you have parameters in your add-on package you may now put value 
    5. Click Next
    6. Then Finish
    7. Your package is now in the list.
    Company Assignment:

    You can now deploy your extension or add-on package in the specific Company database.
    1. In the Company Assignment tab, click the Company Database in the Company List that you want to assign the add-on package or extension.
    2. Click Assign button, the specify an extension or add-on package.
    3. Click Next
    4. Parameters, click Next
    5. Default Startup mode for each user.
      • You can select Default, Automatic, Manual, Disabled
    6. Click Next
    7. Then Finish
    8. Your package is now in the list for the specific Company Database.
    And you are done. :)

    Feel free to drop comments below. If you are using old school when creating and registering add-on 

    Thursday, October 1, 2015

    Block document(per line) using SBO_SP_TransactionNotification


    Most of our client are in production and service industry that require per document(lines) blocking. However, we've encounter some limitations in SAP Business One on how to block transaction using SBO_SP_TransactionNotification per line. Most of the solutions in scn.sap.com are in per document(header). So I decided to study and tweak the SBO_SP_TransactionNotificationSBO_SP_TransactionNotification is a stored procedure is to receive notification on any transaction - in other words to do some validation inSAP Business One and prevent the user from doing an action if the validation condition fails. This stored procedure(SP) is created automatically with each database.This stored procedure is fired whenever operations are performed on business objects like document or master records and User-Defined Objects. For more information about the SBO_SP_TransactionNotification or if you don't know how to use SBO_SP_TransactionNotification you may visit this post from scn.sap.com.

    Back to our concern, I'll show you on how to achieved that requirements. For example, I want to block all the documents that are in the Item Group of 118 and 120 and also the Customer that has 'CI-' in their code.



     IF (@object_type = '17' AND @transaction_type IN ('A', 'U'))  
          BEGIN   
               SELECT TOP 1 @LINENUM = b.linenum  
                    FROM ORDR a inner join RDR1 b on a.DocEntry = b.DocEntry  
                    INNER JOIN OITM c on b.itemcode = c.ItemCode  
                              WHERE b.DocEntry = @list_of_cols_val_tab_del and c.ItmsGrpCod in ('118','120') and a.CardCode not like 'CI-%'  
               If NOT @LineNum IS NULL  
                    Begin  
                         SET @error = -17  
                         SET @error_message = 'Please select a valid Item Group applicable to your Dealer!'  
                    End  
          END  
    

    That's it. You can now block any transactions per line in your document. If you have concerns, please comment below.

    Wednesday, September 30, 2015

    Creating and Registering Add-on on SAP B1


    I want to share you a simple tutorial, I noticed that some of our fellow SAP developer straggling on how they create a add-on installer.
    This video demonstrate you on how you create your add-on and deploy it to SAP B1.
    It takes 3mins of your time.

    Thing that you should have.
    1. Visual Studio
    2. You should already installed B1 AddonInstaller(B1DE)
    3. AddOnRegDataGen.exe



    If you have other questions, please don't hesitate to ask.

    If you want to use ExtensionManager, you read this post: Creating and Registering add-on package SAP 9.1

    Monday, September 1, 2014

    Confession of a SAP Consultant


    Consultant. Big word. The word web dictionary defines it as "someone who gives an advice" while meriam webster says "one who gives professional advice or services"

    Who would ever imagined that I'll become a consultant? It's like a perfume. It's an ego booster. It's pleasant to the ear. But what does really it takes to become a consultant?

    A SAP Consultant means you're waking up each day, convincing yourself that you need to wake up early because you will travel too far. It's like you're convincing yourself to be motivated and have a passionate heart as if it's your first day. EVERYDAY.

    Being a SAP consultant means you have to be patient. Clients keep asking same questions at the same time. You'll get irritated sometime. As if they are not thinking any possible way out. And All answers are on hands. Be Patient. MAKE IT YOUR CHARACTER.

    Being a SAP Consultant means you know the difference between white and black. When you have the darkest moment of being a consultant and nobody helps you, or nobody could help you, You should always look to the brighter side. There's always a brighter side. LOOK UP.

    Being a SAP Consultant means you can say no. If the clients are too demanding and when they're asking too much, and and you know too much is too much. JUST SAY NO.

    Being a SAP Consultant means to be personal. Drop the "Trabaho lang walang personalan" You should put your heart on what you do. Once you're heart is in it, you'll never run out of joy to do more. TAKE IT PERSONALLY.

    Being a SAP consultant means you are not MS-I-KNOW-EVERYTHING. Learning is always a continuous process for you. You learn from every people you meet, From your officemates, from the client, from the system. And even from the least person you meet along. BE HUMBLE.

    And lastly, Being a SAP Consultant doesn't mean "Its all about me" It's always about who deserves glory. It's about God who gives you a job. It's about him who gives an applause each time you uploaded a correct beginning balance when noone else did. It's about him who protects you not to be harmed when you're travelling alone. It's about him who celebrates when you closed a project. It's about him being who doesn't leave you afterall.

    Being a SAP Consultant means, to bring back all the glory onto the LORD



    This is a guest post from Mahj. Mahj is a SAP Consultant and the blogger behind http://pasthadpassed.com/

    Friday, August 29, 2014

    Sunday, March 30, 2014

    SAP - SAP Client upgrade take too long


    We encountered a problem when upgrading the SAP Client application in our server. I've spent almost 8hrs waiting to upgrade the SAP Client application. The actual picture below :


    I leave the server open for a day. But it surprise me that the upgrade process is still in upgrading process. I was worried that if I cancel or force stop this upgrade process, the SAP Client will corrupt. The last time we encounter the problem, we canceled the upgrade process and try to install again. But, when we installing it there's a missing file in the folder. So what we do is to re-install all the SAP related application in the server. I believed that was not necessary or advisable if you are in a production type of company.  There's a SAP note provided by SAP 1991617 - SAP Business One 9.0 client upgrade freezes.  Just log-in your S-user ID.

    Thursday, March 6, 2014

    SAP - Slow Login on SAP Client


    This is the most frustrating error that I've encounter when troubleshooting our SAP Business One server. Imagine, when you are logging in to SAP Business One Client it takes 5-10mins before you actually login. But if, if you are trying to login on the SAP Server you may not encounter the slowness. So, after compiling some solution I've decided to create my own. This is Tips and some kind of Tricks. :) Would you mind to try it if ever you encouter? So lets begin.


    Please check if their SAP Server is running on two NETWORK CARD.

    • Disable additional network cards in the Network Connections. Also, make sure there is no dial-up interface or VPN interface set up, and restart the server. Note that you can re-enable the additional network card after the restart. This will resolve the issue until the next restart.
    • Check if there is an additional IP address assigned for single network cards (Start-->Run-->cmd-->ipconfig). If there is more than one IP address displayed, ensure there is only one address assigned.
    • Install the license server on a machine with a single network card.
    Disable all network cards, restart the license server, and then enable the network cards again.
    • Restart license server.
    Disable the Firewall and the antivirus
    Change registry entry, and add the IP address of the License Server computer. 
    • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ACE\TAO
    • For example: -ORBEndPoint iiop://10.59.39.60:30000  -ORBDottedDecimalAddresses 1
    • Use the IP address instead of the computer name for the License Server address wherever License Server address is needed, such as SAP Business One client, DI API, B1i, and so on.
    Check SQL Server process in the Task Manager
    • If the SQL Server eating too much CPU usage between than 70-80% then you should adjust the memory consumptions in SQL Server settings. I remember this when we are on training for SQL Server Implementation and Maintenance.
    • Log on to SQL Server > right click the Server name > Properties > Memory
    • Change the Maximum server memory value, as you see the default value is set to 2147483647(mb) equivalent of 2097151(gb).
    • Change it to the total memory of the server then dived it by two, assumption 8192(mb)/2 = 4096(mb)
    • You can use this online tool for conversion (http://www.whatsabyte.com/P1/byteconverter.htm


    Wednesday, March 5, 2014

    SAP - Access Provider cannot be found. (DTW)


    Most of the time, the DTW(Data Transfer Workbench) save a lot of time when importing Transactions, Master Data in SAP Business One instead of typing it manually. But what if upon importing your data an error occurs? Error not from the file, but the application it self. I've encountered this error most of the time so basically I know how can I fixed it. I'm pretty sure you'll encounter this, in the last step of importing an error message will show 
    "Access Provider cannot be found. It may not be properly installed."


    The symptoms might be the installation of your Microsoft Office has a problem. To fixed this error, you may go to Microsoft website or visit this link Microsoft Access Database Engine 2010. I preferred to install the 32bit version of Microsoft Access Database Engine and 32bit version of DTW.

    Tuesday, March 4, 2014

    SAP - Unhanded Exception on Depreciation Run


    Recently our team encountered an "Unhanded Exception" in SAP Business One using Depreciation Run, after this message an error will appear again "Microsoft Visual C++ Runtime Library". We raised this issue to SAP Business One team and they recommend to upgrade our current version of the application. Unfortunately after we upgrade to the latest version, we still encounter this error.




    As we analyze the error, I've check the Log file of the application that indicate in the error description in SAP Business One client go to "Help > Support Desk > Log Settings" from there you can check the default path of the error. "C:\Users\YourUser\Local Settings\Application Data\SAP\SAP Business One\Log\BusinessOne\" as I read the error log, I've noticed that there is also a problem in the SBO_SP_TransactionNotification stored procedure. As previously discussed in SAP - Conversion failed when converting the nvarchar. So we decided to disable again the SBO_SP_TransactionNotification and after that, it work perfectly. Mostly this error occur when SBO_SP_TransactionNotification is blocking some transactions.