‎2008 Jan 02 7:30 AM
Hi friends,
Pls help me to post some example codes for looping the table control data items.
i.e., Details available in table control item in MIGO.
Ex:
LINE Material text Qty
1 INGOT 5.0
1 INGOT 2.5
1 INGOT 10.0
1 FURNACE OIL 180.0
Pls help me,How to loop this table control items , so that i want to sum the consolidated qty by material wise.
the fileds are cs_goitem-matnr and cs_goitem-qty.
FYI, the cs_goitem is a structure of MIGO.(cant do it for looping)
Post ur comments with sample codes.
thanks & reagrds
sankar.
Edited by: sankar babu on Jan 2, 2008 10:14 AM
‎2008 Jan 02 9:37 AM
Hello Sankar.
You can write the code needed in the POST_DOCUMENT method of the BAdI where you have the IT_MSEG table, so that you can loop it and collect the qty you need.
For example:
data: ls_mseg type MSEG.
data: begin of i_coll_qty occurs 0,
matnr type matnr,
menge type menge_d,
end of i_coll_qty.
loop at it_mseg into ls_mseg where shkzg = 'S'.
i_coll_qty-matnr = ls_mseg-matnr.
i_coll_qty-menge = ls_mseg-menge.
collect i_coll_qty.
endloop.
Please reward if helpful.
Regards,
George
‎2008 Jan 02 9:44 AM
Hi george..
thanks for ur prompt reply...
but u cant declare a table with headers....in the OO context.(i've tried the same and it showing errors).
Pls advise.
‎2008 Jan 02 4:28 PM