Application Development 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: 

f4 help

Former Member
0 Kudos
167

following is my requirement

Designation – (Mandatory, Single selection, F4 Help from Z table with all columns)

Signature – (Mandatory, Single selection, F4 Help from Z table with first two columns)

how to get f4 help for the above.

6 REPLIES 6

Former Member
0 Kudos
136

HI,

Use AT Selection-screen on value-request Event..

and in that use the function module

' F4if-INT_TABLE_VALUE_REQEUST'

Reward if helpful.

RSS.

Former Member
0 Kudos
136

Hi,

try this FM

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'WERKS'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'WERKS'

window_title = 'Plant Name'

value_org = 'S'

tables

value_tab = it_werks

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-

msgv3 sy-msgv4.
  endif.

reward if usefull

0 Kudos
136

Hi,

Here is an example.

SELECT-OPTIONS : s_categ FOR ausp-atwrt , " Change Category

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_categ-low.

REFRESH t_val_categ.

CLEAR : w_dynprofld,w_characteristic.

w_characteristic = 'CHANGE_CATEGORY'.

w_dynprofld = 's_categ-low'.

  • Get the Change category value help

PERFORM value_request TABLES t_val_categ USING w_dynprofld

w_characteristic.

FORM value_request TABLES p_t_values

USING p_w_dynprofld

p_characteristic.

  • Get the Internal characteristic

REFRESH p_t_values.

CLEAR w_atinn.

CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'

EXPORTING

input = p_characteristic

IMPORTING

output = w_atinn

EXCEPTIONS

OTHERS = 1.

  • Fetch all possible entries for Internal characteristic into an internal table

SELECT atwrt

FROM cawn

INTO TABLE p_t_values

WHERE atinn EQ w_atinn.

  • Pass the values to the fuction module to display Value request

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ATWRT'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = w_dynprofld

value_org = 'S'

TABLES

value_tab = p_t_values[].

ENDFORM. " value_request

Hope this helps.

Thanks,

Ahsan

Former Member
0 Kudos
136

hi

try this

at selection-screen on value-request for < ur field name >.

then call FM.

F4_FIELD_ON_VALUE_REQUEST.

pass the required parameter in export parameter, table parameter.

reward if uesful

regards

mano

former_member873340
Active Participant
0 Kudos
136

CONSTANTS: C_STROW TYPE INT4 VALUE '10', "F4 indow position

C_STCOL TYPE INT4 VALUE '30', "F4 Window position

C_EDROW TYPE INT4 VALUE '20', "F4 Window position "height

C_EDCOL TYPE INT4 VALUE '42', "F4 Window position "width

Data : W_LINENO LIKE SY-TABIX.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR <FIELDNAME>

Select all the values from the Z table and put it in a internal table. say it_tab.

CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'

EXPORTING

ENDPOS_COL = C_EDCOL "60

ENDPOS_ROW = C_EDROW "15

STARTPOS_COL = C_STCOL "30

STARTPOS_ROW = C_STROW "05

TITLETEXT = 'Title '

IMPORTING

CHOISE = W_LINENO

TABLES

VALUETAB = it_tab

EXCEPTIONS

BREAK_OFF = 1

OTHERS = 2.

IF SY-SUBRC EQ 0.

READ TABLE it_tab INDEX W_LINENO.

IF SY-SUBRC EQ 0.

Screen field = it_tab-value.

ENDIF.

ENDIF.

Award points if helpful.

Regards.

Gowri

Former Member
0 Kudos
136

Hi,

Check the below code.

parameters: p_abkrs(4) type c,

p_abkrs1(4) type c.

data it_abkrs like t549a occurs 0 with header line.

data: begin of it_abkrs1 occurs 0,

mandt type mandt,

abkrs type abkrs,

end of it_abkrs1.

at selection-screen on value-request for p_abkrs.

select * from t549a into table it_abkrs.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'ABKRS'

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'P_ABKRS'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = it_abkrs

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

at selection-screen on value-request for p_abkrs1.

select mandt abkrs from t549a into table it_abkrs1.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'ABKRS'

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'P_ABKRS1'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = it_abkrs1

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

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

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

ENDIF.