‎2009 Aug 06 4:56 PM
Hi
i want to do join and i have error:
SELECT a~app a~appr b~atid b~attal
INTO CORRESPONDING FIELDS OF TABLE app_att_tab
FROM ( Z_app as a
INNER JOIN Zd_d_apat ON a~userid = iv_userid ).Iv_user id is parameter that i get in the input FM
the error is :
You cannot compare with "IV_USERID". Each comparison in the ON
condition must contain a field from the RH table.
Regards
Joy
‎2009 Aug 06 5:02 PM
the ON section is used to connect the two tables in the SELECT statement, so you should provide the fields which connect the two. For example, if A has a user id field and so does B, then your ON statement should look like this.
on a~user_id = b~user_idThen you can do your restrictions in the WHERE clause like this.
where a~user_id = iv_user_id.So the finished SELECT statement might look like this.
SELECT a~app a~appr b~atid b~attal
INTO CORRESPONDING FIELDS OF TABLE app_att_tab
FROM ( Z_app as a
INNER JOIN Zd_d_apat as b
ON a~userid = b~user_id )
where a~user_id = iv_user_id.Cheers,
Rich Heilman
‎2009 Aug 06 5:02 PM
the ON section is used to connect the two tables in the SELECT statement, so you should provide the fields which connect the two. For example, if A has a user id field and so does B, then your ON statement should look like this.
on a~user_id = b~user_idThen you can do your restrictions in the WHERE clause like this.
where a~user_id = iv_user_id.So the finished SELECT statement might look like this.
SELECT a~app a~appr b~atid b~attal
INTO CORRESPONDING FIELDS OF TABLE app_att_tab
FROM ( Z_app as a
INNER JOIN Zd_d_apat as b
ON a~userid = b~user_id )
where a~user_id = iv_user_id.Cheers,
Rich Heilman