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