‎2008 Jul 16 6:31 PM
Hi,
I am getting error for this select statement
SELECT eine~evers INTO wa_eine-evers
FROM eina
JOIN eine ON einainfnr = eineinfnr
WHERE eina~matnr = wa_idata-matnr
AND eina~lifnr = wa_idata-lifnr
AND eine~esokz = wa_idata-esokz
AND eine~werks = wa_idata-werks
AND eine~evers = wa_idata-ship_inst.
Here the SY-SUBRC = 4.
But not for this select statement
SELECT eine~evers INTO eine-evers
FROM eina
JOIN eine ON einainfnr = eineinfnr
WHERE eina~matnr = wa_idata-matnr
AND eina~lifnr = wa_idata-lifnr
AND eine~esokz = wa_idata-esokz
AND eine~werks = wa_idata-werks
AND eine~evers = wa_idata-ship_inst.
Here SY-SUBRC = 0.
Can anyone tell the difference between these two select statement.and the cause for the error.
Thanks
Kumar
‎2008 Jul 16 6:44 PM
Hi,
Pls try to state the error clearly and what error it is throwing.
Pls check with the declarations of Wa_eine and eine. DO they refer to same struture or not.
Reward if helpful.
Regards
Chandralekha
‎2008 Jul 16 6:44 PM
Hi,
Pls try to state the error clearly and what error it is throwing.
Pls check with the declarations of Wa_eine and eine. DO they refer to same struture or not.
Reward if helpful.
Regards
Chandralekha
‎2008 Jul 16 6:57 PM
Hi,
TYPES: BEGIN OF x_eine.
INCLUDE STRUCTURE eine.
TYPES: END OF x_eine.
t_eine TYPE TABLE OF x_eine. "Internal Table
wa_eine TYPE x_eine. "Work area
LOOP AT t_idata INTO wa_idata.
CLEAR: wa_eine-netpr,
wa_eine-peinh,
wa_eine-bprme,
wa_eine-waers,
wa_idata-new,
wa_idata-old,
wa_eine-evers.
Select statement 1
SELECT eine~evers INTO wa_eine-evers
FROM eina
JOIN eine ON einainfnr = eineinfnr
WHERE eina~matnr = wa_idata-matnr
AND eina~lifnr = wa_idata-lifnr
AND eine~esokz = wa_idata-esokz
AND eine~werks = wa_idata-werks
AND eine~evers = wa_idata-ship_inst.
Certain Logic and then.
Select statement 2
SELECT einenetpr einepeinh
einebprme einewaers eine~prdat
INTO (wa_eine-netpr,
wa_eine-peinh,
wa_eine-bprme,
wa_eine-waers,
wa_eine-prdat)
FROM eina
JOIN eine ON einainfnr = eineinfnr
WHERE eina~matnr = wa_idata-matnr
AND eina~lifnr = wa_idata-lifnr
AND eine~ekorg = '1000'
AND eine~esokz = wa_idata-esokz
AND eine~werks = wa_idata-werks.
EXIT.
ENDSELECT.
I am getting the data from select statement 2 but not from Select statement 1.
The sy-subrc for 1st statement is 4, but wen i checked in the DB table the record is there.
Thanks
Kumar
‎2008 Jul 16 7:03 PM
Hi,
Are you using all the reference keys in join?
regards,
Subramanian
Edited by: Subramanian PL on Jul 16, 2008 11:04 AM
‎2008 Jul 16 7:07 PM
Hi,
No i'm not using all the reference in the join.
Here is my select statement.
SELECT eine~evers INTO wa_eine-evers
FROM eina
JOIN eine ON einainfnr = eineinfnr
WHERE eina~matnr = wa_idata-matnr
AND eina~lifnr = wa_idata-lifnr
AND eine~esokz = wa_idata-esokz
AND eine~werks = wa_idata-werks
AND eine~evers = wa_idata-ship_inst.
EXIT.
ENDSELECT.
IF sy-subrc <> 0.
l_flag = 'X'.
ENDIF.
‎2008 Jul 16 6:47 PM
Ram,
I feel the wa_ eine-evers and eine-evers are of not same type and length.
‎2008 Jul 16 7:08 PM
Hi,
I see a difference
AND eine~ekorg = '1000'
AND eine~evers = wa_idata-ship_inst.
is missing
THanks
Naren
‎2008 Jul 16 7:14 PM
Hi,
Problem solved
thanks for all those who have replied my questions.
Thanks
Kumar