Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Modify statement in MB_DOCUMENT_BADI

Former Member
0 Kudos
282

Hi All,

I am working on BADI implementation for the MB_DOCUMENT_BADI.

In the implementation, i ineed to change the document type (ZMKPF-BLART) value.

If use the code like follow, the system is giving syntax error as 'The structure XMKPF can not be modified'.


data: wa_xmkpf like line of xmkpf.
data: xmseg like line of xmseg.
read table xmkpf into wa_xmkpf index 1.
if wa_xmkpf-bwart = '102'.
read table XMSEG into WA_XMSEG into wa_xmseg.
if sy-subrc = 0.
wa_xmseg-blart = 'RT'.
modify xmseg from wa_mseg.
endif.
endif.

Is there any other logic, so as to make the zmseg-blart = 'RT'...??

Regards

Pavan

2 REPLIES 2

Former Member
0 Kudos
85

In this BADI, the XMSEG structure can not be changed. It can be used for other programs only..

GauthamV
Active Contributor
0 Kudos
85

Dont use modify statements in BADI for changing data in standard transactions.