Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Select statement failed to get data from transparent table

former_member936723
Participant
0 Likes
3,083

Hi Experts,

Please let me know why my select statement is failing to get data form transparent table REGUH. My code query is as below:



SELECT * FROM REGUH WHERE
                          LAUFD = RUN_DATE AND
                          LAUFI = ID AND
                          LIFNR = P0009-PERNR AND
                          RZAWE = 'C'.

  MOVE REGUH-RWBTR TO CASH.
      CASH = CASH * -1.

  ENDSELECT.



REGUH table has data for the given query but it is not retreiving the data.Please let me know what is the problem with the query

because of which it is not fetching the data.The same query is working fine in Developement but fails in production may be because one new patch is updated.please help asap.

1 ACCEPTED SOLUTION
Read only

ravi_lanjewar
Contributor
0 Likes
1,805

Hi,

Do one simple thing debug the program, the variable assign in sql not the value of all variable and open table in se16 and put all value which receiving in the dubug. you get exact situaltion over there. Some time happend people define select option for input and while select SQL use = sign insted of in.

Try this.

Rgds

Ravi Lanjewar

15 REPLIES 15
Read only

ravi_lanjewar
Contributor
0 Likes
1,806

Hi,

Do one simple thing debug the program, the variable assign in sql not the value of all variable and open table in se16 and put all value which receiving in the dubug. you get exact situaltion over there. Some time happend people define select option for input and while select SQL use = sign insted of in.

Try this.

Rgds

Ravi Lanjewar

Read only

0 Likes
1,805

No, i have checked it already all variables are under parameter statement only and there is data in the table for the provided query i have checked it during debbuging.

Read only

0 Likes
1,805

Ankita,

try to add where condition one by one and check whether select query is able to fetch data

Thanks

Bala Duvvuri

Read only

0 Likes
1,805

Hi ,

Actually the same query is running fine in development and QA but fails in production.Can you tell any reason why is it happening?

Rgds,

Ankita

Read only

0 Likes
1,805

Hi Ankita,

Why you are going for select *

Try This...

SELECT SINGLE RWBTR

INTO v_RWBTR

WHERE LAUFD = RUN_DATE

AND LAUFI = ID

AND LIFNR = P0009-PERNR

AND RZAWE = 'C'.

MOVE v_RWBTR TO CASH.

CASH = CASH * -1.

Regards,

Raj.

Read only

0 Likes
1,805

Hi,

p0009 is a structure right....why you are given strucutre in condition

Regards,

Raj...

Read only

Former Member
0 Likes
1,805

Hi,

I think there is a datatype mismatch between LIFNR (CHAR10) and P0009-PERNR(NUMC 8). Use the conversion exit and check the query again.

Regards

Vinod

Read only

Former Member
0 Likes
1,805

Hi,

in REGUH are the fields LIFNR and PERNR.

LIFNR = WA_ITAB-LIFNR "if you have an LIFNR in WA_ITAB

or

PERNR = P0009-PERNR

LIFNR is CHAR 10

PERNR in NUMC 8.

Look via SE11 in REGUH.

Regards, Dieter

Read only

0 Likes
1,805

Hi Dieter,

You are right but why same things are running fine in DEV and QA but not in production?

Rgds,

Ankita

Read only

0 Likes
1,805

Hi,

do you have the same authority in all systems?

regards, Dieter

Read only

0 Likes
1,805

Ya it is the same

Read only

0 Likes
1,805

Hi,

I am facing the same issue with a select statement on Transparent Table in Development. I do not have any where conditions and the fields are declared based on the same Transparent Table.

I am just selecting two fields MATNR & PRDHA from MATKEY table, where both are not key fields. I am wondering why this happens?

Pls let me know if any one has the solution?

Thanks,

Naren

Read only

0 Likes
1,805

Mine got resolved.. The Variables I was using to read the data from the table had names starting with 'Z', which was the issue.

I changed the Variable names to some proper names and the select statement worked properly.

Read only

Former Member
0 Likes
1,805

Hi,

Goto se16 what are the value pass the select query same value pass to database table manually.So you'll get the solution for it.

Thanks

With Regards

I.Muthukumar.

Read only

0 Likes
1,805

Hi Muthukumar.

Ya i have done the same and it is displaying the data for the same.

Rgds,

Ankita