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: 

Get Migo Field values

former_member2492
Active Participant
0 Kudos

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

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

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".

18 REPLIES 18

Sandra_Rossi
Active Contributor
0 Kudos

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.

p244500
Active Contributor
0 Kudos

Try with bellow link,

custom TAB for MIGO Item Details

0 Kudos

this is not an answer,but I have tried anyway

0 Kudos

hi,

i'd rather using CI_COBL instead of using append structure.

0 Kudos

my question is how to get the data...thanks

0 Kudos

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.

0 Kudos

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

former_member2492
Active Participant
0 Kudos

sandra.rossi I would appriciate if tried to answer at least with an example.thank you in advance

Sandra_Rossi
Active Contributor
0 Kudos

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?

former_member2492
Active Participant
0 Kudos
sandra.rossi I have already done that.

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?

Sandra_Rossi
Active Contributor
0 Kudos

I'm not sure, are you using the word BAPI instead of BAdI, or what? It's completely different.

former_member2492
Active Participant
0 Kudos

@ sandra.rossi BADI Interface IF_EX_MB_MIGO_BADI

Sandra_Rossi
Active Contributor

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".

0 Kudos

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...

0 Kudos

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.

0 Kudos

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?

SO I finally found out the prb is that I should create an append into structure imseg3 and not in GOITEM !!!(imseg3 is included)

0 Kudos

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.