'DYNP_VALUES_UPDATE'
Hello experts,
i m developing one screen , in that i put one F4 help, there are two fields doc & doc Date.
i want when user select that doc no. corresponding date will appear in date field.I m using FM 'DYNP_VALUES_UPDATE'
to update.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'EXNUM'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'ZBOE_NO'
window_title = 'BOE Details'
value_org = 'S'
display = 'F'
tables
value_tab = i_j_1iexchdr
return_tab = return.
*refresh dynfields.
READ TABLE RETURN INTO W_RETURN INDEX 1.
EXDAT = RETURN-FIELDVAL.
READ TABLE i_j_1iexchdr WITH KEY exdat = exdat.
IF SY-SUBRC = 0.
DYNFIELDS-FIELDNAME = 'ZBOE_DATE'.
DYNFIELDS-FIELDVALUE = I_J_1IEXCHDR-EXDAT.
append dynfields.
CLEAR DYNFIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = dynfields
EXCEPTIONS
others = 8.
endif.
Plz suggest where i m wrong
Aastha
Hi Aastha,
Try this way. Just execute it and change your program accordingly.
REPORT ZVENKAT_F4_FOR_PARAMETERS MESSAGE-ID ZMSG .
TYPES:BEGIN OF T_T001W,
WERKS TYPE T001W-WERKS,
NAME1 TYPE T001W-NAME1,
END OF T_T001W,
T_RETURN_TAB TYPE DDSHRETVAL.
DATA:W_T001W TYPE T_T001W,
W_RETURN_TAB TYPE T_RETURN_TAB.
DATA:I_T001W TYPE STANDARD TABLE OF T_T001W,
I_RETURN_TAB TYPE STANDARD TABLE OF T_RETURN_TAB.
DATA:W_DYNPFIELDS TYPE DYNPREAD,
I_DYNPFIELDS LIKE STANDARD TABLE OF DYNPREAD.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS :P_WERKS TYPE T001W-WERKS,
P_NAME1 TYPE T001W-NAME1.
SELECTION-SCREEN END OF BLOCK B1.
"F4 Help for Werks
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WERKS.
IF I_T001W[] IS INITIAL.
SELECT WERKS NAME1
FROM T001W
INTO TABLE I_T001W.
ENDIF.
"Function module for F4 help
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'WERKS' "field name on f4 help window
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_WERKS' "Screen field name
VALUE_ORG = 'S'
TABLES
VALUE_TAB = I_T001W
RETURN_TAB = I_RETURN_TAB.
READ TABLE I_RETURN_TAB INTO W_RETURN_TAB INDEX 1.
P_WERKS = W_RETURN_TAB-FIELDVAL.
READ TABLE I_T001W INTO W_T001W WITH KEY WERKS = P_WERKS.
IF SY-SUBRC = 0.
W_DYNPFIELDS-FIELDNAME = 'P_NAME1'.
W_DYNPFIELDS-FIELDVALUE = W_T001W-NAME1.
APPEND W_DYNPFIELDS TO I_DYNPFIELDS.
CLEAR W_DYNPFIELDS.
"DYNP_VALUES_UPDATE
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = SY-REPID
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = I_DYNPFIELDS.
ENDIF.
Thanks
Venkat.O
Similar Messages
-
Using DYNP_VALUES_UPDATE with a Maintenance View
Hi,
I am using a maintenance view to insert values into a table. When user creates a new entry, based on the value provided for a field,I need to fill a read-only field. In PAI, when user enters a value for one field, I am using FM 'DYNP_GET_STEPL' to get the current line and then DYNP_VALUES_UPDATE to fill the contents to the read-only field. But this does not seem to work. Any idea?
Regards
RachanaHi Tamas,
I tried both the options suggested by you.
I am updating the underlying structure, still its not visible when the screen loads again. But if you see the same field gets filled with DYNP_VALUES_UPDATE if an F4 help is used for teh first(editable) field and then my read-only field is also filled in the PROCESS ON VALUE REQUEST module.
So my guess is that, since it is a table control, it loops through the rest of the table control which is empty and my underlying structure gets cleared. So the problem could be where I am actually filling the field.
Is it possible to somehow fill the <EXTRACT> table so that teh value is not lost?
Regards
Rachana -
Mysterious function module DYNP_VALUES_UPDATE?
Hi ABAP Gurus/Experts,
I'm very confused about function module DYNP_VALUES_UPDATE in function group SHL2. It'll be nice if you could answer my question below.
I tried to call the function module with space passed to both parameter DYNAME and DYNUMB, such as the following, and it successfully updated the selection screen of the calling report. I wonder how it got program/screen information of the calling report.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = space
dynumb = space
TABLES
dynpfields = lt_dynp_fld[]
EXCEPTIONS
OTHERS = 0.
The source code of the function module is shown below. It merely calls a subroutine and simply ignores parameters DYNAME and DYNUMB.
FUNCTION dynp_values_update.
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(DYNAME) LIKE D020S-PROG
*" VALUE(DYNUMB) LIKE D020S-DNUM
*" TABLES
*" DYNPFIELDS STRUCTURE DYNPREAD
PERFORM fill_dpovtab_upd TABLES dynpfields.
ENDFUNCTION.
The form is shown below. Did the C function DYNP_GET_STATUS link function group SHL2 to the calling report in the background? I guess that field symbol <dpovtab> (linked to global variable dpovtab610 in my test) in the form was mapped to the calling report by the ABAP runtime environment...
FORM fill_dpovtab_upd TABLES dynpfields STRUCTURE dynpread.
DATA: hf TYPE i, dp TYPE dpov610, hstepl(3) TYPE n,
flduseoffs TYPE i, flduselen TYPE i,
fldnameoffs TYPE i, fldnamelen TYPE i,
fldinhoffs TYPE i, fldinhlen TYPE i,
fldinpoffs TYPE i, fldinplen TYPE i.
FIELD-SYMBOLS: <dpovline> TYPE ANY, <dpovtab> TYPE table,
<dfline> TYPE dynpread.
CALL 'DYNP_GET_STATUS' ID 'FUNCTION' FIELD 16 "kennt der Kern DPOV610?
ID 'VALUE' FIELD hf. "#EC CI_CCALL
IF sy-subrc NE 0 OR hf EQ 0. "sieht wohl nicht so aus
ASSIGN: dpovtab TO <dpovline>,
dpovtab[] TO <dpovtab>.
flduseoffs = 0. flduselen = 1.
fldnameoffs = 1. fldnamelen = 132.
fldinhoffs = 133. fldinhlen = 132.
fldinpoffs = 265. fldinplen = 1.
ELSE. "DPOV610 ist bekannt
ASSIGN: dpovtab610 TO <dpovtab>,
dp TO <dpovline>.
flduseoffs = 0. flduselen = 1.
fldnameoffs = 1. fldnamelen = 140.
fldinpoffs = 141. fldinplen = 1.
fldinhoffs = 142. fldinhlen = 255.
ENDIF.
* dynpfields nach dpovtab schaufeln
CLEAR: <dpovtab>, <dpovline>.
LOOP AT dynpfields ASSIGNING <dfline>.
IF <dfline>-stepl GT 0.
hstepl = <dfline>-stepl.
CONCATENATE <dfline>-fieldname '(' hstepl ')'
INTO <dpovline>+fldnameoffs(fldnamelen).
ELSE.
<dpovline>+fldnameoffs(fldnamelen) = <dfline>-fieldname.
ENDIF.
<dpovline>+flduseoffs(flduselen) = 'E'.
<dpovline>+fldinhoffs(fldinhlen) = <dfline>-fieldvalue.
APPEND <dpovline> TO <dpovtab>.
ENDLOOP.
ENDFORM. "fill_dpovtab_updHi Bo,
In some place, some where, ..., SAP links the dpov table of this function group with your kernel. See:
call 'DYNP_GET_STATUS' id 'FUNCTION' field 16 "kennt der Kern DPOV610?
id 'VALUE' field hf. "#EC CI_CCALL
if sy-subrc ne 0 or hf eq 0. "sieht wohl nicht so aus
This call is a internal function that verify the table in the kernel.
With sure another point of system is linking it.
Best regards,
Leandro Mengue -
ABAP Basics: FUNCTION 'DYNP_VALUES_UPDATE'
Hi,
in a selection-screen-event (AT SELECTION-SCREEN ON RADIOBUTTON GROUP dest.) I want to modify another screen field depending on the input for the 2 radiobutton fields.
The exit is only processed after I declared the first parameter with addition "USER-COMMAND dest". I don't understand why, but it's OK.
Now comes the dilemma:
When changing the radiobutton first, the event is processed and the value on the selection screen replaced.
When I do it again, the event is processed, but the replament does not work.
I'm using DYNP_VALUES_UPDATE as shown below:
<pre>
FORM dynp_values_update USING pv_field TYPE fieldname
pv_value TYPE any.
DATA:
lv_dyname TYPE d020s-prog,
lv_dynumb TYPE d020s-dnum,
lt_dynpfields TYPE STANDARD TABLE OF dynpread WITH DEFAULT KEY,
ls_dynpfields TYPE dynpread.
FIELD-SYMBOLS:
<dynpfields> TYPE dynpread.
lv_dyname = sy-repid.
lv_dynumb = sy-dynnr.
ls_dynpfields-fieldname = pv_field.
ls_dynpfields-fieldvalue = pv_value.
APPEND ls_dynpfields TO lt_dynpfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = lv_dyname
dynumb = lv_dynumb
TABLES
dynpfields = lt_dynpfields
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. " dynp_values_update
</pre>
Sy-Subrc is zero - what's wrong? Obviously the update takes place only if the screen field is empty.
Please help me, thank you.
Regards,
ClemensPlease check this sample program, here there is no need to use the DYNPRO_VALUE_UPDATE.
report zrich_0001 .
parameters: p_rad1 radiobutton group dest user-command chk,
p_rad2 radiobutton group dest,
p_file type localfile.
<b>
* Comment out this event
*at selection-screen on radiobutton group dest.</b>
<b>at selection-screen output.
if p_rad1 = 'X'.
p_file = 'C:/TestFile1.txt'.
elseif p_rad2 = 'X'.
p_file = 'C:/TestFile2.txt'.
endif.</b>
Regards,
Rich Heilman -
Hi gurus,
Im making a search help using FM F4IF_INT_TABLE_VALUE_REQUEST with multiple choice and it's working fine, my problem it's passing the values choosed from this FM to the screen...
I've declare a select option, and what i want it's to pass the choosen values from the search help to the screen but it's not working fine... i already tried the FM DYNP_VALUES_UPDATE to update the screen field but still yhe same...
Below goes my code, just in case...
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ZLINHA'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'SO_NUM'
window_title = 'Programa'
value_org = 'S'
multiple_choice = 'X'
TABLES
value_tab = it_values
return_tab = return_tab.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
LOOP AT return_tab.
* CLEAR r_num.
so_num-option = 'EQ'.
so_num-sign = 'I'.
MOVE 'SO_NUM' TO dynpfields-fieldname.
MOVE return_tab-fieldval TO dynpfields-fieldvalue.
APPEND dynpfields.
* so_num-low = return_tab-fieldval.
* APPEND so_num.
ENDLOOP.
ENDIF.
CLEAR dynpfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = progname
dynumb = dynnum
TABLES
dynpfields = dynpfields.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
If anyone has any idea, feel free to speak
Thanks in advance,
Best RegardsHi Martins,
You have used the select options that means you have to use the function module for the <select-option >-low and <select-option>-high.
I am giving you a code snippet in which the selection screen has select-options and with the help of function module it shows F4 help and pass the values.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-023.
SELECT-OPTIONS:S_PIDNUM FOR ZMST_PERMIT-ZPIDNUM ,
S_ENGDSC FOR ZMST_PERMIT-ZENGDSC NO INTERVALS LOWER CASE,
S_ARBDSC FOR ZMST_PERMIT-ZARBDSC NO INTERVALS LOWER CASE,
S_TARIFF FOR ZMST_PERMIT-ZTARIFF NO INTERVALS,
S_PERNUM FOR ZMST_PERMIT-ZPERNUM NO INTERVALS,
S_ARRPRT FOR ZMST_PERMIT-ZARRPRT NO INTERVALS MATCHCODE OBJECT ZMST_PORTS.
PARAMETER:P_PERTYP(2) TYPE C AS LISTBOX VISIBLE LENGTH 20.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PIDNUM-LOW.
W_NAME2 = 'S_PIDNUM-LOW'.
W_NAME1 = 'ZPIDNUM'.
PERFORM F4_HELP USING W_NAME1 W_NAME2 . "calling subroutine to provide desired F4 help
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PIDNUM-HIGH.
W_NAME2 = 'S_PIDNUM-HIGH'.
W_NAME1 = 'ZPIDNUM'.
PERFORM F4_HELP USING W_NAME1 W_NAME2 . "calling subroutine to provide desired F4 help
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_ENGDSC-LOW.
W_NAME2 = 'S_ENGDSC'.
W_NAME1 = 'ZENGDSC'.
PERFORM F4_HELP USING W_NAME1 W_NAME2 . "calling subroutine to provide desired F4 help
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_ARBDSC-LOW.
W_NAME2 = 'S_ARBDSC'.
W_NAME1 = 'ZARBDSC'.
PERFORM F4_HELP USING W_NAME1 W_NAME2 . "calling subroutine to provide desired F4 help
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_TARIFF-LOW.
W_NAME2 = 'S_TARIFF'.
W_NAME1 = 'ZTARIFF'.
PERFORM F4_HELP USING W_NAME1 W_NAME2 . "calling subroutine to provide desired F4 help
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PERNUM-LOW.
W_NAME2 = 'S_PERNUM'.
W_NAME1 = 'ZPERNUM'.
PERFORM F4_HELP USING W_NAME1 W_NAME2 . "calling subroutine to provide desired F4 help
*& Form F4_HELP
text
--> p1 text
<-- p2 text
FORM F4_HELP USING: W_VAR TYPE DFIES-FIELDNAME
W_VAR1 TYPE HELP_INFO-DYNPROFLD .
Fetching data from zmst_permit for F4 help on PERMIT ID No.--
IF IT_PERMIT[] IS INITIAL.
SELECT ZPIDNUM
ZENGDSC
ZARBDSC
ZTARIFF
ZPERNUM
ZARRPRT
ZEFFDT
ZEXPDT
FROM ZMST_PERMIT INTO CORRESPONDING FIELDS OF TABLE IT_PERMIT.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = W_NAME1 " 'ZPIDNUM'
DYNPPROG = 'ZMSTR0022'
DYNPNR = SY-DYNNR
DYNPROFIELD = W_NAME2 "'S_PIDNUM'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = IT_PERMIT
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
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. " F4_HELP
I hope this will help you.
Help children of U.N World Food Program by rewarding points and encourage others to answer your queries. -
Select options - dynp_values_update
Hi,
I need to update a select option ( multiple values ) in the selection screen. I tried with DYNP_VALUES_UPDATE but it was not working. I am checking on this for last two days but did not reach the solution.
Please donot tell me to use submit statement ( calls an internall session ) becuase that is what i got when i searched in SCN. I want this functionality to happen when the f4 help is selected. We are providing a popup of multiple checkboxes when f4 is pressed on a select option. When one or more check boxes are selected then those values must be appended to the select option. Please give me some ideas.
If i have to use DYNP_VALUES_UPDATE then how should i use it for select option ?
Regards
KesavHello Keshav,
Not sure why you've used REUSE_ALV_POPUP_TO_SELECT. You can achieve the same by turning on the MULTIPLE_CHOICE param in F4IF_INT_TABLE_VALUE_REQUEST. Check this code snippet:
DATA: v_field TYPE fieldname.
SELECT-OPTIONS: s_field FOR v_field NO INTERVALS.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'S_FIELD-LOW'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_field-low.
* Local type declarations
TYPES : BEGIN OF t_flds,
tabname TYPE dfies-tabname,
fieldname TYPE dfies-fieldname,
keyflag TYPE dfies-keyflag,
fieldtext TYPE dfies-fieldtext,
END OF t_flds.
CONSTANTS: lc_field TYPE fieldname VALUE 'FIELDNAME'.
* Local data declarations
DATA:
ls_flds TYPE t_flds,
lt_flds TYPE STANDARD TABLE OF t_flds,
ls_values TYPE ddshretval,
lt_values TYPE STANDARD TABLE OF ddshretval,
lt_dfies TYPE TABLE OF dfies,
ls_dfies TYPE dfies.
* Get field details of the Table
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = 'MARC'
langu = sy-langu
TABLES
dfies_tab = lt_dfies
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
IF sy-subrc = 0.
LOOP AT lt_dfies INTO ls_dfies WHERE fieldname NE 'MANDT'.
MOVE-CORRESPONDING ls_dfies TO ls_flds.
APPEND ls_flds TO lt_flds.
ENDLOOP.
ELSE.
EXIT.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = lc_field
window_title = 'Select the Table Field'(001)
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_FIELD-LOW'
value_org = 'S'
multiple_choice = 'X'
display = 'F'
TABLES
value_tab = lt_flds
return_tab = lt_values.
s_field-sign = 'I'.
s_field-option = 'EQ'.
LOOP AT lt_values INTO ls_values .
s_field-low = ls_values-fieldval.
APPEND s_field.
ENDLOOP.
DATA: lt_dynpread TYPE STANDARD TABLE OF dynpread,
lwa_dynpread TYPE dynpread.
READ TABLE s_field INDEX 1.
IF sy-subrc = 0.
lwa_dynpread-fieldname = 'S_FIELD-LOW'.
lwa_dynpread-fieldvalue = s_field-low.
APPEND lwa_dynpread TO lt_dynpread.
* Update the screen field values
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = lt_dynpread
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 NE 0.
ENDIF.
ENDIF.
Hope this helps.
BR,
Suhas -
Function DYNP_VALUES_UPDATE not working in PBO
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,
RugmaniWell, if this is not the program, please suggest an alternative program.
-
Reg DYNP_VALUES_UPDATE.
Hi all,
Does the FM DYNP_VALUES_UPDATE work only with the same screen?My requirement is to update the field values of a main screen according to the value selected from a drop-down in a subscreen.I am able to update values of the same subscreen using this FM but not other screens.Can anyone tell me whether it will work.
Thanks in advance,
AnjalyDear Anjaly,
I think it should work.But if it is not then u can use another method.
eg : ur main Program is ZMAIN_PGROGRAM.
And the field u want to update is MYFIELD.
MY_VALUE is the value u need to assign to MYFIELD.
so u can use .
DATA : FLD_NAME(60).
FIELD-SYMBOLS : <FS> TYPE ANY.
FLD_NAME = '(ZMAIN_PGROGRAM)MYFIELD' .
ASSIGN (FLD_NAME) TO <FS>.
IF SY-SYBRC EQ 0.
<FS> = MY_VALUE.
ENDIF. -
Problem with FM "DYNP_VALUES_UPDATE"
Hi gurus
I am using a table control containg 2 columns. I have used a f4 help in the first column by the fm "F4IF_INT_TABLE_VALUE_REQUEST" . And the corresponding second column i am displaying a value for which i have used the fm "DYNP_VALUES_UPDATE" . It's working fine but after the values upadted in the second column , the value in the first column vanishes.It becomes balnk .
so please help me . thanks in advance .
regards
AmarendraHI,
Check this Code ..
PARAMETES : p_werks type ...
PARAMETES : p_plnnr type ....
PARAMETES : p_plnal type....
AT SELECTION-SCREEN ON P_PLNNR.
data:
lg_condition type string.
data:
lwa_ddshretval type ddshretval,
lwa_dselc type dselc,
lwa_dynpread type dynpread.
data:
li_f4_insp type standard table of t_f4_insp,
li_ddshretval type standard table of ddshretval,
li_dselc type standard table of dselc,
li_dynpread type standard table of dynpread.
lwa_dynpread-fieldname = 'P_WERKS'.
append lwa_dynpread to li_dynpread.
clear lwa_dynpread.
* Read Screen Field Values.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-repid
dynumb = sy-dynnr
tables
dynpfields = li_dynpread.
* Read the first record as only one record will be present
read table li_dynpread into lwa_dynpread index 1.
p_werks = lwa_dynpread-fieldvalue.
if p_werks is initial.
move 'PLNTY EQ ''Q''' to lg_condition.
else.
move 'WERKS EQ P_WERKS AND PLNTY EQ ''Q''' to lg_condition.
endif.
* Fetch Data
select werks
plnnr
plnal
plnty
ktext
into table li_f4_insp
from plko
where (lg_condition).
lwa_dselc-fldname = 'F0002'.
lwa_dselc-dyfldname = 'PLNNR'.
append lwa_dselc to li_dselc.
clear lwa_dselc.
lwa_dselc-fldname = 'F0003'.
lwa_dselc-dyfldname = 'PLNAL'.
append lwa_dselc to li_dselc.
clear lwa_dselc.
* FM For F4 Help
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'PLNNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'PLNNR'
value_org = 'S'
tables
value_tab = li_f4_insp
return_tab = li_ddshretval
dynpfld_mapping = li_dselc
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc eq 0.
refresh li_dynpread.
read table li_ddshretval into lwa_ddshretval index 1.
if sy-subrc eq 0.
move lwa_ddshretval-fieldval to p_plnnr.
lwa_dynpread-fieldname = 'P_PLNNR'.
lwa_dynpread-fieldvalue = lwa_ddshretval-fieldval.
append lwa_dynpread to li_dynpread.
clear lwa_dynpread.
endif. " IF sy-subrc EQ 0.
read table li_ddshretval into lwa_ddshretval index 2.
if sy-subrc eq 0.
move lwa_ddshretval-fieldval to p_plnal.
lwa_dynpread-fieldname = 'P_PLNAL'.
lwa_dynpread-fieldvalue = lwa_ddshretval-fieldval.
append lwa_dynpread to li_dynpread.
clear lwa_dynpread.
endif. " IF sy-subrc EQ 0.
endif. " IF sy-subrc EQ 0.
* Set Screen Field Values.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-repid
dynumb = sy-dynnr
tables
dynpfields = li_dynpread
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
others = 8.
check sy-subrc eq 0. -
Screen Fields Not getting Updated with DYNP_VALUES_UPDATE
Hi All,
I am using FM DYNP_VALUES_READ to read the screen field values and then modifying those values and passing the modified table to DYNP_VALUES_UPDATE. But the problem is screen fields are not populated with these values . The values I wish to populate are footer values . I am using OO ALV for this wherein I am handling an event for filter of records and accordingly I need to modify my footer. Any Suggestions??
*& Form footer
Caslculate Total items, number of hits/Miss and percent MSP
--> p1 text
<-- p2 text
FORM footer .
CLEAR : io_totitems,
io_tothit,
io_totmiss,
io_permiss.
IF NOT l_flag EQ 1.
Get total items
DESCRIBE TABLE i_outdata LINES io_totitems.
LOOP AT i_outdata INTO wa_outdata.
calculate number of hits
IF wa_outdata-hit_miss = 'HIT'.
io_tothit = io_tothit + 1.
ENDIF.
calculate number of Miss
IF wa_outdata-hit_miss = 'MISS'.
io_totmiss = io_totmiss + 1.
ENDIF.
CLEAR wa_outdata.
ENDLOOP.
calculate percent MSP
io_permiss = ( ( io_totitems - io_totmiss ) / io_totitems ) * 100 .
IF l_flag EQ 1.
wa_dynpread-fieldname = 'IO_TOTITEMS'.
APPEND wa_dynpread TO t_dynpread.
wa_dynpread-fieldname = 'IO_TOTHIT'.
APPEND wa_dynpread TO t_dynpread.
wa_dynpread-fieldname = 'IO_TOTMISS'.
APPEND wa_dynpread TO t_dynpread.
wa_dynpread-fieldname = 'IO_PERMISS'.
APPEND wa_dynpread TO t_dynpread.
CLEAR wa_dynpread.
d020s-prog = sy-repid.
d020s-dnum = sy-dynnr.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = d020s-prog
dynumb = d020s-dnum
translate_to_upper = 'X'
REQUEST = ' '
TABLES
dynpfields = t_dynpread.
MOVE io_totitems TO io_totitem.
CONDENSE io_totitem NO-GAPS.
MOVE io_tothit TO io_tothits.
CONDENSE io_tothits NO-GAPS.
MOVE io_totmiss TO io_totmis.
CONDENSE io_totmis NO-GAPS.
MOVE io_permiss TO io_permis.
CONDENSE io_permis NO-GAPS.
LOOP AT t_dynpread INTO wa_dynpread.
CASE: wa_dynpread-fieldname.
WHEN 'IO_TOTITEMS'.
wa_dynpread-fieldvalue = io_totitem .
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_TOTHIT'.
wa_dynpread-fieldvalue = io_tothits.
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_TOTMISS'.
wa_dynpread-fieldvalue = io_totmis.
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_PERMISS'.
wa_dynpread-fieldvalue = io_permis .
MODIFY t_dynpread FROM wa_dynpread.
ENDCASE.
CLEAR wa_dynpread.
ENDLOOP.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = d020s-prog
dynumb = d020s-dnum
TABLES
dynpfields = t_dynpread
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.
Get all fotter details in a internal table
this is used to download footer in Excel
wa_footer-fldname = 'Total Items '.
wa_footer-value = io_totitems.
APPEND wa_footer TO i_footer.
wa_footer-fldname = 'Number of HIT'.
wa_footer-value = io_tothit.
APPEND wa_footer TO i_footer.
wa_footer-fldname = 'Number of MISS'.
wa_footer-value = io_totmiss.
APPEND wa_footer TO i_footer.
wa_footer-fldname = 'Percentage MISS '.
wa_footer-value = io_permiss.
APPEND wa_footer TO i_footer.
CLEAR wa_footer.
ENDFORM. " footerdata: t_dynfields1 type table of dynpread with header line.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = d020s-prog
dynumb = d020s-dnum
translate_to_upper = 'X'
REQUEST = ' '
TABLES
dynpfields = t_dynfields1.
<b>read table t_dynfields1 index 1</b> I hope this is missing
I will be selecting from a list .
Because once the value is read we need to update the screen field with that value .
Here the selected value will be in the first place
Now
Your operation is to populate the fields with some variables .
In the same when I do this there is only one value then
Im expecting only one entry here
LOOP AT t_dynpread INTO wa_dynpread.
CASE: wa_dynpread-fieldname.
WHEN 'IO_TOTITEMS'.
wa_dynpread-fieldvalue = io_totitem .
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_TOTHIT'.
wa_dynpread-fieldvalue = io_tothits.
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_TOTMISS'.
wa_dynpread-fieldvalue = io_totmis.
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_PERMISS'.
wa_dynpread-fieldvalue = io_permis .
MODIFY t_dynpread FROM wa_dynpread.
ENDCASE.
CLEAR wa_dynpread.
ENDLOOP. */
Comment this for a while and
Change the code as
t_dynfields1-fieldname = ' '. "<--- header name
t_dynfields1-fieldvalue = ' '."<----val
append t_dynfields1.
t_dynfields1-fieldname = ' '.
t_dynfields1-fieldvalue = ' '.
append t_dynfields1.
t_dynfields1-fieldname = ' '.
t_dynfields1-fieldvalue = ' '.
append t_dynfields1.
And check .
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = d020s-prog
dynumb = d020s-dnum
TABLES
dynpfields = t_dynfields1.
regards,
vijay -
Field Exit with DYNP_VALUES_UPDATE
Hello, I am trying to develop a validation in a SAP transaction (XD01) to check some field values and if them are right then fill automatically the rest of the field in the screen, using a Function Modulo and the FM DYNP_VALUES_READ I am able to retrieve the field values correctly, my problem is when a try to fill the rest of the screen's fields with FM DYNP_VALUES_UPDATE it doesn't work. Does anybody have used this FM? is possible what I am trying to do?
Thanks in advice for your help.Hi Fernando,
Using Field exit we can't populate multiple fileds, One filed exit is applicable for only one input filed.If you want to implement the
filed exit for multiple fileds you have to implement the one exit for one filed.
Regards,
Mahender Reddy -
DYNP_VALUES_UPDATE does not change the value of my screen fields
Hi,
I have a screen with a header area and a control with an ALV.
In my header area i have 2 fields shown as an icon. These icons should change
with an event triggered in the ALV (in handle_user_command)
In handle_user_command I check the values of a column in my ALV - I have 3 possible cases : a green led, a yellow led or a red led.
When i'm debugging the program, everything seems to be ok. In my table i see the new values of the icons, but when I see the screen afterwards the old values have not been replaced. (I also use an refresh of my ALV)
Any help is welcome!
THx,
HelgaHi,
declare the internal table like below:
DATA: i_fieldvalues TYPE dynpread OCCURS 0 WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR field.
PERFORM Display_contion_types.
FORM Display_contion_types.
Search help for Condition Type
PERFORM Display_contion_types.
Update screen fields like below:
Update Screen Field.
CLEAR i_fieldvalues[].
MOVE: 'V_TEXT' TO i_fieldvalues-fieldname .
WRITE i_t685-vtext TO i_fieldvalues-fieldvalue .
APPEND i_fieldvalues.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = i_fieldvalues.
endif
regards,
Raja -
DYNP_VALUES_UPDATE not updating SCREEN FIELD PERNAM
Following code not working. screen field pernam not getting updated. pls advise.
tables:zmara ,DFIES.
PARAMETER: pmatnr LIKE zmara-matnr,
pernam like zmara-ernam.
AT SELECTION-SCREEN ON PMATNR.
perform p2.
FORM P2.
*****READ
DATA: SCREEN_VALUES TYPE TABLE OF DYNPREAD ,
SCREEN_VALUE LIKE LINE OF SCREEN_VALUES.
DATA: MATNR1 LIKE ZMARA-MATNR,
ERNAM1 LIKE ZMARA-ERNAM.
SCREEN_VALUE-FIELDNAME = 'PMATNR' . " Field to be read
APPEND SCREEN_VALUE TO SCREEN_VALUES. " Fill the table
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = SCREEN_VALUES.
read TABLE SCREEN_VALUES INDEX 1 INTO SCREEN_VALUE.
MATNR1 = SCREEN_VALUE-FIELDVALUE.
*OVERLAY MATNR1 WITH '000000000000000000'.
*SHIFT MATNR1 RIGHT DELETING TRAILING SPACE.
UNPACK MATNR1 TO MATNR1.
SELECT ERNAM FROM ZMARA INTO ERNAM1 WHERE MATNR = MATNR1.
ENDSELECT.
*message ERNAM1 TYPE 'I'.
**********UPDATE
CLEAR SCREEN_VALUES[].
CLEAR SCREEN_VALUE.
SCREEN_VALUE-FIELDNAME = 'PERNAM' . " Field to be read
SCREEN_VALUE-FIELDVALUE = ERNAM1.
APPEND SCREEN_VALUE TO SCREEN_VALUES. " Fill the table
CLEAR SCREEN_VALUE.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = sy-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = SCREEN_VALUES.
loop at screen_values into screen_value.
message SCREEN_VALUE-FIELDVALUE TYPE 'I'.
ENDLOOP.
ENDFORM.
Moderator Message: Put a little more effort from your end. Did you check in Debugger?
Edited by: kishan P on Mar 30, 2011 12:21 PMHi Manfred,
Replace all the DYNP_VALUES_UPDATE-related content by the following statement:
SET USER-COMMAND 'xxx'.
While DYNP_VALUES_UPDATE does update the fields, a roundtrip is not triggered so the content of the fields will not be refreshed. The SET USER-COMMAND does that.
Hope this helps you!
Cheers, Roel -
DYNP_VALUES_UPDATE to update table control cell
How can I update a cell (e.g. in line n) value in a table control using the function DYNP_VALUES_UPDATE? Can someone give me an example?
Thanks in advance.
Adhimas S.Hi,
Check this sample code
REPORT ZVV.
tables tcurt.
DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
PARAMETERS: P_WAERS LIKE TCURT-WAERS, "Currency
P_LTEXT LIKE TCURT-LTEXT, "Long Text
P_KTEXT LIKE TCURT-KTEXT. "Short Text
*--- Example of updating value of another field on the screen -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.
CLEAR: DYFIELDS[], DYFIELDS.
*--- select currency
CALL FUNCTION 'HELP_VALUES_GET'
EXPORTING
fieldname = 'WAERS'
tabname = 'TCURT'
IMPORTING
SELECT_VALUE = P_WAERS.
*--- get long text for the selected currency
SELECT SINGLE LTEXT FROM TCURT
INTO DYFIELDS-FIELDVALUE
WHERE SPRAS = SY-LANGU
AND WAERS = P_WAERS.
IF SY-SUBRC <> 0.
CLEAR DYFIELDS-FIELDVALUE.
ENDIF.
*--- update another field
DYFIELDS-FIELDNAME = 'P_LTEXT'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
tables
dynpfields = DYFIELDS .
*--- Example of reading value of another field -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KTEXT.
*--- read another field
CLEAR: DYFIELDS[], DYFIELDS.
DYFIELDS-FIELDNAME = 'P_WAERS'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYFIELDS .
READ TABLE DYFIELDS INDEX 1.
*--- get short text and update current field
SELECT SINGLE KTEXT FROM TCURT
INTO P_KTEXT
WHERE SPRAS EQ SY-LANGU
AND WAERS EQ DYFIELDS-FIELDVALUE.
Thanks & Regards,
Judith. -
DYNP_VALUES_UPDATE not Updating the Field on my Dynpro
Hi.
I want to create a dynpro where two fields are. Field 1 allows the user to enter a customer number, field two shall come up with a number that is calculated somehow. The calculation can last up to 20 seconds, so I dont want to make the user waite for this number.. .he shall be able to work with the rest of the dynpro.
Therefore I called the function that does the calcuiation like that:
MODULE user_command_0100 INPUT.
DATA: lv_guid_16 TYPE guid_16.
IF kna1-kunnr IS NOT INITIAL AND kna1-kunnr <> gv_kunnr
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_16 = lv_guid_16.
gv_taskid = lv_guid_16+8(8).
CALL FUNCTION 'YDETERMINE_DEPOTDISTANCE'
STARTING NEW TASK gv_taskid
PERFORMING receive_depent ON END OF TASK
EXPORTING
i_kunnr = kna1-kunnr.
ENDIF.
ENDMODULE.
The next piece of code shall get the returning value if the function wants to return its results.
FORM receive_depent USING i_task TYPE clike.
TABLES: d020s.
DATA: dyname LIKE d020s-prog,
dynumb LIKE d020s-dnum.
DATA: BEGIN OF dynpfields OCCURS 1.
INCLUDE STRUCTURE dynpread.
DATA: END OF dynpfields.
IF i_task = gv_taskid.
RECEIVE RESULTS FROM FUNCTION 'YDETERMINE_DEPOTDISTANCE'
IMPORTING
e_depent = kna1-yydepent
e_accuracy = gv_accuracy.
MOVE 'KNA1-YYDEPENT' TO dynpfields-fieldname.
MOVE kna1-yydepent TO dynpfields-fieldvalue.
APPEND dynpfields.
dyname = sy-cprog.
dynumb = '0100'.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = dyname
dynumb = dynumb
TABLES
dynpfields = dynpfields
EXCEPTIONS
invalid_abapworkarea = 01
invalid_dynprofield = 02
invalid_dynproname = 03
invalid_dynpronummer = 04
invalid_request = 05
no_fielddescription = 06
undefind_error = 07.
ASSERT sy-subrc = 0.
ENDIF.
Problem is: The DYNP_VALUES_UPDATE does not update the field on my dynpro at all. If I hit enter another time, then the field is provided by the value as another PBO will be processed. What is my mistake here?
Regards
Manfred
Edited by: Rob Burbank on Oct 29, 2010 12:07 PMHi Manfred,
Replace all the DYNP_VALUES_UPDATE-related content by the following statement:
SET USER-COMMAND 'xxx'.
While DYNP_VALUES_UPDATE does update the fields, a roundtrip is not triggered so the content of the fields will not be refreshed. The SET USER-COMMAND does that.
Hope this helps you!
Cheers, Roel
Maybe you are looking for
-
I´ve got a 2nd Generation iPod touch with iPhone OS v. 3.1.2. I bought a new computer and I plugged my iPod there. It said that if I would like to erase all data, but I have a problem: I've got iTunes Store songs and what if I delete them? Can I be s
-
File Adapter Question...
Hi all, could somebody tell me if there is a way to limit the number of files processed by a File Adapter in a poll cycle? We need to load files from seven folders, each one has different priority (files from one folder have more priority than other
-
IWeb Images and Assets Switched Around After Publishing to MobileMe
Hello, A few days ago a podcast I am hosting started acting odd. If I add a new graphic element to the site, ALL graphic elements get moved around, stretched, rotated, etc. This DOESN'T happen when I publish to a folder. I managed to do some workarou
-
I'm getting an "iTunes application could not be opened. A required itunes component is not installed (-42404)" when I try to open iTunes. Any ideas?
-
QM Quantitative results: Report
Hello, Is there any standard report in SAP which will give the output as follows: Inspection Lot .... Characteristic 1 .... Characteristic 2 .... Characteristic 3 20000000002 ..... 10,5 mm ..... 5,3 degree .... 105 ft 20000000003 .