I faced a scenario where I had an ALV grid where all columns were made generic of type (let’s make it simple) CHAR255. Each column has its name in field catalog in format TABNAME-FIELDNAME (+ more human readable column header texts of course). What I needed to achieve was to make validation of data that user entered in the ALV cells. Since the cell validation is not available by default (because of type CHAR255) I had to make it dynamically.
In this article I’d like to share my solution Continue reading
Category Archives: Development
ABAP – create dynamic variable knowing reference tabname and fieldname
If you want to create a variable during runtime knowing only the reference table name and its field name (in string form), you can achieve it following the code presented in this article Continue reading
ABAP – ALV custom toolbar button + Import data from clip board
In this code example I’ll show how to add custom button to your ALV toolbar. This custom button will import data from clipboard into the ALV grid. This can solve issue with classic Ctrl+C and Ctrl+V where there’s a problem that new rows are NOT created in the ALV grid automatically – this will be solved by the extra toolbar button Continue reading
ABAP – ALV Context menu + keep row selection after a filter is applied
Standard functionality of an ALV grid offers row selection by clicking on the row headers. You can also use Ctrl or Shift keys to do mutliple row selection. Drawback of this is when you need to select some rows and apply some filters at the same time. Setting or deleting filter (or any operation which does grid refresh) clears the row selection. If you need to keep the row selection together with functionality of filter (and others), you can follow my little suggestion Continue reading
ABAP – List of all available icons
To display all available icons in SAP ABAP just enter TCode SE38 and execute either program SHOWICON or RSTXICON. In the output report you can see their image representation together with corresponding code interpretation Continue reading
Java – JSON serialization
In this article I’d like to present:
- Example of Object serialization into JSON string
- Deserialization of JSON string to the Object
Java – Map ResultSet to Object dynamically
Did you ever wanted to implement simple mapping of database tables to java objects (models) and you wanted to do the whole stuff dynamically? I managed to put some code together which does exactly what you wanted Continue reading
Java – Build model from an instance of ResultSet
If you want to display a JTable that displays data from a DataBase ResultSet you can do it manually using JTable that displays data converted from database table ResultSet into Object [ ][ ].
Another approach is to build the JTable model dynamically using the ResultSet meta data. In this article you can see an example of how this can be achieved. Continue reading
Java – How to store Array of pairs
In this article you can see a sample code I use to store simple Key-Value pairs in another objects, i.e. List or ArrayList Continue reading
SAP – Create new material status
X-Plant material status means that the material can be procured or blocked or not blocked, etc. After you create the status in customizing you can go into its configuration details and setup the the response for everything the material can be related to (Purchasing, BOM’s, Routing/recipe, etc.) using message type either error (type B) or warning (type A). Continue reading