cancel
Showing results for 
Search instead for 
Did you mean: 

smartform-currency field error.

former_member1006740
Participant
0 Kudos

Hi folks,

In My smartform i want to print the net value from vbrp table ( netpr) .but when iam executing the form it is throwing error as " reference field netpr " is unknown in form..

where i have to declare reference field of netpr.

Thanks,

Neelima.N

Accepted Solutions (1)

Accepted Solutions (1)

former_member673464
Active Contributor
0 Kudos

hi ,

use the following documentation for your help.

Displaying Fields That Refer to Currencies or Quantities

Use

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

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Neelima,

In the Global Definitions there will be a Tab named Currency/Quant.Fields

Give the Field Name ie VBRP-NETWR and the Refernec field as the field Specified in the Standard Table ie VBRK-WAERK and Select the Data Type as CURR

Regards,

Vijaya Lakshmi.T

Former Member
0 Kudos

In global definitions in ur smartform u have a currency fields tab, give ur fiels name, reference fiels and type there, then it should work fine.

кu03B1ятu03B9к

former_member1006740
Participant
0 Kudos

Hi kartik,

i already declared like that it is throwig error as "field WAERK is unknown.it is one of the specified tables nor defined by the data statement".

Thanks,

Neelima.N

Former Member
0 Kudos

hey,

just try to declare

net_value type kwert

in global defination-global data

otherwise declare it_vbrp type STANDARD TABLE OF VBRP in global defination-global data

and then read it_vbrp-netwr

Former Member
0 Kudos

Hi,

Declare the field name as the internal table which u are using in the smartform like it_vbrp-netwr and the reference field as the internal table for header ie it_vbrk-waerk and the Data Type select as CURR.

Declare the Internal Tables in the For Interface if u r using Driver Program or Else U declare the Field in the Global Data with refernce to the Refernce field Name

and moreover there is no filed with netpr in table VBRP but it is with table VBAP and in that table u go through the currency and Quantity filed in the table u can find the Reference field and refernce table over there.

Regards,

Vijaya Lakshmi.T

Edited by: Vijaya Lakshmi on Mar 12, 2009 10:37 AM