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: 

Customer fields in MIGO do not have access to goitem structure

former_member388650
Participant
0 Kudos

Hi,

I have added 3 fields in customer data tab in MIGO using badi MB_MIGO_BADI. There are some validations on these fields.

Everything works fine. My requirement is to validate these fields only for certain materials only. For rest it should not bother about those fields.

My problem is - I am not able to get the material at item level in these BADI methods. I want to get it in method PBO_DETAIL. This is because I do not want to show customer tab for the materials for which these fields are irrelevant. If the material is relevant, then this tab will be displayed and user can enter data in customer fields.

I tried to GET parameter ids MAT / BES / BSP. But none of these is SET by that time. So, how do I know about the current material ?

Pl. throw some ideas.

Regards,

Vishram

3 REPLIES 3

former_member289261
Active Contributor
0 Kudos

Hi,

Although not recommended, you can use the following steps :

data :     ls_goitem type GOITEM,

               lv_prg     type string value 'SAPLMIGO(GOITEM)'.

field-symbols : <fs_goitem>.

ASSIGN (lv_prg) TO <fs_goitem>.

clear ls_goitem.

ls_goitem = <fs_goitem>.

Now you have the GOITEM structure data in LS_GOITEM.

Regards,

Ashish

0 Kudos

Hi Ashish,

Thanks for your reply. I tried with this but system does not have value in GOITEM structure of SAPLMIGO. So, I could not get the result.

ASSIGN statement was giving sy-subrc = 4.

Instead I changed my requirement a little bit and I could succeed. Instead of trying to derive it in PBO_DETAIL, I derived it in LINE_MODIFY method as I can get access to GOITEM structure data.

Here I am setting the flag whether to display customer screen or not. In PBO_DETAIL I am checking this flag first. Based on this I display / hide the customer screen in PBO_DETAIL.

So, initially it does not display the screen. But once you enter PO number, it displays the customer screen.

So, it has been resolved this way.

Thanks for your help.

Former Member
0 Kudos

Hi

try with export import

export material from which metgod you are getting, and import in your method where you have a validation.

hope this will help you.

regards

laxman