Advertisement
yaramohamed78

select option test -v2

Jan 18th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 2.61 KB | None | 0 0
  1. *&---------------------------------------------------------------------*
  2. *& Report  Z_SELECTOPTION_TEST
  3. *&
  4. *&---------------------------------------------------------------------*
  5. *&
  6. *&
  7. *&---------------------------------------------------------------------*
  8.  
  9. REPORT Z_SELECTOPTION_TEST.
  10.  
  11. *Tables Used
  12. TABLES: ZASG_SAL , ZASG_EMP .
  13.  
  14. *Data Variables.
  15. DATA: l_subrc TYPE SY-SUBRC,
  16.       wa_emp TYPE ZASG_EMP,
  17.       S_empid TYPE TABLE OF SELOPT WITH HEADER LINE,
  18.       where_statement TYPE STRING,
  19.       STR2 TYPE STRING,
  20.       emp_name LIKE ZASG_EMP-name,
  21.       emp_amount LIKE ZASG_SAL-amount,
  22.       emp_currency LIKE ZASG_SAL-currency,
  23.       counter TYPE INT1 VALUE 0,
  24.       errors TYPE INT1 VALUE 0.
  25.  
  26.  
  27. *Selection Screen (ID)
  28. SELECTION-SCREEN BEGIN OF BLOCK SELECTION WITH FRAME TITLE text-001.
  29. SELECT-OPTIONS EMP_ID FOR ZASG_EMP-id .
  30. SELECTION-SCREEN END OF BLOCK SELECTION.
  31.  
  32. S_empid-SIGN = EMP_ID-SIGN.
  33. S_empid-OPTION = EMP_ID-OPTION.
  34. S_empid-LOW = EMP_ID-LOW.
  35. S_empid-HIGH = EMP_ID-HIGH.
  36.  
  37.  
  38. CALL FUNCTION 'Z_ASG_FN_SEARCH_TEST'
  39.   TABLES
  40.     Z_EMPID       = S_empid
  41.     Z_TEST        = EMP_ID[].
  42.  
  43. INITIALIZATION.
  44.  
  45.  
  46. *
  47. **Loop through all entered values for employee id.
  48. *loop at EMP_ID.
  49. *  counter = counter + 1.
  50. * IF EMP_ID-OPTION = 'EQ'.
  51. *   where_statement = 'e~id = EMP_ID-LOW'.
  52. *   CONCATENATE where_statement STR2 INTO where_statement.
  53. * ELSEIF EMP_ID-OPTION = 'NE'.
  54. *   CONCATENATE where_statement STR2 INTO where_statement.
  55. *   STR2 = 'e~id <> EMP_ID-LOW'.
  56. * ELSEIF EMP_ID-OPTION = 'GT'.
  57. *   STR2 = 'e~id > EMP_ID-LOW'.
  58. *    CONCATENATE where_statement STR2 INTO where_statement.
  59. *  ELSEIF EMP_ID-OPTION = 'LT'.
  60. *    STR2 = 'e~id < EMP_ID-LOW'.
  61. *    CONCATENATE where_statement STR2 INTO where_statement.
  62. *    ELSEIF EMP_ID-OPTION = 'GE'.
  63. *    STR2 = 'e~id >= EMP_ID-LOW'.
  64. *    CONCATENATE where_statement STR2 INTO where_statement.
  65. *    ELSEIF EMP_ID-OPTION = 'LE'.
  66. *    STR2 = 'e~id <= EMP_ID-LOW'.
  67. *    CONCATENATE where_statement STR2 INTO where_statement.
  68. *    ELSEIF EMP_ID-OPTION = 'BT'.
  69. *      STR2 = 'e~id BETWEEN EMP_ID-LOW AND EMP_ID-HIGH'.
  70. *   CONCATENATE where_statement STR2  INTO where_statement.
  71. *  ENDIF.
  72. *  SELECT e~name s~amount s~currency
  73. *    INTO (emp_name,emp_amount,emp_currency)
  74. *  FROM (
  75. *    ZASG_EMP AS e
  76. *    INNER JOIN ZASG_SAL AS s ON e~id = s~empid
  77. *    )
  78. *    WHERE (where_statement).
  79. *    WRITE : / emp_name , emp_amount , emp_currency.
  80. *    ENDSELECT.
  81. **    If no id is found.
  82. *   IF  SY-SUBRC <> 0.
  83. *     errors = errors + 1.
  84. * ENDIF.
  85. *
  86. *
  87. *endloop.
  88. *
  89. *if errors = counter.
  90. *MESSAGE ID 'ZINSERTION_ERRORS' TYPE 'I' NUMBER '007'.
  91. *ENDIF.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement