02-10-2010 10:13 AM
Hi Experts,
I have issue with field group. I declared like,
FIELD-GROUPS: header.
INSERT: ext-afaber
ext-ktogr
ext-afasl
ext-gsber
ext-fkber
ext-kostl
ext-fistl INTO header.
Its working fine for one first time. second time the same code will be executed with some other datas
and it throws a dump.
Error description is,
With field groups, INSERT is not supported after EXTRACT.
The current ABAP program "SAPLZALT_FG806" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
The current ABAP program "SAPLZALT_FG806" uses field groups and
extract techniques.
Extracts consist of records of different types where the structure
of each record type is described by a field group.
If there is a field group HEADER, it precedes every record.
Although an extract dataset can contain different record types,
each individual record type must be consistent in its structure.
This means that you cannot modify a field group
when the first record of that type has been extracted.
This program attempts to place a new field "EXT-AFABER" in the field group
"\FUNCTION-POOL=ZALT_FG806\DATA=HEADER[]", although a record of type
"\FUNCTION-POOL=ZALT_FG806\DATA=HEADER[]" was already extracted.
Can anybody help me on this. After extracting the field group im in need of again insert data's to the same field group.
Thanks in advance,
Helps will be appreciated.
Edited by: Nandini on Feb 10, 2010 11:48 AM
02-10-2010 10:51 AM
Hi
It seems you're using INSERT twice, u should use it once at the begging
Max
02-10-2010 11:16 AM
Hi,
Is there any way to insert into the field group that was already extracted.
Thanks.
02-10-2010 11:21 AM
No
The INSERT can't be done after an extraction: why do u need to do it again?
From help:
The field group header can only be extended till a field group of the program is extracted because it is a part of all field groups. An INSERT statement for an already extracted field group causes an exception that cannot be handled.
Max
02-10-2010 11:29 AM
INSERT statment is used to define the structure of your Extract dataset.
EXTRACT statement is used to insert data to your extract dataset.
You can call n number of INSERT statement provided you havent called your first EXTRACT statement.
02-10-2010 12:07 PM
Hi Experts thanks for your repies.
Im customizing standard program and that program has the field groups. They used it for a single display but i need to loop it for multiple times. So the first time its working fine and then the second time it goes to dump.
Program is RAPOST2000 & Subroutine is FORM INIT_EXT.
Is there any alternate available for field group.
Please Advice,
Thanks Again.
02-10-2010 12:16 PM
Use statement.
LOOP.
ENDLOOP.
Thats how u get data out of your extract data set.
02-10-2010 12:34 PM
Hi Antony,
I did search in that std program RAPOST2000. I didnt found any code like EXTRACT HEADER.
So whats the meaning. Extract is not yet done for the field group 'Header'. Right?
Thanks.
Edited by: Nandini on Feb 10, 2010 2:14 PM
02-10-2010 1:34 PM
You dont have to explicitly say EXTRACT header.
The following code in the program RAPOST2000 will also extract data into header
EXTRACT posten.
I think you are still not clear about how an extract dataset works
Go through the below link
[http://help.sap.com/saphelp_nw70/helpdata/EN/9f/db9ed135c111d1829f0000e829fbfe/content.htm]