2014 Feb 22 3:59 AM
Dear ABAP'ers,
I have a written a select statement which is not fetching data from the table .
passing values in so_werk, so_budat, so_arbpl
SELECT a~werks a~budat a~qualf a~urcod a~arbpl a~katalogart a~urgrp a~urcod a~version
a~iserh
INTO CORRESPONDING FIELDS OF TABLE itab1
FROM zctsi_pw AS a
WHERE a~werks IN so_werk
AND a~budat IN so_budat
AND a~arbpl IN so_arbpl
AND a~aufnr IN so_aufnr
AND a~urgrp IN so_urgrp
AND a~urcod IN so_urcod.
kindly guide me to solve the issue.
2014 Feb 22 4:12 AM
If the table Zctsi_pw is maintained in SAP , then cross check the data thru se11 . or if this table is created during the program execution , try to debug the program and see the content of the 'z' table.
2014 Feb 22 4:20 AM
Thanks Anjali,
Its a data dic table, I checked thru se11, data is available. When i debug, the internal table itab1 is not getting filled.
2014 Feb 22 4:30 AM
Is there any field whose data requires padding zero in beginning . i.e the data length is 16 , but the actual data is for 10 and for which u have to pad six zeros.
2014 Feb 22 4:34 AM
Hi Suhale,
i don't getting why you have written like this, the syntax you have used are used when we used
join conditions.
Simply write your logic as shown below
SELECT werks budat qualf urcod arbpl katalogarturgrp urcod version
iserh
INTO CORRESPONDING FIELDS OF TABLE itab1
FROM zctsi_pw
WHERE werks IN so_werk
AND budat IN so_budat
AND arbpl IN so_arbpl
AND aufnr IN so_aufnr
AND urgrp IN so_urgrp
AND urcod IN so_urcod.
One thing more have you used SELECT-OPTIONS or PARAMETERS
if parameters, then you have to change these declarations.
2014 Feb 22 4:32 AM
hi
Don`t pass value to so_werk, so_budat, so_arbpl, will get data?
then one by one check.
regards,
Archer
2014 Feb 22 4:33 AM
Hi,
Go to se16n and put the select option data in the respective field and execute, check if u r getting the records.
Hope it helps.
2014 Feb 22 4:44 AM
Hello Suhale,
Write like below.
TYPES : BEGIN of strt.
Declare the fields werks budat qualf urcod arbpl katalogart urgrp urcod versio iserh.
END OF strt.
DATA: itab TYPE TABLE OF strt.
SELECT werks budat qualf urcod arbpl katalogart urgrp urcod versio iserh
INTO TABLE itab
FROM zctsi_pw
WHERE werks IN so_werk
AND budat IN so_budat
AND arbpl IN so_arbpl
AND aufnr IN so_aufnr
AND urgrp IN so_urgrp
AND urcod IN so_urcod.
Don't use table alias, it can be used only if you are using the JOINS.
2014 Feb 22 5:43 AM
Issue Solved... Thanks for your help. issue is in IF statement.
Old Stmt:
---------------
IF so_werk = '1061'. " Problem is here"
SELECT a~werks a~budat a~qualf a~urcod a~arbpl a~katalogart a~urgrp a~urcod a~version
a~iserh
INTO CORRESPONDING FIELDS OF TABLE itab1
FROM zctsi_pw AS a
WHERE a~werks IN so_werk
AND a~budat IN so_budat
AND a~arbpl IN so_arbpl
AND a~aufnr IN so_aufnr
AND a~urgrp IN so_urgrp
AND a~urcod IN so_urcod.
ELSE.
***
***
ENDIF.
New Stmt:
----------------
IF so_werk-low = '1061'.
SELECT a~werks a~budat a~qualf a~urcod a~arbpl a~katalogart a~urgrp a~urcod a~version
a~iserh
INTO CORRESPONDING FIELDS OF TABLE itab1
FROM zctsi_pw AS a
WHERE a~werks IN so_werk
AND a~budat IN so_budat
AND a~arbpl IN so_arbpl
AND a~aufnr IN so_aufnr
AND a~urgrp IN so_urgrp
AND a~urcod IN so_urcod.
ELSE.
***
***
ENDIF.
2014 Feb 22 6:00 AM
You never mentioned "IF" statement in your earlier ( first) mail. Any how , as u solved it , it is good
close the thread
2014 Feb 22 6:08 AM
No he didn't. This really shows why it is so important to give full information when you have a problem. If he'd posted this in the first place, no-one's time would have been wasted. Very poor in my opinion.
2014 Feb 22 6:15 AM
Sorry Anjali,
I noticed only after the couple of debugging when it simple quit and moving to else part.
Thanks a lot.
2014 Feb 22 6:15 AM
Please mention the enough informations before posting in SCN.
2014 Feb 22 6:20 AM