Tuesday, August 4, 2020

UiPath loop Excel and key in SAP

A lot of SAP documents are posted as Header and Line (e.g. VA01 for Sales Order, ME21N for Purchase Order). Below is a generic template to load data from Excel to SAP documents. 

Preparation:
(A) Excel file with 1 worksheet as Header and 1 worksheet as Line
    (a) For "Header" worksheet: The first column "No" is important to link to the "Line" worksheet.
    (b) For "Line" worksheet. 



(B) Declare variable in UiPath

(C) Sequence
    1: start by "Read Range" to read Header and Line workehet. Then "Call Transaction" VA01. Store the header worksheet into dtHeader and line worksheet into dtLine. 

(2) Loop through the Header for variable "RowHeader". The "RowCounter" is very important to identify the row number in Line Grid in SAP program like VA01. Use the "Filter Wizard" to filter the dtLine datatable to the current dtHeader "No"


Filter Wizard: Output to another datatable dtLine_Filtered


(3) Loop through the dtLine_Filtered datatable, then perform whatever "type in" activity. Finally, remember to increase the RowCounter. 


Next time will have a guide on using this template to fill up ME21N (Purchase Order)


Financial freedom with purely CPF

Theory: If you can get $2,000 per month to cover all your expenses from age 55, you need $2,000 x 12 = $24,000 per year. If based on CPF interest of 4%, you need a capital of $24,000 / 4% = $600k. In other words, if you can have $600k in your CPF retirement account, you can be financial freedom purely based on CPF. i.e. you don't need to work anymore because you have a basic income to cover your monthly expense.

Catch:
(1) Your expense cannot be more than the interest you get of $24,000. Otherwise you have to build a bigger capital
(2) Inflation 
(3) Medical or accident. That's why health and insurance are super important. 

If the theory above is correct, the direction is easier: how to get $600k in your CPF when you reach 55? If you don't have any CPF at age 30 (quite unlikely), you need to have salary of $5,619 when you age 30. 

Another way of thinking, if you can tighten your monthly expense to $1,000 per month. You can achieve the same financial freedom for capital of $300k. 



CPF $600k workbackward

Sunday, July 26, 2020

Uipath Auto SAP login and access Tcode


The following is the step by step guide how to use UiPath to auto run SAP GUI, login in and run Tcode VA01.


Open UiPath, create a "Sequence". Drag the "SAP Logon" (under UI Automation -> SAP) to the Sequence"




Copy the connection description to "Connection Name"



Drag and drop "Get Secure Credential" step before the SAP Login



Type in the "Windows Credential" Name. Under User ID, press "Control+K" to create variable, name as "SAP_UID".  Under Password, press "Control+K" to create variable, name as "SAP_Pass"



Drag and drop "SAP Login"




Click on "Indicate on screen", then click on "SAP GUI" screen




1: Client : in your client ID (in my case is 100)
2: Username: press "Ctrl + Space" then choose variable "SAP_UID"
3: Choose "Secure"
4: Password: press "Ctrl + Space" then choose variable "SAP_Pass"
5: Language: "EN" for english



Note: this setting reflect the option for multiple login in SAP GUI





Click "Indicate on screen", then click SAP GUI




Drag "Call Transaction" to the design panel




1: Input the Transaction Code "VA01"
2: Click to open Option Menu
3: Choose "Edit Selector"



1: Un-check "title"
2: Click "Validate"
3: Click "OK"




Finally, press run. This will auto run SAP GUI, login in and run Tcode VA01


This is originated from UiPath Academy, SAP Automation. I strongly encourage you to sign up for UiPath Academy to know more detail.

Saturday, July 18, 2020

Loan Calculator : calculate monthly repayment and total interest to pay


Want to know how much you need to pay every month if you take up a loan? How much interest you need too pay in total for the whole loan period? You can use this loan calculator

Loan Calculator v1