W Pub: ABAP Prog Propios SISTEMA

  1. report zsyst no standard page heading.
  2.  
  3. tables: dd03l.
  4.  
  5. data: bkp like syst,
  6.       tipo(1),
  7.       eax like sy-index.
  8.  
  9. field-symbols: <n>, <m>.
  10.  
  11. end-of-selection.
  12.   bkp = syst.
  13.   clear eax.
  14.   do.
  15.     add 1 to eax.
  16.     assign component eax  of structure syst to <m>.
  17.     if sy-subrc ne 0. exit. endif.
  18.     describe field <m> type tipo.
  19.     case tipo.
  20.       when 'C' or 'N'.
  21.         if <m> <> '1'. <m> = '1'. else. <m> = '0'. endif.
  22.       when others.
  23.         if <m> <>  1.  <m> =  1.  else. <m> =  2.  endif.
  24.     endcase.
  25.   enddo.
  26.   clear eax.
  27.   do.
  28.     add 1 to eax.
  29.     assign component eax of structure bkp  to <n>.
  30.     if sy-subrc ne 0. exit. endif.
  31.     assign component eax of structure syst to <m>.
  32.     check <n> ne <m>.
  33.     select single * from dd03l where tabname = 'SYST'
  34.                                    and position = eax.
  35.     write: / dd03l-fieldname.
  36.   enddo.