Application Development and Automation 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: 
Read only

Module pool.

Former Member
0 Likes
633

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

1 ACCEPTED SOLUTION
Read only

former_member673464
Active Contributor
0 Likes
613

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

6 REPLIES 6
Read only

former_member673464
Active Contributor
0 Likes
614

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

Read only

0 Likes
613

hi veereshbabu,

My requirement is that

field3 = field2 - field 1.

Please help being more specific.

rgds

Preeti

Read only

0 Likes
613

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.

Read only

0 Likes
613

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.

Read only

Former Member
0 Likes
613

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

Read only

Former Member
0 Likes
613

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 .