‎2013 Jun 04 10:38 PM
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
‎2013 Jun 05 6:01 AM
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
‎2013 Jun 05 6:13 AM
Hi JR,
Where have you wrote the validation routine? Is it under the Function code ENTER or SAVE?
With Regards,
Gurulakshmi
‎2013 Jun 05 7:31 AM
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
‎2013 Jun 05 8:03 AM
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
‎2013 Jun 05 9:03 AM
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.
‎2013 Jun 05 9:18 AM
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