Bài đăng

Hiển thị các bài đăng có nhãn IT

[Backend] Best practice working with HANA XS on Cloud Platform

Hình ảnh
Hi, I will share some best practice that took me hour to figure out what's solution. Perquisite: I follow the tutorial series here , so things are basically set up. 1/ Cannot add more column to table  After I completed all the tutorial series, I've got a XS service expose table data as OData service. And I can use the service to bind onto UI in SAPUI5 application. Then I come up with idea to add more data & relation so that I can do more with my application. That's when I got error: Even I add one column to my table, added data using SCV import. The 2 files are saved & activated successfully. But the data didn't returned in the Data service. When I check in the catalog of the service, it look like this (the new column "INSTOCK" does not have data): Issue with "INSTOCK" column I've thought that I cannot modify the structure of table during the database is up & running. So I tried to restart the database but it didn...

[sapui5] Best Practice in sapui5 development

Hình ảnh
Hi, Small Tips but no many knows: - Use this.getResouceBundle().getText(sKey, aParam) - Use BaseController (instead of creating a Util service). - Odata Model resetChanges() & submitChanges() ('TwoWay' binding required). Allow TAB to navigate within a table: Use property " keyboardMode " of ListBase . Set it to value " sap.m.ListKeyboardMode.Edit " and it would allow users to use TAB to move to the next cell in a table (the same behavior in MS Office table). API: https://sapui5.hana.ondemand.com/sdk/#/api/sap.m.ListBase/controlProperties https://sapui5.hana.ondemand.com/sdk/#/api/sap.m.ListKeyboardMode/overview References Advanced JS technique to shorten your code: Below hand-on with explanation will help you to shorten your frontend code a lot. Make the code more succinct, readable & easier to maintain. Functional Programming for your UI5 Apps Hands-On Worksheet Keep in mind the mindset: Think "everythin...

[tool] Tool tạo CV

https://novoresume.com Ưu điểm: - Lưu thông tin cơ bản dưới dạng form - Nhiều template kiểu mới. ---V---

[sapui5] aggregation binding - Use Control Visible instead removeItem or destroyItem

Hình ảnh
Hi, You may be working with binding items in table or list, we call it aggregation binding in common. You may encounter some case where you need to hide some item in the list. If it's the case, remember to look at my practice: User item's visibility instead of remove or destroy that item in the list. Because  remove  or  destroy will remove the item from the HTML document, but still leave the Id of the HTML object there. If you make some time to the table that changes the items, the table rebind and you will get id duplication error . On the other hands, if you just hide the item by using the visible property of ListBaseItem, the control is still there (only hidden). Which leads to no id error. ---V---

[sapui5] [git] Avoid using "Amend Change" in git pane of sap Web IDE

Hình ảnh
Hi, SAP Web IDE provide a "seem to be useful" function in the git pane: " Amend changes" . This function allows you to amend you current change to the latest  commit . It's quite useful if you make additional small changes after your last commit, which is in the same scope of the commit. However, that lead to a fatal error if you're working with a remote git repository (like Bitbucket, Github). It would create a conflict betweens commit, which will cause you lots of pain points. For example, you have 3 commits: A, B, C A: already pushed to the remote repository. B: you've just committed. (but not pushed yet) C: You've made small changes and " ammend changes"  to commit B, and changed the commit description. Then, you want to push all the changes (B & C) to the remote. Here's you will get the conflict. Because the commit B itself contains 2 commits with different description, the remote server cannot distinguis...

[sapui5] How to work around “multiple merge bases” error in EGit Eclipse plugin?

