2009 Feb 18 9:56 AM
Hi ,
Can i use EXTRACT (FIELD GROUPS) in a ordinary select without any logical database?
If yes, send me some sample for that.
Thanks,
Nithya.
2009 Feb 18 10:03 AM
Hi Nithya,
Refer the following code:
tables: mara.
types : begin of str_mara,
matnr type matnr,
mtart type mtart,
meins type meins,
matkl type matkl,
ernam type ernam,
mbrsh type mbrsh,
bstme type bstme,
end of str_mara.
data: wa_mara type str_mara,
it_mara type standard table of str_mara.
field-groups: fld_grp.
start-of-selection.
insert mara-matnr mara-mtart mara-meins
mara-matkl mara-ernam mara-mbrsh mara-bstme into fld_grp.
select matnr mtart meins matkl ernam mbrsh bstme from mara into
correspoNDING FIELDS OF mara.
extract fld_grp.
endselect.
*SORT ASCENDING .
clear mara.
loop.
at fld_grp .
wa_mara-matnr = mara-matnr.
wa_mara-mtart = mara-mtart.
wa_mara-meins = mara-meins.
wa_mara-matkl = mara-matkl.
wa_mara-ernam = mara-ernam.
wa_mara-mbrsh = mara-mbrsh.
wa_mara-bstme = mara-bstme.
append wa_mara to it_mara.
endat.
endloop.
loop at it_mara into wa_mara.
write:/ wa_mara-matnr, wa_mara-mtart, wa_mara-meins.
endloop.
Regards,
Nitin.
2009 Feb 18 10:03 AM
Hi Nithya,
Refer the following code:
tables: mara.
types : begin of str_mara,
matnr type matnr,
mtart type mtart,
meins type meins,
matkl type matkl,
ernam type ernam,
mbrsh type mbrsh,
bstme type bstme,
end of str_mara.
data: wa_mara type str_mara,
it_mara type standard table of str_mara.
field-groups: fld_grp.
start-of-selection.
insert mara-matnr mara-mtart mara-meins
mara-matkl mara-ernam mara-mbrsh mara-bstme into fld_grp.
select matnr mtart meins matkl ernam mbrsh bstme from mara into
correspoNDING FIELDS OF mara.
extract fld_grp.
endselect.
*SORT ASCENDING .
clear mara.
loop.
at fld_grp .
wa_mara-matnr = mara-matnr.
wa_mara-mtart = mara-mtart.
wa_mara-meins = mara-meins.
wa_mara-matkl = mara-matkl.
wa_mara-ernam = mara-ernam.
wa_mara-mbrsh = mara-mbrsh.
wa_mara-bstme = mara-bstme.
append wa_mara to it_mara.
endat.
endloop.
loop at it_mara into wa_mara.
write:/ wa_mara-matnr, wa_mara-mtart, wa_mara-meins.
endloop.
Regards,
Nitin.
2009 Feb 18 10:04 AM
2009 Feb 18 10:04 AM
Hello,
check the code .....its an SAP std code or
write extract and press F1 for help
REPORT demo_extract.
NODES: spfli, sflight.
FIELD-GROUPS: header, flight_info, flight_date.
START-OF-SELECTION.
INSERT: spfli-carrid spfli-connid sflight-fldate
INTO header,
spfli-cityfrom spfli-cityto
INTO flight_info.
GET spfli.
EXTRACT flight_info.
GET sflight.
EXTRACT flight_date.
Thank u,'
santhosh
2009 Feb 18 10:08 AM