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,072

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,025

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,025

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,025

HI BABA,

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

Read only

Former Member
0 Likes
1,025

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,025

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,025

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,027

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,025

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,025

Thanks for ur code..its working...