J-Ground

J-Ground

导航

Convert char to numbers, the number must be declare as P

 

           CALL FUNCTION 'MOVE_CHAR_TO_NUM'

             EXPORTING

               chr = i_lagp-lgpla+5(2)

             IMPORTING

               num = int_tmp

             EXCEPTIONS

               convt_no_number = 1

               convt_overflow = 2

             OTHERS = 3.

            IF sy-subrc <> 0.

              int_tmp = 0.

            endif.

 

Get the absolute value

     int_tmp = abs( int_tmp - int_tmp2 ).

 

Append internal table.

        result-r_lgtyp = i_lagp-lgtyp.

        result-r_lgnum = i_lagp-lgnum.

        result-r_lgpla = i_lagp-lgpla.

        result-r_lptyp = i_lagp-lptyp.

        result-r_index = int_index.

 

 

        append result to i_result.

 

Sort internal table   SORT  i_result DESCENDING BY r_index ASCENDING.

 

Read table by index

int_index = 1.

DO 9 TIMES.

  READ TABLE i_result index int_index.

  IF sy-subrc = 0.

    result-r_lgtyp = i_result-r_lgtyp.

    result-r_lgnum = i_result-r_lgnum.

    result-r_lgpla = i_result-r_lgpla.

    result-r_lptyp = i_result-r_lptyp.

    result-r_index = i_result-r_index.

    append result to i_bin.

  ENDIF.

  int_index = int_index + 1.

ENDDO.

posted on 2009-03-13 13:57  jground  阅读(261)  评论(0)    收藏  举报