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

select statement, not working, please help

Former Member
0 Likes
1,106

Hello,

everything looks good but the select query is giving sy-subrc = 4.

DATA: begin of lt_zsfdet_new occurs 0,

invnmb like zsfdet_new-invnmb,

shipdt like zsfdet_new-shipdt,

end of lt_zsfdet_new.

select invnmb shipdt from zsfdet_new into table lt_zsfdet_new for all entries in gt_display where invnmb = gt_display-delno.

Please help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,087

have you looked in Debugging ?

First see the data in gt_display internal table ,if data is availble then check in database table .

Thanks

Seshu

10 REPLIES 10
Read only

naimesh_patel
Active Contributor
0 Likes
1,087

Check out the gt_display entries. It seems that you don't have mathching entries in the with the zsfdet_new -invmb and gt_display-delno.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
1,087

Keep the break-point at select query and check gt_display-delno has values or not.

if no values found it will returns 4.

Reward points if it helps,

Satish

Read only

ferry_lianto
Active Contributor
0 Likes
1,087

Hi,

Please check table zsfdet_new.

SY-SUBRC = 4 means no data was found in the database.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,088

have you looked in Debugging ?

First see the data in gt_display internal table ,if data is availble then check in database table .

Thanks

Seshu

Read only

0 Likes
1,087

Thanks for the suggestions,

I have checked them in debug mode, gt_display has the entries which even exist in the zsfdet_new .

Read only

0 Likes
1,087

Take one or two records in debugging ( gt_display-delno),now goto SE16 -> check the entries in zsfdet_new ( Look at exact field).

May be wrong field name mentioned in where clause.

Thanks

Seshu

Read only

0 Likes
1,087

Hi,

keep all delno values of internal table lt_zsfdet_new into table zsfdet_new from SE11 and see whether u r getting any values or not.

if not problem then there is no data in ZSFDET_NEW with delno values.

reward if it helps,

Satish

Read only

0 Likes
1,087

Check the leading zeros for both the fields. If your GT_DISPLAY-INVNO doesnot have leading zeros and your ZSDFET_NEW-DELNO has leading zeros than you need to fill the leading zeros ...

You can use the conversio routine or do it with UNPACK.

LOOP AT GT_DISPLY.

UNPACK GT_DISPLY-INVNO to GT_DISPLAY-INVNO.

modify GT_DISAPLY.

endloop.

Than use this table into select query...

Regards,

Naimesh Patel

Read only

0 Likes
1,087

gt_display-delno may be missing leading zeroes that are present in the database. You should run these through the proper conversion exit before doing the SELECT.

Rob

Read only

ferry_lianto
Active Contributor
0 Likes
1,087

Hi,

Perhaps you need to add leading zeros to field delno in internal table gt_display.

If you do, you can use FM CONVERSION_EXIT_ALPHA_INPUT to update with leading zeros prior to use in select statement.

Regards,

Ferry Lianto