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

Problem in Search help in Table control

Former Member
0 Likes
1,363

Dear ABAPers,

I am using the Table control.In that i am using F4 help.the F4 Value should be based o the

another field in the Table control.how to do this.

Thanks & Regards,

Ashok.

Dear ABAPers,

I am using the Table control.In that i am using F4 help.the F4 Value should be based o the

another field in the Table control.how to do this.

Thanks & Regards,

Ashok.

3 REPLIES 3
Read only

former_member673464
Active Contributor
0 Likes
659

Hi,

You can use the PROCESS ON VALUE-REQUEST.

...

FIELD <f> MODULE <mod>. statement for getting the f4 help.

you have to call this statements inside your table control loop.

Regards,

Veeresh

Read only

Former Member
0 Likes
659

Value should be based o the

another fieldin the Process on Value Request

You capture the record using the GET CURSOR

LINE line

From SAP help

Addition 4

... LINE lin

Effect

If the screen element on which the cursor is positioned is within a table control or a step loop, the addition assigns the number of the row of the table control or the group of the step loop to the LINE data object lin. Otherwise, lin is set to 0. For lin, a variable of the type i is expected.

using the Line, read the record, you get the value ( what ever value you want ) and now get the F4 values and display .

Read only

Former Member
0 Likes
659

I had a similar requirement. In this table control the values for the F4 help for the shipping conditions depend on the vendor the user selects in the first column.

Here is my code:


PROCESS ON VALUE-REQUEST.
  FIELD gs_pod_screen-ship_cond
    MODULE f4_ship_cond.


MODULE f4_ship_cond INPUT.

  PERFORM f4_pod_shipping_conditions.

ENDMODULE.                 " f4_ship_cond  INPUT


FORM f4_pod_shipping_conditions .

  DATA: lt_return TYPE TABLE OF ddshretval,
        ls_return TYPE ddshretval,
        lv_line   TYPE i,
        lv_vendor TYPE bu_partner,
        ls_shlp   TYPE shlp_descr,
        ls_selopt TYPE ddshselopt,
        ls_if     TYPE ddshiface,
        lv_c(132) TYPE c.

* where on the table control did we hit F4?
  GET CURSOR LINE lv_line.
  READ TABLE gt_pod_sales
       INTO gs_pod_screen
       INDEX lv_line
       TRANSPORTING vendor.

  CHECK NOT gs_pod_screen-vendor IS INITIAL.

* the possible values always depend on the vendor => build it every time
* get the search help parameters first
  CALL FUNCTION 'F4IF_GET_SHLP_DESCR'
    EXPORTING
      shlpname = gc_shlp_shipcon
    IMPORTING
      shlp     = ls_shlp.

* now we have to set restrictions based on the vendor
  CLEAR ls_selopt.
  ls_selopt-shlpname  = gc_shlp_shipcon.
  ls_selopt-shlpfield = gc_name_vendor.
  ls_selopt-sign      = gc_i.
  ls_selopt-option    = gc_eq.
  ls_selopt-low       = gs_pod_screen-vendor.
  APPEND ls_selopt TO ls_shlp-selopt.
* set the field for the output
  READ TABLE ls_shlp-interface INTO ls_if
       WITH KEY shlpfield = gc_name_ship_cond.
  IF sy-subrc EQ 0.
    ls_if-valfield = gc_field_shipcon.
    MODIFY ls_shlp-interface FROM ls_if
           INDEX sy-tabix TRANSPORTING valfield.
  ENDIF.

* pass in the base date and call the search help
  CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
    EXPORTING
      shlp                = ls_shlp
    TABLES
      return_values       = lt_return.

  READ TABLE lt_return INTO ls_return INDEX 1.
  IF sy-subrc EQ 0.
    gs_pod_screen-ship_cond = ls_return-fieldval.
  ELSE.
    CLEAR gs_pod_screen-ship_cond.
  ENDIF.

* transfer the value
  MODIFY gt_pod_sales
         FROM gs_pod_screen
         INDEX lv_line
         TRANSPORTING ship_cond.

ENDFORM.                    " f4_shipping_conditions

Hope that helps,

Michael