‎2009 Jan 28 7:02 PM
Hi,
I need some coding to select data from table and insert in a target field.
In the definition of start routine I have this:
TYPES : BEGIN OF TYITAB,
MATERIAL TYPE /BI0/ASD_O0100-MATERIAL,
ITEM_CATEG TYPE /BI0/ASD_O0100-ITEM_CATEG,
END OF TYITAB.
DATA: ITAB TYPE STANDARD TABLE OF TYITAB,
WA TYPE TYITAB.
In the implementation:
I need it to write material and item category from /BI0/ASD_O0100 to itab where source_fields-material are identical with material.
Any help on select statement in implementation would be great.
Br,
Sonni
‎2009 Jan 28 7:07 PM
HI,
SELECT MATERIAL ITEM_CATEG
FROM /BI0/ASD_O0100
INTO TABLE ITAB
WHERE <Condt>.
‎2009 Jan 28 7:07 PM
HI,
SELECT MATERIAL ITEM_CATEG
FROM /BI0/ASD_O0100
INTO TABLE ITAB
WHERE <Condt>.
‎2009 Jan 28 7:19 PM
Hi,
Thank you - it does give me a runtime error when executing which stops at the select statement beginning:
Error: GETWA_NOT_ASSIGNED.
> SELECT MATERIAL ITEM_CATEG
FROM /BI0/ASD_O0100
INTO TABLE ITAB
WHERE MATERIAL = <SOURCE_FIELDS>-MATERIAL.
What could be wrong?
Br,
Sonni
Edited by: Sonni Jacobsen on Jan 28, 2009 8:20 PM
‎2009 Jan 28 7:25 PM
Hi,
The problem could be with <SOURCE_FIELDS>-MATERIAL ..instead of this try to hard code the material number and test it.
‎2009 Jan 28 7:32 PM
Hi Sonni,
Error is because of the field symbol.
You are using field symbol without assigning it.
For example <fs> is a field symbol, you can not directly use it like
SELECT PERID
FROM PA0002
WHERE PERNR = <FS>-PERNR.
Actual procedure is
ASSIGN ITAB TO <FS> (please check syntax of ASSIGN).
and use
SELECT PERID
FROMPA0002
WHERE PERNR = <FS>-PERNR.
where itab is your internal table with field PERNR in it.
just assign your field symbol before using it.
mubeen
‎2009 Jan 28 7:27 PM
Hi Sonni,
SELECT statement is a very important statement in ABAP and it is very simple.
SELECT field names
FROM database table name / view name
INTO TABLE internal table name
WHERE conditions
AND/OR more conditions.
ex: SELECT nachn vorna perid
from pa0002
into table itab
where pernr = '10001'.
There are other forms of SELECT like if you want to select just one record
SELECT SINGLE *
FROM data base table name
INTO stucture
WHERE conditions
AND/OR more conditions
There are many other forms, check syntax in ABAP editor
Let me know if you want to know more.
mubeen