2013 Mar 05 7:41 PM
Hello Experts
i am new in this field when i create my program and when i need to check my steps in the debugger mode i faced the following problem
Error
ShrtText
Error in RSQL module of database interface.
What happened?
Error in ABAP application program.
The current ABAP program "!VS3" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Error analysis
An exception occurred. This exception will be dealt with in more detail
below. The exception, assigned to the class 'CX_SY_OPEN_SQL_DB', was not
caught, which
led to a runtime error. The reason for this exception is:
The data read during a SELECT access could not be inserted into the
target field.
Either conversion is not supported for the target field's type or the
target field is too short to accept the value or the data are not in a
form that the target field can accept
75 BREAK-POINT .
>>>>> SELECT BUKRS LIFNR GJAHR BELNR BUDAT WAERS SHKZG DMBTR FROM BSIK INTO table T_BSIK
77 WHERE LIFNR IN P_lifnr and BUDAT in P_budat.
78 SORT T_BSIK ASCENDING BY BELNR .
79 DELETE ADJACENT DUPLICATES FROM T_BSIK COMPARING BELNR .
80
81 loop at : t_bsik into wbsik.
82 count = count + 1 .
code
REPORT ZVS3.
TYPE-POOLS: SLIS .
TABLES : BSIK , LFA1 , BKPF , SKA1 .
*Defination Referances
TYPES : BEGIN OF S_BSIK ,
BUKRS type BUKRS ,
LIFNR type LIFNR ,
GJAHR type GJAHR ,
BELNR TYPE BELNR ,
BUDAT TYPE BUDAT ,
WAERS TYPE WAERS ,
SHKZG TYPE SHKZG ,
DMBTR TYPE DMBTR ,
END OF S_BSIK .
TYPES : BEGIN OF S_LFA1 ,
LIFNR TYPE LIFNR ,
NAME1 TYPE NAME1 ,
END OF S_LFA1 .
TYPES : BEGIN OF S_BKPF ,
BUKRS type BUKRS ,
BELNR TYPE BELNR ,
BUDAT TYPE BUDAT ,
DMBTR TYPE DMBTR ,
XREVERSAL TYPE XREVERSAL ,
END OF S_BKPF .
TYPES : BEGIN OF S_FINAL ,
BUKRS type BUKRS ,
LIFNR type LIFNR ,
GJAHR type GJAHR ,
BELNR TYPE BELNR ,
BUDAT TYPE BUDAT ,
WAERS TYPE WAERS ,
DMBTR TYPE DMBTR ,
SHKZG TYPE SHKZG ,
SAKNR TYPE SAKNR ,
NAME1 TYPE NAME1 ,
XREVERSAL TYPE XREVERSAL ,
TXT50 TYPE TXT50 ,
END OF S_FINAL .
* INTERNAL TABLE AND WORK AREAA
DATA :
T_BSIK type STANDARD TABLE OF S_BSIK ,
T_LFA1 type STANDARD TABLE of S_LFA1 ,
T_BKPF type STANDARD TABLE of S_BKPF ,
WBSIK TYPE S_BSIK ,
WLFA1 TYPE S_LFA1 ,
WBKPF TYPE S_BKPF .
DATA : count type i value is INITIAL .
* SELECTION SCREEN
SELECTION-SCREEN begin OF BLOCK Vendor WITH FRAME TITLE text-000 .
PARAMETERS : p_bukrs TYPE bukrs .
SELECT-OPTIONS : P_lifnr for Bsik-lifnr,
P_budat for bsik-budat.
SELECTION-SCREEN END OF BLOCK VENDOR .
BREAK-POINT .
SELECT BUKRS LIFNR GJAHR BELNR BUDAT WAERS SHKZG DMBTR FROM BSIK INTO table T_BSIK
WHERE LIFNR IN P_lifnr and BUDAT in P_budat.
SORT T_BSIK ASCENDING BY BELNR .
DELETE ADJACENT DUPLICATES FROM T_BSIK COMPARING BELNR .
loop at : t_bsik into wbsik.
count = count + 1 .
if wbsik-SHKZG = 'H' .
WBSIK-DMBTR = -1 * WBSIK-DMBTR .
modify T_bsik from wbsik index count .
ENDIF .
endloop .
SELECT LIFNR NAME1 FROM LFA1 INTO TABLE T_LFA1 WHERE LIFNR IN P_lifnr .
2013 Mar 21 12:47 PM
This is the repetedly coming Error for U ,
To overcome this problem
Please use
Types as
Table name - Field name.
Types : begin of TY_ITAB,
FIELD1 TYPE TABLENAME-FIELDNAME 1,
FIELD2 TYPE TABLENAME-FIELDNAME2 ,
FIELD3 TYPE TABLENAME-FIELDNAME3 ,
END OF TY_ITAB.
Thanks & regards
Kranthi kumar reddy G
2013 Mar 05 10:29 PM
Please check the workprocess developer trace for the full DB interface error message.
"CX_SY_OPEN_SQL_DB" is not your error, but just the reply from the DB interface to the ABAP processor.
- Lars
2013 Mar 06 3:32 AM
Hi,
The data type => "BELNR TYPE BELNR" is used wrongly? You can use type "BELNR_D" to prevent the data parsing error if that is what your program is trying to map to the accounting document number.
Best regards.
YS
2013 Mar 21 12:47 PM
This is the repetedly coming Error for U ,
To overcome this problem
Please use
Types as
Table name - Field name.
Types : begin of TY_ITAB,
FIELD1 TYPE TABLENAME-FIELDNAME 1,
FIELD2 TYPE TABLENAME-FIELDNAME2 ,
FIELD3 TYPE TABLENAME-FIELDNAME3 ,
END OF TY_ITAB.
Thanks & regards
Kranthi kumar reddy G