2008 Mar 25 10:01 AM
Hello experts,
please check this code.
CHECK NOT T_DELIVERIES[] IS INITIAL.
SELECT MANDT VBELV POSNV VBELN POSNN INTO TABLE T_VBFA FROM VBFA
FOR ALL ENTRIES IN T_DELIVERIES
WHERE VBELN EQ T_DELIVERIES-VBELN
AND POSNN EQ T_DELIVERIES-POSNR
*{ INSERT DE1K903920 2
AND VBELV EQ T_OUTPUT-VBELV
AND POSNV EQ T_OUTPUT-POSNV
*} INSERT
AND ( VBTYP_V EQ 'C' OR VBTYP_V 'H' ). "AO03
SORT T_VBFA BY VBELN VBELV.
Check the inserted lines and let me know whether it is correct or not.
2008 Mar 25 10:08 AM
CHECK NOT T_DELIVERIES[] IS INITIAL.
SELECT MANDT VBELV POSNV VBELN POSNN INTO TABLE T_VBFA FROM VBFA
FOR ALL ENTRIES IN T_DELIVERIES
WHERE VBELN EQ T_DELIVERIES-VBELN
AND POSNN EQ T_DELIVERIES-POSNR
*{ INSERT DE1K903920 2
AND VBELV EQ T_OUTPUT-VBELV
AND POSNV EQ T_OUTPUT-POSNV
*} INSERT
AND VBTYP_V IN ( 'C', 'H' ). "AO03
2008 Mar 25 10:05 AM
how should we know if this is correct?
all i can tell you that the syntax you used is correct, but since i have no clue what kind of data you have in t_output i canmnot tell you if this is logically correct.
2008 Mar 25 10:06 AM
Hi
it is not correct the itab T_OUTPUT-VBELV is not mentioned in the same
look for the same fields in T_DELIVERIES
CHECK NOT T_DELIVERIES[] IS INITIAL.
SELECT MANDT VBELV POSNV VBELN POSNN INTO TABLE T_VBFA FROM VBFA
FOR ALL ENTRIES IN T_DELIVERIES
WHERE VBELN EQ T_DELIVERIES-VBELN
AND POSNN EQ T_DELIVERIES-POSNR
*{ INSERT DE1K903920 2
AND VBELV EQ T_DELIVERIES-VBELV
AND POSNV EQ T_DELIVERIES-POSNV
*} INSERT
AND ( VBTYP_V EQ 'C' OR VBTYP_V 'H' ). "AO03
SORT T_VBFA BY VBELN VBELV.
regards
Shiva
2008 Mar 25 10:11 AM
You mean, I cant use t_output since I am selecting for all entries of t_deliveries?
2008 Mar 25 10:35 AM
you can not use ither table
also leave the remaining primary keys if they are not available
try to use them in your select
select vbeln posnr vbelv e
regards
Shiva
2008 Mar 25 10:47 AM
Thanku for the reply Shiva.
But I am facing performance issue if I do not use all the primary keys in condition query.
2008 Mar 25 10:08 AM
Hi,
You are using FOR ALL ENTRIES.But in your inserted lines is having the condition to match T_OUTPUT values. You should use only the values of T_DELIVERIES.
*{ INSERT DE1K903920 2
AND VBELV EQ T_OUTPUT-VBELV
AND POSNV EQ T_OUTPUT-POSNV
*} INSERT
SORT T_VBFA BY VBELN VBELV.
Use T_DELIVERIES not T_OUTPUT.
Regards,
Sankar.
2008 Mar 25 10:08 AM
CHECK NOT T_DELIVERIES[] IS INITIAL.
SELECT MANDT VBELV POSNV VBELN POSNN INTO TABLE T_VBFA FROM VBFA
FOR ALL ENTRIES IN T_DELIVERIES
WHERE VBELN EQ T_DELIVERIES-VBELN
AND POSNN EQ T_DELIVERIES-POSNR
*{ INSERT DE1K903920 2
AND VBELV EQ T_OUTPUT-VBELV
AND POSNV EQ T_OUTPUT-POSNV
*} INSERT
AND VBTYP_V IN ( 'C', 'H' ). "AO03
2008 Mar 25 10:09 AM
2008 Mar 25 10:19 AM
Ya, I didnt get any error for this query.But I doubt using two internal table fields in condition query.
So, are you very much sure that this way of code doesnt cause any issues?
2008 Mar 25 10:10 AM
Divya,
The inserted code is wrong.
Because in a select query u can check for all entries option only on one internal table where as in ur query it is checking against two internal table ( T_DELIVERIES, T_OUTPUT), which is wrong.
2008 Mar 25 10:26 AM
If this is wrong,please help me hw can I check for the other primary keys of vbfa(t_deliveries contains only vbeln n posnr)
2008 Mar 25 10:47 AM
hI,
Instead of select query use this code.
pass ur vbeln to this FM,
data: IT_VB1 LIKE VBFAVB OCCURS 0 WITH HEADER LINE,
IT_VBF1 LIKE VBFAVB OCCURS 0 WITH HEADER LINE,
CALL FUNCTION 'WB2_VBFA_READ_WITH_VBELN'
EXPORTING
I_VBELN = WA_VBRK-VBELN
TABLES
ET_VBFAVB = IT_VB1
ET_VBFA = IT_VBF1.
REWARD POINTS IF HELPFUL.