S4/HANA 버전에서는 BSID, BSIK 테이블이 View 로 되어 있기 때문에
해당 테이블에 update 하는 로직을 만들 수가 없다.
=> source 에서 syntax error 발생함.
The database view "BSID" is read-only and cannot be changed.
The database view "BSIK" is read-only and cannot be changed.
=> 해결방법 : FB02 에서 변경 처리가 되도록 BDC Function 을 이용함.
<참고 소스>
DATA: ls_bseg TYPE bseg,
lt_errdoc TYPE tpit_t_errdoc,
lt_fname TYPE tpit_t_fname,
lt_buztab TYPE tpit_t_buztab.
* Field name to be changed
APPEND 'CESSION_KZ' TO lt_fname.
* New field value
ls_bseg-cession_kz = 'AB'.
* Selection of items to be changed
* Only select customer items to avoid problems in batch input
SELECT bukrs belnr gjahr buzei koart umskz bschl mwart mwskz
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE lt_buztab
WHERE belnr = '1400000000' AND
bukrs = '1000' AND
koart = 'D'. "Customers
CALL FUNCTION 'FI_ITEMS_MASS_CHANGE'
EXPORTING
s_bseg = ls_bseg
IMPORTING
errtab = lt_errdoc[]
TABLES
it_buztab = lt_buztab
it_fldtab = lt_fname
EXCEPTIONS
bdc_errors = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
'프로그래밍 > SAP ABAP' 카테고리의 다른 글
[SAP/ABAP] sap screen parameter 비활성화 (0) | 2022.02.23 |
---|---|
[SAP/ABAP] Excel uplod 기능 - smw0 (0) | 2022.02.09 |
[SAP/ABAP] EXIT, STOP, RETURN, CHECK, CONTINUE, LEAVE PROGRAM (0) | 2022.01.14 |
공장달력 설정 (0) | 2022.01.07 |
[SAP/ABAP] 문자열 길이/찾기 (0) | 2021.11.04 |