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

field unknown

Former Member
0 Likes
4,827

Hi All,

In this code, i have an error if someone can help :

lt_cat99 type standard table of zcategorie99

select distinct matkl as categorie wgbez as description
  from t023t
  into corresponding fields of table lt_cat99
  where matkl in ('001', '00103', '002', '00207', '004')
  and spras = 'F'.

select m~matnr as id_produit kt~maktx as description m~meins as unite b~stprs as prix m~matkl as categorie
  up to 100 rows
  from mara as m
  inner join makt as kt on ( m~matnr = kt~matnr )
  inner join mbew as b  on ( b~matnr = m~matnr )
  into corresponding fields of table lt_prd99
  for all entries in lt_cat99
  where llt_cat99-categorie = m~matkl
  and b~bwkey = 1000.

It says : Field "LT_CAT99-CATEGORIE" unknown

and in the table "zcategorie99" I have a column name "CATEGORIE"

1 ACCEPTED SOLUTION
Read only

geert-janklaps
SAP Mentor
SAP Mentor
3,618

Hi,

In your where clause you have a typo (llt_cat99 instead of lt_cat99) and a wrong statement (m~matkl should be before lt_cat99).

This should solve your problem:

select m~matnr as id_produit kt~maktx as description m~meins as unite b~stprs as prix m~matkl as categorie
  up to 100 rows
  from mara as m
  inner join makt as kt on ( m~matnr = kt~matnr )
  inner join mbew as b  on ( b~matnr = m~matnr )
  into corresponding fields of table lt_prd99
  for all entries in lt_cat99
  where m~matkl = lt_cat99-categorie
  and b~bwkey = 1000.

Best regards,

Geert-Jan Klaps

Hi All,

In this code, i have an error if someone can help :

lt_cat99 type standard table of zcategorie99

select distinct matkl as categorie wgbez as description
  from t023t
  into corresponding fields of table lt_cat99
  where matkl in ('001', '00103', '002', '00207', '004')
  and spras = 'F'.

select m~matnr as id_produit kt~maktx as description m~meins as unite b~stprs as prix m~matkl as categorie
  up to 100 rows
  from mara as m
  inner join makt as kt on ( m~matnr = kt~matnr )
  inner join mbew as b  on ( b~matnr = m~matnr )
  into corresponding fields of table lt_prd99
  for all entries in lt_cat99
  where llt_cat99-categorie = m~matkl
  and b~bwkey = 1000.

It says : Field "LT_CAT99-CATEGORIE" unknown

and in the table "zcategorie99" I have a column name "CATEGORIE"

8 REPLIES 8
Read only

pfefferf
Active Contributor
0 Likes
3,618

It would be good if you would share the structure definition for zcategorie99 too.

But looking at your code - which is by the way not complete, e.g. the missing data keyword at the beginning - one issue is that in the where clause of your second query you named the table LLT_CAT99 instead of LT_CAT99. Changing the name to LT_CAT99 in where clause too, should resolve the issue.

Read only

geert-janklaps
SAP Mentor
SAP Mentor
3,619

Hi,

In your where clause you have a typo (llt_cat99 instead of lt_cat99) and a wrong statement (m~matkl should be before lt_cat99).

This should solve your problem:

select m~matnr as id_produit kt~maktx as description m~meins as unite b~stprs as prix m~matkl as categorie
  up to 100 rows
  from mara as m
  inner join makt as kt on ( m~matnr = kt~matnr )
  inner join mbew as b  on ( b~matnr = m~matnr )
  into corresponding fields of table lt_prd99
  for all entries in lt_cat99
  where m~matkl = lt_cat99-categorie
  and b~bwkey = 1000.

Best regards,

Geert-Jan Klaps

Read only

3,618

Typo llt_cat99 - that should be:

  where m~matkl = lt_cat99-categorie
Read only

0 Likes
3,618

My mistake! Corrected! Thanks Sandra!

Read only

Former Member
0 Likes
3,618

Thank you a lot.

But why "m~matkl = lt_cat99-categorie" and not "lt_cat99-categorie = m~matkl" ????

Read only

0 Likes
3,618

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.

Read only

0 Likes
3,618

Because ... it's how it works.

Other examples:

  • Valid: where column = 'literal'
  • Error: where 'literal' = column

And many more.

Read only

0 Likes
3,618

Thanks 🙂