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

Module Pogramming POV Validations

Former Member
0 Likes
768

HI All,

I have a requirement, i am having a Table Control and 3 fields FIELD1, FIELD2, FIELD3.

Lets assume FIELD1 = '1002'. Now my requirement is to add a F4 help in FIELD2 based on FIELD1 = '1002' selected.

Unfortunatly the value of FIELD1 (1002) i couldnt able to retreive them in the Process On Value-Request (POV) of FIELD2 so that i can add this FIELD in my select statement.

Can anyony help me in resolving this issue ?

Thanks in advance,

Prem.

7 REPLIES 7
Read only

Former Member
0 Likes
742

Hi,

Please check the below thread explaining the same issue.

Regards,

Pawan

Read only

gopi_narendra
Active Contributor
0 Likes
742

Hi,

Use the function module 'DYNP_VALUES_READ' to read the existing values on the screen into a internal table.

read that internal table with the field name that of on the screen which you want and you can get its corresponding value in fieldvalue column the internal table. see example below.

CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname               = sy-repid
      dynumb               = sy-dynnr
    TABLES
      dynpfields           = gt_dynpfields
    EXCEPTIONS
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      invalid_parameter    = 7
      undefind_error       = 8
      double_conversion    = 9
      stepl_not_found      = 10
      OTHERS               = 11.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ELSE.
    READ TABLE gt_dynpfields INTO gs_dynpfields
         WITH KEY fieldname = 'T012K-HBKID'.
    IF sy-subrc = 0.
      l_hbkid = gs_dynpfields-fieldvalue.
      CLEAR gs_dynpfields.
    ENDIF.
  ENDIF.

Regards

Gopi

Read only

Former Member
0 Likes
742

HI All,

thanks for your quick reply. But still doesnt works.

PROCESS ON VALUE-REQUEST.

FIELD FIELD2 MODULE FIELD2_F4.

MODULE get_meter_preffix INPUT.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr " This is a sub screen and the field is one of field in the TABLE CONTROL

TABLES

dynpfields = lt_dyn.

" The table lt_dyn is empty.

ENDMODULE.

Need some more help.

Thanks in advance.

Cheers,

Prem.

Read only

0 Likes
742

Hi Prem,

Have you checked the link I gave earlier I have used the solution provided in this thread and worked also and I think it will be

better also than using 'DYNP_VALUES_READ' FM.

Regards,

Pawan

Read only

0 Likes
742

Hi,

You need to pass the fieldname to the table before calling the FM

CLEAR gs_dynpfields.
  gs_dynpfields-fieldname = 'T012K-HBKID'.
  APPEND gs_dynpfields TO gt_dynpfields.

Then pass this table to the FM, which will return the filedvalues.

Regards

Gopi

Read only

Former Member
0 Likes
742

HI All Thanks Once again for your quick reply,

Yes u treid the link and also the FM.

But surprisingly i found out that once the PAI is triggered the value is passed.

So is there a way to forcefully trigger the PAI to retrieve the value.

Thanks once again in advance.

Prem.

Read only

Former Member
0 Likes
742

Hi Prem,

check this url

Link: [;

it is shown over there:


 CALL METHOD cl_gui_cfw=>set_new_ok_code  
         EXPORTING new_code = 'EXECUTE'. 

Hope it'll help you.

Thanks and regards,

Sachin Bhatt.