2015 Jul 23 1:29 PM
Hi.
I am new to ABAP and I will need some help.
I have made an infoset based on table MBEWH.
I need to get the total of quantity of table MSEG per plant for a certain period and for certain movement types.
I created an extra field "ANAL" and in extra code for the field I wrote:
after
SELECT * FROM mkpf INNER JOIN mseg ON.........
CHECK sy-subrc = 0.
CLEAR ANAL.
SORT ITAB BY werks bwart.
LOOP AT itab INTO wa.
AT NEW werks.
CLEAR ANAL.
ENDAT.
IF wa-shkzg = 'H'.
wa-menge = wa-menge * ( -1 ).
ENDIF.
IF wa-bwart = '201' or wa-bwart = '202'.
ADD wa-menge to ANAL.
ENDIF.
ENDLOOP.
which works fine if a have selected only one plant.
For more plants, it displays always the last value calculated (as you can see at attached picture).
Could you please help me how I will give a different value per plant?
Thanks in advance.
Hi.
I am new to ABAP and I will need some help.
I have made an infoset based on table MBEWH.
I need to get the total of quantity of table MSEG per plant for a certain period and for certain movement types.
I created an extra field "ANAL" and in extra code for the field I wrote:
after
SELECT * FROM mkpf INNER JOIN mseg ON.........
CHECK sy-subrc = 0.
CLEAR ANAL.
SORT ITAB BY werks bwart.
LOOP AT itab INTO wa.
AT NEW werks.
CLEAR ANAL.
ENDAT.
IF wa-shkzg = 'H'.
wa-menge = wa-menge * ( -1 ).
ENDIF.
IF wa-bwart = '201' or wa-bwart = '202'.
ADD wa-menge to ANAL.
ENDIF.
ENDLOOP.
which works fine if a have selected only one plant.
For more plants, it displays always the last value calculated (as you can see at attached picture).
Could you please help me how I will give a different value per plant?
Thanks in advance.
2015 Aug 04 2:42 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |