0% found this document useful (0 votes)
10 views2 pages

EDI Invoice Processing Method Implementation

The document outlines a method for processing EDI invoices in an SAP system, focusing on mapping data and determining supplier and company code details. It includes error handling and registration of the inbound process, utilizing various data structures and types. The method also appends messages for further processing and indicates a skip for core implementation.

Uploaded by

Umer Shehzad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

EDI Invoice Processing Method Implementation

The document outlines a method for processing EDI invoices in an SAP system, focusing on mapping data and determining supplier and company code details. It includes error handling and registration of the inbound process, utilizing various data structures and types. The method also appends messages for further processing and indicates a skip for core implementation.

Uploaded by

Umer Shehzad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

METHOD if_edi_mm_invoice_ext_badi~execute_own_implementation.

DATA:
lt_data TYPE /otx/pf01_tt_1ext,
ls_data TYPE /otx/pf01_t_1ext,
ls_1reg TYPE /otx/pf01_t_1reg,
lt_1img TYPE /otx/pf01_tt_img_data,
lv_extnumber TYPE balnrext,
lv_profile TYPE /otx/pf01_e_ext_profile VALUE 'PS03_SUPINV_SRV',
ls_msg TYPE bapiret2,
lt_msg TYPE bapiret2_t,
lv_pathh TYPE char01 VALUE 'P',
lv_pathi TYPE char01 VALUE 'Q',
lv_exc TYPE REF TO cx_root,
lr_suppl_det TYPE REF TO if_edi_mrm_supplier_det,
lt_comp_det TYPE REF TO if_edi_mrm_company_code_det,
lv_eikto TYPE eikto_k,
lv_lifnr TYPE lifnr,
lv_bukrs TYPE bukrs.

FIELD-SYMBOLS:
<ls_party> TYPE edi_party.

lv_extnumber = cs_proxy_input-message_header-id-content.

* lt_data = /opt/cl_vim_aribacig_utils=>map_data( EXPORTING pi_head_pathtype =


lv_pathh "VIMI-39733
/opt/cl_vim_aribacig_utils=>map_data( EXPORTING pi_head_pathtype = lv_pathh
"VIMI-39733
pi_item_pathtype =
lv_pathi
ps_input =
cs_proxy_input
ps_header =
cs_proxy_input-invoice
pt_items =
cs_proxy_input-invoice-item
IMPORTING pt_msg = lt_msg
pt_data = lt_data ).
"VIMI-39733

READ TABLE lt_msg INTO ls_msg WITH KEY type = 'A'.


IF sy-subrc <> 0. "No errors

* add company code and vendor mapped by standard SAP logic


CREATE OBJECT lr_suppl_det TYPE cl_edi_mrm_supplier_det.
CREATE OBJECT lt_comp_det TYPE cl_edi_mrm_company_code_det.

TRY.
lv_lifnr = lr_suppl_det->determine_supplier( cs_proxy_input ).
CATCH cx_root INTO lv_exc.
ENDTRY.
IF NOT lv_lifnr IS INITIAL.
READ TABLE cs_proxy_input-invoice-party ASSIGNING <ls_party> WITH KEY
party_type = if_edi_partner_constants=>gc_bill_to_ext.
IF sy-subrc = 0.
lv_eikto = <ls_party>-supplier_party_id.
TRY.
lt_comp_det->determine_company_code(
EXPORTING
iv_lifnr = lv_lifnr
iv_company_name = <ls_party>-address-address_name
iv_eikto = lv_eikto
IMPORTING
ev_bukrs = lv_bukrs ).
CATCH cx_root INTO lv_exc.
ENDTRY.
ENDIF.
ENDIF.

ls_data-extfield = 'BUKRS_SAP'.
ls_data-extindex = 0.
ls_data-extvalue = lv_bukrs.
ls_data-extfieldtype = 'H'.
APPEND ls_data TO lt_data.
ls_data-extfield = 'LIFNR_SAP'.
ls_data-extindex = 0.
ls_data-extvalue = lv_lifnr.
ls_data-extfieldtype = 'H'.
APPEND ls_data TO lt_data.

* register inbound process


/opt/cl_vim_aribacig_utils=>register( EXPORTING pi_1reg = ls_1reg
pi_profile = lv_profile
pt_data = lt_data
pt_img = lt_1img
pi_lognumber = lv_extnumber
IMPORTING pt_msg = lt_msg ).
ENDIF.

APPEND LINES OF lt_msg TO ct_messages.


cv_skip_core_implementation = 'X'.

ENDMETHOD.

You might also like