on 10-13-2009 9:18 AM
TRY.
EXEC SQL.
OPEN dbcur FOR
SELECT B.SCI_CART_NO
B.SCI_MATL_NO
B.SCI_QTY
B.SCI_RCV_PLANT
B.SCI_RCV_STRG_LOC
C.SCM_FOD_NO
D.saa_category
D.SAA_ASGND_TO
FROM T_SHOPPING_CART_ITEM B,
T_SHOPPING_CART_MANF C,
T_SC_ACCT_ASGNMT D,
WHERE C.SCM_CART_NO = B.SCI_CART_NO
AND D.SAA_CART_NO = B.SCI_CART_NO
AND B.SCI_CART_NO = :t_wa_aufk_cobrb-scm_cart_no
ENDEXEC.
CATCH cx_sy_native_sql_error INTO t_exc_ref.
w_error_text_oc = t_exc_ref->get_text( ).
MESSAGE w_error_text_oc TYPE 'E'.
ENDTRY.
TRY.
DO.
EXEC SQL.
FETCH NEXT dbcur INTO :t_wa_ora-SCI_CART_NO,
:t_wa_ora-SCI_MATL_NO,
:t_wa_ora-SCI_QTY,
:t_wa_ora-SCI_RCV_PLANT,
:t_wa_ora-SCI_RCV_STRG_LOC,
:t_wa_ora-SCM_FOD_NO,
:t_wa_ora-saa_category,
:t_wa_ora-SAA_ASGND_TO
ENDEXEC.
IF sy-subrc <> 0.
EXIT.
ELSE.
t_wb_ora-sci_cart_no = t_wa_ora-sci_cart_no.
t_wb_ora-sci_matl_no = t_wa_ora-sci_matl_no.
t_wb_ora-sci_qty = t_wa_ora-sci_qty.
t_wb_ora-sci_rcv_plant = t_wa_ora-sci_rcv_plant.
t_wb_ora-sci_rcv_strg_loc = t_wa_ora-sci_rcv_strg_loc.
t_wb_ora-scm_fod_no = t_wa_ora-scm_fod_no.
t_wb_ora-saa_category = t_wa_ora-saa_category.
t_wb_ora-saa_asgnd_to = t_wa_ora-saa_asgnd_to.
APPEND t_wb_ora TO t_ora.
CLEAR : t_wb_ora, t_wa_ora.
ENDIF.
ENDDO.
CATCH cx_sy_native_sql_error INTO t_exc_ref.
w_error_text_fc = t_exc_ref->get_text( ).
MESSAGE w_error_text_fc TYPE 'E'.
ENDTRY.
After execution of "FETCH NEXT dbcur INTO :t_wa_ora-SCI_CART_NO,...." I am getting an SQL Error ""An SQL error has occurred: ORA-00923: From keyword not found where expected"". please guide to resolve..
Thanks & regards
Saifur Rahaman
Hi,
In native SQL don't forget to separate the SELECT list with ", "
SELECT B.SCI_CART_NO ,
B.SCI_MATL_NO ,
B.SCI_QTY ,
B.SCI_RCV_PLANT ,
B.SCI_RCV_STRG_LOC ,
C.SCM_FOD_NO ,
D.saa_category ,
D.SAA_ASGND_TO
FROM T_SHOPPING_CART_ITEM B,
T_SHOPPING_CART_MANF C,
T_SC_ACCT_ASGNMT D
WHERE C.SCM_CART_NO = B.SCI_CART_NO
AND D.SAA_CART_NO = B.SCI_CART_NO
AND B.SCI_CART_NO = :t_wa_aufk_cobrb-scm_cart_no
...
bye
yk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanx YukonKid
It resolved the ORA-00923 sql error but when it is coming to following part it is giving return value 4
not able to identify what might be the reason
EXEC SQL.
FETCH NEXT dbcur INTO :t_wa_ora-SCI_CART_NO,
:t_wa_ora-SCI_MATL_NO,
:t_wa_ora-SCI_QTY,
:t_wa_ora-SCI_RCV_PLANT,
:t_wa_ora-SCI_RCV_STRG_LOC,
:t_wa_ora-SCM_FOD_NO,
:t_wa_ora-saa_category,
:t_wa_ora-SAA_ASGND_TO
ENDEXEC.
In oracle data base SCI_CART_NO(Number-10) , SCI_MATL_NO(Varchar2 - 18), SCI_QTY(Number -14,3),SCI_RCV_PLANT(Varchar2- 4), SCI_RCV_STRG_LOC(varchar2- 5),SCM_FOD_NO(varchar2-12), saa_category(varchar2- 1),SAA_ASGND_TO( varchar 2 -20) is defined
and in prog i have defined
types: begin of ty_ora,
sci_cart_no(10) type n,
sci_matl_no(18) type c,
sci_qty(16) type p decimals 3,
sci_rcv_plant(4) type c,
sci_rcv_strg_loc(5) type c,
scm_fod_no(12) type c,
saa_category(1) type c,
saa_asgnd_to(20) type c, end of ty_ora.
data : t_ora type standard table of ty_ora initial size 0.
data : t_wa_ora type ty_ora.
data : t_wb_ora type ty_ora.
Is the return value 4is coming because of wrong delclaration sci_qty ??
Please help
Do you have an Ora-Err number for this?
on first glance seems ok. You could remove the column from the SELECT and FETCH and test if it's the problem
(or any other column)
please read this doc about mappings of Oracle / ABAP data types:
http://help.sap.com/saphelp_nw04/helpdata/en/a3/74caa1d9c411d1950e0000e8353423/frameset.htm
bye
yk
I would leave out the comma here:
T_SC_ACCT_ASGNMT D,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you do a quick sql trace (ST05) and post the sql statement here?
Cheers Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Check SAP note 640553.
Thanks
Sunny
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.