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

rintime error

Former Member
0 Likes
880

Hellow I doing this select and I have a dump of runtime error

SELECT objid begda endda

FROM hrp1001

INTO TABLE b_itab

FOR ALL ENTRIES IN z_course_table

WHERE objid = z_course_table-objid

AND otype = z_course_table-otype

AND plvar = '01'

AND relat = '020'

AND rsign = 'B'

AND begda <= sy-datum

AND endda => sy-datum.

This is my declare of b_itab

TYPES: BEGIN OF 2_itab,

objid TYPE hrobjid,

sobid TYPE sobid,

begda TYPE begdatum,

endda TYPE enddatum,

priox TYPE priox,

END OF 2_itab.

DATA: b_itab TYPE TABLE OF 2_itab,

wa_b_itab LIKE LINE OF b_itab.

And z_course table is declare in tables in function module

This is the messege

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

In a SELECT access, the read file could not be placed in the target

field provided.

Either the conversion is not supported for the type of the target field,

the target field is too small to include the value, or the data does not

have the format required for the target field.

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
837

hi,

change like this.

SELECT objid begda endda

FROM hrp1001

INTO <b>corresponding fields of</b> TABLE b_itab

FOR ALL ENTRIES IN z_course_table

WHERE objid = z_course_table-objid

AND otype = z_course_table-otype

AND plvar = '01'

AND relat = '020'

AND rsign = 'B'

<b>AND begda LE sy-datum

AND endda GE sy-datum.</b>

rgds

anver

7 REPLIES 7
Read only

Former Member
0 Likes
837

check may be this is problem

SELECT objid begda endda

FROM hrp1001

INTO <b>corresponding fields of </b> TABLE b_itab

FOR ALL ENTRIES IN z_course_table

WHERE objid = z_course_table-objid

AND otype = z_course_table-otype

AND plvar = '01'

AND relat = '020'

AND rsign = 'B'

<b>AND begda =< sy-datum

AND endda >= sy-datum</b>.

kishan negi

null

Read only

anversha_s
Active Contributor
0 Likes
838

hi,

change like this.

SELECT objid begda endda

FROM hrp1001

INTO <b>corresponding fields of</b> TABLE b_itab

FOR ALL ENTRIES IN z_course_table

WHERE objid = z_course_table-objid

AND otype = z_course_table-otype

AND plvar = '01'

AND relat = '020'

AND rsign = 'B'

<b>AND begda LE sy-datum

AND endda GE sy-datum.</b>

rgds

anver

Read only

Former Member
0 Likes
837

change the TYPES declaration to:

This is my declare of b_itab

TYPES: BEGIN OF 2_itab,

objid TYPE hrobjid,

begda TYPE begdatum,

endda TYPE enddatum,

<b>sobid TYPE sobid,</b>

priox TYPE priox,

END OF 2_itab.

this should solve your problem.

Note: Award points for helpful answers.

Read only

Former Member
0 Likes
837

check this one..

<b>SELECT * FROM hrp1001

INTO corresponding fields of TABLE b_itab

FOR ALL ENTRIES IN z_course_table

WHERE objid = z_course_table-objid

AND otype = z_course_table-otype

AND plvar = '01'

AND relat = '020'

AND rsign = 'B'

AND begda <= sy-datum

AND endda => sy-datum.</b>

Read only

Former Member
0 Likes
837

Check the field type for z_course_table-objid

Is it the same as HRP1001-objid?

Also, since your declaration has sobid for b_itab, use that too in the select of add 'INTO CORRESPONDING FIELDS' .

Read only

Former Member
0 Likes
837

Hi sh_tal,

i think your select-statement must be expendet form

SELECT objid begda endda

to this

SELECT objid<b> sobid</b> begda endda

Hope it helps.

Regards, Dieter

Read only

Former Member
0 Likes
837

Hi

In select statement you are not selecting the data in the order you declared in the declaration and also you r not selecting all the data, if you dont want to select all the data give into correspoding fields of table b_itab :

SELECT objid begda endda

FROM hrp1001

INTO <b>coresponding fields of table</b> b_itab

or change the order of declaration of table like this:

TYPES: BEGIN OF 2_itab,

objid TYPE hrobjid,

<b>begda TYPE begdatum,

endda TYPE enddatum,</b>

sobid TYPE sobid,

priox TYPE priox,

END OF 2_itab.

Regards

Haritha