Author Archive fjourneau

Constants for message types

Instead of declaring constants in reports to manage message types, save time and use attributes of interface IF_XO_CONST_MESSAGE  :


IF_XO_CONST_MESSAGE=>ABORT     " TYPE BAPI_MTYPE  'A'
IF_XO_CONST_MESSAGE=>ERROR     " TYPE BAPI_MTYPE  'E'
IF_XO_CONST_MESSAGE=>EXIT      " TYPE BAPI_MTYPE  'X'
IF_XO_CONST_MESSAGE=>INFO      " TYPE BAPI_MTYPE  'I'
IF_XO_CONST_MESSAGE=>SUCCESS   " TYPE BAPI_MTYPE  'S'
IF_XO_CONST_MESSAGE=>WARNING   " TYPE BAPI_MTYPE  'W'

Constants for range management

Instead of declaring constants in reports to manage ranges, save time and use attributes of interface IF_FSBP_CONST_RANGE :


IF_FSBP_CONST_RANGE=>OPTION_BETWEEN.              " Type DDOPTION    'BT'
IF_FSBP_CONST_RANGE=>OPTION_CONTAINS_PATTERN.     " Type DDOPTION    'CP'
IF_FSBP_CONST_RANGE=>OPTION_EQUAL.                " Type DDOPTION    'EQ'
IF_FSBP_CONST_RANGE=>OPTION_GREATER.              " Type DDOPTION    'GT'
IF_FSBP_CONST_RANGE=>OPTION_GREATER_EQUAL.        " Type DDOPTION    'GE'
IF_FSBP_CONST_RANGE=>OPTION_LESS.                 " Type DDOPTION    'LT'
IF_FSBP_CONST_RANGE=>OPTION_LESS_EQUAL.           " Type DDOPTION    'LE'
IF_FSBP_CONST_RANGE=>OPTION_NOT_BETWEEN.          " Type DDOPTION    'NB'
IF_FSBP_CONST_RANGE=>OPTION_NOT_CONTAINS_PATTERN. " Type DDOPTION    'NP'
IF_FSBP_CONST_RANGE=>OPTION_NOT_EQUAL.            " Type DDOPTION    'NE'
IF_FSBP_CONST_RANGE=>SIGN_EXCLUDE.                " Type DDSIGN      'E'
IF_FSBP_CONST_RANGE=>SIGN_INCLUDE.                " Type DDSIGN      'I'

Quicky manage SLG1 messages in ABAP

This post provides methods or macro for logging SLG1 message.
It is shortcuts for calling standard methods :
– BAL_LOG_CREATE
– BAL_LOG_MSG_ADD
– BAL_DB_SAVE

Read More

Template for ABAP local ALV event class

Local ALV event class template (to be completed with missing events) :

Read More

Clear Adobe form cache

If you work with adobe form translations, you will see that translations are not effective immediately. It is because of cache.

To clear the cache, launch program : FP_PDF_TEST_26 .

Search tag : refresh, buffer, pdf

Adobe form: set field color dynamically with javascript

To specify with javascript the color for a text field in adobe form, use the code below.


// data.MAIN.SUBFORM.FIELD_TO_CHANGE_COLOR::initialize - (JavaScript, client)
this.font.fill.color.value = "255,0,0"; // Color Red in RGB Color

The color has to be specified in 🔗 RGB format.

Read More

Reverse sorting of an internal table

Use method CL_RS_DATA=>SWITCH_ORDER( ) :


CALL METHOD cl_rs_data=>switch_order( CHANGING c_t_data = lt_my_table ).

Check if BADI is implemented

Transaction SE18, enter your BADI name and go to
Enhancement Implementation –> Overview :

Generate a random number in ABAP

Use class CL_ABAP_RANDOM_INT to generate a random integer number :


DATA(lv_random_num) = cl_abap_random_int=>create( seed = cl_abap_random=>seed( )
                                                  min  = 1
                                                  max  = 100 )->get_next( ).
* lv_random_num will be type i

Read More

DELKZ : Code list of MRP elements

Most used :
ValueDesignation ENDesignation FR
AR Dependent reservationRéservation dépendante
FE Production orderOrdre de fabrication
PP Planned independent requirementBesoins indépendants Prévisionnel (BIP)
QM Inspection lot for quality management Lot de contrôle QM
SA Simulation orderOrdre de simulation
SM Sim. dependent reqmtsBesoin dépendant de simulation
WB Plant stockStock division
All values :
Read More