2005 Aug 11 3:54 PM
I am trying to fetch all the values of POSNR for given values of AUFNR and VORNR from RESB.
Using databrowser in se11 I can query posnr on above condition and also can see the queried data.
But when I try to write SQL statements in my report nothing gets fetched. I am wondering the way I am querying is wrong or what ?
(Also I get warning like VORNR may contain null values in where clause but it get activated. I guess this is not the problem)
report ZTF1.
TABLES: RESB.
DATA: BEGIN OF IRESB OCCURS 100,
W_POSNR LIKE RESB-POSNR,
END OF IRESB.
SELECT POSNR from RESB INTO IRESB-W_POSNR where VORNR = 0010 and AUFNR = 7200000100.
ENDSELECT.
LOOP AT IRESB.
WRITE: / IRESB-W_POSNR.
ENDLOOP.
2005 Aug 11 4:00 PM
Hi Tushar,
In your SELECT you select only record for record and you put the result into the header line of the table.
Try:
SELECT posnr
FROM RESB
INTO TABLE IRESB
WHERE VORNR = '0010'
AND AUFNR = '720000100'.
Then you can loop over your internal table!.
Regards,
John.
Hi Tushar,
In your SELECT you select only record for record and you put the result into the header line of the table.
Try:
SELECT posnr
FROM RESB
INTO TABLE IRESB
WHERE VORNR = '0010'
AND AUFNR = '720000100'.
Then you can loop over your internal table!.
Regards,
John.
2005 Aug 11 3:59 PM
Hi,
The select is failing because there is a convertion exit for both these fields.
For VORNR it is NUMCV and for AUFNR it is ALPHA.
You can get the corresponding function module by checking in SE37 ( NUMCV and ALPHA).
Before the selection convert the values. The function modules are
CONVERSION_EXIT_NUMCV_INPUT
CONVERSION_EXIT_ALPHA_INPUT
Hope this will work.
Thanks
Vinod
2005 Aug 11 4:00 PM
Hi Tushar,
In your SELECT you select only record for record and you put the result into the header line of the table.
Try:
SELECT posnr
FROM RESB
INTO TABLE IRESB
WHERE VORNR = '0010'
AND AUFNR = '720000100'.
Then you can loop over your internal table!.
Regards,
John.
2005 Aug 11 4:03 PM
2005 Aug 11 4:01 PM
Hi, try this
SELECT POSNR from RESB INTO IRESB-W_POSNR where VORNR = '0010' and AUFNR = '007200000100'.
ENDSELECT.
or use FM 'CONVERSION_EXIT_ALPHA_OUTPUT' to convert AUFNR
Svetliin
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |