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

help in declertion

Former Member
0 Likes
1,205

Hallow

I have a problem with declaration of table

I do like that and I have error?

what i have to change?

this is my code & errors

regards

"OBJECTS_TEMP" is not an internal table - the "OCCURS n" specification missing.

I try to add occurs 0 but after that I have error that

"OBJECTS_TEMP" is a table without a header line and therefore has nocomponent called "PLVAR".

<b>DATA: objects_temp TYPE hrsobid.</b>

objects_temp-plvar = '01'.

objects_temp-otype = 'P'.

objects_temp-sobid = pernr.

CALL FUNCTION 'RHPP_Q_PROFILE_READ'

  • EXPORTING

  • BEGDA = SY-DATUM

  • ENDDA = SY-DATUM

  • WITH_STEXT = 'X'

  • WITH_QK_INFO = 'X'

  • CHECK_NOTE = ' '

TABLES

<b>OBJECTS = objects_temp</b>

  • ERR_OBJECTS =

profile = qualifications_tab

  • EXCEPTIONS

  • NO_AUTHORITY = 1

  • WRONG_OTYPE = 2

  • OBJECT_NOT_FOUND = 3

  • UNDEFINED = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

regards ENDIF.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,155

Try this.

DATA: objects_temp TYPE TABLE OF hrsobid. 
data: wa_objects_temp like line of objects_temp.

wa_objects_temp-plvar = '01'.
wa_objects_temp-otype = 'P'.
wa_objects_temp-sobid = pernr.
append wa_objects_temp to objects_temp.


CALL FUNCTION 'RHPP_Q_PROFILE_READ'
* EXPORTING
* BEGDA = SY-DATUM
* ENDDA = SY-DATUM
* WITH_STEXT = 'X'
* WITH_QK_INFO = 'X'
* CHECK_NOTE = ' '
TABLES
OBJECTS = objects_temp
* ERR_OBJECTS =
profile = qualifications_tab
* EXCEPTIONS
* NO_AUTHORITY = 1
* WRONG_OTYPE = 2
* OBJECT_NOT_FOUND = 3
* UNDEFINED = 4
* OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.


ENDIF.

Regards,

Rich Heilman

Hallow

I have a problem with declaration of table

I do like that and I have error?

what i have to change?

this is my code & errors

regards

"OBJECTS_TEMP" is not an internal table - the "OCCURS n" specification missing.

I try to add occurs 0 but after that I have error that

"OBJECTS_TEMP" is a table without a header line and therefore has nocomponent called "PLVAR".

<b>DATA: objects_temp TYPE hrsobid.</b>

objects_temp-plvar = '01'.

objects_temp-otype = 'P'.

objects_temp-sobid = pernr.

CALL FUNCTION 'RHPP_Q_PROFILE_READ'

  • EXPORTING

  • BEGDA = SY-DATUM

  • ENDDA = SY-DATUM

  • WITH_STEXT = 'X'

  • WITH_QK_INFO = 'X'

  • CHECK_NOTE = ' '

TABLES

<b>OBJECTS = objects_temp</b>

  • ERR_OBJECTS =

profile = qualifications_tab

  • EXCEPTIONS

  • NO_AUTHORITY = 1

  • WRONG_OTYPE = 2

  • OBJECT_NOT_FOUND = 3

  • UNDEFINED = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

regards ENDIF.

7 REPLIES 7
Read only

Former Member
0 Likes
1,155

Hi,

Declare it like this..

DATA: objects_temp TYPE hrsobid OCCURS 0 WITH HEADER LINE.

Thanks,

Naren

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,156

Try this.

DATA: objects_temp TYPE TABLE OF hrsobid. 
data: wa_objects_temp like line of objects_temp.

wa_objects_temp-plvar = '01'.
wa_objects_temp-otype = 'P'.
wa_objects_temp-sobid = pernr.
append wa_objects_temp to objects_temp.


CALL FUNCTION 'RHPP_Q_PROFILE_READ'
* EXPORTING
* BEGDA = SY-DATUM
* ENDDA = SY-DATUM
* WITH_STEXT = 'X'
* WITH_QK_INFO = 'X'
* CHECK_NOTE = ' '
TABLES
OBJECTS = objects_temp
* ERR_OBJECTS =
profile = qualifications_tab
* EXCEPTIONS
* NO_AUTHORITY = 1
* WRONG_OTYPE = 2
* OBJECT_NOT_FOUND = 3
* UNDEFINED = 4
* OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.


ENDIF.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,155

Declare it as

DATA: objects_temp TYPE hrsobid occurs 0 with header line.

Read only

Former Member
0 Likes
1,155

DATA: objects_temp TYPE hrsobid.

<b>change it here....

DATA: objects_temp TYPE hrsobid OCCURS 0 WITH HEADER LINE.

end of change.</b>

objects_temp-plvar = '01'.

objects_temp-otype = 'P'.

objects_temp-sobid = pernr.

CALL FUNCTION 'RHPP_Q_PROFILE_READ'

  • EXPORTING

  • BEGDA = SY-DATUM

  • ENDDA = SY-DATUM

  • WITH_STEXT = 'X'

  • WITH_QK_INFO = 'X'

  • CHECK_NOTE = ' '

TABLES

OBJECTS = objects_temp

  • ERR_OBJECTS =

profile = qualifications_tab

  • EXCEPTIONS

  • NO_AUTHORITY = 1

  • WRONG_OTYPE = 2

  • OBJECT_NOT_FOUND = 3

  • UNDEFINED = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

Former Member
0 Likes
1,155

<b>DATA: objects_temp TYPE table of hrsobid with header line.</b>

Read only

0 Likes
1,155

Come on guys, you know we are not supposed to use OCCURS or HEADER LINES anymore.

Regards,

RIch Heilman

Read only

suresh_datti
Active Contributor
0 Likes
1,155

data : objects_temp type table of hrsobid,

rec_hrsobid like line of objects_temp .

rec_hrsobid-plvar = '01'.

rec_hrsobid-otype = 'P'.

rec_hrsobid-sobid = pernr.

append rec_hrsobid to t_hrsobid.

then make your function call..

~Suresh