Sunday, July 23, 2023

2315907 - Starting HANA automatically after Host has been started

 

Symptom

By default the SAP HANA database is configured so that it is not started automatically when the SAP HANA host is rebooted.



Environment

SAP HANA Platform

Resolution

If required, you can change this configuration by modifying the profile of the SAP HANA database as follows:

  1. Log on to the SAP HANA host as a user with root authorization.
  2. Change to the system profile directory /usr/sap/<SID>/SYS/profile.
  3. Edit the profile <SID>_HDB<instance number>_<host name>.
  4. Change the parameter setting Autostart = 0 to Autostart = 1 .
  5. Save the profile <SID>_HDB<instance number>_<host name>.

Tuesday, June 13, 2023

Samba Service Commands

Enable and start Samba service to save the changes:
# sudo systemctl enable smb
# sudo systemctl enable nmb
# sudo systemctl start smb
# sudo systemctl start nmb

To check the status of the Samba services:
# sudo systemctl status smb
# sudo systemctl status nmb

To stop the Samba services:
# sudo systemctl stop smb
# sudo systemctl stop nmb

To restart the Samba services:
# sudo systemctl restart smb
# sudo systemctl restart nmb

Wednesday, May 3, 2023

[SUSE Linux Pre- Setup before HANA Installation]

 

Since I always find it hard to gather the “right” packages for a fresh install of SLES for SAP Business One, here is a summary of repositories and associated packages required.

The following information was gathered from installing using the “SLE-15-SP3-Full-x86_64-QU2-Media1.iso”, however, the same should apply when installing from the “GM” release, or the newest “QU3” release. Packages were validated against the SAP Business One Administrator’s Guide, version for SAP HANA corresponding to FP2202 (the latest as of now).

During installation (or after), enable the following repositories, so that you can install the packages they provide:

  • Basesystem-Module 15.3-0
    • bc (not documented, but required)
    • glibc-i18ndata
    • insserv-compat (not documented, but required)
    • libcap-progs
    • libssh2-1
    • nfs-kernel-server
    • python
    • samba
    • samba-client
    • zip
  • Legacy-Module 15.3-0
    • libicu60_2
  • Python2-Module 15.3-0
    • python2-pyOpenSSL
  • SLEWE15-SP3 15.3-0 (SUSE Linux Enterprise Workstation Extension 15)
    • python-gtk
  • Development-Tools-Module 15.3-0
    • rpm-build
  • Server-Applications-Module 15.3-0
    • xmlstarlet

If the required repositories are enabled, you should be able to install all the prerequisites with the following one-liner:

zypper in -y bc glibc-i18ndata insserv-compat libcap-progs libssh2-1 nfs-kernel-server python samba samba-client zip libicu60_2 python2-pyOpenSSL python-gtk rpm-build xmlstarlet

If you do need to enable the required repositories after the installation, and have an active subscription or trial code, here are the commands to do so. Note that the Workstation Extension requires a separate registration code. Instead of activating the repositories online, you can use the “Full” media and enable these repositories during installation or from yast2.

SUSEConnect -p sle-module-basesystem/15.3/x86_64
SUSEConnect -p sle-module-legacy/15.3/x86_64
SUSEConnect -p sle-module-python2/15.3/x86_64
SUSEConnect -p sle-we/15.3/x86_64 -r <registration-code>
SUSEConnect -p sle-module-development-tools/15.3/x86_64
SUSEConnect -p sle-module-server-applications/15.3/x86_64

If you plan to only install SAP HANA (2.0 SP05 SPS 056) on the same machine, the prerequisites are much more simple:

  • Basesystem-Module 15.3-0
    • libatomic1
    • insserv-compat
zypper in -y libatomic1 insserv-compat


Tuesday, February 7, 2023

Prevent error activating calculated view in new schemas: user is not authorized (2950)

 

Scenario: you want to create a Calculation View and once you execute receive error .


Repository: Encountered an error in repository runtime extension;Model inconsistency. Create Scenario failed: The following errors occurred: user is not Authorize (2950)



Solution :


Run the below command for each Schema.


