02-09-2007 5:24 AM
DATA: wa_usr05 TYPE usr05.
The select statement always gives sy-subrc = 0
even if there is no entry with parid = 'ZRD'.
On successful it fills the structure wa_usr05 as
MANDT C 3 ACC
BNAME C 12 SCL
PARID C 20 X
PARVA C 18
but mandt is 310.
USR05 is a pool table and has mandt field.
SELECT SINGLE bname
parid
parva
FROM usr05
INTO wa_usr05
WHERE bname = sy-uname AND
parid = 'ZRD' AND
parva = 'x' OR parva = 'X'.
Let me know the reason and solution to the problem.
02-09-2007 5:35 AM
SELECT SINGLE * FROM usr05
INTO wa_usr05
WHERE bname = sy-uname AND
parid = 'ZRD' AND
( parva = 'x' OR parva = 'X' ). "in brackets.
02-09-2007 5:30 AM
SELECT SINGLE * FROM usr05
INTO wa_usr05
WHERE bname = sy-uname AND
parid = 'ZRD' AND
parva = <b>'X'</b> .
Use single * as u have defined the wa+usr05 as usr05.
Else.
DATA: i_usr05 TYPE STANDARD TABLE of usr05.
SELECT * FROM USR05
INTO TABLE usr05
WHERE bname = sy-uname AND
parid = 'ZRD' AND
parva = <b>'X'</b> .
Then loop at itab and write data.
Hope this solves ur query.
Reward points if this helps.
Message was edited by:
Judith Jessie Selvi
02-09-2007 5:35 AM
Hi Jessi,
Can you tell me what is the use of <b> and </b> ? and why the select was always successful.
02-09-2007 5:35 AM
SELECT SINGLE * FROM usr05
INTO wa_usr05
WHERE bname = sy-uname AND
parid = 'ZRD' AND
( parva = 'x' OR parva = 'X' ). "in brackets.
02-09-2007 5:40 AM
02-09-2007 5:43 AM
Hi jessi,
if you see your first reply there it is mentioned
< b > and < / b > what is this ?
02-09-2007 5:44 AM
Hi,
Just tried to show it as bold thats y.
U can specify as 'X' that is enough no need for 'x'.
U can also specify with OR no problem with OR
U can simply specify that as
SELECT SINGLE * FROM usr05
INTO wa_usr05
WHERE bname = sy-uname AND
parid = 'ZRD' AND
parva IN ( 'X', 'x' ) .
The problem u had in ur query is with SINGLE fields and u were passing that to a work area with more number of fields, in taht case u should use INTO CORRESPONDING.
Hope u r clear now.
Reard poinst and close the thread if ur problem got solved.
Message was edited by:
Judith Jessie Selvi
02-09-2007 5:47 AM
The problem is solved ....
The need for 'x' is required as the part of the requirement
because user may type small x.
I was also thinking to convert to single * but want to know why the select run successfully.....May be bcoz some SAP constraints ...
Thanks Jessi..
02-09-2007 5:51 AM
Hi,
SELECT SINGLE * FROM usr05
INTO wa_usr05
WHERE bname = sy-uname AND
parid = 'ZRD' AND
parva IN ( 'X', 'x' ) .
The problem u had in ur query is with SINGLE fields and u were passing that to a work area with more number of fields, in taht case u should use <b>INTO CORRESPONDING FIELDS OF.</b>
U can reward points, u have closed the thread by your self without rewarding points. U can say thansk by rewarding points.
Click on the star against the reply which u want to reward points.
Also close the thread.
Whenever u r opening a thread reward points and close the thread. It will encourage those who are replying.