Application Development 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: 

problem in FM DYNP_VALUES_UPDATE

Former Member
0 Kudos

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.

13 REPLIES 13

Former Member
0 Kudos

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

0 Kudos

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!

0 Kudos

you can initialize it in

INITLAIZATION event

S_ABC-low= 'Material1'.

S_abc-high= 'Material2'.

append S_abc.

Nabheet

kesavadas_thekkillath
Active Contributor
0 Kudos

Ignore

Edited by: Keshav.T on Dec 29, 2011 1:18 PM

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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.

Clemenss
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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' .

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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