Tutorial by Examples: c

This example portrays the most simple ALV creation using the cl_salv_table class and no additional formatting options. Additional formatting options would be included after the TRY ENDTRY block and before the alv->display( ) method call. All subsequent examples using the ABAP Objects approach to...
This example shows how to optimize the column width so that column headings and data are not chopped off. alv->get_columns( )->set_optimize( ).
This example hides the MANDT (client) field from the ALV. Note that the parameter passed to get_column( ) must be capitalized in order for this to work. alv->get_columns( )->get_column( 'MANDT' )->set_visible( if_salv_c_bool_sap=>false ).
The column text may change upon the horizontal resizing of a column. There are three methods to accomplish this: Method NameMaximum Length of Headingset_short_text10set_medium_text20set_long_text40 The following example shows usage of all three. A column object is declared and instantiated as a re...
The following method call enables usage of many advanced features such as sorting, filtering, and exporting data. alv->get_functions( )->set_all( ).
Suppose you have a parentView into which you want to insert a new subView programmatically (eg. when you want to insert an UIImageView into a UIViewController's view), than you can do it as below. Objective-C [parentView addSubview:subView]; Swift parentView.addSubview(subView) You can also...
CSS .bordered { border-image: linear-gradient(to right, red 20%, green 20%, green 40%, blue 40%, blue 60%, maroon 60%, maroon 80%, chocolate 80%); /* gradient with required colors */ border-image-slice: 1; } HTML <div class='bordered'>Border on all sides</div> The above ex...
FOR JSON PATH enables you to control format of the output JSON using column aliases: SELECT top 3 object_id as id, name as [data.name], type as [data.type] FROM sys.objects FOR JSON PATH Column alias will be used as a key name. Dot-separated column aliases (data.name and data.type) will be gen...
WITHOUT_ARRAY_WRAPPER option enables you to generate a single object instead of the array. Use this option if you know that you will return single row/object: SELECT top 3 object_id, name, type, principal_id FROM sys.objects WHERE object_id = 3 FOR JSON PATH, WITHOUT_ARRAY_WRAPPER Single obje...
FOR JSON clause ignores NULL values in cells. If you want to generate "key": null pairs for cells that contain NULL values, add INCLUDE_NULL_VALUES option in the query: SELECT top 3 object_id, name, type, principal_id FROM sys.objects FOR JSON PATH, INCLUDE_NULL_VALUES NULL values in...
Wraps returned JSON array in additional root object with specified key: SELECT top 3 object_id, name, type FROM sys.objects FOR JSON PATH, ROOT('data') Result of the query would be array of JSON objects inside the wrapper object: { "data":[ {"object_id":3,&qu...
If you need some complex JSON structure that cannot be created using FOR JSON PATH or FOR JSON AUTO, you can customize your JSON output by putting FOR JSON sub-queries as column expressions: SELECT top 5 o.object_id, o.name, (SELECT column_id, c.name FROM sys.columns c WHERE o...
Select all columns from some table (system table in this case): SELECT * FROM sys.objects Or, select just some specific columns: SELECT object_id, name, type, create_date FROM sys.objects
WHERE clause filters only those rows that satisfy some condition: SELECT * FROM sys.objects WHERE type = 'IT'
HAVING clause removes groups that do not satisfy condition: SELECT type, count(*) as c FROM sys.objects GROUP BY type HAVING count(*) < 10 typecSQ3PK1U5
OFFSET FETCH clause is more advanced version of TOP. It enables you to skip N1 rows and take next N2 rows: SELECT * FROM sys.objects ORDER BY object_id OFFSET 50 ROWS FETCH NEXT 10 ROWS ONLY You can use OFFSET without fetch to just skip first 50 rows: SELECT * FROM sys.objects ORDER BY obj...
SELECT statement can be executed without FROM clause: declare @var int = 17; SELECT @var as c1, @var + 2 as c2, 'third' as c3 In this case, one row with values/results of expressions are returned.
C11 This was a new storage specifier introduced in C11 along with multi-threading. This isn't available in earlier C standards. Denotes thread storage duration. A variable declared with _Thread_local storage specifier denotes that the object is local to that thread and its lifetime is the entire e...
This example shows a helper class that contains methods useful, when executing the queries for data. Every method here uses Java Generic's in order to be very flexible. public <T> List<T> selectElements(AbstractDao<T, ?> dao) { if (dao == null) { return null; } ...
@Singleton @Component(modules = AppModule.class) public interface AppComponent { void inject(App app); Context provideContext(); Gson provideGson(); MainActivityComponent mainActivityComponent(ActivityModule activityModule); } @ActivityScope @Subcomponent(modules = Act...

Page 394 of 826