‎2008 Aug 06 4:54 AM
Hi All,
Iam currently encounting a simple select statement problem. Iam using the below code retrieve data into a internal table, but not able to do so.
tables : iflot, iflotx.
data : l_func_loc like iflot-tplnr.
DATA : L_iflot LIKE IFLOT OCCURS 0 WITH HEADER LINE.
l_func_loc = 'AB01.04.25.01-TRH03'.
select * FROM IFLOT into TABLE l_iflot WHERE TPLNR = l_func_loc.
if sy-subrc = 0.
read table l_iflot index 1.
write : l_iflot-submt.
endif.
This normal statement does not work. but when i search in the table iflot using se16 i have one record for tplnr = 'AB01.04.25.01-TRH03'.
Please help me to solve this problem.
Thanks,
Raj
‎2008 Aug 06 5:55 AM
Hi All,
No solution still now. The solutions given did not work. Can anyone help in this.
but when i use the below statement all records can be retrieved.
select * FROM IFLOT into TABLE l_ITOB WHERE TPLNR ne ' '.
if sy-subrc = 0.
read table l_itob index 1.
write : l_itob-submt.
endif.
when i retrieve the record for tplnr = 'AB01.04.25.01-TRH03' using se16 in table iflot, the output for tpnlr field seems to be '?0100000000000002070' .
can anyone tell me why.
Thanks,
Rajesh.
Edited by: Rajesh KUmar on Aug 6, 2008 6:56 AM
‎2008 Aug 06 5:02 AM
use conversion exit and then try
Function module CONVERSION_EXIT_TPLNR_INPUT
TABLES : iflot, iflotx.
DATA : l_func_loc LIKE iflot-tplnr.
DATA : l_iflot LIKE iflot OCCURS 0 WITH HEADER LINE.
l_func_loc = ' ' . "give the value of location
CALL FUNCTION 'CONVERSION_EXIT_TPLNR_INPUT'
EXPORTING
input = l_func_loc
* I_FLG_CHECK_INTERNAL = 'X'
IMPORTING
OUTPUT = l_func_loc
* EXCEPTIONS
* NOT_FOUND = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SELECT * FROM iflot INTO CORRESPONDING FIELDS OF TABLE l_iflot WHERE tplnr = l_func_loc.
IF sy-subrc = 0.
READ TABLE l_iflot INDEX 1.
WRITE : l_iflot-submt.
ENDIF.
Edited by: mrugesh phatak on Aug 6, 2008 6:03 AM
‎2008 Aug 06 5:06 AM
Hi,
try this...
ables : iflot, iflotx.
data : l_func_loc like iflot-tplnr.
DATA : L_iflot LIKE IFLOT OCCURS 0 WITH HEADER LINE.
select * FROM IFLOT into TABLE l_iflot WHERE TPLNR = 'AB01.04.25.01-TRH03'.
if sy-subrc = 0.
read table l_iflot index 1.
write : l_iflot-submt.
endif.
‎2008 Aug 06 5:07 AM
hi rajesh
pls change the where clause like --> "WHERE iflot-TPLNR = l_func_loc."
‎2008 Aug 06 5:53 AM
Check the value 'AB01.04.25.01-TRH03' you are passing to l_func_loc .As it is of type CHAR if there is any lowercase charactor or space select statement will not work.
‎2008 Aug 06 5:55 AM
Hi All,
No solution still now. The solutions given did not work. Can anyone help in this.
but when i use the below statement all records can be retrieved.
select * FROM IFLOT into TABLE l_ITOB WHERE TPLNR ne ' '.
if sy-subrc = 0.
read table l_itob index 1.
write : l_itob-submt.
endif.
when i retrieve the record for tplnr = 'AB01.04.25.01-TRH03' using se16 in table iflot, the output for tpnlr field seems to be '?0100000000000002070' .
can anyone tell me why.
Thanks,
Rajesh.
Edited by: Rajesh KUmar on Aug 6, 2008 6:56 AM
‎2008 Aug 06 6:25 AM
Hi Rajesh KUmar,
The code which I have written above is working fine.
Just set a break point on select statement & see if you are getting values in your internal table.
In my server Report is coming blank because there is no value maintained for 'submt' field
just check if the same case is there at your end.
you said
when i retrieve the record for tplnr = 'AB01.04.25.01-TRH03' using se16 in table iflot, the output for tpnlr field seems to be '?0100000000000002070' .
this is because the the field 'tplnr' is having a Convers. Routine TPLNR
if u check in FM -> CONVERSION_EXIT_TPLNR_OUTPUT
input 0100000000000002070
u will get output as AB01.04.25.01-TRH03
to check i ffield is having a Convers. Routine
1.go to ur table in se11
2.double click on data element
3.open the Domain TPLNR
4.In definition tab u will get Convers. Routine TPLNR
if u still face a problem do reply
Edited by: mrugesh phatak on Aug 6, 2008 7:26 AM
‎2008 Aug 06 6:11 AM
Hi
Check with 'LIKE' or CP
select * FROM IFLOT into TABLE l_iflot WHERE TPLNR like l_func_loc.
select * FROM IFLOT into TABLE l_iflot WHERE TPLNR CP l_func_loc.
regards
padma
‎2008 Aug 06 6:15 AM
Us ethis way.
select * FROM IFLOT into TABLE l_iflot WHERE TPLNR EQ l_func_loc.
rgds
rajesh
‎2008 Aug 06 6:29 AM