#Création de range à partir de table interne # FUNCTION zcreate_range. *"---------------------------------------------------------------------- *"*"Interface locale : *" IMPORTING *" REFERENCE(I_FIELDNAME) TYPE CHAR30 *" TABLES *" IT_TABLE *" ET_RANGE *"---------------------------------------------------------------------- ************************************************************************ * Description : A module function capable of building a range from * * any table !!! * ************************************************************************ FIELD-SYMBOLS : <ls_value> TYPE any, <fieldname> TYPE any, <ls_range> TYPE any, <lit_range> TYPE STANDARD TABLE, <ls_table> TYPE any. ASSIGN i_fieldname TO <fieldname>. ASSIGN et_range[] TO <lit_range>[]. ASSIGN et_range TO <ls_range>. LOOP AT it_table ASSIGNING <ls_table>. ASSIGN COMPONENT <fieldname> OF STRUCTURE <ls_table> TO <ls_value>. <ls_range>(3) = 'IEQ'. <ls_range>+3 = <ls_value>. APPEND <ls_range> TO <lit_range>. ENDLOOP. SORT <lit_range>. DELETE ADJACENT DUPLICATES FROM <lit_range>. ENDFUNCTION.