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

group the data

Former Member
0 Likes
782

SELECTION- CRITERIA:

PLANT

DATE

TIME

PROGRAM START:

IF PLANT = 1204 THEN REFER LAYOUT 1 AS AN OUTPUT AND

SELECT

MSEG-MATNR ( MATERIAL)

MSEG-MENGE ( QUNTITY)

WHERE

MKPF-BUDAT = SELECTION CRITERIA

MSEG-WERKS = THE SELECTION CRITERIA

MSEG-BWART = ‘101’

MSEG-AUFNR >0

MSEG-LGORT(SLOC) = 1204&7610&7620&7630.

TABLES MKPF AND MSEG CAN BE LINKED VAI THE KEY FIELD MBLNR

Group the data SLOC 1204, 7610, 7620, 7630, 7640. as per the layout.

Group the data in each individual SLOC where CAUFV-AUART =

ZP20 FOR DOOR

ZP24 FOR REAR

ZP26&ZP27 FOR WIND

ZP25 FOR TUFF ASSEMBLINES

ZP28 FOR LAM ASSEMBLINES

WHERE CAUFV-AUFNR = MSEG-AUFNR

IF CAUFV-AUART = ZR00. GROUP THOSE VALUES WHERE MARC-DISGR =

ZP20 FOR DOOR REWORK

ZP24 FOR REAR REWORK

ZP26 &ZP27 REWORKS

this is the requirement how can i group the data can anybody suggest me and how can i write the code for this.

1 REPLY 1
Read only

Former Member
0 Likes
467

Is the below complete spec because they seem to be incomplete and out of sync..

SELECTION- CRITERIA:

PLANT

DATE

TIME

==>

select-option: plant for mseg-werks,

date for mkpf-budat.

PROGRAM START:

IF PLANT = 1204 THEN REFER LAYOUT 1 AS AN OUTPUT AND

SELECT

MSEG-MATNR ( MATERIAL)

MSEG-MENGE ( QUNTITY)

WHERE

MKPF-BUDAT = SELECTION CRITERIA

MSEG-WERKS = THE SELECTION CRITERIA

MSEG-BWART = ‘101’

MSEG-AUFNR >0

MSEG-LGORT(SLOC) = 1204&7610&7620&7630.

TABLES MKPF AND MSEG CAN BE LINKED VAI THE KEY FIELD MBLNR

==>

select mseg-lgort mseg-matnr mseg-menge mseg-aufnr

into table itab

from mkpf inner join mseg on mkpf-mblnr = mseg-mblnr

where mkpf-budat in date and mseg-werks in plant and mseg-bwart = '101' and mseg-aufnr > 0 and mseg-lgort in ('1204','7610','7620','7630').

Group the data SLOC 1204, 7610, 7620, 7630, 7640. as per the layout.

==>Not sure what do you mean by that by in the itab you can use the AT NEW and AT END OF events to group it by storage location as it is our first field in the internal table. Please remember to sort it before the loop.

Group the data in each individual SLOC where CAUFV-AUART =

ZP20 FOR DOOR

ZP24 FOR REAR

ZP26&ZP27 FOR WIND

ZP25 FOR TUFF ASSEMBLINES

ZP28 FOR LAM ASSEMBLINES

WHERE CAUFV-AUFNR = MSEG-AUFNR

==>

select mseg-lgort caufv-auart

into itab1

from mseg inner join caufv on mseg-aufnr = caufv-aufnr

where mseg-lgort = itab-lgort.

you can check on the above as well as the below on auart field.

IF CAUFV-AUART = ZR00. GROUP THOSE VALUES WHERE MARC-DISGR =

ZP20 FOR DOOR REWORK

ZP24 FOR REAR REWORK

ZP26 &ZP27 REWORKS

Message was edited by: Anurag Bankley