This method maps input data from an external system to internal SAP data structures using a mapping class. It then calls a BAPI to create an entry sheet in SAP based on the mapped data. Any error messages are collected and sent as the response. It also calls a BADI for additional processing and sends a confirmation message to an external system upon successful creation.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
904 views7 pages
Bapi Entrysheet Create
This method maps input data from an external system to internal SAP data structures using a mapping class. It then calls a BAPI to create an entry sheet in SAP based on the mapped data. Any error messages are collected and sent as the response. It also calls a BADI for additional processing and sends a confirmation message to an external system upon successful creation.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7
METHOD INPUT_MAPPING.
DATA: lt_message TYPE bapirettab.
DATA: ls_entrysheetheader TYPE bapiessrc, lt_entrysheetaccountassignment TYPE tt_bapiesknc, lt_entrysheetservices TYPE tt_bapiesllc, lt_entrysheetsrvaccassvalues TYPE tt_bapiesklc, lt_return TYPE tt_bapiret2, lt_bapi_entrysheet_create TYPE bapi_entrysheet_create_tp, lt_entrysheetservicestexts TYPE tt_bapieslltx, lt_entrysheetheadertext TYPE tt_bapiessrtx, lv_completetransind TYPE flag, lv_memory_complete TYPE bapiflag-bapiflag, lv_memory_uncomplete TYPE bapiflag-bapiflag.
*--------------------------------------------------------------------* * Mapping Header and item data *--------------------------------------------------------------------* data lv_srv_mapping_ref type ref to cl_srv_mapping_xi2erp. CALL METHOD cl_srv_mapping_xi2erp=>get_instance IMPORTING ev_srv_mapping_ref = lv_srv_mapping_ref.
DATA: ls_input_message TYPE srv_service_acknowledgement_er, ls_input_message_orig TYPE srv_service_acknowledgement_er, lv_po_number TYPE sapplco_business_transaction_d, lt_messages TYPE bapirettab, lt_messages_all TYPE bapirettab, lr_badi TYPE REF TO srv_se_saerpcreaterequest, lx_badi_error TYPE REF TO CX_APPL_PROXY_BADI_PROCESSING, lo_log TYPE REF TO CL_OPS_SE_PROT, lv_severity TYPE bapi_mtype, lv_action_code TYPE sapplco_action_code, "sapplsef_action_code, lv_ebeln TYPE ekko-ebeln, lv_objkey type char70.
*Bapi data DATA: lt_bapi_entrysheet_create TYPE bapi_entrysheet_create_tp.
* Forward Error Handling DATA: lt_post_mapping TYPE bapi_entrysheet_create_tp, ls_post_mapping LIKE LINE OF lt_post_mapping , ls_first_error TYPE bapiret2, ls_f_object TYPE ech_str_object, ls_error_cat TYPE ech_dte_error_category.
*---------------------------------------------------------------------* * Creating an object for collecting of protocols *---------------------------------------------------------------------* CREATE OBJECT lo_log.
*---------------------------------------------------------------------* * Check length of the incomming fields *---------------------------------------------------------------------* CALL METHOD me->check_incoming_fields IMPORTING et_messages = lt_messages CHANGING cs_input_message = ls_input_message.
*---------------------------------------------------------------------* * add log to lo_prot *---------------------------------------------------------------------* APPEND LINES OF lt_messages TO lt_messages_all. CALL METHOD lo_log->add_log( EXPORTING it_prot = lt_messages_all ). CLEAR lt_messages.
*-------- Instantiating SES Conf Out Class------------ Data Lo_SrvConf type ref to cl_se_srv_srvconf_out. TRY. CALL METHOD cl_se_srv_srvconf_out=>get_instance receiving re_instance = Lo_SrvConf. CATCH cx_ai_system_fault. ENDTRY. *-------------------------------------------------------
* " /sending confirmation to SUS APPEND LINES OF lt_messages TO lt_messages_all. CLEAR lt_messages. ENDLOOP. *add message to log CALL METHOD lo_log->add_log( EXPORTING it_prot = lt_messages_all ). CLEAR lt_messages. *ADDING THE SUCCESS MESSAGES TO ET_RETURN. IF lt_messages_all IS NOT INITIAL. APPEND LINES OF lt_messages_all TO ET_RETURN. ENDIF.
*---------------------------------------------------------------------* * check if error occured *---------------------------------------------------------------------* lv_severity = lo_log->get_severity( ). IF lv_severity = 'E'. et_return = lo_log->get_prot( ).