Application Development and Automation 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: 
Read only

Coding help reqd for BADI - looping strategy

Former Member
0 Likes
491

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

3 REPLIES 3
Read only

George_Lioumis
Active Participant
0 Likes
460

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

Read only

0 Likes
460

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.

Read only

Former Member
0 Likes
460

Answered.

regards

sankar.