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: 

Problem with DYNP_UPDATE_FIELDS in PBO

sebastian_wilhelm1
Participant
0 Kudos
1,073

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:

  • Is there a possibility to use the FM DYNP_UPDATE_FIELDS in the PBO?
  • Is there an alternative FM? DYNP_VALUES_UPDATE probably doesn't work here either.
  • Is there another way of setting the data on the screen via a controller class?

Any help is very welcome!

Thanks and regards,

Sebastian

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos
718

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.

sebastian_wilhelm1
Participant
0 Kudos
718

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 :(.

Sandra_Rossi
Active Contributor
0 Kudos
718

You may at least use the "dirty assign" instead, in read/write:

ASSIGN ('(programname)globalvariablename') TO <field>.

sebastian_wilhelm1
Participant
0 Kudos
718

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.