2008 Jul 23 7:22 AM
I have wrote the following select query
Already my final Internal table contains Material number
SELECT matnr
FROM ekpo
INTO TABLE t_ekpo
FOR ALL ENTRIES IN t_final
WHERE konnr IN s_konnr
AND matnr EQ t_final-number
AND matkl IN s_matkl
AND meins IN s_meins
AND bstyp = c_k.
IF sy-subrc EQ 0.
SORT t_ekpo BY matnr.
ENDIF.
In select option i have entered a valid Konnr which have material number(in t_final) I am not getting any Material numbers.
Sy-subrc =4
Can anyone tell me where is the problem?
Hi,
when you are using for all entries in select statement.. either select fields should contain all the key fields or in where clause it should contain all the key fields where as u r select query on table EKPO either in select clause or in where clause u have not mentioned any key fields rectify it.
regards,
Sunil Kumar Mutyala
2008 Jul 23 7:27 AM
Madan,
just modify your query like this:
SELECT matnr
FROM ekpo
INTO TABLE t_ekpo
FOR ALL ENTRIES IN t_final
WHERE konnr IN s_konnr
AND matnr EQ t_final-number
AND matkl IN s_matkl
AND meins IN s_meins
AND bstyp = 'C_K'."should be in caps
IF sy-subrc EQ 0.
SORT t_ekpo BY matnr.
ENDIF.Amit.
2008 Jul 23 7:28 AM
hi,
Since you say u have matching konnr for the s_konnr you enter :
Check if you have any matnr from ekpo matching the values in t_final-number. If there is no matching matnr in ekpo when compared to the matnr in internal table then there is a possibility of select to have sy-subrc = 4.
regards,
madhu
2008 Jul 23 7:29 AM
hiiii
check before this select statement that t_final is initial or not then use this select query..also check with the table taht wether that particular data exist with the same data you are entering on selection screen..check with following code
SELECT matnr " Material Number
FROM mara
INTO TABLE t_final
WHERE matnr IN s_matnr.
IF t_final[] IS NOT INITIAL.
SELECT matnr
FROM ekpo
INTO TABLE t_ekpo
FOR ALL ENTRIES IN t_final
WHERE matnr EQ t_final-number
AND matkl IN s_matkl
AND konnr IN s_konnr
AND meins IN s_meins
AND bstyp = c_k.
ENDIF.
IF sy-subrc EQ 0.
SORT t_ekpo BY matnr.
ENDIF.
ENDIF.
regards
twinkal
Edited by: twinkal patel on Jul 23, 2008 8:29 AM
Edited by: twinkal patel on Jul 23, 2008 8:30 AM
2008 Jul 23 7:39 AM
Twinkel,
thanks for replying and giving time to SDNers.
but i would suggest you that pls once you sure than only put your thoughts in forum you wrote:
check before this select statement that t_final is initial or not then use this select queryif the internal table is blank on which you are using for all entries than no data is suppose to fetch or all data will be fetch pls confirm than reply.
because in future from this thread some other person may also can take help so pls donot create misleads.
hope you dont hurt.
Amit.
2008 Jul 23 7:31 AM
Hi,
when you are using for all entries in select statement.. either select fields should contain all the key fields or in where clause it should contain all the key fields where as u r select query on table EKPO either in select clause or in where clause u have not mentioned any key fields rectify it.
regards,
Sunil Kumar Mutyala
2008 Jul 23 7:32 AM
Hi,
you have to mention bstyp in CAPSLOCK.
any Types i.e., Document type ,Material type ,BOM type has to be mentioned in CAPSLOCK.
Hope this will solve your problem.
Regards,
sharmishta.
2008 Jul 23 7:32 AM
Hi,
Please check wether c_k = 'K'. - Capital K. If you see domain BSTYP, there will be value ranges which are A,B,F,I,K,L,Q,W.
Regards,
Sukhbold
2008 Jul 23 7:35 AM
Hi Madan,
i think the problem is with ekpo just check whether the same Konnr is availble in ekpo also or not. ithink c_k is constant so no need to have it in capital only pretty printer will do it for u if necessary. also check the Matkl, meins and Bstyp = c_k are their in ekpo corresponds to Konnr you are entering in the screen.
hope this will help
Thanks
Ankur
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |