07-11-2019 5:25 PM
Hello
I added a custom screen in Migo Item detail
the fields are populated and the tab is shown.
Requirement is to update the mseg table with these values.(I have already created an append structute to table mseg with these fields ZEX and ZID.)
Problem:
I am not able to get these fields in Bapi of MIGO.
weather I am in the
IF_EX_MB_MIGO_BADI~LINE_MODIFY
~PBO_DETAIL
or ~POST_DOCUMENT
I am unable to get them,
Get parameter id 'ZID' field data(zid). does not work,even though the screen in the custom program has parameter,somehow in migo is without one.
The line I save it with a global parameter g_line_id and works okay.
how can I get these two values ?
Thank You in advance
07-12-2019 8:58 PM
For the big picture, follow the blog post that Nawanandana Edirisinghe referred to.
So, you have 2 custom fields EXR (Exec Reference) and ZID.
Create a DDIC structure ZMSEG with these 2 fields.
Create one append for GOITEM and one for MSEG, in both you include ZMSEG so that the 2 fields are appended to GOITEM and MSEG.
Add the code "TABLES goitem" in the program of your subscreen (is it missing in the blog post!?)
Name your subscreen fields GOITEM-EXR and GOITEM-ZID, and tick the checkbox to link them to the ABAP Dictionary. Thanks to "TABLES goitem", the transfer will be automatic between your subscreen, your program and the global variable in the standard program!
Etc.
PS: No need of using GET PARAMETER/SET PARAMETER as done in the blog post, I think the author just missed the important "TABLES goitem"!
And better refer to the example provided by SAP for the BAdI MB_MIGO_BADI. There are subscreens and there is "TABLES goitem".
07-11-2019 6:47 PM
You have to implement custom fields in screen and in BAPI separately. Please search the forum the questions like "Custom fields BAPI MSEG MIGO EXTENSIONIN", and search "EXTENSIONIN" alone if the first results are not sufficient.
07-11-2019 8:05 PM
07-11-2019 8:31 PM
07-11-2019 10:58 PM
07-12-2019 8:16 AM
07-12-2019 2:05 PM
You have to add extra fields to GOITEM structure.
And CI_COBL structure is on both MSEG and GOITEM.
So you would assign field from GOITEM to MSEG and vice versa.
07-12-2019 6:18 PM
I have already added the fields in goitem, however I am finding it difficult to update table mseg,in post_document I can not modify it.
Where should I populate the goitem?
in which method?
If you can help me with this I'll accept your answer
07-12-2019 8:34 AM
sandra.rossi I would appriciate if tried to answer at least with an example.thank you in advance
07-12-2019 8:41 AM
Comments are not here for answering, anyway I gave you a good hint that you don't even seem to hear. At least, you should react on "You have to implement custom fields in screen and in BAPI separately". Don't you think it's something that you should investigate?
07-12-2019 6:28 PM
Goitem has the 2 extra fields,my most difficult thing is where to update table mseg.
Looks like in the bapi I can not,can you help me with this?
07-12-2019 6:47 PM
I'm not sure, are you using the word BAPI instead of BAdI, or what? It's completely different.
07-12-2019 8:21 PM
07-12-2019 8:58 PM
For the big picture, follow the blog post that Nawanandana Edirisinghe referred to.
So, you have 2 custom fields EXR (Exec Reference) and ZID.
Create a DDIC structure ZMSEG with these 2 fields.
Create one append for GOITEM and one for MSEG, in both you include ZMSEG so that the 2 fields are appended to GOITEM and MSEG.
Add the code "TABLES goitem" in the program of your subscreen (is it missing in the blog post!?)
Name your subscreen fields GOITEM-EXR and GOITEM-ZID, and tick the checkbox to link them to the ABAP Dictionary. Thanks to "TABLES goitem", the transfer will be automatic between your subscreen, your program and the global variable in the standard program!
Etc.
PS: No need of using GET PARAMETER/SET PARAMETER as done in the blog post, I think the author just missed the important "TABLES goitem"!
And better refer to the example provided by SAP for the BAdI MB_MIGO_BADI. There are subscreens and there is "TABLES goitem".
07-13-2019 5:47 AM
in my subscreen :tabels goitem?
You mean add in this at the screen top when I declare ? Or declare the parameters p_zid type goitem-zid.This is how I do it...
07-13-2019 8:03 AM
No, in the program of your subscreen. TABLES is an ABAP statement (read the documentation).
I don't advise you to define your subscreen as a selection screen, define it as a classic subscreen, so that to benefit all features of Dynpro technology. Name your subscreen fields GOITEM-EXR and GOITEM-ZID and tick the checkbox to link them to the ABAP Dictionary.
07-13-2019 4:15 PM
I have only one problem now,somehow even though the table GOITEM now has my data ZID in the table IT_MSEG which is in the post document method ,the values are missing.
The have the same name and domain.
What could it be the prb?
07-13-2019 5:10 PM
SO I finally found out the prb is that I should create an append into structure imseg3 and not in GOITEM !!!(imseg3 is included)
07-13-2019 6:50 PM
Nice finding and thank you for the feedback!
Finally, the hint given by Ali Ceylan is also possibly a solution for the second part of your question, by including the fields in CI_COBL: in the forum, there are different answers which mention either IMSEG3 or CI_COBL, they are both right; but CI_COBL is more for Account Assignment Block (Coding Block; cf SPRO) so don't use CI_COBL if it's not for that. For more clarity here's the relationship between GOITEM, IMSEG3 and CI_COBL:
GOITEM:
.INCLUDE IMSEG3
<either your ZZ columns in append of IMSEG3>
.INCLUDE CI_COBL
<or your ZZ columns in append of CI_COBL>
Note that the MB_MIGO_BADI documentation doesn't say if custom fields in MSEG can be updated; their example defines the custom fields in a separate custom table. Maybe another possibility is to update the custom fields of MSEG by doing a direct UPDATE mseg SET zzfield = ... WHERE mblnr = ... and mjahr = ... and line_id = ... via a custom update function module called in method POST_DOCUMENT. Anyway using IMSEG3 (title: "MMIM: Input Structure for FM to Post Goods Mvmt: Data") is much easier.