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: 

Module Pool

abdul_hakim
Active Contributor
0 Kudos
70

Hi Friends,

Is there any function module available for capturing the old screen value.I mean if the change the value from GBP to KRW then it should return GBP?

Thanks,

Abdul

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
51

You would have to handle this manually in your program.

I would suggest having an "X" structure to hold old values. For example, say you have a structure with data, lets call it TEST. These are the fields that are presented to the user on the screen. Have an "X" version of the structure, XTEST. In your PBO, move the values from TEST to XTEST. Now you have a copy of the values that are being presented to the user, In the PAI, you can now check for any changes of the data and handle accordingly.

Regards,

Rich HEilman

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
52

You would have to handle this manually in your program.

I would suggest having an "X" structure to hold old values. For example, say you have a structure with data, lets call it TEST. These are the fields that are presented to the user on the screen. Have an "X" version of the structure, XTEST. In your PBO, move the values from TEST to XTEST. Now you have a copy of the values that are being presented to the user, In the PAI, you can now check for any changes of the data and handle accordingly.

Regards,

Rich HEilman

0 Kudos
51

Hi Rich,

Actually i have problem with the table control on the screen.It doesnt have item column also.I need to know to which line the user has made changes and the corresponding old value..

Tks,

Abdul

0 Kudos
51

Ok, in your PBO, make a copy of the entire internal table. There should be a LOOP in the PAI of your screen flow logic. Something like this...




PROCESS AFTER INPUT.
* PAI FLOW LOGIC FOR TABLECONTROL 'I_INTRCON'
  LOOP AT I_INTR.
[code]    CHAIN.
      FIELD  I_INTR-CHECK.
      FIELD  I_INTR-RCVQTY.

      MODULE I_INTRCON_MODIFY ON CHAIN-REQUEST.
    ENDCHAIN.

ENDLOOP.

[/code]

Make sure that all you editable fields are part of this chain. Notice the module I_INTRCON_MODIFY. This module is fired to handle the changes to the table control fields.

NOw inside of this module you can check the old internl table and look for the changes.




*********************************************************************
*      Module  I_INTRCON_MODIFY  INPUT
*********************************************************************
module i_intrcon_modify input.

  modify i_intr index <b>i_intrcon-current_line.</b>

* Check the changes here.  I believe that you can use 
*  i_intrcon-current_line as your index to the Old data
*  table.

read table itab_olddata index i_intrcon-current_line.
if sy-subrc = 0.
* Check changes.
Endif.



endmodule.

Make Sense?

Regards,

Rich Heilman

0 Kudos
51

Hi Rich.

I have solved the problem according to your idea..

Many Thanks,

Abdul Hakim

former_member181962
Active Contributor
0 Kudos
51

Hi Abdule,

You can use the get parameter statement.

GET PARAMETER ID pid FIELD dobj.

Regards,

Ravi