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

Need Help on selection screen

kamesh_g
Contributor
0 Likes
798

Hi Friends

I have Two parameters on selection screen.

P1

P2

I have F4 help for both parameters .

When i have selected one value for P1 through F4 ,Depending on that second parameter will get values ,Which is my requirement also ,

But issue is , when I selected P1 through F4 then only i am getting F4 for p1 .

Suppose If user enters manually on P1 I am not getting F4 for P2.

So please suggest me how to do both things .

if did not get requirement i will explain it again

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
767

Hi,

Use Field Mapping to get F4 based on First Field.

second use DYNP_VALUES_READ to get the Value entered( Not F4) in first parameter.

This FM gives the Value entered in First parameter whenever you take F4 help based on this you can get the F4 for second.

Use correct flags to differenitate to know whether first field entered or F4 help has been taken.

Hope this is clear to you.

Take F1 helps on key words.

or Take Where used list on F4 Help Function Module and DYNP_VALUES_READ.

Cheerz

Ram

5 REPLIES 5
Read only

Former Member
0 Likes
767
data t_return like ddshretval occurs 0 with header line.
<declare parameters p1 and p2>
at selection-screen on value-request for p1.

refresh t_p1.

SELECT <your fields> from <table>  INTO CORRESPONDING FIELDS OF TABLE T_p1.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'field1'
value_org = 'S'
tables
value_tab = t_values                  " the selected values passed to FM
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.

if sy-subrc = 0.
read table t_return index 1.
p1 = t_return-fieldval.
endif.

 at selection-screen on value-request for p2.

SELECT <your fields> from <table>  INTO CORRESPONDING FIELDS OF TABLE T_p2.

refresh t_p1.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'field2'
value_org = 'S'
tables
value_tab = t_values                  " the selected values passed to FM
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.


if sy-subrc = 0.
read table t_return index 1.
p2 = t_return-fieldval.
endif.

Regards,

Sumit.

Read only

Former Member
0 Likes
768

Hi,

Use Field Mapping to get F4 based on First Field.

second use DYNP_VALUES_READ to get the Value entered( Not F4) in first parameter.

This FM gives the Value entered in First parameter whenever you take F4 help based on this you can get the F4 for second.

Use correct flags to differenitate to know whether first field entered or F4 help has been taken.

Hope this is clear to you.

Take F1 helps on key words.

or Take Where used list on F4 Help Function Module and DYNP_VALUES_READ.

Cheerz

Ram

Read only

Former Member
0 Likes
767

Hi Kamesh,

If you want the input of one parameter based on which the serach help of the second parameter will populate then in that case you will have to create the search help exit by exporting the value in the memory and importing the value in the in the serach help exit .

Thanks

Jatender

Read only

Former Member
0 Likes
767

Hi

Just run this program and you will be able to solve the problem.

DATA: it_t399i TYPE t399i OCCURS 0.
DATA: it_return_tab TYPE ddshretval OCCURS 0,
      wa_return LIKE LINE OF it_return_tab.

PARAMETER : p_swerk TYPE iloa-swerk.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_swerk.
  IF it_t399i[] IS INITIAL.
    SELECT * FROM t399i INTO TABLE it_t399i.
  ENDIF.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'IWERK'
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'P_SWERK'
      value_org   = 'S'
    TABLES
      value_tab   = it_t399i
      return_tab  = it_return_tab.
  IF sy-subrc EQ 0.
    READ TABLE it_return_tab INTO wa_return INDEX 1.
    IF sy-subrc EQ 0.
      p_swerk = wa_return-fieldval.
    ENDIF.
  ENDIF.

Regards

Anshul

Read only

kamesh_g
Contributor
0 Likes
767

This is question is answered with some inputs.

Thanks for all..