Advertisement
Guest User

Untitled

a guest
Nov 21st, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 1.34 KB | None | 0 0
  1. *&---------------------------------------------------------------------*
  2. *& Report  ZGL156PROGRAMC3
  3. *&
  4. *&---------------------------------------------------------------------*
  5. *&
  6. *&
  7. *&---------------------------------------------------------------------*
  8. REPORT  ZGL156PROGRAMC3.
  9.  
  10. * declaratie de tip
  11. types: begin of ty_tip1,
  12.       counter type n length 2,
  13.       short_desc type c length 20,
  14.       long_desc type c length 60,
  15.   end of ty_tip1.
  16.  
  17.  
  18.  data: gs_struct1 type ty_tip1,
  19.        gv_var1  type n length 3.
  20.  
  21.  
  22.  parameters p_par1 type n length 3.
  23.  
  24.  
  25.  start-of-selection.
  26.  
  27.  write p_par1.
  28.  
  29.  move p_par1 to gv_var1.
  30.  skip 2.
  31.  write / gv_var1.
  32.  
  33.  
  34.  move: 11 to gs_struct1-counter,
  35.        'descriere scurta' to gs_struct1-short_desc,
  36.        'descriere lunga' to gs_struct1-long_desc.
  37.  
  38.  
  39. * afisare continut structura
  40.  skip 1.
  41.  write: gs_struct1-counter,
  42.         / gs_struct1-short_desc,
  43.         / gs_struct1-long_desc.
  44.  
  45. * instructiunea if
  46. skip 1.
  47.  IF p_par1 < 100.
  48.    write / 'mai mic de 100'.
  49. ELSEIF  p_par1 > 100.
  50.   write / 'mai mare ca 100'.
  51.  else.
  52.    write / 'egal 100'.
  53.  ENDIF.
  54.  
  55. * instructiunea case
  56.  skip 3.
  57.  CASE  p_par1.
  58.     WHEN '100'.
  59.     write 'egal 100'.
  60.     WHEN OTHERS.
  61.     write 'diferit de 100'.
  62.  ENDCASE.
  63.  
  64.  skip 1.
  65.  
  66.  write sy-datum to gs_struct1-short_desc.
  67.  
  68. * afisare
  69.  write gs_struct1-short_desc.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement