Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- METHOD cats_2010.
- DATA: lo_catch TYPE REF TO cx_root,
- lt_messages TYPE bapiret2_t,
- lv_text TYPE string,
- ls_log TYPE zmd_api_log,
- mapped TYPE p2010,
- p2010 TYPE p2010,
- lt_remspec TYPE TABLE OF bapi7012_2,
- ls_remspec TYPE bapi7012_2.
- CREATE OBJECT message_handler.
- me->collect_custom_message(
- EXPORTING
- message_type = 'S'
- msgtext = '<<START UPDATE|' && record-infty && '|' && record-subty && '|' && record-begda && '|' && record-endda && '>>'
- CHANGING
- message_handler_to = me->a_message_handler_all
- ).
- me->additional_change_cats(
- CHANGING
- control = control
- additional = additional
- ).
- ls_log-method = get_stack_event_by_depth( 2 ). "2 means this method
- ls_log-umode = control-umode.
- ls_log-infty = record-infty.
- ls_log-epernr = record-pernr.
- ls_log-data = get_log_data_from_raw( record ).
- ls_log-data_add = get_log_data_from_raw( additional ).
- ls_log-reference_id = control-reference_id.
- APPEND ls_log TO a_log.
- TRY.
- me->map_all(
- EXPORTING
- control = control
- record_in = record
- IMPORTING
- record_out = p2010
- CHANGING
- ok = ok
- message_handler = message_handler
- ).
- CATCH cx_root INTO lo_catch.
- lv_text = lo_catch->get_text( ).
- a_ok_all = ''.
- ok = ''.
- me->collect_custom_message(
- EXPORTING
- message_type = 'E'
- msgtext = lv_text
- CHANGING
- message_handler_to = me->a_message_handler_all
- ).
- ENDTRY.
- IF a_ok_all = 'X'.
- a_ok_all = ok.
- ENDIF.
- me->a_pernr = p2010-pernr.
- CLEAR: ls_remspec.
- REFRESH: lt_remspec.
- *map p2010 to ls_remspec
- ls_remspec-extsystem = additional-extsystem.
- ls_remspec-extapplication = additional-extapplication.
- ls_remspec-extdocumentno = additional-extdocumentno.
- ls_remspec-reversed = additional-reversed.
- ls_remspec-customer_field = additional-customer_field.
- ls_remspec-costcenter = additional-costcenter.
- ls_remspec-employeenumber = p2010-pernr.
- ls_remspec-validitydate = p2010-endda.
- ls_remspec-wagetype = p2010-lgart.
- ls_remspec-no_of_hours = p2010-stdaz.
- ls_remspec-number = p2010-anzhl.
- ls_remspec-time_unit = p2010-zeinh.
- APPEND ls_remspec TO lt_remspec.
- me->collect_custom_message(
- EXPORTING
- message_type = 'S'
- msgtext = '<<START CATS|' && record-infty && '|' && record-subty && '|' && record-begda && '|' && record-endda && '>>'
- CHANGING
- message_handler_to = me->a_message_handler_all
- ).
- CALL FUNCTION 'BAPI_PTMGREXTREMSPEC_INSWCOST'
- TABLES
- remuneration_specification = lt_remspec
- return = lt_messages.
- READ TABLE lt_messages TRANSPORTING NO FIELDS WITH KEY type = 'E'.
- IF sy-subrc = 0.
- a_ok_all = ''.
- ok = ''.
- ENDIF.
- LOOP AT lt_messages INTO DATA(lw_messages).
- CLEAR: lv_text.
- MESSAGE ID lw_messages-id TYPE lw_messages-type NUMBER lw_messages-number
- INTO lv_text
- WITH lw_messages-message_v1 lw_messages-message_v2 lw_messages-message_v3 lw_messages-message_v4.
- me->collect_custom_message(
- EXPORTING
- message_type = lw_messages-type
- msgtext = lv_text
- CHANGING
- message_handler_to = me->a_message_handler_all
- ).
- ENDLOOP.
- IF a_ok_all = 'X'.
- a_ok_all = ok.
- ENDIF.
- me->collect_custom_message(
- EXPORTING
- message_type = 'S'
- msgtext = '<<END CATS|' && record-infty && '|' && record-subty && '|' && record-begda && '|' && record-endda && '>>'
- CHANGING
- message_handler_to = me->a_message_handler_all
- ).
- me->collect_custom_message(
- EXPORTING
- message_type = 'S'
- msgtext = '<<END UPDATE|' && record-infty && '|' && record-subty && '|' && record-begda && '|' && record-endda && '>>'
- CHANGING
- message_handler_to = me->a_message_handler_all
- ).
- ENDMETHOD.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement