Application Development and Automation 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: 
Read only

Function DYNP_VALUES_UPDATE not working in PBO

Former Member
0 Likes
756

Hello,

I have a field 'Risk Category' whose value I need to change upon an action. The action is controlled through a button on the screen. For e.g: if the action is 'Update Credit Info', when the user chooses this action, it takes him to another location where he makes changes to the Credit parameters. When he returns back to the original screen, he needs to see the new value for 'Risk Category'.

I have controlled this in the PBO...I read the table containing the risk category and then call the function DYNP_VALUES_UPDATE. However, the value of the field does not change.

Please find my code below:

MODULE status_1100 OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'KNKK-CTLPC'.

IF lt_dynpfld IS NOT INITIAL.

LOOP AT lt_dynpfld INTO ls_dynpfld.

DELETE TABLE lt_dynpfld FROM ls_dynpfld.

ENDLOOP.

ENDIF.

SELECT SINGLE ctlpc FROM knkk

INTO ls_dynpfld-fieldvalue

WHERE kunnr = knkk-kunnr.

ls_dynpfld-fieldname = 'KNKK-CTLPC'.

APPEND ls_dynpfld TO lt_dynpfld.

CLEAR: ls_dynpfld.

SELECT SINGLE rtext FROM t691t

INTO ls_dynpfld-fieldvalue

WHERE ctlpc = ls_dynpfld-fieldvalue.

ls_dynpfld-fieldname = 'T691T-RTEXT'.

APPEND ls_dynpfld TO lt_dynpfld.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-repid

dynumb = '1100'

TABLES

dynpfields = lt_dynpfld

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

undefind_error = 7

OTHERS = 8.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

ENDLOOP.

ENDMODULE. " STATUS_1100 OUTPUT

*******************************************

The flow logic for the screen 1100 is:

PROCESS BEFORE OUTPUT.

MODULE STATUS_1100.

PROCESS AFTER INPUT.

*******************************************

Please let me know if there is something wrong with this code or if something is missing.

Thanks,

Rugmani

2 REPLIES 2
Read only

Former Member
0 Likes
405

Did you read first line from FM documentation?

Read only

0 Likes
405

Well, if this is not the program, please suggest an alternative program.