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

search help

Former Member
0 Likes
557

i am creating a selection screen with 2 fileds - MATNR and SERNR

i created a search help for MATNR

and i want that the second search help for SERNR will display only the sernr that belong to the matnr i chosed ( i want to get the sernr depend to the matnr i have entered )

thanks

AMI

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
536

Hi,

Get all the values for the selected MATNR and store in an internal table .

Then use FM F4_INT_VALUE_REQUEST to provide search help and pass that internal tabel in this FM.

5 REPLIES 5
Read only

Former Member
0 Likes
537

Hi,

Get all the values for the selected MATNR and store in an internal table .

Then use FM F4_INT_VALUE_REQUEST to provide search help and pass that internal tabel in this FM.

Read only

Former Member
0 Likes
536

Hi,

use the following sample code to get pointers


PARAMETERS: p_bu LIKE zta_emc-bu_unit,
            p_sbu(50) TYPE c. "LIKE zta_emc-sbu_unit.

DATA : itab LIKE zta_sbu_unit OCCURS 0 WITH HEADER LINE.
DATA : itab_bu LIKE zta_bu_unit OCCURS 0 WITH HEADER LINE.
DATA : itab_code LIKE zta_bu_sbu OCCURS 0 WITH HEADER LINE.
DATA:  tp_dirty LIKE ddshretval OCCURS 0 WITH HEADER LINE.
DATA it_dynfield TYPE STANDARD TABLE OF dynpread WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_sbu.

* the fetching of data has to be done within the AT SELECTION-SCREEN ON VALUE-REQUEST.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname             = sy-repid
      dynumb             = sy-dynnr
*      translate_to_upper = 'X'
      request            = 'A'
    TABLES
      dynpfields         = it_dynfield.
  READ TABLE it_dynfield WITH KEY fieldname = 'P_BU'.

  p_bu = it_dynfield-fieldvalue.

  SELECT * FROM zta_bu_unit INTO TABLE itab_bu WHERE bu_unit = p_bu.

  SELECT * FROM zta_bu_sbu
  INTO TABLE itab_code
  FOR ALL ENTRIES IN itab_bu
  WHERE bu_code = itab_bu-bu_code.

  SELECT * FROM zta_sbu_unit
  INTO TABLE itab
  FOR ALL ENTRIES IN itab_code
  WHERE sbu_code = itab_code-sbu_code.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'SBU_UNIT'
      dynpprog    = sy-repid
*      for screen no of the parameter screen goto the system => status
      dynpnr      = sy-dynnr
      dynprofield = 'SBU'
      value_org   = 'S'
    TABLES
      value_tab   = itab
      return_tab  = tp_dirty.

In this case based on BU i get SBU values.

Regards,

Mansi.

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
536

Select SERNR based on the selected MATNR ,this you can read via FM DYNP_VALUES_READ.

Fill internal table and pass it to teh FM as mentioned in above thread.

Read only

Former Member
0 Likes
536

Hi,

Use the Function Module DYNP_VALUES_READ

which reads the value of the matnr from the screen, then use these value to get your SERNR value in to the table and use FM F4IF_INT_TABLE_VALUE_REQUEST.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_subty-low.
  DATA :
        t_dynpread TYPE TABLE OF  dynpread WITH HEADER LINE.

  t_dynpread-fieldname = 'P_INFTY'.
  APPEND t_dynpread.
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname               = sy-repid
      dynumb               = sy-dynnr
    TABLES
      dynpfields           = t_dynpread[]
    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.
  ENDIF.

Regards

Kumar M.

Read only

Former Member
0 Likes
536

Hi Ami,

Select sernr from equi
                     into table it_sernr
                     where matnr in s_matr.  "select option.

then use the FM F4IF_INT_TABLE_VALUE_REQUEST at the AT SELECTION-SCREEN S_SERNR-LOW.

Thanks!