Application Development 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: 

how to do column calculation in smartforms using table

Former Member
0 Kudos

Hi,

In Smartform Table..I created main area ( as TABLE) having columns

POSNR(CELL7), MATNR(CELL8), FKIMG(CELL9), VRKME(CELL10), UPRICE(CELL11), NETWR(CELL12)....

Here UPRICE--- Calculate this field as Unit price = Amount / Billed Qty.

For this....I created a Flow Logic at CELL11

CELL11(Right click)

CREATE---FLOW LOGIC -


PROGRAM LINE

Provided code:

UPRICE = WA-NETWR / WA-FKIMG.

Its showing the run time error

Reference field WA-NETWR unknown in form

what i have to do now for calculating UPRICE in this case...

<offer removed by moderator>

Thanks

Lohit

Edited by: Thomas Zloch on Jan 11, 2011 11:36 AM

6 REPLIES 6

Former Member
0 Kudos

Hi,

The workarea WA is the destination structure in TableArea declaration?

0 Kudos

retreived the five column ( POSNR MATNR FKIMG VRKME NETWR ) values by providing code in GLOBAL SETTINGS -- INITIALISATION (TAB)

SELECT POSNR MATNR FKIMG VRKME NETWR INTO CORRESPONDING FIELDS OF TABLE

ITAB FROM VBRP WHERE VBELN EQ PVBELN.

And in MAIN AREA-----Table -


DATA (Tab) provided

Loop

Internal Table ITAB TO WA.

Created Text at each cell as

WA-POSNR(for Cell 7),

WA-MATNR (for Cell 8),

WA-FKIMG(for CELL9),

WA-VRKME(for Cell 10),

UPRICE(for Cell 11),

WA-NETWR(for Cell 12)

Former Member
0 Kudos

Hi Lohit,

Move the wa-NETWR Value to another field declared locally in the Progeam Logic and use the declared variable for calculation.

It happens for CURR / QUAN fields.

Thanks,

Preyansh

0 Kudos

Hi Preyansh,

Thanks for the reply..

I declared locally in the Program Logic as below

DATA : PNETWR TYPE VBRP-NETWR,

PFKIMG TYPE VBRP-FKIMG.

PNETWR = WA-NETWR.

PFKIMG = WA-FKIMG.

UPRICE = PNETWR / PFKIMG.

Same error is coming...

Can u explain me clearly plz.. i dont know much about CURR / QUAN fields..

0 Kudos

In Global Definition -> Currency/Quant. Fields put your WA-NETWR and define the field as quantity or currency

former_member536879
Active Contributor
0 Kudos

Hi,

The error is because of the NETWR is type of currency .

So you need to give a reference for this wa_netwr field.

For doing this you can give the reference as currency against wa_netwr in the table where you are looping this .

Hope this might be helpful to solve your issue

With Regards,

Sumodh.P