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

syntax error

Former Member
0 Likes
1,160

i have defined a table ZIT_ERROR_TAB which i defined in se11. but when i check the synatx of the program. it gives me

SYNTAX ERROR

Program ZGET_WORKLIST_ALL_USERS

"ZIT_ERROR_TAB" must be a flat structure. you cannot use internal

tabkes, strings, references, or structures as components.

REPORT ZGET_WORKLIST_ALL_USERS.

TABLES ZIT_ERROR_TAB.

DATA: lt_user TYPE zuser_tt,

ls_user TYPE zuser_sty.

pls let me know why iam getting this error

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,120

Hi,

You can use TABLE statement to declare a workarea only for DataBase Objects like tables and views.

Kindly make sure that the ZIT_ERROR_TAB is a DB table and is active.

Rajat

10 REPLIES 10
Read only

Former Member
0 Likes
1,119

Hello,

Can you details on your table declaration.??

Is it defined as table type..?

Also in your program how you are using your table declaration.?

Regards,

Sameer

Read only

0 Likes
1,119

hi,

till now i haven't used the table i have just defined it in my program.

TABLES ZIT_ERROR_TAB.

also this table i have defined in se11 (this is a z Transp. Table)

Read only

0 Likes
1,119

HI,

ZIT_ERROR_TAB should be declared in the database as table/structure not in the program.

If you have this in the Database then check the spelling.

Read only

0 Likes
1,119

IHAVE DEFINED IT IN DATABSE ONLY IN SE11 AS TABLE

Read only

Former Member
0 Likes
1,119

Hi

Could you send your complete report

Thanks,

Venkat

Read only

0 Likes
1,119

&----


*& Report ZGET_WORKLIST_ALL_USERS

*&

&----


*&

*&

&----


REPORT ZGET_WORKLIST_ALL_USERS.

TABLES ZIT_ERROR_TAB.

*DATA ZIT_ERROR_TAB TYPE STANDARD TABLE OF ZIT_ERROR_TAB.

*

*DATA WA_ZIT_ERROR_TAB TYPE LINE OF ZIT_ERROR_TAB.

DATA: lt_user TYPE zuser_tt,

ls_user TYPE zuser_sty.

DATA: lt_worklist TYPE uwlitemlist,

lt_messages TYPE TABLE OF swr_messag,

lt_mess_struct TYPE TABLE OF swr_mstruc.

DATA: CREATED_TIME(22) type c,

  • it_error_tab TYPE STRING,

wa_lt_worklist like line of lt_worklist,

go_sys_exception TYPE REF TO cx_ai_system_fault,

employee_data TYPE REF TO ZPI_CO_SI_EP003_ACTION_ITEM_MA,

output type ZPI_MT_EP003_ACTION_ITEM,

employee_rec type ZPI_DT_EP003_ACTION_ITEM_SUMMA,

employee type ZPI_DT_EP003_ACTION_ITEM_S_TAB,

n type i.

n = 1.

SELECT bname FROM usr02 INTO TABLE lt_user.

SORT lt_user.

DELETE ADJACENT DUPLICATES FROM lt_user.

LOOP AT lt_user INTO ls_user.

CLEAR lt_worklist.

CLEAR lt_messages.

CLEAR lt_mess_struct.

CALL FUNCTION 'SWN_UWL_GET_WORKLIST'

EXPORTING

user = ls_user-bname

  • LANGUAGE = SY-LANGU

  • TRANSLATE_WI_TEXT = ' '

  • IM_TASK_FILTER =

  • IM_STATUS_FILTER =

  • IM_ITEM_TYPE_FILTER =

IMPORTING

  • RETURN_CODE =

worklist = lt_worklist

  • DEADLINE_ITEMS =

TABLES

message_lines = lt_messages

message_struct = lt_mess_struct.

loop at lt_worklist into wa_lt_worklist.

employee_rec-USER_ID = wa_lt_worklist-USER_ID.

employee_rec-SUBJECT = wa_lt_worklist-SUBJECT.

CREATED_TIME = wa_lt_worklist-CREATED_TIME.

employee_rec-CREATED_TIME = CREATED_TIME+0(14).

employee_rec-FORWARDED_BY = wa_lt_worklist-FORWARDED_BY.

employee_rec-IDENTITY_NUMBER = n.

append employee_rec to employee.

output-MT_EP003_ACTION_ITEM-SUMMARY_EMAIL_ACTION_ITEM = employee.

clear employee_rec.

n = n + 1.

endloop.

ENDLOOP.

TRY.

CREATE OBJECT employee_data.

call method employee_data->UPLOAD_ACTION_ITEM

EXPORTING

OUTPUT = output.

commit work.

CATCH cx_ai_system_fault INTO go_sys_exception.

*it_error_tab-message = go_sys_exception->errortext.

  • it_error_tab = go_sys_exception->errortext.

*it_error_tab-code = go_sys_exception-code.

ENDTRY.

*WRITE it_error_tab.

Read only

Former Member
0 Likes
1,121

Hi,

You can use TABLE statement to declare a workarea only for DataBase Objects like tables and views.

Kindly make sure that the ZIT_ERROR_TAB is a DB table and is active.

Rajat

Read only

Former Member
0 Likes
1,119

Hi,

In ur table(ZIT_ERROR_TAB) Some component data type may be string.Then it will give that particular error.

Thanks,

Nithya

Read only

0 Likes
1,119

...

Thanks,

Nithya

You're welcome.

Read only

Former Member
0 Likes
1,119

THANKS NITHYA BANG ON UR ANSWER IS CORRECT