Permutation of Numbers - A simple ABAP Report
INITIALIZATION. TYPES: BEGIN OF lty_tab, i_field TYPE i, c_field TYPE c, c_field2 TYPE c, END OF lty_tab. DATA: it_tab TYPE STANDARD TABLE OF lty_tab WITH HEADER LINE. START-OF-SELECTION. it_tab-i_field = 1. it_tab-c_field = 'A'. it_tab-c_field2 = 'X'. APPEND it_tab. it_tab-i_field = 2. it_tab-c_field = 'B'. it_tab-c_field2 = 'Y'. APPEND it_tab. it_tab-i_field = 3. it_tab-c_field = 'C'. it_tab-c_field2 = 'Z'. APPEND it_tab. PERFORM permutation TABLES it_tab.
*&---------------------------------------------------------------------* *& Form Permutation *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM permutation TABLES f_itab LIKE it_tab[]. DATA: f_line LIKE LINE OF f_itab, f_line2 LIKE LINE OF f_itab . LOOP AT f_itab INTO f_line. LOOP AT f_itab INTO f_line2. WRITE: / f_line-i_field, f_line2-c_field, f_line2-c_field2. ENDLOOP. ENDLOOP. ENDFORM. "permutation
No comments:
Post a Comment