05-12-2011 9:58 AM
Hello all,
I've a strange action in my ecatt script.
I need to know RSNUM (reservation number) from table RESB corresponding to KDAUF (sales order number).
An index existing for RESB-KDAUF.
The record exists (se16n).
To execute this select, I've create a function module for simplifying tests :
- When I call the FM in the script, the record is not found.
- When I call the FM by se37, the record is found.
I've created another FM which select KDAUF in RESB by attacking RSNUM (primary key) :
- When I call the FM in the script, the record is found.
- When I call the FM by se37, the record is found.
My questions :
- In script ecatt, can we access to database table with no primary key?
- Is it a bug & is there any OSS Note or my Sap environment isn't good?
- Did someone had already seen this problem?
Thank you for responses!
Djamel.
05-12-2011 1:06 PM
Hi,
for tables with needed access by non-key-fields please use not GETTAB, please use inline ABAP with select statements instead.
Kind regards,
Christoph
05-12-2011 1:16 PM
Hi,
I don't use GETTAB
Here is the problematic script line :
FUN ( Z_BC_LOAD_RESB , Z_BC_LOAD_RESB_1 ).
And here the function module called :
FUNCTION Z_BC_LOAD_RESB.
*"----
""Local Interface:
*" IMPORTING
*" REFERENCE(I_KDAUF) TYPE KDAUF
*" EXPORTING
*" REFERENCE(O_RESB) TYPE RESB
*"----
select single * into corresponding fields of o_resb
from resb
where kdauf = i_kdauf.
ENDFUNCTION.