1 1 1 1 1 Rating 0% (0 Votes)
Now we're ready to build the data for screen output, call the update screen and then move the data back from screen to reference data. We will use here:
  • COC1_FEATURE_CHECK to get characteristic ID
  • CTMS_DDB_INIT to initialize memory 
  • CTMS_CLASS_DDB to put in memory classification settings
  • CTMS_DDB_SET_VAL_FROM_OBJECT to set values in update screen from existing object (option)
  • CTMS_DDB_SET_VALUE_INTERNAL to set values in update screen in case of using reference data structure
  • CTMS_DDB_SET_VALUE_ONLINE to call the update screen
  • CTMS_DDB_HAS_VALUES_INTERNAL to check and get the values from the update screen after user action
  • zcl_abapblog_com_classific=>create_structure_for_class to create reference data structure
  • zcl_abapblog_com_classific=>move_screen_val_to_ref_data to move screen values to reference data
  • zcl_abapblog_com_classific=>clear_initial_line_api_vari to delete initial line for multiple values characteristics
  • zcl_abapblog_com_classific=>move_ref_data_to_screen_val to move reference data to update screen values table
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
In previous article I've shown how to move characteristics from reference data to screen values table, this method is doing opposite way from screen values table to reference data structure.
 
Importing:

IT_VALUES TYPE TT_API_VALI -> screen values table
I_ATNAM TYPE API_VALI-ATNAM -> Characteristic Name

Changing:

C_DATA TYPE REF TO DATA

Exceptions:

NO_DATA_TO_CHANGE

Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
Before we can call the screen with the characteristic value to change we need to convert data from our reference data structure to table of type TT_API_VALI. Following method shows how to do it.
 
Importing:

I_ATNAMTYPE API_VALI-ATNAM ->Characteristic Name
I_DATATYPE REF TO DATA-> our reference data

Changing:

CT_VALUES TYPE TT_API_VALI-> Structure for characteristic screen

Exceptions:

NO_DATA_TO_CHANGE

Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
We've got method to convert internal value to float, now it's time for next one which I didn't suppose it would be needed but when I was calling CTMS_DDB_SET_VALUE_ONLINE to show input screen with previously filled data by CTMS_DDB_SET_VALUE_INTERNAL then for multiple value characteristic I was always receiving one additional line to these which was passed by me in export parameters. The funny thing was that it wasn't the case when CTMS_DDB_SET_VAL_FROM_OBJECT was used. Of course this line was initial but the values were treated after as imputed by user. So as always I started to debug the code to see why it's happening. Finally I found that internal table WS in the function group CTMS was not refreshed during the call of CTMS_DDB_SET_VALUE_INTERNAL
As I couldn't refresh it in any call of FM from this function group I had to use old trick with assignment of data from program in memory. But firstly I check with FM CTMS_DDB_HAS_VALUES_INTERNAL if any values are already there.
 
Importing:

IT_API_CHAR TYPE TT_API_CHAR -> Table type for structure api_char_tab

Read more ...

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.
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% (3 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 ...
Page 3 of 5