‎2007 May 07 6:59 AM
Hi all,
i am making an infotype where i have 3 amount fields - field1, field2 and field3.
my requirement is that in the infotype, field 3 should get populated itself by the value of (<i>field2 - field3</i>).
Please let me know how to code for the same in PAI...its urgent
Thanks & Reagrds,
Preeti
‎2007 May 07 7:04 AM
hi..
In pai write below code .
select single
from spfli
into field3
where carrid eq field2.
you can use input option to be display the field for display only.Whenever user enters data field3 will be filled automatically.
regards.
veeresh
‎2007 May 07 7:04 AM
hi..
In pai write below code .
select single
from spfli
into field3
where carrid eq field2.
you can use input option to be display the field for display only.Whenever user enters data field3 will be filled automatically.
regards.
veeresh
‎2007 May 07 7:16 AM
hi veereshbabu,
My requirement is that
field3 = field2 - field 1.
Please help being more specific.
rgds
Preeti
‎2007 May 07 7:27 AM
you should write it in PBO
example...
.....................
PBO...
Module get_field3.
.......................
Module-pool...
Module get_field3.
field3 = field2 - field1.
endmodule.
regards,
Aabhas
-Reward if helpful.
‎2007 May 07 7:31 AM
Hello Preeti,
Can you eloberate a bit more. Or can you pose in the code.
IN PAI do your calculation.
loop at itab.
*itab is ur internal table passed to table control. module calculate.
endloop.
module calculate input.
itab-field3 = itab-filed2 -itab-field3.
modify itab transporting field3.
endmodule.
regards.
‎2007 May 07 7:36 AM
Hi Preeti,
Try out the fallowing code
In PAI
Declare the module in the flow logic as below
Field field3 Module value_fill.
Write This logic in your program
data begin of dynpfields occurs 1.
include structure dynpread.
data end of dynpfields.
dynpfields-fieldname = 'FIELD1'.
append dynpfields.
dynpfields-fieldname = 'FIELD2'.
append dynpfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = repid
dynumb = sy-dynnr
tables
dynpfields = dynpfields
exceptions
others.
read table dynpfields index 1.
field1 = dynpfields-fieldvalue.
read table dynpfields index 2.
field2 = dynpfields-fieldvalue.
field3 = field1 - field 2.
Regards,
Kasi S
‎2007 May 08 6:53 AM
Hi Preeti,
In PAI try this code.
Loop at itab.
itab-field3 = itab-field2 - itab-field1 .
modify itab from itab.
endloop.
itab is internal table of your infotype .