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: 

Getting quantity from MIGO using field-symbols

Former Member
0 Kudos
385

Hello All,

I am trying to get the quantity entered(for some computation) in MIGO, before it is posted, using the code :

EXIT: EXIT_SAPLEINR_003

Include: ZXM06U47

Code:

data: m(40) type c.

types: wa_goitem type goitem.

data: lv_erfmg type erfmg.

FIELD-SYMBOLS: <wa_goitem> type wa_goitem.

clear: m, lv_erfmg.

m = '(SAPLMIGO)GOITEM'.

assign (m) to <wa_goitem>.

if sy-subrc = 0.

  lv_erfmg = <wa_GOITEM>-ERFMG.

endif.

Problem with above is, if there are more than 1 item, it is only returning the last item quantity.

I also found another table LT_XMSEG which returns all item quantity, but i'm not able to call the same using the above approach. Am i missing something ?


3 REPLIES 3

kakshat
Advisor
Advisor
0 Kudos
101

Did you make sure that the field-symbol you are assigning LT_XMSEG to is declared of the correct type? WA_GOITEM is declared of type GOITEM above but in case of LT_XMSEG, I believe the type would be different.

Former Member
0 Kudos
101

Hello Kumar,

Yes. I declared it of type ty_t_imseg.

Regards.

Former Member
0 Kudos
101

Any help anyone ??? I want to get the value in quantity field during runtime for each item...