Application Development 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: 

plz chk the code

Former Member
0 Kudos
176

==================================

PERFORM get_spool_number USING sy-repid

sy-uname

CHANGING mi_rqident.

=====================================

FORM get_spool_number USING f_repid

f_uname

CHANGING f_rqident.

DATA:

lc_rq2name LIKE tsp01-rq2name.

CONCATENATE f_repid+0(8)

f_uname+0(3)

INTO lc_rq2name SEPARATED BY '_'.

SELECT rqident FROM tsp01 WHERE rq2name = lc_rq2name

ORDER BY rqcretime DESCENDING.

f_rqident = tsp01-rqident.

EXIT.

ENDSELECT.

IF sy-subrc NE 0.

CLEAR f_rqident.

ENDIF.

ENDFORM." get_spool_number

Field list without INTO clause is not allowed . allowed. . allowed. .

is the error i m getting when i activate it..

what is the error in select query....

8 REPLIES 8

Former Member
0 Kudos
140

Declare table tsp01.

like

Tables: tsp01.

in ur program

Former Member
0 Kudos
140

declare as follows in global data declaration of ur code.

tables tsp01.

Former Member
0 Kudos
140

either you can use select * for your qery or

SELECT rqident FROM tsp01 <b>into tsp01</b>-rqident WHERE rq2name = lc_rq2name

ORDER BY rqcretime DESCENDING.

f_rqident = tsp01-rqident.

EXIT.

ENDSELECT.

regards

shiba dutta

Former Member
0 Kudos
140

i guess u r missing INTO clause in the select statement

SELECT rqident FROM tsp01 INTO tsp01-rqident WHERE rq2name = lc_rq2name
ORDER BY rqcretime DESCENDING.
f_rqident = tsp01-rqident.
EXIT.
ENDSELECT.

also declare the table as suggested by others

Message was edited by:

Chandrasekhar Jagarlamudi

Message was edited by:

Chandrasekhar Jagarlamudi

Former Member
0 Kudos
140

Hi neha,

look at this short example. you have to use an INTO-Field.

*

TABLES: MARA.

data: matnr like mara-matnr.

START-OF-SELECTION.

*

SELECT MATNR FROM MARA UP TO 10 ROWS into matnr.

*

WRITE: / MARA-MATNR, matnr.

*

ENDSELECT.

*

Regards, Dieter

Former Member
0 Kudos
140

Neha,

use below code

data : v_temp like tsp01-rqident.

SELECT rqident FROM tsp01 into v_temp WHERE rq2name = lc_rq2name

ORDER BY rqcretime DESCENDING.

f_rqident = tsp01-rqident.

EXIT.

ENDSELECT.

you have to use into variable name in your select statement

reward Pls.

Former Member
0 Kudos
140

Hi Neha ,

Declare the table tsp01 in your program using the command

<b>TABLES : tsp01.</b>

Regards

Arun

Former Member
0 Kudos
140

Hi,

try this

==================================
PERFORM get_spool_number USING sy-repid
sy-uname
CHANGING mi_rqident.
=====================================
FORM get_spool_number USING f_repid
f_uname
CHANGING f_rqident.
DATA: lc_rq2name LIKE tsp01-rq2name.

CONCATENATE f_repid+0(8) f_uname+0(3) 
INTO lc_rq2name SEPARATED BY '_'.

SELECT rqident INTO tsp01-rqident FROM tsp01 
WHERE rq2name = lc_rq2name
ORDER BY rqcretime DESCENDING.

f_rqident = tsp01-rqident.

EXIT.
ENDSELECT.
IF sy-subrc NE 0.
CLEAR f_rqident.
ENDIF.
ENDFORM." get_spool_number

Make sure that u have declared teh TABLES: tsp01.

Hope thsi solves ur problem.

Reward points and close the thread if ur problem got solved.