on 2020 Dec 30 7:18 AM
I have a list report with output table that looks as follows:
I want the Competency (last column) to change to "COMPETENT" on the selected record when I hit the "Set Competent" Button.
I have created an action called "Set_Competent in a behavior definition:
action ( features : instance ) Set_Competent result [1] $self;
The action is implemented as follows in the behavior pool (behavior implementation):
METHODS Set_Competent FOR MODIFY
IMPORTING comp_keys FOR ACTION qman~Set_Competent RESULT result.
.
.
CLASS lcl_handler_qman IMPLEMENTATION.
METHOD Set_Competent.
DATA: ls_result LIKE LINE OF result,
ls_qman TYPE zqualman.
SELECT * FROM z_u_qman INTO TABLE @DATA(lt_comp_result)
FOR ALL ENTRIES IN @comp_keys WHERE qrec = @comp_keys-qrec.
LOOP AT lt_comp_result ASSIGNING FIELD-SYMBOL(<fs_Qman>).
ls_result-qrec = <fs_Qman>-qrec.
ls_result-%param = CORRESPONDING #( <fs_qman> ).
ls_result-%param-qrec = <fs_Qman>-qrec.
ls_result-%param-Competency = 'COMPETENT'.
APPEND ls_result TO result.
** The relevant Success Message is mapped to the REPORTED parameter of the method
APPEND VALUE #( qrec = <fs_Qman>-qrec
%msg = new_message( id = 'MM' number = '899' v1 = 'Set to Competent in qualification' v2 = <fs_qman>-qualification severity = if_abap_behv_message=>severity-success )
%element-Competency = cl_abap_behv=>flag_changed ) TO reported-qman.
ENDLOOP.
ENDMETHOD.
The code is hit and runs successfully but does not change the field "Competency" of the selected record from "TRAINED" to "COMPETENT" on the screen i.e. the list report field is not updated!
After the code runs the Result table looks like:
The Reported table looks like:
The message in the "reported table" is showing on the List report as a toast as expected.
Request clarification before answering.
Hello Jeffrey,
I think you need to adjust/modify your custom data source z_u_qman once you are done with the loop. The Database is not getting updated from TRAINED to COMPETENT for the selected record.
Regards,
Pawan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pawan,
Thanks for your response.
I agree the DB is not updated but I expect the field in the List report to be updated to "COMPETENT" regardless as I am filling the response table as if I have updated the DB. If I then where to hit the "GO" button in the List report I would expect it to be reset to "TRAINED" as it would refresh from the (not updated) DB.
Jeff
User | Count |
---|---|
74 | |
30 | |
9 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.