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

Dynpro fields get overwritten

Former Member
0 Likes
1,732

Hello,

Can someone tell me what I'm missing here?  It's been a while since I had to deal with classic dynpro processing.  When I go into a validation routine and look at the intermal table from the screen I'm processing in debug I don't see the field changes I've just made in that internal table.  All values are as they were before I changed some of the fields.  When I return from debug the changes still display on the screen but those values were not used in the validation.  Then if I press ENTER or SAVE all the original values overwrite my changes.  Any ideas?

Regards,

JR

6 REPLIES 6
Read only

0 Likes
1,173

Hi,

Use CHAIN ... END CHAIN in PAI ( Process After Input ) for validation.

This will read fields from screen and return to your program for validation using FIELD inside CHAIN ... END CHAIN.

Regards,

Amit

Read only

Former Member
0 Likes
1,173

Hi JR,

Where have you wrote the validation routine? Is it under the Function code ENTER or SAVE?

With Regards,

Gurulakshmi

Read only

Former Member
0 Likes
1,173

Dear JR,

I suppose you are using table control in the screen.

In PBO you are updating the values from the program into the screen.

MAKE SURE

In PAI you do the same that is you transfer the values from Screen to program.

The loop endloop you write in PAI should also have the update module with Modify statement.

For more details

http://help.sap.com/saphelp_470/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm

BR

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,173

I suppose you use a table control, In the LOOP AT itab of the PAI did you insert a module to update the program internal table ?

* TOP include (global data)

TABLES: itab.

* Dynpro logic

PROCESS AFTER INPUT.

   MODULE get_cursor.

   MODULE user_command_xxxx at exit-command.

   MODULE itab_xxxx_user_command.

   LOOP AT itab.

     MODULE read_curent_itab.

     FIELD  itab-field1 module check_itab_field1.

     CHAIN.

       FIELD itab-field2.

       FIELD itab-field3 module check_itab_field2. " check field 3

       MODULE itab_xxxx_chain. " check field2 and field3

     ENDCHAIN.

     MODULE itab_modify.

   ENDLOOP.

   MODULE user_command_xxxx.

* PAI Include

MODULE itab_xxxx_modify INPUT.

   MODIFY itab INDEX control_itab-current_line.

ENDMODULE.                 

Regards,

Raymond

Read only

Former Member
0 Likes
1,173

Hi,

I believe somewhere in PBO, you might have updated values of your field.

Do one simple thing...

     Localise the point where the values are getting modified. Put break point at start of PAI and End of PAI, Start of PBO and End of PBO. you will come to know where the values are getting modified.

     Put a watchpoint for your field--> see where they are getting modified.

Read only

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,173

Hi JR,

In PAI you need to Update the Itab with the MODIFY Statement.

In PBO you need to start the logic of validating the Data.

The Process from PBO - > PAI and then PBO.

So Break the code in PBO and see what happens.

Then Break the code in PAI and see what happens.

If you dont modify the data in PAI with Modify stmnt. Then what ever the ENTER or SAVE you press the changed values will be wiped out and the old data which is there in the Workarea or Table Header will be overwritten and updates the DB or ITAB or something etc..

Hope this helps