Another approach to get the number of records stored in a table in HANA DB

Still used the old way SELECT COUNT(*) to get total number of records stored in a table? If you are using HANA database, there is another approach to achieve the same. In HANA there is a metadata table m_tables which stores the related information: You can find its definition in SAP help. You can use the following ABAP code to access this HANA table from ABAP server: class CL_CRM_HOME_TABLE_SIZE_TOOL definition public final create public . public section. TYPES: BEGIN OF ty_size, table_name TYPE char256, record_count TYPE int4, table_size TYPE int4, END OF ty_size. TYPES: tt_size TYPE TABLE OF ty_size with key table_name. class-methods GET_SIZE importing !IT_INPUT type STRING_TABLE returning value(RT_RESULT) type tt_size . protected section. private section. ENDCLASS. CLASS CL_CRM_HOME_TABLE_SIZE_TOOL IMPLEMENTATION. METHOD get_size. DATA(lv_in) = REDUCE string( INIT x TYPE string FOR IN it_input NEXT x = SWITCH #( x WHEN space THEN |’{ }’| ELSE x && ’,’ && |’{ }’| ) ). TRY. DATA(lo_sql_con) = cl_sql_connection=>get_connection( ). DATA(lo_stmt) = lo_sql_con->create_statement( ). DATA: lv_stmt TYPE string. lv_stmt = |select table_name, record_count, table_size from m_tables where table_name in ({ lv_in })|. DATA(lo_res) = lo_stmt->execute_query( lv_stmt ). GET REFERENCE OF rt_result INTO DATA(lr_data). lo_res->set_param_table( lr_data ). lo_res->next_package( ). lo_res->close( ). CATCH cx_sql_exception INTO DATA(cx_root). WRITE:/ ‘Error:’, cx_root->get_text( ). RETURN. ENDTRY. ENDMETHOD. ENDCLASS.

Consumer report: REPORT zsize. DATA: lt_input TYPE String_table. lt_input = VALUE #( ( CONV string( ‘TADIR’ ) ) ( CONV string( ‘TFDIR’ ) ) ). DATA(lt_size) = cl_crm_home_table_size_tool=>get_size( lt_input ). cl_demo_output=>display_data( lt_size ).

Result: http://bit.ly/2DDjrbq #SAP #SAPCloud #AI

Run Your Online Business Anywhere in the World Using a VPN

Do you know how many people are building eCommerce businesses at the moment? It’s never been easier and cheaper to start from the ground up. Some entrepreneurs decide to mix it with travel. They want to build a company while traveling around the world.

Obviously you’ll be more successful if you stay in the same place, but the lure of exotic locations is overwhelming. If you decide to go down this route you’ll need to use a VPN. Let’s take a look at some of the top reasons why it’s essential.

1. Running a Business in Places Like China

I’m sure you’ve heard it’s almost impossible to use the internet in places like China without running into problems. They’ll sensor anything they don’t like, which will leave you handicapped.

There is a large choice of free VPN providers you can sign up with right now. You’ll immediately be able to access sites that are currently blocked. Make sure it’s switched on when you’re surfing.

2. Nobody Can Try to Destroy Your Business

When you’re building a business while traveling the world, you’ll spend lots of time in nice coffee shops. They’re one of best places to find a Wi-Fi connection when you need access to the internet.

Unfortunately, the connections are definitely not secure. You don’t want to touch your business in case a hacker manages to gain access to it. If you’re connected through a paid VPN you won’t have anything to worry about.

3. It’s Much Easier to Carry out Research

It’s hard to guess what kind of research you’ll need to carry out without knowing your business. Let’s just assume you’ll need to watch a few free documentaries to gather data for a future article.

In most cases, you won’t be able to access the documentaries if you’re using a foreign IP address. The website will know you’ve left your home country. A VPN can fool them into thinking you’re at home.

4. Your Valuable Data Won’t Be Stored Away

When you’re using the internet most ISPs will store your data. Although it’s not necessarily a terrible thing, you don’t want anyone to have access to your business. You never know when an employee will go rogue.

If you use a VPN you won’t have to worry about them holding the key to your business in their hands. Some companies actually do store your data, but you can avoid it by signing up with those that don’t.

5. Companies Know About Security Threats

Millions of internet users trust VPNs for a very good reason. It’s not just because they say they’re secure on their homepage. A VPN company wouldn’t last 5 minutes if it wasn’t safe to use.

It’s why they’ll know everything there is to know about the latest security threats. They will stay on top of them to keep your mind at ease. Trying to build a business while worrying about new threats will fry your brain.

6. You’ll Save Money in the Long Term

If you want to sign up to a reputable VPN provider with fast speeds you’ll need to pay them money. Let’s call it the cost of doing business. If you can’t afford to invest in your company you should give up right now.

Thankfully, you’ll find amazing deals that won’t break the bank. If someone hacked into your business it could cost you tens of thousands, so you’ll end up saving lots of money in the long term.

Don’t Run Your Business Abroad Without One

You shouldn’t try to run your business abroad without a VPN. It’s not worth risking your livelihood for a few dollars per month. Once you become more successful you won’t even notice it leaving your account. http://bit.ly/2DBUZqH #SAP #SAPCloud #AI

When a REST Resource Should Get Its Own Address

Background

Author’s note

In a purist REST approach, all endpoints (except the starting endpoint) are opaque and their various details shouldn’t need to be published. Even if this approach is being used, the points in this article are relevant as Server logic will have to determine when something requires an endpoint or not. https://goo.gl/nkRyKD #DataIntegration #ML