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

If Ex Ac Document Change Initial 20220322 1142am

This method populates accounting document line item text. It checks if a configuration master is active, reads header and item data from a BAPI, and loops through items to populate additional fields and append to the output document items. Text for a specific configuration master number is generated based on vehicle, partner, and document reference fields.

Uploaded by

Chandrahas
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)
275 views2 pages

If Ex Ac Document Change Initial 20220322 1142am

This method populates accounting document line item text. It checks if a configuration master is active, reads header and item data from a BAPI, and loops through items to populate additional fields and append to the output document items. Text for a specific configuration master number is generated based on vehicle, partner, and document reference fields.

Uploaded by

Chandrahas
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
You are on page 1/ 2

METHOD if_ex_ac_document~change_initial.

*&---------------------------------------------------------------------*
* Method Name : IF_EX_AC_DOCUMENT~CHANGE_AFTER_CHECK
* Release : SAP ECC 6.0 EHP8 750
* Date Written : 13.01.2022
* Module : FICO
* Type : Class Method
* Author : Ramakrishna
*----------------------------------------------------------------------*
* Title : Accounting Document Line Item Text Populate
* Purpose :
* Copied From : NA
*----------------------------------------------------------------------*
CONSTANTS:
co_cm_0058755567 TYPE /dcsea/z_cm_number VALUE '0058755567'.

DATA:
wf_vendor_flag TYPE /dcsea/zais_cm_a-z_active_flag,
ls_head TYPE /opt/vim_1head,
ls_ex TYPE accit_sub,
ls_filter TYPE /dcsea/z_cm_filter,
r_mwskz TYPE RANGE OF mwskz.

IMPORT ls_head TO ls_head FROM MEMORY ID 'DOC_HEADER'. " From the BAPI:
/DCSEA/OPT_VIM_52_BAPI_PO_LINE
FREE MEMORY ID 'DOC_HEADER'.

ls_filter = ls_head-doctype.
ex_document-header-bktxt = im_document-header-bktxt.

CALL FUNCTION '/DCSEA/Z_AIS_CHECK_ACTIVE_CM'


EXPORTING
cm_number = co_cm_0058755567
werks = ls_head-bukrs
filter = ls_filter
IMPORTING
active_flag = wf_vendor_flag.

CHECK wf_vendor_flag IS NOT INITIAL.


r_mwskz = VALUE #( ( sign = 'I' option = 'EQ' low = 'V0' )
( sign = 'I' option = 'EQ' low = 'V7' )
( sign = 'I' option = 'EQ' low = 'VN' )
( sign = 'I' option = 'EQ' low = 'D7' ) ).

LOOP AT im_document-item INTO DATA(ls_item).


MOVE-CORRESPONDING ls_item TO ls_ex.
IF ls_item-koart = 'K'.
ls_ex-sgtxt = ls_head-sgtxt.
ENDIF.
IF ls_head-tax_code IN r_mwskz.
ls_ex-xref1_hd = ls_head-barcode.
ls_ex-xref2 = ls_head-xref2.
ENDIF.
APPEND ls_ex TO ex_document-item.
CLEAR ls_ex.
ENDLOOP.
*Begin of Insert for CM-0059896659 by SUUTAGE on 28/12/2021
CONSTANTS:co_0059896659 TYPE /dcsea/z_cm_number VALUE '0059896659'.
DATA: lv_sgtxt TYPE sgtxt,
ls_exe TYPE accit,
lv_date TYPE char10.
ex_document-header-bktxt = im_document-header-bktxt.
READ TABLE im_document-item ASSIGNING FIELD-SYMBOL(<fs_item>) INDEX 1.
IF sy-subrc EQ 0.
IF /dcsea/tr_cl_global=>check_cm_active(
im_cm_no = co_0059896659
im_werks = <fs_item>-bukrs
) IS NOT INITIAL .

LOOP AT im_document-item ASSIGNING <fs_item>.


IF <fs_item>-bwtar IS NOT INITIAL.
DATA(lv_vhcle) = <fs_item>-bwtar.
ENDIF.
IF <fs_item>-lifnr IS NOT INITIAL.
DATA(lv_lifnr) = <fs_item>-lifnr.
ENDIF.
IF <fs_item>-xblnr IS NOT INITIAL.
DATA(lv_xblnr) = <fs_item>-xblnr.
ENDIF.
ENDLOOP.
IF lv_vhcle IS NOT INITIAL AND lv_lifnr IS NOT INITIAL.
SELECT SINGLE name1 FROM lfa1 INTO @DATA(lv_name1)
WHERE lifnr = @lv_lifnr.

IF sy-subrc IS INITIAL.
SELECT zz_commnos, zz_rego_number UP TO 1 ROWS
FROM vlcvehicle INTO @DATA(ls_vlcvehicle)
WHERE vhcle = @lv_vhcle.
ENDSELECT.
IF sy-subrc IS INITIAL .
IF sy-tcode EQ '/DCSEA/ZAIS_SU_AD_CO'.
WRITE im_document-header-cpudt TO lv_date.
lv_sgtxt = 'MBO ara� al#m#/' &&
lv_date && '/' &&
lv_xblnr.
ELSE.
lv_sgtxt = lv_name1+0(10) && '/' &&
ls_vlcvehicle-zz_rego_number && '/' &&
ls_vlcvehicle-zz_commnos.
ENDIF.
LOOP AT im_document-item ASSIGNING <fs_item>.
MOVE-CORRESPONDING <fs_item> TO ls_ex.
ls_ex-sgtxt = lv_sgtxt.
APPEND ls_ex TO ex_document-item.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.

*End of Insert for CM-0059896659 by SUUTAGE on 28/12/2021


ENDMETHOD.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy