‎2008 Dec 26 5:36 PM
I would like to take first 9 digit from a table column where input match with 9 digit.
for e.g PROJ table , column ZUONR(9).
How to do in the select statement where cond?
Select * from PROJ into IT_TAB where ZUONR(9) = input ZUONR.
Any suggestion
‎2008 Dec 26 5:41 PM
Field ZUONR in PROJ not exist.
Reframe your question with right information and good language.
‎2008 Dec 26 5:55 PM
I have an internal table with zvalue - containing 9 digit values only .
I'm using this value in a select statement of PROJ Where PSPID = intab value.
There are some cases where pspid has 10 digits so i need to compare only 9 digits of PSPID with my internal table value.
SELECT * FROM WHERE PSPID = ITAB-ZVALUE.
this select will retrieve only values where pspid has 9 digits.
but if proj-pspid has 10 digits i need to check the 9 digits of PSPID with my itab value.
Any suggestion
Edited by: Prabha on Dec 26, 2008 11:00 AM
‎2008 Dec 26 6:06 PM
‎2008 Dec 26 6:07 PM
Hi,
Try Select * from PROJ into IT_TAB where PSPID(9) LIKE '%xxx'.
Guy.
‎2008 Dec 26 6:08 PM
tables:proj."This is must
data:it_itab TYPE STANDARD TABLE OF proj WITH HEADER LINE.
Select * from PROJ.
IF proj-PSPID(9) = xxx.
APPEND proj to it_itab.
ENDIF.
ENDSELECT.
‎2008 Dec 26 6:14 PM
>
> Hi,
>
> Try Select * from PROJ into IT_TAB where PSPID(9) LIKE '%xxx'.
>
> Guy.
This Will Syntax Error.
‎2008 Dec 26 6:16 PM
I didn't mean "Try" as in the command, but as in "attempt the following code".
‎2008 Dec 26 6:32 PM
Yes,I know every one gives here some Code snippet(only idea,Not exact code ).
But your basic suggestion( PSPID(9) with Select query ) would give syntax error.We cannot use Offsets with select queries.
‎2008 Dec 26 6:55 PM
Without if condition is it possible in select statement?becoz i'm joining two table, other table has only 9 digit in the table coumn?
‎2008 Dec 26 7:08 PM
LOOP AT itab.
SELECT * FROM prpj.
if prpj-PSPID(9) = itab-pspid.
APPEND prpj TO itab2 .
endif.
ENDSELECT.
ENDLOOP.With select query we cannot use Offsets anyway.So you may need to do work some around this only.
‎2008 Dec 26 9:54 PM