2015 Sep 07 10:31 AM
Hi
I am trying to implment badi:MB_DOCUMENT_BADI with method MB_DOCUMENT_BEFORE_UPDATE for validation of cost ceter during GR(with PO number movement type 101).
My code in MB_DOCUMENT_BEFORE_UPDATE
------------------------------------------------------------------
method IF_EX_MB_DOCUMENT_BADI~MB_DOCUMENT_BEFORE_UPDATE.
DATA:
LS_MSEG TYPE MSEG,
LS_BNAME TYPE USR02-BNAME.
LOOP AT XMSEG INTO LS_MSEG WHERE WERKS = '4120'.
SELECT SINGLE BNAME FROM ZMCC INTO LS_BNAME WHERE BNAME = LS_MSEG-USNAM_MKPF AND KOSTL = LS_MSEG-KOSTL AND WERKS = LS_MSEG-WERKS.
IF SY-SUBRC <> 0.
MESSAGE E027(ZQ) WITH LS_MSEG-KOSTL.
ENDIF.
ENDLOOP.
endmethod.
----------------------------------------------------------------------------------------------------------------------------
While doing GR I am getting run time error(dump) as below.
Dump:
Short text
The current application triggered a termination with a short dump.
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
Can somebody guide me to solve this problem?
2015 Sep 07 10:55 AM
Hi Jaheer,
Instead of writing code in MB_DOCUMENT_BEFORE_UPDATE,
write a check in user exit MBCF0002.
This exit is having all the required parameters and also it will trigger while checking document and also posting document.
Arivazhagan S
Hi Jaheer,
Instead of writing code in MB_DOCUMENT_BEFORE_UPDATE,
write a check in user exit MBCF0002.
This exit is having all the required parameters and also it will trigger while checking document and also posting document.
Arivazhagan S
2015 Sep 07 10:55 AM
Hi Jaheer,
Instead of writing code in MB_DOCUMENT_BEFORE_UPDATE,
write a check in user exit MBCF0002.
This exit is having all the required parameters and also it will trigger while checking document and also posting document.
Arivazhagan S
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |