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 in declaration

Former Member
0 Likes
799

Hi,

I am working on 3.1I version of SAP and using the following code in my program.

types: begin of t_ar_doc,

bukrs like bkpf-bukrs,

belnr like bkpf-belnr,

gjahr like bkpf-gjahr,

monat like bkpf-monat,

waers like bkpf-waers,

end of t_ar_doc.

data: ar_tab type hashed table of t_ar_doc

with unique key bukrs belnr.

But getting a syntax error saying 'The type "HASHED" is unknown'.

Can anyone help me?

Thanks,

Srinivasa

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
759

I am not sure if Hashed tables were introduced in 3.1I. I just checked F1 help in our system which is 4.7 and there is no mention of which versions .

I suggest putting your cursor on the "type" word in your data statement and pressing F1. If the F1 help does not mention them, they might not be available.

Best Regards,

Chris H.

6 REPLIES 6
Read only

Former Member
0 Likes
759

I think hashed tables were introduced later (4.0?)

Rob

Read only

Former Member
0 Likes
760

I am not sure if Hashed tables were introduced in 3.1I. I just checked F1 help in our system which is 4.7 and there is no mention of which versions .

I suggest putting your cursor on the "type" word in your data statement and pressing F1. If the F1 help does not mention them, they might not be available.

Best Regards,

Chris H.

Read only

0 Likes
759

Yep, I used the F1 help, but nothing tells on this.

I want to know from experts whether this is possible/available in 3.1I or not.

Please help.

Thanks,

Srinivasa

Read only

0 Likes
759

Well, if you get a syntax error, it's probably not there.

Rob

Read only

Former Member
0 Likes
759

I don't have access to any documention for a 3.1 system, but there is documentation on hashed tables (such as this page: http://help.sap.com/saphelp_40b/helpdata/en/fc/eb3639358411d1829f0000e829fbfe/frameset.htm) for a 4.0b system. I tried the code that you have written, and it works in my ERP 2004s system. I noticed that some of the older documentation has the original table, such as your t_ar_doc, defined in a DATA statement rather than a TYPE statement. The hashed table is then defined as:

DATA: ar_tab LIKE HASHED TABLE OF t_ar_doc

WITH UNIQUE KEY bukrs belnr.

You could try this older style of definition and see if it works.

- April King

Read only

0 Likes
759

I tried, but it is not working.

Thanks,

Srinivasa