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

F4 help on Selection-Screen

Former Member
0 Likes
1,604

Hi gurus,

I have one query on F4 help for selection-screen

I developed a report for displaying warehouse stock.For this in selection-screen i have select-options Plant ,material and Pur.Group are there.

I wrote F4 help for Plant by using the FM 'F4IF_INT_TABLE_VALUE_REQUEST' .Its working successfully.

But now i have to write F4help for Material, But here the requiremnet is , when the user gives the plant after he presses F4 help on Material , he needs to see only the materials and material descriptions into that corresponding plant only.Material other than the above plant will not appeared.

Please can any one suggest me how to do..

Thanks in Advance.

Thanks and Regards

Siri...

9 REPLIES 9
Read only

Former Member
0 Likes
1,203

Hi

i think you wrote a select query to retrive values for F4 help 'F4IF_INT_TABLE_VALUE_REQUEST'

mention i where condition what ever u want then it will display no and desc related to that plant

enter where plant = p_plant

Read only

Former Member
0 Likes
1,203

Hi...

Code like this...

In event AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_matnr.

If p_plant is not initial.

Select Materials based on the plant from respective table.

Pass this table to FM 'F4IF_INT_TABLE_VALUE_REQUEST' .

Cheers!!

Lokesh

Read only

0 Likes
1,203

Hi lokesh,

Please can u send me the code , how to select materials based on plant.I need material description also.

Thanks in Advance.

Thanks and Regards

Siri..

Read only

Former Member
0 Likes
1,203

Hi,

Please refer to the code below:


DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_WERKS-LOW.

SELECT WERKS NAME1 INTO CORRESPONDING FIELDS OF TABLE KUNNSO_ITAB FROM T001W.

DELETE ADJACENT DUPLICATES FROM KUNNSO_ITAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'WERKS'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_WERKS'
VALUE_ORG = 'S'
multiple_choice = 'X'
TABLES
VALUE_TAB = KUNNSO_ITAB
return_tab = return.
IF SY-SUBRC 0.
SORT return BY fieldval DESCENDING.
LOOP AT return.
S_WERKS-low = return-fieldval.
S_WERKS-option = 'EQ'.
S_WERKS-sign = 'I'.
S_WERKS-high = space.

APPEND S_WERKS.
ENDLOOP.

SORT S_WERKS BY low.
ENDIF.

Thanks,

Sriram Ponna.

Read only

0 Likes
1,203

Hi sriram,

Thanks for sending a valuble code , Thats fine.I also get F4 help for werks.

But i need F4 help for materials , when the user presses F4 on material, the materials will be displayed for the corresponding Plant.

Please suggest me how to do this Requirement.

Thanks in Advance.

Thanks and Regards,

Siri..

Read only

0 Likes
1,203

Hi,

Material text u can fetch from MAKT table.........

Here is a sample code where the second fields F4 hit list is dependent on first fields entry...

PARAMETERS : p_state TYPE char20,
             p_city  TYPE char18.

DATA       : BEGIN   OF   t_state OCCURS 0,
             state   TYPE char20,
             END     OF   t_state,
             BEGIN   OF   t_city  OCCURS 0,
             city    TYPE char18,
             END     OF   t_city.

DATA       : r_state TYPE TABLE OF ddshretval WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_state.
  REFRESH t_state.
  APPEND 'Tamil nadu' TO t_state.
  APPEND 'Kerala'     TO t_state.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'STATE'
      dynpprog        = sy-repid
      dynpnr          = '1000'
      dynprofield     = 'P_STATE'
      window_title    = 'State'
      value_org       = 'S'
    TABLES
      value_tab       = t_state[]
      RETURN_TAB      = r_state[]
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
  IF sy-subrc <> 0.
  ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_city.
  REFRESH t_city.
  LOOP AT r_state.
    CASE    r_state-fieldval.
      WHEN  'TAMIL NADU'.
        APPEND 'Chennai'    TO t_city.
        APPEND 'Madurai'    TO t_city.
      WHEN  'KERALA'.
        APPEND 'Trivandrum' TO t_city.
        APPEND 'Kochi'      TO t_city.
    ENDCASE.
  ENDLOOP.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'CITY'
      dynpprog        = sy-repid
      dynpnr          = '1000'
      dynprofield     = 'P_CITY'
      window_title    = 'City'
      value_org       = 'S'
    TABLES
      value_tab       = t_city[]
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
  IF sy-subrc <> 0.
  ENDIF.

Cheers,

jose.

Read only

0 Likes
1,203

Hi,

Select MATNR from MARC into itab where WERKS = p_plant.

You can get the description of Materials fetched from MAKT.

OR

Select MATNR MAKTX from V_OLR3_MARACKT into itab where werks = p_plant

Cheers!!

Lokesh

Edited by: Lokesh Aggarwal on Mar 5, 2008 12:04 PM

Read only

0 Likes
1,203

Hi jose,

Thanks for giving a gud suggestion.But here the plants are not fixed. And also the materials under the plant also not fixed.

The material are in 1000's for each plant.In that case how to do.

Please suggest me..

Thanks in Advance..

Thanks and Regards

Siri....

Read only

0 Likes
1,203

Hi Gurus,

Thanks to all for providing a helping hand for solving my problem.Its solved about 90%.

Means i got the materials for corresponding plants. But the thing is , If I select the plant through F4 help then only it will give the corresponding material under that plant. If I know the plant and i give to manually, that time when i press F4 on material i didnt got the materials. It comes the message as "No values Found" .. Please help me on this issue.

Thanks in Advance

Thanks and Regards

Siri....