2008 Jan 02 7:22 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,
1) the cs_goitem is a structure of MIGO.(cant do it for looping)
2) cs_goitem is the parameter and goitem is a structure
3) we cant declare an internal table here.ex:
data: itab type standard table of goitem with header line.
data: begin of itab occurs 0.
data: itab like mchb occurs 0 with header line.
Post ur comments with sample codes.
thanks & reagrds
sankar.
Edited by: sankar babu on Jan 2, 2008 10:13 AM
Edited by: sankar babu on Jan 2, 2008 11:17 AM
hi as u used table control . fetch data from dat table control in internal table.
data: itab type standard table of cs_goitem with header line.
data : total like cs_goitem-matnr.
loop at itab.
at new itab-qty.
total = 0.
total = total + itab-qty.
endat.
* at this point u get total qty for that material.
endloop.
Edited by: yogesh kothavade on Jan 2, 2008 11:04 AM
2008 Jan 02 9:16 AM
use the COLLECT keyword.
or
check MCHB it is helpful to u.
Regards,
Arpit
2008 Jan 02 9:47 AM
Hi Arpit.S,
Could u pls explain it in detail??...with collect stmt...
Bcos...inside badi method,u cant declare a table with headers...So pls post with some good examples.
thanks & regards
sankar.
2008 Jan 02 10:02 AM
hi as u used table control . fetch data from dat table control in internal table.
data: itab type standard table of cs_goitem with header line.
data : total like cs_goitem-matnr.
loop at itab.
at new itab-qty.
total = 0.
total = total + itab-qty.
endat.
* at this point u get total qty for that material.
endloop.
Edited by: yogesh kothavade on Jan 2, 2008 11:04 AM
2008 Jan 02 10:15 AM
HI Yogesh,
first,thanks for ur reply.
with ur code helps, the system saying error as cs_goitem is unknown.("data: itab type standard table of cs_goitem with header line").
Here cs_goitem is the parameter and its parameter type is goitem.
first,just tell me how to get the internal table of MIGO where the datas getting stored.
Pls advise.
2008 Jan 02 4:28 PM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |