Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in fetching records

Former Member
0 Likes
909

Hello,

I am trying to get the data from table J_1IBOND in a report for which the Bond no, Bond year and Plant are the parameters and Issue date is a select-option in the selection screen. Out of the 4 selection screen elements, Plant is the only mandatory field.

When I have tried to execute the program with specifying only the plant, the select statement is unable to fetch the data and sy-surc fails. I inferred that the Bond number and Bond year are compared with the initial values '0000000000' and '0000' respectively. From the data dictionary too, if i provide the same as the fixed values, I am not able to retrieve the entries.

Please do let me know as to why the error is happening.

Thanks,

Samson

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
854

Replace the non-mandatory [PARAMETER|http://help.sap.com/abapdocu/en/ABAPPARAMETERS.htm]S with [SELECT-OPTIONS|http://help.sap.com/abapdocu/en/ABAPSELECT-OPTIONS.htm] with [NO-EXTENSION|http://help.sap.com/abapdocu/en/ABAPSELECT-OPTIONS_SCREEN.htm#!ABAP_ADDITION_4@4@] and [NO INTERVALS|http://help.sap.com/abapdocu/en/ABAPSELECT-OPTIONS_SCREEN.htm#!ABAP_ADDITION_5@5@] options, and use a [IN|http://help.sap.com/abapdocu/en/ABENWHERE_LOGEXP_SELTAB.htm] operator in the [WHERE|http://help.sap.com/abapdocu/en/ABAPWHERE.htm] clause. (You can also use [SELECT_OPTIONS_RESTRICT|https://forums.sdn.sap.com/search.jspa?objID=c42&q=SELECT_OPTIONS_RESTRICT] to insure that only EQ is used)

Regards,

Raymond

Hello,

I am trying to get the data from table J_1IBOND in a report for which the Bond no, Bond year and Plant are the parameters and Issue date is a select-option in the selection screen. Out of the 4 selection screen elements, Plant is the only mandatory field.

When I have tried to execute the program with specifying only the plant, the select statement is unable to fetch the data and sy-surc fails. I inferred that the Bond number and Bond year are compared with the initial values '0000000000' and '0000' respectively. From the data dictionary too, if i provide the same as the fixed values, I am not able to retrieve the entries.

Please do let me know as to why the error is happening.

Thanks,

Samson

5 REPLIES 5
Read only

Former Member
0 Likes
854

Hi,

Can you show your SELECT query or the code?

Regards,

Ankur Parab

Read only

RaymondGiuseppi
Active Contributor
0 Likes
855

Replace the non-mandatory [PARAMETER|http://help.sap.com/abapdocu/en/ABAPPARAMETERS.htm]S with [SELECT-OPTIONS|http://help.sap.com/abapdocu/en/ABAPSELECT-OPTIONS.htm] with [NO-EXTENSION|http://help.sap.com/abapdocu/en/ABAPSELECT-OPTIONS_SCREEN.htm#!ABAP_ADDITION_4@4@] and [NO INTERVALS|http://help.sap.com/abapdocu/en/ABAPSELECT-OPTIONS_SCREEN.htm#!ABAP_ADDITION_5@5@] options, and use a [IN|http://help.sap.com/abapdocu/en/ABENWHERE_LOGEXP_SELTAB.htm] operator in the [WHERE|http://help.sap.com/abapdocu/en/ABAPWHERE.htm] clause. (You can also use [SELECT_OPTIONS_RESTRICT|https://forums.sdn.sap.com/search.jspa?objID=c42&q=SELECT_OPTIONS_RESTRICT] to insure that only EQ is used)

Regards,

Raymond

Read only

0 Likes
854

Hello,

Thanks everyone for the valuable inputs.

Sam

Read only

Former Member
0 Likes
854

Hi Samson,

Try to fetch the record using SE16 for same table and check the select parameters for getting records.

Same parameters you should try to pass in your SELECT query.

Regds,

Anil

Read only

Former Member
0 Likes
854

Hi Samson,

whenever you are declearing parameter that means parameter value can't not be initial

in select query, because in parameter & select-options combination you are selecting value from table.

So you declear parameter as select-options with no-extension no interval and in where clause

use in instead of eq.

Regards,

Tutun