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

Former Member
0 Likes
1,055

hi all,

i m not getting any values for below code..as it contains some values in table..

SELECT SINGLE PSPNR POSID USR11 FROM PRPS INTO LT_PRPS WHERE PSPNR = LV_WBS_ELEM_E1.

.

READ TABLE LT_PRPS INTO WA_PRPS WITH KEY LV_USR11 = 'X'.

IF SY-SUBRC = 0.

MOVE 'X' TO LV_CHECK.

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,008

your select doesnt look, bad, so are you really sure there is data in the Table?

and i dont mean any data, i mean data matching your where condition.

8 REPLIES 8
Read only

Former Member
0 Likes
1,008

SELECT SINGLE PSPNR POSID USR11 FROM PRPS INTO LT_PRPS WHERE PSPNR = LV_WBS_ELEM_E1.

.

READ TABLE LT_PRPS INTO WA_PRPS WITH KEY LV_USR11 = 'X'.

IF SY-SUBRC = 0.

MOVE 'X' TO LV_CHECK.

ENDIF.

Please change the query like below.

Clear: PRPS

SELECT SINGLE * FROM PRPS WHERE PSPNR = LV_WBS_ELEM_E1.

IF SY-SUBRC = 0 AND PRPS-LV_USR11 = 'X'.

.MOVE 'X' TO LV_CHECK.

ENDIF.

Thanks,

Read only

0 Likes
1,008

HI BABA,

there is NO INTO statement..it is giving error..pls help

Read only

Former Member
0 Likes
1,008

Hi,

Check in debug mode if you need to remove leading zeros.

If yes you can use function module Conversion_exit_alpha_output.

Hope it helps.

Regards,

Siddhesh S.Tawate

Read only

Former Member
0 Likes
1,008

Hi

You write code like this.

DATA: LV_CHECK LIKE PRPS-US11.

SELECT SINGLE PSPNR POSID USR11

FROM PRPS

INTO LT_PRPS

WHERE PSPNR = LV_WBS_ELEM_E1.

.

READ TABLE LT_PRPS

INTO WA_PRPS

WITH KEY USR11 = 'X'.

IF SY-SUBRC = 0.

MOVE WA_PRPS-USR11 TO LV_CHECK.

ENDIF.

REGARDS,

KAMALA.

Read only

Former Member
0 Likes
1,008

SELECT SINGLE PSPNR POSID USR11 FROM PRPS INTO LT_PRPS WHERE PSPNR = LV_WBS_ELEM_E1.

.

READ TABLE LT_PRPS INTO WA_PRPS WITH KEY LV_USR11 = 'X'.

IF SY-SUBRC = 0.

MOVE 'X' TO LV_CHECK.

ENDIF.

Please change the query like below.

Clear: PRPS

SELECT SINGLE * FROM into LT_PRPS WHERE PRPS WHERE PSPNR = LV_WBS_ELEM_E1.

IF SY-SUBRC = 0 AND PRPS-LV_USR11 = 'X'.

.MOVE 'X' TO LV_CHECK.

ENDIF.

Read only

Former Member
0 Likes
1,009

your select doesnt look, bad, so are you really sure there is data in the Table?

and i dont mean any data, i mean data matching your where condition.

Read only

0 Likes
1,008

Use below code..

SELECT SINGLE USR11 FROM PRPS INTO LV_USR11

WHERE POSID = LV_WBS_ELEM_E.

MOVE LV_USR11 TO LV_CHECK.

Read only

0 Likes
1,008

Thanks for ur code..its working...