Hình ảnh
Hi, When I pull remote repository to my local branch in SAP Web Ide, I’ve got this problem with GIT: 3 : 13 : 49 PM ( git ) Pull request failed No merge base could be determined . Reason = CONFLICTS_DURING_MERGE_BASE_CALCULATION . "More than 200 merge bases for: a ac84124fd128aa579db65693b36be11b5d9a3575 b 1 b9e27eb78bed7f9ec40517fee32dfb0a5504ef7 found : count 2 " I’ve searched but found no solution, the only solution is mentioned  here. They suggest to update the git version to higher version, but it seems unable to do so in sap web IDE. The Web IDE also does not support git command line so there’s no solution to get over this bug. (my remote repository is bitbucket) Solution It's pretty weird, I'm not really sure. But to get over it, you can try: - cherry-pick from your latest commit in your local branch. - fix the conflict. - Commit to a new one (or append your latest commit). - Try to pull again (it should be successfully right a...

Download all data from table which contain many data

If table contains many data, you can not download all table data using Export object from SAP. You need to set the Size Limit of table to maximum: setSizeLimit ( iSizeLimit ) Cheers! ---V---

[sapui5] Freeze table - fixed columns on the left, or allow right columns scrollable only

Hình ảnh
Hi there, Sometimes you may get a requirement for the table that I mentioned in the title:  Freeze table,  or fixed columns on the left, or allow right columns scrollable only. This can be achieved easily by sap.ui.table Control from the ui5 library. Try this control in Explored . More details API ---V---

[sapui5] remember this function pair when you want to fire Select on some items of ListBase

Hi, Please remember 2 functions which always go in pair: setSelectedItem(oItem); fireSelect({key: sItemKey}); Example: oTabBar.setSelectedItem(oTabBar.getItems()[0]); oTabBar.fireSelect({key: oTabBar.getItems()[0].getId()}); If you're a newbie in sapui5 development, when you look up in the API, you may definitely think the only 1 function fireSlect() is enough to trigger the selectItem event of Listbase. However, that function does not all the thing we want. The fireSelect () do select the new items to the Listbase, but it not set the property ' selectedItem ' of that Listbase to correct Item. That's why we need to use setSelectedItem also to set the ' selectedItem' to correct value. Hope this helps you in your development. Cheer, ---V---

[sapui5] List binding remove application filter

Hi, I've search sapui5 API can find the function to remove all existing filter from sapui5 List Binding . Hence I need to find a workaround to reset the list binding (used in resetting search field). We have no function yet, so we need to empty the filter array by manual assignment: oListBinding.aApplicationFilters = []; oListBinding.sFilterParams = undefined; oListBinding.refresh(); We have some more method to empty an array, you can find here . p/s: Update on 02 Nov, 2017: to remove the filters, you just need to pass an empty array to the function: oListBinding.filter([]); This worked in SAPUI5 1.44 ---V---

[sapui5] Cannot get control by control Id? See this post

Hello guys, You maybe sometime frustrated when getting ID of controls of the sapui5 framework, I got the same problem too, when I was starting to work with sapui5. The root cause that I found the most is forgetting declaring ID for the fragment. Because as sapui5 guideline mentioned, unlike View, Fragment's ID  is not generated automatically by the framework. You have to do it by yourself when you initiate the fragment. If you forgot to do this, you won't be able to get the fragment (or controls inside it) using sap.ui.Core.byId() later. Remember to use this line of code when initiate fragment: sap.ui.core.Fragment ( sFragmentId ,  sId ) But if you use other function, be aware of the order: sap.ui.xmlfragment ( sId,  sFragmentId ,  , oController ) Example: this.oDialog = sap.ui.xmlfragment( "createProcessDialog","com.HQ.app.test..fragment.CreateProcessDialog", this); More details can be found here: https://sapui5.hana.ondemand.com/sdk/#doc...

Tips & Best Pratice in Software Development

Testing in development: - We should add a comment above the code block where used as testing some instruction like: // Testing purpose: ... - Later, when we have done developing the project. We can use 'Search' function in the whole project to search the "testing purpose" instruction, then remove it if necessary. - This tips should be applied at the beginning of every project. ---V---

How to save your code in online noting tool

Hình ảnh
Hi guys, As a developer, you may have wondered how to save your code for later reference. There's some solution out there, but I would like to share my method that seems to be effective & convenient in this CLOUD era. 1. Copy your code. 2. Save on  https://repl.it/  (create your account first) 3. Copy the link generated. 4. Paste the link in Online Onenote. Onenote will generate the panel to contain the code (retrive from rep.it) 5. Enjoy. (You know what, you can have live demo with the panel in Onenote - amazing). At the present, the function generate panel/snippet from the link is only available for Onenote only. But I'm pretty sure that they will bring it to Onenote soon. Other noting tools like Evernote, Google keep... have the same function as well. ---V---

[sapui5] You should know about neo-app.json

Hình ảnh
This file is a configuration file in sapui5 project, which should be KNOWN by every developer. On function I used (actually it take me lots of time to figure it our) is the 'path' attribute of neo-app, which is some kind of shortcut to destination: For example: This neo-app.json has defined that "/app_safety_app" is the shortcut for destination name "app_safety_app" (this one is defined in your HcP or 'destination' in local web IDE). With this definition, you can make HTTPRequest (or ajax call) to external service without worrying about violating cross-domain policy (discussion about it can be found here ). Hence, it your code, you don't need to write the full URL, just pick this short URL with the shortcut in the beginning: Cheer! ---V---

Implement Search field with case-INSENSITIVE by SAP UI5

Hello guys, Continue to read if you're sapui5 developer, or you work closely with UI development. At the time I write this post, SAP UI5 and Odata does not support filter with case sensitivity. Odata provide some filter parameter that help you to filter with case-INSENSITIVe. However, you hardly modify the URI of ODATA service in your font end SAP UI5 code. Most of us use API provided from SAP , we only provide the parameter to API function, then let the API from SAPUI5 library handle the ODATA service URL. In short, I mean we cannot, or hardly, modifying the odata GET request as we want, but use the standard API instead. Return to the main topic, we need to write a function to filter the ODATA get request so that we get the returned data filtered as the way we want (filter with case-INSENSITIVE). For example: you type " test " in the search field, then you should get the results with all the entries containing "test", or "Test", or "TES...

Xbox One X có thể trở thành một cái máy tính và hơn thế nữa

Hình ảnh
Xbox One X đã ra mắt, so với những thông tin do chính Microsoft rò rỉ trước đó thì không có nhiều điểm là chúng ta ngạc nhiên . Nhưng điểm thú vị ở đây đó là  Xbox One X  giờ đang có vị trí cực kì thuận lợi, kết hợp với thời điểm tốt và một tầm nhìn tốt để trở thành một chiếc máy tính làm được gần như mọi việc, từ chơi game, điều khiển nhà thông minh cho đến đầu setup box để giải trí hay tiến xa hơn là thay luôn cho cái máy tính bình thường. Sự hội tụ của  Windows 10 Xbox One  X chạy một hệ điều hành Xbox OS riêng, nhưng nền tảng này lại được xây dựng trên Windows 10 nên sẽ không khó để nó có thể làm được những thứ mà một chiếc máy tính có thể làm. Con CPU của sản phẩm lại sử dụng cùng nhân x86 nhưng được tùy biến lại cho phù hợp với nhu cầu hiệu năng cao. Vậy thì Xbox One X giờ đâu có khác gì so với một cái máy tính của bạn, à có khác là có mạnh hơn và giá chỉ 500$ mà thôi. Nếu một ngày nào đó  Microsoft  cho phép Xbox chạy app desktop đầy đủ thì chắc là ...

Setup customized destination for local SAP Web IDE

Follow instruction in: https://www.sap.com/documents/2015/08/484b6d95-5b7c-0010-82c7-eda71af511fa.html# i'm wondering if because of Bosch's firewall has blocked the connection of local web IDE to the external ODATA service like Northwind. Will try when I back home. ---V---

Be careful to pick the right region for your SAP HANA Cloud

Hình ảnh
I've lost the whole morning to figure out why all of my joined domain get disappeared in SAP HANA cloud platform. SAP appy  pretty well the new Fiori UX to their end user, but it is not done very well with the SAP HANA Cloud cockpit. It make me confused and don't know what is the reason for my problem. OK, here the story: I login my account to continue my working pending from yesterday, but I can't found my working folder with my team like yesterday, which should be like this: Instead, I got the default log in screen like this: At first, I think SAP HcP mis-understand with my trial account. (I have 2 account: partner account to dev app and trial account for my discovery). Hence, I tried to log in again many times. But not working. Then I delete all history & cookies of history, log in again but not work. I have to restart my computer, but nothing work... Having no clues, I read about user type of SAP HcP. Then and see this key word: Region Sudden...

How to Find and Replace Words in Multiple Files

Hình ảnh
What do you do if you have to replace a single word in dozens, or even hundreds or thousands, of text files? You keep calm and download  Notepad++  or  Replace Text . These two utilities will do the job in seconds. It’s a dilemma common among developers and programmers. Imagine you’re managing a project with hundreds or thousands of files. When a product name that appears on almost every page changes, you can hardly go through each page to manually search and change the name. No, you’re smarter than that. You fire up Google, you find this article, and you learn about a solution that only takes seconds. How to Edit Multiple Files in Bulk You can either use Notepad++ or a dedicated tool called Replace Text to  bulk-edit  your files. Notepad++ First, allow Notepad++ to find the word in all the files you need to edit. Open Notepad++ and go to  Search > Find in Files…  or press  CTRL+SHIFT+F . This opes the Find in Files menu. Under...

Beware to use comparison and logic operator (< > =) in string in SAPUI5 control’s string

Hình ảnh
Hi there, Today I got a strange issue, which is simple, but take me a lots of time to figure out why. I used control sap.m.select, and put the text into its property like below: My page crashed because of "XML parse error"... I've found out that the character "<=" in the string of additionalText property has caused the problem. But i'm not sure what is the reason. Maybe the "<=" has special meaning in sapui5 control string. I will look up for the reason and update later. In the mean time, I've modified the string into text form so that the error can be fixed: I hope you got answer if you encounter the same issue. Anyone the root reason behind this error, please let us know. Thanks & have a nice day. Victor. ---V---