GRANT SELECT ON SCHEMA "SBOCONENERGY_TEST" TO _SYS_REPO WITH GRANT OPTION;

Tuesday, December 27, 2022

Extract Chart of Account COA Query

 

Select  AccountCode,AccountName,Title  from (

   Select OACT.AcctCode as AccountCode, OACT.AcctName as AccountName,OACT.GroupMask,OACT.GrpLine,OACT.Postable as Title

   from OACT

   Where OACT.Postable='Y'


   UNION ALL


   Select OACT.AcctCode as AccountCode, OACT.AcctName as AccountName,OACT.GroupMask,OACT.GrpLine,OACT.Postable as Title

   from OACT

   Where OACT.Postable='N'

   ) as T


   ORDER BY T.GroupMask,T.GrpLine


Sunday, December 4, 2022

[Part 1-3] Single Sign on Connection

Properties current SAP Connection command line argument: 0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056 


using System;

using System.Collections.Generic;

using System.Linq;

using System.Threading.Tasks;

using System.Windows.Forms;

using SAPbobsCOM;


namespace MySAPB1WinFormApp

{


  



    static class Program

    {

        /// <summary>

        /// The main entry point for the application.

        /// </summary>

        /// 


        public static SAPbouiCOM.Application oApplication = null;

        public static SAPbobsCOM.Company oCompany = null;

        [STAThread]

        static void Main()

        {

            if(IsSAPConnected()==true)

            {


            }

        }



        public static bool IsSAPConnected()

        {

            try

            {

                int oErrorValue = -1;

                string oErrorMessage = string.Empty;



                //***Step:1

                //***** in this step we getting the Application 

                SAPbouiCOM.SboGuiApi oSboGuiApi = new SAPbouiCOM.SboGuiApi();

                string[] strCon = Environment.GetCommandLineArgs();

                oSboGuiApi.Connect(strCon[1]);

                oApplication = oSboGuiApi.GetApplication(-1);

                //**************************************************



                oApplication.StatusBar.SetText("SampleFormAddon is Connection", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success);



                //*** Step 2

                // in this step company object generates the cookie for the current session  with the help of  method  GetContextcookie()


                oCompany = new SAPbobsCOM.Company();

                string oCookies =(string) oCompany.GetContextCookie();


                //**********************************************************


                //*** Step 3

                //****** in this step  GetConnectionContext(oCookies) method of the application object encrypt the connection string with the help of Cookies provided by the DI API


                string constr = oApplication.Company.GetConnectionContext(oCookies);


                //*************************************


                if (oCompany.Connected == true)

                    oCompany.Disconnect();


                //***Step4

                //*** in this step  setsbologincontext(constr) method of company object deciphers the encrypted  connection information and sets the connection parameter to the company object


                oCompany.SetSboLoginContext(constr);

                //**************************************************



                ///**Step 5

                ///*** in this step with the help of connect() method we establish connection with the company


                oErrorValue = oCompany.Connect();


                if (oErrorValue == 0)

                {

                    oApplication.MessageBox("Single Sign on  connection established", 1, "Alert", "", "");

                    return true;

                }


                else

                    oCompany.GetLastError(out oErrorValue, out oErrorMessage);

                    oApplication.MessageBox("ErrorCode" + oErrorValue + "ErroMessage" + oErrorMessage.ToString(), 1, "Error", "", "");

                    return false;


            }

            catch (Exception ex)

            {


                throw new Exception(ex.ToString());

            }

        }

    }

}

Crystal Report Formula Convert Amount into Words

 numbervar x := {OINV.DocTotal};


numbervar ipart;


numberVar decpart;


ipart := int(x);


decpart := x - ipart;


Propercase(Replace(towords(ipart)," and xx / 100",""))& " Ringgit" &


if decpart = 0 then "" else " and "&Propercase(Replace(towords(decpart*100)," and xx / 100","")) &" sen";

2315907 - Starting HANA automatically after Host has been started

  Symptom By default the SAP HANA database is configured so that it is not started automatically when the SAP HANA host is rebooted. Environ...