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: 

How can I get the material number after using function module 'MIGO_DIALOG'

Former Member
0 Kudos

Hello *,

can anybody tell how I would get the GR number back after I've created it with the function module 'MIGO_DIALOG'?

Thanks a lot for your input!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello!

This may work for you. It is not the best solution, but it does not appear that the function wants to return that value.

tables: mkpf.

get parameter id 'MBN' field mkpf-mblnr.

Cheers,

John

2 REPLIES 2

Former Member
0 Kudos

Hello!

This may work for you. It is not the best solution, but it does not appear that the function wants to return that value.

tables: mkpf.

get parameter id 'MBN' field mkpf-mblnr.

Cheers,

John

0 Kudos

I think that this may be the only way to solve your problem safely. John's suggestion may work, but I'm not sure that its the safest way.




report zrich_0001.


data: messtab type table of bdcmsgcoll  with header line.
data: bdcdata type table of bdcdata with header line.
data: mode(1) type c value 'E'.


call transaction 'MIGO' using bdcdata mode mode
                              update 'S'
                              messages into messtab.


read table messtab with key msgid = 'MIGO'
                            msgnr = '012'.
if sy-subrc  = 0.
  write:/ 'Your material document number is ', messtab-msgv1.
endif.

Regards,

Rich Heilman