Advertisement
yaramohamed78

ZASG_SAL_UPDATE

Jan 18th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 1.53 KB | None | 0 0
  1. *&---------------------------------------------------------------------*
  2. *& Report  ZASG_SAL_UPDATE
  3. *&
  4. *&---------------------------------------------------------------------*
  5. *&
  6. *&
  7. *&---------------------------------------------------------------------*
  8.  
  9. REPORT ZASG_SAL_UPDATE.
  10. TABLES: ZASG_SAL.
  11. DATA: l_subrc TYPE SY-SUBRC,
  12.       wa_emp TYPE ZASG_SAL,
  13.       it_emp type TABLE OF ZASG_EMP,
  14.       it_sal type TABLE OF TCURC.
  15.  
  16.  
  17. SELECTION-SCREEN BEGIN OF BLOCK SELECTION WITH FRAME TITLE text-001.
  18. PARAMETERS :     EMP_ID LIKE ZASG_SAL-empid OBLIGATORY.
  19. PARAMETERS :     EMP_CUR LIKE ZASG_SAL-currency OBLIGATORY.
  20. PARAMETERS :     EMP_AMNT LIKE ZASG_SAL-amount OBLIGATORY.
  21.  
  22. SELECTION-SCREEN END OF BLOCK SELECTION.
  23.  
  24.  
  25. wa_emp-empid = EMP_ID.
  26. wa_emp-currency = EMP_CUR.
  27. wa_emp-amount = EMP_AMNT.
  28.  
  29. *ID VALIDATION.
  30.  
  31. SELECT * FROM ZASG_EMP
  32.   INTO CORRESPONDING FIELDS OF TABLE it_emp
  33.   WHERE id = wa_emp-empid .
  34.  
  35.   IF  it_emp[] IS INITIAL.
  36.     MESSAGE ID 'ZINSERTION_ERRORS' TYPE 'I' NUMBER '007'.
  37. ELSE.
  38.  
  39.  
  40.  SELECT * FROM TCURC
  41.    INTO CORRESPONDING FIELDS OF TABLE it_sal
  42.     WHERE waers = wa_emp-currency.
  43.  
  44.     IF it_sal[] IS INITIAL.
  45.       MESSAGE ID 'ZINSERTION_ERRORS' TYPE 'I' NUMBER '008'.
  46.   ELSE.
  47.  
  48.  
  49. CALL FUNCTION 'Z_ASG_FN_UPDATESAL'
  50.   EXPORTING
  51.     WA_EMP        = wa_emp
  52.  IMPORTING
  53.    E_SUBRC       =  l_subrc.
  54. if l_subrc = 1.
  55.   MESSAGE ID 'ZINSERTION_ERRORS' TYPE 'I' NUMBER '009'.
  56.  ELSEIF l_subrc = 0.
  57.    MESSAGE ID 'ZINSERTION_ERRORS' TYPE 'I' NUMBER '004'.
  58.    EXIT.
  59.  ENDIF.
  60. ENDIF.
  61. ENDIF.
  62. INITIALIZATION.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement