‎2010 Jul 06 11:17 AM
Hi Experts,
we are facing some problem in select query while fetching the data.
data is coming to internal table t_table. but when i am trying to retrieve data into t_afko, it is not retrieving.
please find below code.
SELECT sap_po_nb vin_nb vsl_nb gltrp matnr werks
FROM zprdctn_ordr_mpn
INTO TABLE t_table
WHERE gltrp IN s_date AND vsl_nb IN s_vslnum
AND matnr IN s_mat AND werks IN s_plant.
IF sy-subrc EQ 0.
SELECT aufnr stlst FROM afko
INTO table t_afko
for all entries in t_table
WHERE aufnr = t_table-sap_po_nb and stlst = '01'.
endif.
Regards,
lokeswari.
‎2010 Jul 06 11:30 AM
‎2010 Jul 06 11:32 AM
‎2010 Jul 06 11:49 AM
Hi lokeswari,
Maintaine SAP_PO data type as AUFNR. and check with that selection in the AFKO table for data.
Regards,
Sri
‎2010 Jul 06 11:51 AM
Dear Bandaru
please check weather the field type afko-aufnr and t_table-sap_po_nb is same,
if so remove stlst = '01'. in your second select and check, it may issue.
when same problem occurs placed the full code here, that will very help full for repliers.
Thanks in advance
‎2010 Jul 06 1:34 PM
Hi,
It seems like your ztable has the value 106, but in the table the value is like 0000106. if this is the reason for your select query failure, try teh below code.
SELECT sap_po_nb
vin_nb
vsl_nb
gltrp
matnr
werks
FROM zprdctn_ordr_mpn
INTO TABLE t_table
WHERE gltrp IN s_date AND vsl_nb IN s_vslnum
AND matnr IN s_mat AND werks IN s_plant.
IF sy-subrc EQ 0.
LOOP AT t_table ASSIGNING <fs_wa>.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = <fs_wa>-sap_po_nb
IMPORTING
output = <fs_wa>-sap_po_nb.
ENDLOOP.
IF t_table[] IS NOT INITIAL.
SELECT aufnr
stlst
FROM afko
INTO TABLE t_afko
FOR ALL ENTRIES IN t_table
WHERE aufnr = t_table-sap_po_nb
AND stlst = '01'.
ENDIF.
ENDIF.
Thanks and Regards,
Senthil kumar Anantham.
‎2010 Jul 06 1:34 PM
Lokeswari,
are you sure you have entries in table t_table
what keshav is saying is domain associated with field aufnr is using some conversion exits
CONVERSION_EXIT_ALPHA_INPUT - to convert into sap format
CONVERSION_EXIT_ALPHA_OUTPUT - to convert into display format
so while using
SELECT aufnr stlst FROM afko
INTO table t_afko
for all entries in t_table
WHERE aufnr = t_table-sap_po_nb and stlst = '01'.
you need to convert t_table-sap_po_nb into sap format using CONVERSION_EXIT_ALPHA_INPUT
Thanks
Bala Duvvuri
‎2010 Jul 06 5:14 PM
PLease
1. check the data types of the where clause field.
2 check data is available in databse.
hope this will help u..
let me know if u required more help on this.
Srinivas