cancel
Showing results for 
Search instead for 
Did you mean: 

Currency field creating problem .... NEED HELP

Former Member
0 Kudos

Hi,

Iam generating a smart form and am extracting the data from the database table to display in the smart form. When i give currency field to the amount field it is givin an error as<b> " Reference field W_ZMAINDOC1-DOC_AMOUNT unknown in form.

"</b> ......... Could anybody help me out ASAP..

Thanks

Shiva shekar k

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi shiva,

at the smartforms u should define like this for cureency/quntity fields,

go to global definations,

select currency/quntity fields tab,

there define as follows.

Field Name Reference Field Data Type

L_WA_ITAB-NETWR WAERK CURR

then save and activate to work.

reward points if helpful.

regards,

seshu.

Answers (3)

Answers (3)

former_member196280
Active Contributor
0 Kudos

use type P instead of currency..

Regards,

Sairam

Former Member
0 Kudos

Hi,

Create a character variable..And then assign the amount to the character variable..

Then print the character variable..

Thanks,

Naren

former_member673464
Active Contributor
0 Kudos

hi check this...

In the ABAP Dictionary, you can assign a currency or quantity field to a table field if the table field contains a currency or quantity value. When printing these fields, SAP Smart Forms can take into account the assigned currency or unit:

If the value field is in the same table as the assigned currency or quantity field, SAP Smart Forms automatically recognizes this and, during output, formats the value field according to the currency or unit in the assigned field.

If the value field and the assigned currency or quantity field are stored in different tables, SAP Smart Forms cannot automatically recognize the relationship.

In the second case, you must inform SAP Smart Forms about the relationship.

Procedure

As mentioned above, you only have to perform the following steps if a value field that is to be displayed in a table (for example, VALTAB) has a relationship to a currency or quantity field in another table (for example, CURTAB). In this case, you have to specify the relationship explicitly:

In the form, define a global field of the same type as the table in which the currency or quantity field is stored, for example WA_CURTAB. Also define a work area for the output of your value field, for example WA_VALTAB.

If you use a table with a header line, you do not need to define a work area. Instead, you work through the following steps with the header line of the relevant table. In the following step, for example, you would specify the field VALTAB-VALUE instead of WA_VALTAB-VALUE under Field Name.

Create the relationship to the currency field by switching to the Currency/Quantity fields of the Global Definitions node and entering the following values:

Field name: WA_VALTAB-VALUE if this is the value field of VALTAB that is to be output

Reference field: WA_CURTAB-CURRENCY, therefore the currency field of CURTAB

Use the work area WA_VALTAB on the data tab page of your table node or loop node.

Create a program lines node before the event at which the value field is printed.

In the program lines node, assign the currency or unit in which you want to format the value field WA_VALTAB-VALUE to the currency or quantity field of the global field WA_CURTAB-CURRENCY. You have to either select the value of WA_CURTAB-CURRENCY afterwards or have already passed it to the form interface.

Display or print the value field WA_VALTAB-VALUE.

Result

During output, SAP Smart Forms formats the value field WA_VALTAB-VALUE according to the value assigned to the currency or quantity field of the global variable WA_CURTAB_CURRENCY.

regards,

veeresh