12-29-2011 6:38 AM
Here is my COde:
report ZTEST_POOL.
tables : d020s,mara.
data: begin of dynpfields occurs 0.
include structure dynpread.
data: end of dynpfields.
selection-screen : begin of block b1 with frame title text-011.
select-options: p_list for mara-matnr.
selection-screen: end of block b1.
dynpfields-fieldname = 'P_LIST-LOW'.
dynpfields-fieldvalue = 'MATERIAL1'.
append dynpfields.
dynpfields-fieldname = 'P_LIST-HIGH'.
dynpfields-fieldvalue = 'MATERIAL2'.
append dynpfields.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
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.
Wheni Execute this... My screen Fields P_LIST-LOW and P_LIST-HIGH are not updating.
they are still empty.
plz let me know whats wrong in my code.
12-29-2011 7:33 AM
assigning the value as constant. Do as below so that the value for low and high will get populate to the table
dynpfields-fieldname = P_LIST-LOW
dynpfields-fieldname = P_LIST-HIGH
12-29-2011 8:14 AM
assigning the value as constant. Do as below so that the value for low and high will get populate to the table
dynpfields-fieldname = P_LIST-LOW
dynpfields-fieldname = P_LIST-HIGH
Still Not WOrking Dude!
12-29-2011 8:32 AM
you can initialize it in
INITLAIZATION event
S_ABC-low= 'Material1'.
S_abc-high= 'Material2'.
append S_abc.
Nabheet
12-29-2011 7:41 AM
12-29-2011 6:26 PM
Please, should be check if the field P_LIST are in the sy-dynnr screen or in other screen...
If this is a Module Pool program case, should be change the Screen in the PBO Module (the function must be in the PBO).
Regards.
Fabio Rodriguez
12-29-2011 6:43 PM
If is the case of the Report Program, see below, please:
TABLES: mara.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-011.
SELECT-OPTIONS: p_list FOR mara-matnr.
SELECTION-SCREEN: END OF BLOCK b1.
INITIALIZATION.
p_list-sign = 'I'.
p_list-option = 'BT'. "Between
p_list-low = 'MATERIAL1'.
p_list-high = 'MATERIAL2'.
APPEND p_list.
START-OF-SELECTION.
"YOUR CODE
Regards.
Fabio Rodriguez
12-29-2011 8:49 PM
abhishek,
if your question is on the working of this function module, then the answer is, it will work only cases like value request(f4 helps).. read the documentation and see the where used list.
so, if you just want to test this FM.
tables : d020s,mara.
data: begin of dynpfields occurs 0.
include structure dynpread.
data: end of dynpfields.
selection-screen : begin of block b1 with frame title text-011.
select-options: p_list for mara-matnr.
selection-screen: end of block b1.
AT SELECTION-SCREEN on
VALUE-REQUEST FOR p_list-low. "==>just added this, press F4 on the low field and volla
dynpfields-fieldname = 'P_LIST-LOW'.
dynpfields-fieldvalue = 'MATERIAL1'.
append dynpfields.
dynpfields-fieldname = 'P_LIST-HIGH'.
dynpfields-fieldvalue = 'MATERIAL2'.
append dynpfields.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
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.
12-30-2011 9:28 AM
if your question is on the working of this function module, then the answer is, it will work only cases like value request(f4 helps).. read the documentation and see the where used list.
I want to use this FM at events of Reports:
at selection screen
at selection screen output
read the documentation and see the where used list.
i can see the list of standard programs where this Fm has been used.
how can i get the areas of abap prog. where i can use this FM.
12-29-2011 9:19 PM
Hi abhishek1345,
as Soumya already tried to explain: DYNP_VALUES_UPDATE can be used to update the screen fields during screen processing. If you create your own F4 help, you can use it to update fields not directly related to the field where the F4 value-request is triggered.
Usually we use PBO (in report: AT SELECTIO-SCREEN OUTPUT) or PAI (in report: AT SELECTIO-SCREEN) to change values of screen fields.
Event INITIALIZATION is the point where you pre-set default values of screen fields.
Please do not just ask a question like 'why is that FM not working?'. Please let us also know what you want to achieve.
Regards
Clemens
12-30-2011 9:41 AM
Usually we use PBO (in report: AT SELECTIO-SCREEN OUTPUT) or PAI (in report: AT SELECTIO-SCREEN) to change values of screen fields.
here is my code after making some changes..
now i m calling this FM at This event.
*at selection-screen output.*
dynpfields-fieldname = 'P_LIST-LOW'.
dynpfields-fieldvalue = 'MATERIAL1'.
append dynpfields.
dynpfields-fieldname = 'P_LIST-HIGH'.
dynpfields-fieldvalue = 'MATERIAL2'.
append dynpfields.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
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.
Still i m not getting my fields P_LIST-LOW and P_LIST-HIGH with values.
Cant we use this FM other than this event:
at selection screen on value request for p_list-low.
Event INITIALIZATION is the point where you pre-set default values of screen fields.
thnks for this New information.
Also i can set their default values like this
select-options: p_list for mara-matnr default 'MATERIAL1' .
12-30-2011 10:02 AM
Hi friend,
Set a break point and see whether are you getting the values updated in the table. I think it should work fine.
Use it in at selection screen on value request for p_list-low.
Try using the function module 'F4IF_INT_TABLE_VALUE_REQUEST' for filling the values in that field.
Below is the sample code,
**********************************************************************
Attaching Search Help on Field
*********************************************************************
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'BOOK_NAME'(155)
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'BOOK_NAME'(155)
stepl = 0
window_title = 'Book Names'(444)
value = lx_dynpfields-fieldvalue
value_org = 'S'(888)
TABLES
value_tab = t_book
return_tab = t_return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc EQ 0.
LOOP AT t_return_tab INTO x_return_tab.
s_bnam-low = x_return_tab-fieldval.
ENDLOOP.
ENDIF.
ENDFORM. " CALL_F4_FOR_BNAME
I think this will solve your issue if you still have queries please revert back to me. I will help you.
Thanks,
Sri Hari
12-30-2011 12:13 PM
Try using the function module 'F4IF_INT_TABLE_VALUE_REQUEST' for filling the values in that field.
Dude! my aim is not to fill my fields..rather i want to know the functioning of FM 'DYN_VALUES_UPDATE.
12-30-2011 12:48 PM
Hi friend,
Just see this link to understand about the function module and its functions clearly
http://www.se80.co.uk/sapfms/d/dynp/dynp_values_update.htm
And you still have doubts i found a similar link posted by Keshav in our forum just see that thread, link shown below,
Here the same problem was addressed.
If you still find any difficulties please revert back to me.
Thanks,
Sri Hari