cancel
Showing results for 
Search instead for 
Did you mean: 

Reference Field Unknown

Former Member
0 Kudos

HI Guys,

At run time, I am getting an error "Reference field

wa_tab-amount unknown. Though there is not error

at the time of activation.

wa_tab-amount is konv-kwert.

Please help.

Regards,

Harsha

Accepted Solutions (0)

Answers (11)

Answers (11)

Former Member
0 Kudos

对于currency/quantity字段,在smartforms中要注意,定义表结构时要把currency和quantity的单位加进去,

这样定义之后就不会出现上面的问题了。

Former Member
0 Kudos

Thanks a ton. I managed it with the clues.

Harsha

Former Member
0 Kudos

Hi Harsha,

I suppose your requirement is to display Quantity and currency field in a smartform.

You can't directly display currency and quantity fields in Smartforms.

For that you have to create an extra variable in the Global definitions.

Suppose you are handling BRGEW field of MARA.

In the Global defintion, create a field (say WA_BRGEW type MARA-BRGEW).

Create program lines. In the input parameters specify the field that you were using(IN_BRGEW) and in the output parameters , use WA_BRGEW.

Now write the statement

WA_BRGEW = IN_BRGEW.

Now in the text element that you are using, give WA_BRGEW instead of IN_BRGEW.

It will work for both Quantity and Currency fields.

Regards,

Sylendra.

Former Member
0 Kudos

just copythis code i hope this is what ur looking for.

write : / wa_tab-amount currency KOMK-WAERK.

komk-waerk is reference field for KWERT.

Former Member
0 Kudos

Hello Harsha,

itab type table_type_x (table type).

itab is a table without a header line and therefore has no component called client.

You also declare a working area which is similar to the table and then while looping in the internal table via the working area then u will be able to access all the fields of the internal table..

itab type table_type_x.

w_itab type xxxx same structure as table_type_x.

loop at itab into w_itab.

now u can use w_itab...

endloop.

Former Member
0 Kudos

Hello Harsha,

itab type table_type_x (table type).

itab is a table without a header line and therefore has no component called client.

You also declare a working area which is similar to the table and then while looping in the internal table via the working area then u will be able to access all the fields of the internal table..

itab type table_type_x.

w_itab type xxxx same structure as table_type_x.

loop at itab into w_itab.

now u can use w_itab...

endloop.

Former Member
0 Kudos

I am using smart forms.

Harsha

Former Member
0 Kudos

Did you drag and drop the field from the field list?

If NOT do that and try.

Regards,

Ravi

Former Member
0 Kudos

Hi,

For calculation purpose you can use the same field, but for printing a quant/curr field u need to pass it to a variable of type c of same length and then use it for printing in smartforms.

Declare a variable as the same type of the currency field of the table which u are using in Global Definition-Global Data

For example:

v_variable type vbrp-fkimg.

where v_variable is ur quantity field to be displayed.

Chk this link for a detailed explanation:

Regards,

Anjali

Former Member
0 Kudos

My itab (internal table) has 7 fields, amount and disamt are type curr. I am importing the itab from the report

and declared itab like structure_x .

If I change this declaration to

itab type table_type_x (table type). I can not access

the other char field in my header. (EX Client Name etc)

as it gives the following error

itab is a table without a header line and therefore has no component called client.

There should be some alternative. I am working ..

Thanks,

Harsha

Former Member
0 Kudos

Harsha,

If you are using WRITE statements, then you don't have to alter the structure.

WRITE 😕 amount CURRENCY 'USD' should work.

Regards,

Ravi

Former Member
0 Kudos

Harsha,

You should have the CURRENCY field along with the AMOUNT field.

Regards,

Ravi

Former Member
0 Kudos

Hi Harsha,

You will get this error probably when trying to output this field? For amounts there should always be a reference to the corresponding currency field.

Regards,

John.

Former Member
0 Kudos

Mostly u have declared the wa_tab-amount field. check for the declaration part. Try to use TYPE for the field with reference field.

At run time when it is trying to fill data, it is not able to get the field properties correctly.