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 (Process on value request)

Former Member
0 Likes
1,222

When I Press f4 key on a Screen field of Module pool screen, it has show the data in the internal table which has two fields. 1. classification id 2. classification description. For populating these values, i am using the function module 'F4IF_INT_TABLE_VALUE_REQUEST' where i am returning classification id based on user selection.

Now the requiremnt is when the user selects any classification id, the value is displayed in the screen field, now based on that value the corresponding classification description should be displayed in the next screen field automatically wihich is description field. I am not using any search helps.

9 REPLIES 9
Read only

Former Member
0 Likes
966

Hi Sridhar,

As you are using the fm - 'F4IF_INT_TABLE_VALUE_REQUEST' to return the classification id, use the same and return classification description also. I mean in the internal table that is returned by the function module, add another column for Classificationd escription.

Now when you are assigning the value to the screen field, assign the classification description to the second field where you want it to be displayed...

Best Regards,

Ram.

Read only

0 Likes
966

Hi Ram,

As per the requirement , i need to use the function module only once and that to for classification id and not for classification description, so based on the classification id selected by the user, automatically the corresponding classification description should be displayed in the second field. I am able to see the classification id on the screen which is selected by the user,, but this value is not captured in the screen field variable.

Refer to the code for help :

SELECT class class_descr status

FROM zvc01

INTO TABLE lt_class_status

WHERE status = c_active.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'CLASS'

dynpprog = lv_prog

dynpnr = lv_dynnr

dynprofield = 'ZVC01-CLASS'

value_org = 'S'

TABLES

value_tab = lt_class_status[].

Read only

0 Likes
966

Hi Sridhar,

You dont need to call the fm two times..You can do it with <b>one function module</b> itself...

While you call the function module, you dont need to pass "DYNPROFIELD" and "DYNPNR" etc.. just check the code below..

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        retfield        = c_s_lsyst
        value_org       = c_bool
      TABLES
        value_tab       = it_l_oijts
        return_tab      = fp_t_return_tab
      EXCEPTIONS
        parameter_error = 1
        no_values_found = 2
        OTHERS          = 3.
    IF sy-subrc EQ 0.
  READ TABLE it_return_tab INTO w_gs_return INDEX 1.
  IF sy-subrc EQ c_0.
    screen-field  = w_gs_return-fieldval.
  ENDIF.
  ENDIF.

Parameter "RETURN_TAB" will contain the values..you can read it and assign it to the screen field.

<b>Reward points for helpful answers</b>.

Best Regards,

Ram.

Read only

0 Likes
966

Hi ram,

can you show me how to declare the fp_t_return_tab internal table.

Read only

0 Likes
966

Hi Sridhar,

"fp_t_return_tab" - You can declare it by checking the type in function module tables parameter..

In run time check what value it holds and accordingly you need to assign it to the screen field...

data: fp_t_return_tab TYPE ty_t_ddhretval.

What you can do is, when you press F4 on field for Classification ID, call this function module. Put a break point and check what value is existing in the return table (You will get the value in return table after selecting any particular record from the F4 pop-up). accordingly assign it to classification id and classification description.

Hope this helps.

Best Regards,

Ram.

Read only

Former Member
0 Likes
966

Hi Sridhar,

Use FM 'REUSE_ALV_POPUP_TO_SELECT' to fulfill ur requirement.

Refer this code :

CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

EXPORTING

I_TITLE = 'Material No'

I_SELECTION = 'X'

  • I_ALLOW_NO_SELECTION = 'X'

  • I_ZEBRA = 'X'

  • I_SCREEN_START_COLUMN = 1

  • I_SCREEN_START_LINE = 1

  • I_SCREEN_END_COLUMN = 2

  • I_SCREEN_END_LINE = 10

  • I_CHECKBOX_FIELDNAME = 'X'

  • I_LINEMARK_FIELDNAME = 'X'

I_SCROLL_TO_SEL_LINE = 'X'

i_tabname = 'T_MARA'

  • I_STRUCTURE_NAME =

IT_FIELDCAT = t_fieldcat

  • IT_EXCLUDING =

  • I_CALLBACK_PROGRAM = 'Z8HG_TEXT_MPOOL'

  • I_CALLBACK_USER_COMMAND =

  • IS_PRIVATE = i_private

  • IMPORTING

  • ES_SELFIELD = i_selfield

  • E_EXIT = W_exit

tables

t_outtab = t_mara

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

read table t_mara with key matnr = t_mara-matnr.

if sy-subrc = 0.

w_mara-matnr = t_mara-matnr.

endif.

Reward points if helpful.

Regards,

Hemant

Read only

alpesh_saparia3
Active Contributor
0 Likes
966

Try using function module DYNP_VALUES_UPDATE.

-Alpesh

Read only

Former Member
0 Likes
966

Dear Sridhar

declare a global variable for description.

when u select from f4 value you will get the id.

read the internal table which you are passing to FM 'F4IF_INT_TABLE_VALUE_REQUEST' which contains both id & description.

on your next screen you can populate the field with the value from global variable.

reward points if helpful

Read only

varma_narayana
Active Contributor
0 Likes
966

Hi

F4IF_INT_TABLE_VALUE_REQUEST

This FM use the RETTab which contain the Values of Returned fields.

Then Call the FM DYNP_VALUES_UPDATE to Get the Value into Second field.

Sample code:

DATA: dynpfields LIKE dynpread OCCURS 5 WITH HEADER LINE.

DATA: l_stepl LIKE sy-stepl.

REFRESH dynpfields.

CLEAR dynpfields.

dynpfields-fieldname = 'SCREENFIELD1-COL1'. "Screen field name

dynpfields-fieldvalue = 10. "New value

dynpfields-stepl = l_stepl. "Step loop for table controls

APPEND dynpfields.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = 'SAPLBDT_GMGR' "Program name

dynumb = '0270' "Screen number

TABLES

dynpfields = dynpfields

EXCEPTIONS

OTHERS = 0.

<b>reward if Helpful</b>