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 request

Former Member
0 Likes
980

Hi,

I am having 4 fields..In 1st field when i select the value,based on tht only second field search help want to display values.

when we select the value in the search help of the second field it want to display the value which we selected in the list and other 2 fields values also want to display automatically.

3rd and 4th field does not have search help.It is only a text box.When we select the 2nd field this value also want to display

Can anybody tell me the sample code for this

7 REPLIES 7
Read only

Former Member
0 Likes
923

hi,

are u using module pool or normal report?

Read only

0 Likes
923

module pool

Read only

0 Likes
923

ok,

let me try that..

R u using standard table's fields?

Read only

0 Likes
923

Hi,

Use the below function modules for your requirement:

1) DYNP_VALUES_READ

2) F4IF_INT_TABLE_VALUE_REQUEST and

3) DYNP_VALUES_UPDATE

Raghav

Read only

0 Likes
923

hi,

do like this

DATA: ok_code LIKE sy-ucomm.

DATA : matnr LIKE mseg-matnr.

TYPES : BEGIN OF ty_mat ,

mblnr LIKE mseg-mblnr,

END OF ty_mat.

DATA : dyfields LIKE dynpread OCCURS 1 WITH HEADER LINE ,

itab2 TYPE TABLE OF ty_mat WITH HEADER LINE,

wa_tab2 TYPE ty_mat.

DATA : value_tab LIKE wa_tab2 OCCURS 0 WITH HEADER LINE,

field_tab LIKE dfies OCCURS 0 WITH HEADER LINE,

return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.

DATA : yr LIKE mseg-mjahr,

tp LIKE mseg-bwart.

declare this data in TOP module...

Here i am entering Material firts...

Then pressing enter and click on F4 help icon in secong field material doc (mblnr) , so only related doc will come.

select one from them and press enter....year and movement type will come automatically...

here my screen fields are ( I/O fields)

MATNR

ITAB2-MBLNR

YR

TP

now make one module in PAI...

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

PROCESS ON VALUE-REQUEST.

FIELD itab2-mblnr MODULE matdoc.

MODULE matdoc INPUT.

SELECT mblnr FROM mseg INTO CORRESPONDING FIELDS OF TABLE itab2 WHERE matnr = matnr.

.

  • SORT itab2 BY mblnr.

  • DELETE ADJACENT DUPLICATES FROM itab2.

CLEAR : value_tab,field_tab,return_tab.

REFRESH : value_tab,field_tab,return_tab.

field_tab-fieldname = 'MBLNR'.

field_tab-tabname = 'MSEG'.

APPEND field_tab.

LOOP AT itab2 .

value_tab-mblnr = itab2-mblnr.

APPEND value_tab.

CLEAR value_tab.

ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = field_tab-fieldname

TABLES

value_tab = value_tab

field_tab = field_tab

return_tab = return_tab

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc = 0.

CLEAR : yr,tp.

itab2-mblnr = return_tab-fieldval.

SELECT SINGLE mjahr INTO yr FROM mseg WHERE mblnr = itab2-mblnr.

SELECT SINGLE bwart INTO tp FROM mseg WHERE mblnr = itab2-mblnr.

ENDIF.

ENDMODULE. " matdoc INPUT

reward if usefull.......

Read only

Former Member
0 Likes
923

Hi,

Please check this it may help you out.

Use the function module 'DYNP_VALUES_READ' to get the value of the first search help. Then retrieve the values of the 2nd search help using the above value selected by a select query.

Use this function module "F4IF_INT_TABLE_VALUE_REQUEST"

to create the 2nd search help.

Write the above logic in at selection-screen on value request for the field of 2nd search help field.

Regards,

Soumya

Read only

Former Member
0 Likes
923

iam assuming that u r calling a screen and not doing the changes on default selection screen 1000 as iam not sure the follwing things can be done selection screen 1000 .

on the screen layout draw input/ output fileds and text field( for display)

double click the input/outpurt field and in the screen properties give the field name and make it as list box, give some value in the FCT code say z_hlp.

do it for both the fields where u want to having diff screen field name and different FCT code.

leave the layout and come to pbo module.

if search help has to be populated for a field before any

input by the user it should be done in PBO module of the screen,

by using the fucntion module

vrm_set_values

first populate the internal table with ur search help values .

and then use the above mentioned function module , give the screen name where u want search help(screen name of fileds have already been given by you) and internal tabel ( where the data for search help is already populated.) as parameters of the function module.

now if u wnt to give search help in the second field based on the selected parameter in the first filed.

write code in pai module

if sy-ucomm = fct code of the first field ( fct code is given by u , while making the first field on screen as listbox in screen properties of the field)

again fill the internal table and on bases of value of the first parameter which u can retrive by mentioning the fieldname

select from custom tabel

into intrnal table

where abc = zdm-abc ( screen name of the field).

agin use the fucntion module vrm_set_values... and give the screen name( of second field) and intenal table .

Edited by: Saurabh on Jun 2, 2008 7:18 AM

Edited by: Saurabh on Jun 2, 2008 7:20 AM