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 in table control using attributes window in layout

Former Member
0 Likes
772

Hi.

I am trying to use search help for my table control fields. the table control basically displays product details.

I have a name field, description field and price field. I have named my field to match the the structure of my search help (stProducts-name, stProducts-description and stProducts-price respectfully). then for each i entered shProducts (my search help) in the search help field.

However, upon running the program, in the name, description and price field, by clicking f4 the name of the product is displayed in the field irrespective to which column I am selecting. Also the values in the other fields are not affected.

Any help would be appreciated

Thank you

Hi.

I am trying to use search help for my table control fields. the table control basically displays product details.

I have a name field, description field and price field. I have named my field to match the the structure of my search help (stProducts-name, stProducts-description and stProducts-price respectfully). then for each i entered shProducts (my search help) in the search help field.

However, upon running the program, in the name, description and price field, by clicking f4 the name of the product is displayed in the field irrespective to which column I am selecting. Also the values in the other fields are not affected.

Any help would be appreciated

Thank you

6 REPLIES 6
Read only

Former Member
0 Likes
723

Hi,

try this way...


*F4 Help
PROCESS ON VALUE-REQUEST.
  FIELD wa_zcxref_classes-atwrt MODULE f4_choose_batch_values.   "wa_zcxref_classes-atwrt  Is table control field ..

MODULE f4_choose_batch_values INPUT.
* Varaibles used in FM
  DATA : selfield(50) TYPE c.
  DATA : selline TYPE i,
         selindex TYPE i  .

  CLEAR : selline ,selindex,w_char_old,w_flg_val_changed_exp.

* getting the cursor line in Table Control
  GET CURSOR FIELD selfield LINE selline.
  selindex = tc_batch-top_line + selline - 1.


* Fetching the Characteristic Name in the cursor Position
  READ TABLE t_zcxref_classes INTO wa_zcxref_classes
                            INDEX selindex.

"Now get the field value of the field before that and fetch the rest of the data from another table and show..

*   PASS PRODUCTION ORDER NUMBER (AUFNR) TO TABLE AFPO
  SELECT matnr FROM afpo INTO TABLE l_matnr
                         WHERE aufnr = w_afpo_aufnr
                         AND wemng   EQ space.
  IF sy-subrc NE 0.
  ENDIF.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'MATNR'
      dynpprog    = sy-repid
      dynpnr      = '2020'
      dynprofield = wa_zcxref_classes-atwrt 
      value_org   = 'S'
    TABLES
      value_tab   = l_matnr.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
 
ENDMODULE.      

Prabhudas

Read only

0 Likes
723

hi prabhu das,

pls let me know how this code window appers......

i want to post the code as a question

so pls help me......

Read only

0 Likes
723

is there anyway to avoid using the code and just changing the settings

Read only

Former Member
0 Likes
723

Hi,

Check the screen attributes in layout,you have declared some other search help name or not...

I hope ,it will help you

<=<< Sharing Knowledge is a way to Innovative >>=>

By,

Yoga

Read only

Former Member
0 Likes
723

Hi,

keeping the same name for screen fields and search help fields won't help. You have to use Parameter ID in the data elements of the screen fields. Use different parameter id for all the 3 data elements . Now use the same data elements in your search help. Also donu2019t forget to check the EXP (column) check boxes for all the three fields in your search help.

thanks

Renjith.

Read only

venkat_o
Active Contributor
0 Likes
723

Hi Charla, <li> Here is a sample program how to update other fields when you select f4 help for one field. <li> Need to apply in module pool program..

REPORT zvenkat_f4_for_parameters MESSAGE-ID zmsg .
TYPES:
   BEGIN OF t_t001w,
     werks       TYPE t001w-werks,
     name1       TYPE t001w-name1,
   END OF t_t001w,
   t_return_tab  TYPE ddshretval.
DATA:w_t001w      TYPE t_t001w,
     w_return_tab TYPE t_return_tab.
DATA:i_t001w      TYPE STANDARD TABLE OF t_t001w,
     i_return_tab TYPE STANDARD TABLE OF t_return_tab.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS :p_werks TYPE t001w-werks,
            p_name1 TYPE t001w-name1.
SELECTION-SCREEN END OF BLOCK b1.
*&---------------------------------------------------------------------*
" AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks.
  PERFORM f4_help_for_palant.
*&---------------------------------------------------------------------*
*&      Form  f4_help_for_palant
*&---------------------------------------------------------------------*
FORM f4_help_for_palant.
  DATA:
      w_dynpfields TYPE dynpread,
      i_dynpfields LIKE STANDARD TABLE OF dynpread.
  IF i_t001w[] IS INITIAL.
    SELECT werks name1
    FROM t001w
    INTO TABLE i_t001w.
  ENDIF.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'WERKS'
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'P_WERKS'
      value_org   = 'S'
    TABLES
      value_tab   = i_t001w
      return_tab  = i_return_tab.
  READ TABLE i_return_tab INTO w_return_tab INDEX 1.
  p_werks = w_return_tab-fieldval.
  READ TABLE i_t001w INTO w_t001w WITH KEY werks = p_werks.
  IF sy-subrc = 0.
    w_dynpfields-fieldname    = 'P_NAME1'.
    w_dynpfields-fieldvalue   = w_t001w-name1.
    APPEND w_dynpfields TO i_dynpfields.
    CLEAR w_dynpfields.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname     = sy-repid
        dynumb     = sy-dynnr
      TABLES
        dynpfields = i_dynpfields.
  ENDIF.
ENDFORM.                    " f4_help_for_palant
Thanks Venkat.O