‎2008 Jul 09 2:07 PM
Hi,
can anyone tell me what this code is doing?
SELECT matnr labst
FROM mard
APPENDING TABLE i_stock
FOR ALL ENTRIES IN i_matdoc
WHERE matnr = i_matdoc-matnr
AND werks = i_matdoc-werks.
why is this appending written?
regards,
Poonam
‎2008 Jul 09 2:17 PM
Hi ,
It is similar to ... INTO TABLE lt_tab, but the difference is that read lines are appended to the previous contents of the internal table lt_tab.
Best regards,
raam
‎2008 Jul 09 2:08 PM
hi,
If there is already any data in the internal table it is not refreshed,
this select stmt. will just keep appending the new values to the same internal table.
Regards,
Subramanian
‎2008 Jul 09 2:11 PM
I very good way to learn about a ABAP is to become familiar with the F1 Function key in the Text Editor when you are unfamilar with a Statement and Syntax. It is much faster than posting a thread here.
‎2008 Jul 09 2:12 PM
Hi,
The records that are allready there in the Internal table will not be refreshed . The new records from the select statement will be appended to the allready exsisting records .
‎2008 Jul 09 2:12 PM
hi,
if my internal table has data before select stmt triggers.
once select stmt is executed then the data in the internal table is refreshed and new data is stored as per the select stmt.
to avoid that we use append stmt in select , the purpose the selected values are appended to the existing internal table values.
Rgds
subash
‎2008 Jul 09 2:13 PM
hi,
in ABAP edtor on select keyword put cursor and press F1 you will get detail documentation for this.
warm regards,
surendar reddy.
‎2008 Jul 09 2:14 PM
Hi Poonam,
The select statement is selecting the matnr and labst from mard table and appending them into table i_stock for all those entries in the internal table i_matdoc which are satisfying the condition.
Here instead of into table we are using APPENDING TABLE, which appends the records into the table.
Hope this helps you.
Regards,
Chandra Sekhar
‎2008 Jul 09 2:14 PM
i_stock might be having entries even before executing to this
select .. In order to retain old values along with the new values
APPENDING is used ...
‎2008 Jul 09 2:17 PM
Hi ,
It is similar to ... INTO TABLE lt_tab, but the difference is that read lines are appended to the previous contents of the internal table lt_tab.
Best regards,
raam
‎2008 Jul 09 2:26 PM
‎2008 Jul 09 2:27 PM
if the criteria is to select data from 2 db tables into the 1 internal table and where u cannot use joins this statement is used..