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

DYNP_VALUES_UPDATE not working

Former Member
0 Likes
3,160

I use a screen which has two cl_gui_picture classes.

And when the pictures are clicked a event is trigerred.

In this event I want to change the values of two radiobuttons which are at the same group.

The names of the radiobuttons are G_SIRKET01 and G_SIRKET02.

The code is as follows. But even it returns no errors, nothing happens.

Regards,

&----


*& Form sub_picture_click

&----


FORM sub_picture_click USING p_x p_y p_sender.

DATA pos_x(5) TYPE c.

DATA pos_y(5) TYPE c.

DATA l_dynnr LIKE syst-dynnr.

DATA it_fields LIKE dynpread OCCURS 1 WITH HEADER LINE.

pos_x = p_x.

pos_y = p_y.

IF p_sender = g_grph_elmatas.

g_sirket01 = 'X'.

g_sirket02 = ' '.

ELSEIF p_sender = g_grph_elmasu.

g_sirket01 = ' '.

g_sirket02 = 'X'.

ENDIF.

it_fields-fieldname = 'G_SIRKET01'.

it_fields-fieldvalue = g_sirket01.

APPEND it_fields.

it_fields-fieldname = 'G_SIRKET02'.

it_fields-fieldvalue = g_sirket02.

APPEND it_fields.

l_dynnr = '0002'.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-repid

dynumb = l_dynnr

TABLES

dynpfields = it_fields

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.

ENDFORM. " sub_picture_click

9 REPLIES 9
Read only

Former Member
0 Likes
1,351

Is it possible that it is not working becaue I use in an event of a class?

Thanks.

Read only

0 Likes
1,351

Check the value of the program name you are passing to the DYNP_UPDATE function.

Function Documentation

DYNAME: Program name (of the calling screen)

Meaning: Name of the program from which the function

module is called. Set sy-prog here, rather than

sy-repid. Reason: the value of sy-repid is the main program of the help processor function group.

-Kiran

*Please reward useful answers

Read only

Laxmana_Appana_
Active Contributor
0 Likes
1,351

Hi,

Check the screen names (G_SIRKET01 and G_SIRKET02) in

LOOP at Screen.

ENDLOOP.

whether these screen fields are coming under same screen.

Laxman

Read only

Former Member
0 Likes
1,351

hi,

Check whether the parameters are passed as per this

http://www.sapdevelopment.co.uk/fmodules/fms_dynp.htm

Regards,

Santosh

Read only

Former Member
0 Likes
1,351

Hai Fuat

Better to use the F.M 'F4IF_INT_TABLE_VALUE_REQUEST'

instead of using 'DYNP_VALUES_UPDATE'.

Check the following Code

TABLES : MARD.

DATA: BEGIN OF IT_MARD OCCURS 0,

WERKS LIKE MARD-WERKS,

END OF IT_MARD.

DATA : T_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.

parameters : P_WERKS LIKE MARD-WERKS.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WERKS.

SELECT WERKS FROM MARD UP TO 10 ROWS INTO table IT_MARD.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'WERKS'

DYNPPROG = SY-REPID

DYNPNR = '1000'

DYNPROFIELD = 'P_WERKS'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_MARD

RETURN_TAB = T_RETURN

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

Thanks & regards

Sreenivasulu P

Message was edited by: Sreenivasulu Ponnadi

Read only

0 Likes
1,351

Answer to the reply post of Sreenivasulu Ponnadi

-


Your answer is about updating F4 help values and there is a on-value request event which updates the screen values.

I am using a picture class and there is no way to F4 it.

Also classes does not triger PAI so PBO is also not processed.

I need a class or FM to update screen values when a class event called. No PAI no PBO!

Message was edited by: Fuat Ulugay

Read only

Former Member
0 Likes
1,351

I think it is not done at the appropriate place. When this event is raised, you will be in PAI of the screen and any modifications to the screen will not work in PAI. Try to set the values in PAI, but call the function module in the PBO of the screen 0002. Also, instead of using sy-repid, use a variable that is assigned the report name and pass it to the function module.

Read only

0 Likes
1,351

When the event is raised it is irrelevant of PAI and PBO. Only the class event is raised and processed. So I need a function which updates the screen values w/o PBO or PAI.

Read only

Former Member
0 Likes
1,351

OK, I found the solution myself and I tell it here.

My problem was that: "When an object raises an event from a screen the values cannot be updated from that event because no PAI was called.'

Solution:

1.When you register the events, make appl_event 'X'.

  • Register the events

event_tab_line-eventid = cl_gui_picture=>eventid_picture_click.

event_tab_line-appl_event = 'X'.

APPEND event_tab_line TO event_tab.

2.Call the dsipatch method of control framework object from the related screen's PAI. The dispatch method will raise the event from PAI and the screen will be updated.

CASE save_code.

WHEN 'BACK' OR '%EX' OR 'CANC'.

....

WHEN OTHERS.

CALL METHOD cl_gui_cfw=>dispatch.