on 09-28-2007 7:43 PM
Hi Friends,
I am in a need to calculate and print unit price in Smartform, I am not supposed to make any changes in Driver Program. Here, the fields FKIMG(total quantity) and NETWR(Total amount) are selected from table VBRP and stored in an internal table itab. now this itab is passed to smartform tables interface. So my itab only have 2 fields FKIMG and NETWR. I need to calculate Unit Price = NETWR / FKIMG.
The out put required is like this,
Total Qty Unit Price Amount
20 100 2000
05 300 1500
08 200 1600
How to do this in smartform--- please help me.
Regards,
Ajoy
Hi Ajoy..
In case of SMARTFORMS we can add the Logic using PROGRAM LINES Node.
Steps:
1. Create a <b>variable</b> in the Global data Tab in Global Definitions of Smartform.
Eg: V_UNITPR TYPE VBRP-NETWR
2. Create a <b>Program lines</b> node above the Text node where the Unit price has to be displayed.
Input Parameters: VBRP-NETWR and VBRP-FKIMG
Output Parameters: V_UNITPR.
Code:
V_UNITPR = VBRP-NETWR / VBRP-FKIMG.
3. Check the Program lines node and Display the Field V_UNITPR.
<b>Reward if Helpful.</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry Friends, I forgot to tell one thing. Smartform is not permitting me to create any Program Lines within Table( not after Header or before any Text of Table ). It only permitting LOOP withinn a Table. Though, I can create Program Lines Before or After the table. But that does not make sense when I have more than one records in Internal Table Itab. I need to calculate the unit price within Table and write it in the Main area of the Table. Please, help me.
Regards,
Ajoy
Hi
Create PROGRAM LINES in the Smartform and write little piece of code to calculate the Total amount using this ITAB data Unit Price and Qty
and you can print that in smartform straight away.
This is the extra benefit(writing our own code) of the smartforms over scripts
so do like that
Regards
Anji
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.