1 1 1 1 1 Rating 0% (0 Votes)
Welcome back :-) 
Some time ago I presented how I get data from classifications to reference data variable ( or table). If you feel comfortable with my method then we can go further. I had a task to update some characteristic values from ALV grid, this would be not a problem at all if the characteristics would be defined from the begriming, but they weren't. In that case I couldn't just add needed fields to fieldcatalog and call FM to update characteristics when save button was pressed. I realized I need dynamic structure for ALV which will call standard screen for characteristic update. If this could be done then I could omit carrying about type of characteristics (date, number, char ) and if it is single o multiple type. So I started to dig in SAP, debug standard functions and I was finally able to prepare all needed functions.
 
So firstly what was needed (additionally to previously presented methods):
 
In this and following parts of this tutorial you'll see all mentioned methods and example of their usage. You can also find the code in attached NUGG file for easier import to your system.
Add a comment
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
Some years ago I was asked to create a report to check if in our Z-developments we are using authorization check or not. Of course not in all developments you need to have authorization check as sometimes standard SAP function modules provides proper checks inside them, but in many cases developer should take care about them inside the coding. The code I will provide below will scan program for AUTHORITY-CHECK statement and will collect the parameters of the call of AUTHORITY-CHECK. But one thing you have to have in mind, if developer used separate FM or class to check authorization then this report will not show any authorizations for program as it's looking only in the code of the program and not for the authorization-check inside called FM or classes.
 
Please look through the code or import to your system using nugg file.
Read more ...

5 1 1 1 1 1 Rating 100% (5 Votes)
During creation of selection screen or normal screen for your program you declare some fields and you want to use with them standard search help but with some modification like putting values to one of the search help parameters or making the SHLP parameter readonly then structure DDSHIFACE and FM F4IF_START_VALUE_REQUEST comes with a help. DDSHIFACE as you can see do not has much fields and for us the most interesting will be SHLPFIELD, VALFIELD, VALUE and DISPFIELD. In SHLPFIELD we will store the name of the SHLP parameter (names you can check in SE11), VALFIELD if filled will tell FM that value of this SHLP parameter should be returned to the user (value isn't important in our case so i'll put 'X' ). VALUE if filled set the value of SHLP parameter before showing the results of F4 call so we can directly restrict searched range with some data. Finally DISPFIELD if set makes the parameter on SHLP display only .
 
 
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
As I promised I will show how to use the methods we've prepared in previous parts of this tread. I will write simple program that calls the method get_objects_of_class and then loops through the results of it. But before I'll prepare program I need to have classification with some characteristics and an object to which I will add classification. So lets start with CL01 to create our test classification. I'll name it ECM_CLASS1, and I'll add one characteristic for each data type so NUM, CURR, CHAR, DATE and TIME.
 
 
Then I'll classify change number in CC02 for two change numbers available there (of course we can do it for how many objects we want) .
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
In previous article ( Classifications - Part 2 - Get Object Details ) I've created a method to get characteristics values for an object to our dynamic structure, in this part I will show how to use this method and FM CLAF_OBJECTS_OF_CLASS  to get the characteristics values for all of objects that are classified by given class. I will firstly read all assignments to the class, then I will loop through all returned objects and I will get all characteristics values to dynamic structure.
 
Importing:

i_class type klah-class -> class number
i_classtype type klah-klart -> class type
i_key_date type sy-datum  default sy-datum -> key date for classification

Exporting:

value( et_objects ) type standard table of clobjekte -> table of objects assigned to class
et_data type ref to data -> table with characteristics data for all objects assigned to class
e_tablestr type ref to cl_abap_tabledescr  -> table type structure
e_structure type ref to cl_abap_structdescr -> structure

Exceptions:

fetch_values_error
structure_error

Implementation:
Add a comment
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
 
In the first part I show how to create a structure on a base of class characteristics, now I will describe how to get the characteristics values for a object and how to fill the structure we've created in part 1. To get the characteristics values for an object I will use FM BAPI_OBJCL_GETDETAIL, then using field-symbols I will move the data from its result tables to our structure. I will use also cl_abap_typedescr to get the type of the field (needed for proper conversion) and FM KKEK_CONVERT_FLOAT_TO_CURR to convert currency values stored as float on database into currency fields.
 
Importing:

i_object type bapi1003_key-object -> key of object to be classified
i_class type klah-class -> class number
i_classtype type klah-klart -> class type
i_objecttable type bapi1003_key-objecttable optional -> name of database table for object
i_key_date type sy-datum  default sy-datum -> key date for classification
i_structure type ref to cl_abap_structdescr optional -> structure

Exporting:

et_objvaluesnum  type tt_bapi1003_alloc_values_num -> table with num characteristics
et_objvalueschar type tt_bapi1003_alloc_values_char -> table with char characteristics
et_objvaluescurr type tt_bapi1003_alloc_values_curr -> table with curr characteristics
e_data type ref to data -> filled structure for object with all characteristics

Exceptions:

fetch_values_error -> error while trying to receive object characteristics value
structure_error -> structure has wrong fields

Implementation:
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
Today I'll start to show you how you can prepare some methods to be able to read classification data without carrying each time about the kind of characteristics. If you follow my suggestions then you'll be able to use this methods each time you deal with classifications. In this part I will show you how to prepare a method to create a structure and table for classification data. I know that some of you can say we can create such structure manually with data or types statement directly in each of our development, but one day you'll see that sometimes it's easier to prepare a function or method which will do it for you so you can keep the logic in each of your program without doing maual work.
 
To create the structure of the class I will use FM BAPI_CLASS_READ  to read class data, then I will use FM BAPI_CHARACT_GETDETAIL to read the characteristics and in each step I'll be using classes cl_abap_elemdescr, cl_abap_structdescr and cl_abap_tabledescr to create the structure I need.
 
Import:

i_classtype klah-class-> class number
i_classtypetype klah-klart ->class type
i_key_datetype sy-datum  default sy-datum-> key date for class

Export:

e_structuretype ref to cl_abap_structdescr-> structure for our class
et_datatype ref to data -> table created on a base of class structure
e_tabletype ref to cl_abap_tabledescr-> table type for our class

Exceptions:

class_classtype_fetch_error
error_creating_table
characteristics_error

Implementation of method:
Read more ...

5 1 1 1 1 1 Rating 100% (8 Votes)
We know already how to use chart designer and we're able to save/read it's result to/from standard texts. So let's go for most interesting part - rendering the chart. Of course we will need some data but I will use dummy one just to show you how to create the chart, you can replace this part with loop on your internal table or even better change it in the way that you'll pass internal table.
In the method provided bellow I firstly create custom container object (cl_gui_custom_container) to place the chart in it, then I create chart engine (cl_gui_chart_engine), then using if_xml I create an xml data container which in fact can be written using simple concatenate statement but it's not nice to change and easy to mess.

So after we receive an xml with data then I will pass it to chart engine, then I will run the method prepared in previous part (Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 2 - Customization ) to read the customization of the chart and I will pass it also to engine. Finally I will render the chart.
Read more ...

ABAP Favorites Eclipse plugin

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client