cancel
Showing results for 
Search instead for 
Did you mean: 

FPM issue with setting and saving default values

former_member189162
Participant
0 Kudos

Hi Experts,

In the class: CL_HRESS_PER_DETAIL we have added some code to set the default value of a calendar input to today's date.


FIELD-SYMBOLS: <FS_DISDT> TYPE DISDT.
ASSIGN COMPONENT 'DISDT' OF STRUCTURE cs_data TO <FS_DISDT>.
<FS_DISDT> = SY-DATUM.
EV_DATA_CHANGED = ABAP_TRUE.


This works fine and when you open the screen, you can see the value in the calendar input field.

The problem is that when we click Save, we get a validation error that a date is required. The screen does not recognize the change until you manually choose a date and then click save.


Is there something else we need to do in order to set a default value that is also set to dirty so it can be saved?


Has anyone run into this same issue? Please let me know if I am missing something additional that needs to be done.


Thanks!

-Kevin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kevin,

this validation error is the error of the Webdynpro itself, or does it come from the backend?

If it comes from webdynpro, it can be a bug.

But if it comes from the backend then it can happen that you need to set the value in the backend buffer as well, otherwise the backend "doesn't know" that you already filled the value in the feeder class.

How does the FLUSH implementation look like?

This should be responsible to sync between the UI and backend (buffers).

Regards,

Peter

former_member189162
Participant
0 Kudos

Thanks Peter.


I am looking now at IF_FPM_GUIBB_FORM~FLUSH.

I see when in the IT_CHANGE_LOG that it does not show the values i set in GET_DATA.

So, I should append entries for this into the IT_CHANGE_LOG, is that the correct?

Thanks!

-Kevin

former_member189162
Participant
0 Kudos

Yep, that appears to have done the trick.

I added the following and I saves now. Thanks Peter!!

GET REFERENCE OF <FS_DISDT> INTO ls_change_log-new_value.
     ls_change_log-name = 'DISDT'.
     INSERT ls_change_log INTO TABLE lt_change_log.
     CLEAR:ls_change_log.

CALL METHOD IF_FPM_GUIBB_FORM~FLUSH
     EXPORTING
          IT_CHANGE_LOG = LT_CHANGE_LOG
          IS_DATA = IS_DATA.

Answers (0)