2021 Mar 01 1:47 PM
Hi experts,
I want to create a MVC Framework for Reports.
This means that reading and writing of the data on the dynpro-screen should be controlled via a global controller class. For this I use the FM DYNP_UPDATE_FIELDS and DYNP_VALUES_READ within the class. That works generally well. The FM’s are called during ucomm processing in the PAI.
Now I have the following problem: The dynpro with data that I read from the DB is initially to be called from the selection screen. Since the FM DYNP_UPDATE_FIELDS only works for the current Dynpro Number, which is still 1000 (selection screen) in the PAI at this time, I wanted to call the FM in the PBO. Apparently, the FM does not work in the PBO!? Unfortunately, I have not found any information on this.
Oh, one more Info: I don’t want to update the dynpro-fields hard coded in PBO like global_structure = go_ctrl->get_data( ).
My questions:
Any help is very welcome!
Thanks and regards,
Sebastian
2021 Mar 01 4:11 PM
DYNP_VALUES_READ and DYNP_VALUES_UPDATE are meant for help and value requests (POH/POV).
For PBO/PAI use the global variables (or "persistent" object attributes) linked to dynpro fields.
2021 Mar 01 4:40 PM
Hi Sandra! Thanks for your quick answer.
But this is exactly what I don't want, as I want to build a Framework where only the Controller-Class stores and updates the data for all ALVs and Dynpro-Fields. If I cannot trigger dynpro-data read and update within the Controller, than I cannot implement a MVC Concept :(.
2021 Mar 01 5:16 PM
You may at least use the "dirty assign" instead, in read/write:
ASSIGN ('(programname)globalvariablename') TO <field>.
2021 Mar 01 6:05 PM
I would use this Option (even if it's dirty), but I need the data directly from the dynpro and not from the global variables. I'll make an example why (makes it easier to explain):
A user enters a value in a dynpro-fields, presses tab-key (unfortunately doesn't trigger anything), Cursor jumps into ALV Table, user enters a value in ALV Table and presses tab-key. Now, a roundtrip is triggered. The Problem is now, that the global variable in the report hasn't been updated until now. When I need this value for e.g. a db-select, how can I get it?
I tried triggering a roundtrip via cl_gui_cfw=>set_new_ok_code, but this worked just once during a roundtrip from ALV Table. I would need this twice - one for reading dynpro-data and one for updating them after ALV-event-handling.
I'm really wondering how other developers solved this Problem!? Any Ideas? A User Manual with a highlighted Warning: Please press enter after entering a value into the dynpro-field would be a bankruptcy by SAP.