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: 

need help on : search help

Former Member
0 Kudos

hi friends,

i have a two screen fields

a :______

b :______

if i press f4 help on screen field a . b should also automatically populate by selection the a screen field.

thank you for reading this.

2 REPLIES 2

Former Member
0 Kudos

write the below code in on Selection screen output.

read the values which you entered in first field using

DYNP_VALUES_READ

then select the values for second parameter.use this FM to populate

F4IF_INT_TABLE_VALUE_REQUEST

thanks

Suman

Former Member
0 Kudos

HI,

CHECK THIS CODE....

process on value-request.

field zalokjobheader-plant module plant_f4.

field zalokjobheader-prord module f4help.

MODULES

module plant_f4 input.

data: begin of i_plant occurs 0,

p_werk type t001w-werks,

name1 type t001w-name1,

end of i_plant.

*--> FETCHING PLANT.

break obt.

select werks

name1

from t001w

into table i_plant.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

  • DDIC_STRUCTURE = ' '

retfield = 'P_WERK'

  • PVALKEY = ' '

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = ' ZALOKJOBHEADER-PLANT '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = i_plant.

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • 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.

endmodule.

module f4help input.

data: begin of i_afpo occurs 0,

aufnr type afpo-aufnr,

end of i_afpo.

data : dyname like d020s-prog value 'SAPMZALOKARUN_SUTLEJ',

dynumb like d020s-dnum value '0100'.

data: begin of dynpfields occurs 3.

include structure dynpread.

data: end of dynpfields.

refresh dynpfields.

move 'ZALOKJOBHEADER-PLANT' to dynpfields-fieldname.

append dynpfields.

*--> FETCHING PURCHASE ORDERS RELATED TO PLANT.

call function 'DYNP_VALUES_READ'

exporting

dyname = 'SAPMZALOKARUN_SUTLEJ'

dynumb = dynumb

translate_to_upper = 'X'

  • REQUEST = ' '

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

tables

dynpfields = dynpfields

  • 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.

read table dynpfields

with key fieldname = 'ZALOKJOBHEADER-PLANT' transporting fieldvalue.

move dynpfields-fieldvalue to zalokjobheader-plant.

select aufnr

from afpo

into table i_afpo

where pwerk eq zalokjobheader-plant.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

  • DDIC_STRUCTURE = ' '

retfield = 'AUFNR'

  • PVALKEY = ' '

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'ZALOKJOBHEADER-PRORD'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = i_afpo

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • 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.

endmodule. " F4HELP INPUT