Application Development and Automation 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: 
Read only

MB_POST_DOCUMENT

former_member709286
Participant
0 Likes
2,888

Hi Expert team:


We have tried MB_POST_DOCUMENT by overwrite XMSEG and ZMSEG. This is our updated:

XMSEG-SJAHR=2021.

But after save MSEG still the same.

So do we need to add MODIFY or UPDATE in this exit?
pls advise and thanks in advance.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,650

Updating in this update task FM

  • XMSEG will have no effect.
  • ZMSEG will, but that would be bad practice. Causing inconsistencyies with data passed to other update FMs.

What was your original requirement?

Could you consider using a standard BAdI before the COMMIT?

  • MB_MIGO_BADI (LINE_MODIFY)
  • MB_DOCUMENT_BADI
11 REPLIES 11
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,651

Updating in this update task FM

  • XMSEG will have no effect.
  • ZMSEG will, but that would be bad practice. Causing inconsistencyies with data passed to other update FMs.

What was your original requirement?

Could you consider using a standard BAdI before the COMMIT?

  • MB_MIGO_BADI (LINE_MODIFY)
  • MB_DOCUMENT_BADI
Read only

0 Likes
2,650

Hi :

Anyone has experience to update mseg-smbln mseg-smblp mseg-sjahr?

We have try MB_DOCUMENT_BADI both method Before_Update and Update but looks like we still cannot update mseg.

Also Line_Modify BADI did not work for us because we are using BAPI call not via MIGO.

Read only

2,650

If you use BAPI_GOODSMVT_CREATE, look at BAdIs of Enhancement Spot MB_GOODSMOVEMENT such as MB_BAPI_GOODSMVT_CREATE which handle EXTENSIONIN parameter copy to material document.

Read only

0 Likes
2,650

Hi Raymond:


very helpful.

Would u kindly give a little more hint?

In this BADI, how to pass the data in extension_in pls? how can we know which document number in mseg we are updating ?

Thank you very much.

Read only

2,650

The BAdI doesn't pass data to EXTENSIONIN, it read the data you provided in EXTENSIONIN and map it to mkpf/mseg.

For items pass the same value to MATDOC_ITM in EXTENSIONIN (BAPI_TE_XMSEG) than to LINE_ID in GOODSMVT_ITEM (BAPI2017_GM_ITEM_CREATE) - look at the SAP provided sample code.

Read only

0 Likes
2,650

Hi Raymond:


How to locate sap sample code pls?

Thank again and sgain

Read only

2,650

From SE18 transaction on ES MB_GOODSMOVEMENT, in 'Enh. Spot Element Definitions' tab, look for 'Example Class'.

Read only

0 Likes
2,650

Hi Raymond:


I have seen sample source code. Thank you very much.

Any guidelines how to pass data to extension_in too? Have try search sap note but cannot found.

Thanks again.

Read only

0 Likes
2,650

Hi Raymond


I can pass data to extensionin and have value in valuepart1,2,3,4

From the sample source code , I not sure how to update to ct_imseg.

Any hint will be very helpful.

Many thanks in advance.

Read only

2,650

Apply your rules (XMSEG-SJAHR=2021.) to records of ct_imseg.

Read only

0 Likes
2,650

Hi Raymond:


you mean in BADI: mb_bapi_goodsmovement_create

To apply rules? How to pls?