F4IF_INT_TABLE_VALUE_REQUEST help
hi,
I have a table of 2 values ( WBS and project definition code ) , I used this function F4IF_INT_TABLE_VALUE_REQUEST for F4 on the project definition field. After that I want to return both Project definition and WBS that I've selected . I used value_org = 'S" but I can get only 1 record in the return_table ? Could you please help me?
Thanks in advance
Hi,
Check this Code..
F4 help is povided on the P_PLNNR field and if any data is selected then P_PLNNR and P_PLNAL is updated in the screen. Both values are shown in the F4 help(P_PLNNR and P_PLNAL ).
PARAMETES : p_werks type ...
PARAMETES : p_plnnr type ....
PARAMETES : p_plnal type....
AT SELECTION-SCREEN ON P_PLNNR.
data:
lg_condition type string.
data:
lwa_ddshretval type ddshretval,
lwa_dselc type dselc,
lwa_dynpread type dynpread.
data:
li_f4_insp type standard table of t_f4_insp,
li_ddshretval type standard table of ddshretval,
li_dselc type standard table of dselc,
li_dynpread type standard table of dynpread.
lwa_dynpread-fieldname = 'P_WERKS'.
append lwa_dynpread to li_dynpread.
clear lwa_dynpread.
* Read Screen Field Values.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-repid
dynumb = sy-dynnr
tables
dynpfields = li_dynpread.
* Read the first record as only one record will be present
read table li_dynpread into lwa_dynpread index 1.
p_werks = lwa_dynpread-fieldvalue.
if p_werks is initial.
move 'PLNTY EQ ''Q''' to lg_condition.
else.
move 'WERKS EQ P_WERKS AND PLNTY EQ ''Q''' to lg_condition.
endif.
* Fetch Data
select werks
plnnr
plnal
plnty
ktext
into table li_f4_insp
from plko
where (lg_condition).
lwa_dselc-fldname = 'F0002'.
lwa_dselc-dyfldname = 'PLNNR'.
append lwa_dselc to li_dselc.
clear lwa_dselc.
lwa_dselc-fldname = 'F0003'.
lwa_dselc-dyfldname = 'PLNAL'.
append lwa_dselc to li_dselc.
clear lwa_dselc.
* FM For F4 Help
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'PLNNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'PLNNR'
value_org = 'S'
tables
value_tab = li_f4_insp
return_tab = li_ddshretval
dynpfld_mapping = li_dselc
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc eq 0.
refresh li_dynpread.
read table li_ddshretval into lwa_ddshretval index 1.
if sy-subrc eq 0.
move lwa_ddshretval-fieldval to p_plnnr.
lwa_dynpread-fieldname = 'P_PLNNR'.
lwa_dynpread-fieldvalue = lwa_ddshretval-fieldval.
append lwa_dynpread to li_dynpread.
clear lwa_dynpread.
endif. " IF sy-subrc EQ 0.
read table li_ddshretval into lwa_ddshretval index 2.
if sy-subrc eq 0.
move lwa_ddshretval-fieldval to p_plnal.
lwa_dynpread-fieldname = 'P_PLNAL'.
lwa_dynpread-fieldvalue = lwa_ddshretval-fieldval.
append lwa_dynpread to li_dynpread.
clear lwa_dynpread.
endif. " IF sy-subrc EQ 0.
endif. " IF sy-subrc EQ 0.
* Set Screen Field Values.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-repid
dynumb = sy-dynnr
tables
dynpfields = li_dynpread
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
others = 8.
check sy-subrc eq 0.
Similar Messages
-
Hi,
I need to enhanse search help and add F4 functionality to display list of company codes when cursor is in PBUKR field. I put F4IF_INT_TABLE_VALUE_REQUEST
into the user exit but nothing works.
I get error that PROCESS is not defined. If I remove that line there is no error but nothing works.
Can someone tell me what is wrong in the code below.
Thank you.
FUNCTION z_hr_shlp_wbs_element.
""Local interface:
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCR_TAB_T
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" VALUE(SHLP) TYPE SHLP_DESCR_T
*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
TABLES: prps.
DATA: it_prps LIKE prps OCCURS 0 WITH HEADER LINE.
DATA: status_tab LIKE jstat OCCURS 0 WITH HEADER LINE.
DATA: l_posid LIKE prps-posid.
DATA: l_subrc LIKE sy-subrc.
DATA: l_pbukr LIKE prps-pbukr, " Added by vr
value TYPE DDSHIFACE-VALUE.
EXIT immediately, if you do not want to handle this step
IF callcontrol-step <> 'SELONE' AND
callcontrol-step <> 'SELECT' AND
" AND SO ON
callcontrol-step <> 'DISP'.
EXIT.
ENDIF.
------------------------------------------------------ added by vr
PROCESS ON VALUE-REQUEST.
FIELD PRPS-PBUKR MODULE PBUKR.
DATA: BEGIN OF VALUE_TAB OCCURS 0,
LPBUKR LIKE PRPS-PBUKR,
LPOSID LIKE PRPS-POSID,
END OF VALUE_TAB.
DATA: BEGIN OF RETURN_TAB OCCURS 0.
INCLUDE STRUCTURE DDSHRETVAL.
DATA END OF RETURN_TAB.
SELECT PBUKR POSID FROM PRPS UP TO 20 ROWS
INTO TABLE VALUE_TAB WHERE SLWID = 'QLT UDF'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'PBUKR'
WINDOW_TITLE = 'Statusselektion'
VALUE_ORG = 'S' "hierdurch kann die Struktur genommen werden
TABLES
VALUE_TAB = VALUE_TAB
RETURN_TAB = RETURN_TAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
end of additions
STEP SELONE (Select one of the elementary searchhelps)
This step is only called for collective searchhelps. It may be used
to reduce the amount of elementary searchhelps given in SHLP_TAB.
The compound searchhelp is given in SHLP.
If you do not change CALLCONTROL-STEP, the next step is the
dialog, to select one of the elementary searchhelps.
If you want to skip this dialog, you have to return the selected
elementary searchhelp in SHLP and to change CALLCONTROL-STEP to
either to 'PRESEL' or to 'SELECT'.
IF callcontrol-step = 'SELONE'.
PERFORM SELONE .........
EXIT.
ENDIF.
STEP PRESEL (Enter selection conditions)
This step allows you, to influence the selection conditions either
before they are displayed or in order to skip the dialog completely.
If you want to skip the dialog, you should change CALLCONTROL-STEP
to 'SELECT'.
Normaly only SHLP-SELOPT should be changed in this step.
IF callcontrol-step = 'PRESEL'.
PERFORM PRESEL ..........
EXIT.
ENDIF.
STEP SELECT (Select values)
This step may be used to overtake the data selection completely.
To skip the standard seletion, you should return 'DISP' as following
step in CALLCONTROL-STEP.
Normally RECORD_TAB should be filled after this step.
Standard function module F4UT_RESULTS_MAP may be very helpfull in this
step.
IF callcontrol-step = 'SELECT'.
Maximum records are set to 0 because the counter for Max records keeps
running, even if you filter out certain records. This is a similar
problem as described in OSS Note 148525.
Feb 3, 2004 LS: devk907353
(maxrecords = 0 defaults to maxrecords 500)
As of release 4.7, it appears that maxrecords is
being considered on the read of the view, rather
than prior to presenting the selection list.
When only 500 records are passed into this exit,
the subsequent evaluation yields very few records
in the selection list. By setting maxrecords to
8000, the entire contents of the view are passed
to this user exit, and therefor the search help
yields a reasonable selection list to the user
(as was the case in release 4.6b).
callcontrol-maxrecords = 0. " devk907353
callcontrol-maxrecords = 8000. " devk907353
PERFORM STEP_SELECT TABLES RECORD_TAB SHLP_TAB
CHANGING SHLP CALLCONTROL RC.
IF RC = 0.
CALLCONTROL-STEP = 'DISP'.
ELSE.
CALLCONTROL-STEP = 'EXIT'.
ENDIF.
EXIT. "Don't process STEP DISP additionally in this call.
ENDIF.
Added by vr, Nov. 2007 ---------------------------
CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'
EXPORTING
PARAMETER = 'PBUKR' " Reference to search help parameter
IMPORTING
VALUE = value
TABLES
SHLP_TAB = shlp_tab
RECORD_TAB = record_tab
CHANGING
SHLP = shlp
CALLCONTROL = callcontrol.
l_pbukr = value.
End of additions by vr ---------------------------
STEP DISP (Display values)
This step is called, before the selected data is displayed.
You can e.g. modify or reduce the data in RECORD_TAB
according to the users authority.
If you want to get the standard display dialog afterwards, you
should not change CALLCONTROL-STEP.
If you want to overtake the dialog on you own, you must return
the following values in CALLCONTROL-STEP:
- "RETURN" if one line was selected. The selected line must be
the only record left in RECORD_TAB. The corresponding fields of
this line are entered into the screen.
- "EXIT" if the values request should be aborted
- "PRESEL" if you want to return to the selection dialog
Standard function modules F4UT_PARAMETER_VALUE_GET and
F4UT_PARAMETER_RESULTS_PUT may be very helpfull in this step.
IF callcontrol-step = 'DISP'.
DEVK909420 Begin
SELECT * FROM prps INTO TABLE it_prps
WHERE belkz = 'X'.
Changed by vr, Nov. 2007
IF l_pbukr <> ''.
SELECT * FROM prps INTO TABLE it_prps
WHERE belkz = 'X'
AND fkstl <> ''
AND pbukr = l_pbukr.
ELSE.
SELECT * FROM prps INTO TABLE it_prps
WHERE belkz = 'X'
AND fkstl <> ''.
ENDIF.
End of changes
DEVK909420 End
SORT it_prps BY posid.
LOOP AT record_tab.
l_posid = record_tab+96(24).
READ TABLE it_prps WITH KEY posid = l_posid.
IF sy-subrc = 0.
CALL FUNCTION 'STATUS_READ'
EXPORTING
objnr = it_prps-objnr
only_active = 'X'
TABLES
status = status_tab.
DEVK909329 Begin
read table status_tab with key inact = ''
stat = 'E0001'.
if sy-subrc is initial.
read table status_tab with key inact = '' "DEVK909345
stat = 'I0002'. "DEVK909345
endif.
DEVK909329 End
ENDIF.
IF sy-subrc NE 0.
DELETE record_tab.
ELSE.
IF record_tab+114(1) EQ '.' AND
record_tab+115(1) EQ '9'.
DELETE record_tab.
ELSE.
DEVK909420 Begin
IF record_tab+102(1) EQ '9'.
DELETE record_tab.
ELSEIF record_tab+104(1) EQ '9'.
DELETE record_tab.
ENDIF.
DEVK909420 End
ENDIF.
ENDIF.
ENDLOOP.
EXIT.
ENDIF.
ENDFUNCTION.Hi Vitaly,
Process on Value Request and search help exit is entirely two idea to display the f4 values.please remove the PROCESS ON VALUE REQUEST from the function module.write the required select statements after CHECK callcontrol-step EQ 'SELECT' . and pass the value to the function module
CALL FUNCTION 'F4UT_RESULTS_MAP'
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
source_tab = l_record
CHANGING
shlp = shlp
callcontrol = callcontrol
EXCEPTIONS
illegal_structure = 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.
IF ( sy-subrc = 0 AND l_record IS INITIAL ).
MESSAGE 'No values found' TYPE 'S'.
ENDIF.
callcontrol-step = 'DISP'.
Find the documentaion for this function module for further help
message edited by
shibu -
Help! F4IF_INT_TABLE_VALUE_REQUEST - no values on hitlist displayed
Hello everybody,
maybe some of you are able to help me, please!
My problem is, that i want to display an F4-help-list that is based on the structure LQUA, but i restricted the shown fields by making some entries in fieldtab.
The value-tab i do import is correctly filled, the F4-Windows shows 1 Row, but is lacking of the expected values.
Furthermore i want to fill depending dynpro-fields on the go, but that doesn't work either. hmmm, its really enerving me...
where's the point? what am i doing wrong?
Thnx a lot for getting me out of my mess!
Here is the coding i use:
PROCESS ON VALUE-REQUEST.
FIELD lqua-lgtyp MODULE F4_lagerplatzliste.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'LGTYP'
VALUE_ORG = 'S'
DYNPPROG = 'ZPI_AUFTRAG_MELDEN_CFX'
DYNPNR = '0100'
DYNPROFIELD = 'LQUA-LGTYP'
WINDOW_TITLE = 'Lagerplätze'
TABLES
VALUE_TAB = IT_LAGER *** is already filled by another module.
FIELD_TAB = FIELD_TAB
RETURN_TAB = RETURN_TAB
DYNPFLD_MAPPING = MAP_TAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
Example of the Table_Definition:
*LGNUM
MOVE 'IT_LAGER' TO FIELD_TAB-TABNAME.
MOVE 'LGNUM' TO FIELD_TAB-FIELDNAME.
MOVE 'D' TO FIELD_TAB-LANGU.
MOVE '0001' TO FIELD_TAB-POSITION.
MOVE '0000' TO FIELD_TAB-OFFSET.
MOVE '003' TO FIELD_TAB-LENG.
MOVE '003' TO FIELD_TAB-INTLEN.
MOVE '003' TO FIELD_TAB-OUTPUTLEN.
CLEAR: WA_MAP.
WA_MAP-FLDNAME = FIELD_TAB-FIELDNAME.
WA_MAP-DYFLDNAME = 'LQUA-LGNUM'.
APPEND WA_MAP TO MAP_TAB.APPEND FIELD_TAB.Hi,
Call the Function module as below in POV
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = tabname
fieldname = fname
* SEARCHHELP = ' '
* SHLPPARAM = ' '
* dynpprog = progname
* dynpnr = dynnr
* dynprofield = ' '
* stepl = dynp_stepl
value = value_bef_f4
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* SUPPRESS_RECORDLIST = ' '
callback_program = progname
callback_form = 'CALLBACK_F4'
TABLES
return_tab = return_tab
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
ENDMODULE.
Regards,
Satish -
F4 Help Needed F4IF_INT_TABLE_VALUE_REQUEST
hi gurus,
i am using the F4IF_INT_TABLE_VALUE_REQUEST function module to populate an F4 help. I am getting a weird situation.
this is the code i am using:
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = f_name "field name to be populated
PVALKEY = ' '
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = lv_dynprofield
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = it_t77tp[]
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
the table it_t77tp has 2 colums [4 digit number and associated text]. the f4 help does show the 2colums, but on clicking on the right value, it always picks the last 4characters of the second column.
so if i make it text followed by number, it gives me number,
but i make it number followed by text (which is what the user wants), it selects the first 4 characters of the text.
could you please tell me where am i going wrong? is there some table that i am passing / providing?
thanks,
vivek
ps:rewards for useful answersHi,
Use the below logic.
parameters: p_abkrs(4) type c.
data: begin of it_abkrs occurs 0,
abkrs type abkrs,
atext type abktx,
end of it_abkrs.
at selection-screen on value-request for p_abkrs.
select abkrs atext from t549t into table it_abkrs
where sprsl = sy-langu.
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. -
Hi all,
i have a problem to retrieve selected value from a custom search help. I need to retrieve 2 columns from the selected line. eg. there are A,B,C,D column in the search help. I need to get the B and D. can anyone help? ThanksFor achieving this follow the following 4 steps:
1. While calling F4IF_INT_TABLE_VALUE_REQUEST pass the importing paramter return_tab to make the data selected by the user IN SELECTION screen. Remember that without this the user entry is avaliable only at START OF SELECTION.
2. Use this value to READ TABLE your internal table to get the value of other column.
3. Load an internal table with values you want to assign to selection screen fields.
4. Assign values to the field in selection field using Fn Module: 'DYNP_VALUES_UPDATE'.
Example:
DATA: ......,
lit_fields type table of dynpread,
ls_fields type dynpread,
lit_ret_tab type table of ddshretval,
ls_ret_tab type ddshretval.
. call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'VARI'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_VARI'
value_org = 'S'
tables
value_tab = lit_abc
return_tab = lit_ret_tab
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
check sy-subrc eq 0.
*-----get the entered value of field vari
read table lit_ret_tab into ls_ret_tab index 1.
lv_vari = ls_ret_tab-fieldval.
check sy-subrc eq 0.
*-----get value of the other column vari_d
read table lit_abc into ls_abc with key vari = lv_vari.
lv_vari_d = ls_abc-vari_d.
*----- Append to an internal table with values you want to assin to selection screen fields.
ls_fields-fieldname = 'P_VARI'.
ls_fields-fieldvalue = lv_vari.
append ls_fields to lit_fields.
ls_fields-fieldname = 'P_VARI_D'.
ls_fields-fieldvalue = lv_vari-d.
append ls_fields to lit_fields.
*---- Assign values to the field in selection field
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = lit_fields
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
others = 8. -
I have two parameters on selection screen .
P_QTR and P_YEAR
I have concatenated the Quarter and Year Value to give same f4 on both paramatersto give f4 using 'F4IF_INT_TABLE_VALUE_REQUEST'
for example Q1 2014
now when user selects one value i want to set Q1 to P_QTR and 2014 to P_YEAR.
but it is setting only one value for P_QTR correctly and the value for P_year is not coming on screen although the value is thier inside code in P_year
i am using same f4 for both events
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_qtr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_year.
here is the code i am using
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CHAR20'
window_title = text-026
value_org = 'S'
TABLES
value_tab = mt_input_f4
return_tab = mt_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
CLEAR mt_input_f4[].
ENDIF.
READ TABLE mt_return INTO ms_return INDEX 1.
IF sy-subrc EQ 0.
p_qtr = ms_return-fieldval+0(2).
p_year = ms_return-fieldval+3(4) .
ENDIF.
plz chk attached picsi am sorry for delayed update but i fixed it using following approach.
READ TABLE mt_return INTO ms_return INDEX 1.
IF sy-subrc EQ 0.
ls_dynpread-fieldname = 'P_QTR'.
ls_dynpread-fieldvalue = ms_return-fieldval+0(2).
APPEND ls_dynpread TO lt_dynpread.
ls_dynpread-fieldname = 'P_YEAR'.
ls_dynpread-fieldvalue = ms_return-fieldval+3(4).
APPEND ls_dynpread TO lt_dynpread.
**setting the selection screen values
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-repid
dynumb = '1000'
TABLES
dynpfields = lt_dynpread
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
CLEAR lt_dynpread[].
ENDIF. -
Help required in F4IF_INT_TABLE_VALUE_REQUEST
hi all,
I am using F4IF_INT_TABLE_VALUE_REQUEST function for F4 list , below is the code im using,
DATA : zmatnr TYPE zauvvselscr-matnr.
DATA: w_choice TYPE sy-tabix.
DATA: BEGIN OF i_values OCCURS 0,
werks TYPE zauvvselscr-werks,
matnr TYPE zauvvselscr-matnr,
maktx TYPE zauvvselscr-maktx,
j_3asean TYPE zauvvselscr-j_3asean,
/afs/collection TYPE zauvvselscr-/afs/collection,
mvgr5 TYPE zauvvselscr-mvgr5,
stock TYPE zauvvselscr-clabs,
END OF i_values.
DATA: screen_values TYPE TABLE OF dynpread ,
screen_value LIKE LINE OF screen_values.
DATA: lv_srch_str TYPE c LENGTH 20.
DATA: it_ret LIKE ddshretval OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF fieldtab_rt OCCURS 20.
INCLUDE STRUCTURE dfies. "field for ddif_fieldinfo_get
DATA: END OF fieldtab_rt.
DATA: dyn_tab TYPE TABLE OF dselc,
S_DYN TYPE DSELC.
s_dyn-fldname = 'MATNR'.
s_dyn-dyfldname = 'P_MATNR'.
APPEND s_dyn TO dyn_tab.
s_dyn-fldname = 'WERKS'.
s_dyn-dyfldname = 'P_WERKS'.
APPEND s_dyn TO dyn_tab.
fieldtab_rt-tabname = zauvvselscr.
fieldtab_rt-fieldname = 'MATNR'.
fieldtab_rt-position = '0001'.
APPEND fieldtab_rt.
fieldtab_rt-tabname = zauvvselscr.
fieldtab_rt-fieldname = 'WERKS'.
fieldtab_rt-position = '0002'.
APPEND fieldtab_rt.
screen_value-fieldname = 'ZMATNR' . " Field to be read
APPEND screen_value TO screen_values. "* Fill the table
REFRESH it_ret.
REFRESH fieldtab_rt.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = screen_values.
READ TABLE screen_values INDEX 1 INTO screen_value.
REPLACE ALL OCCURRENCES OF '*' IN screen_value-fieldvalue WITH space.
CONCATENATE screen_value-fieldvalue '%' INTO lv_srch_str.
REFRESH i_values.
CLEAR i_values.
SELECT DISTINCT matnr werks maktx j_3asean /afs/collection mvgr5 SUM( clabs ) AS stock
INTO CORRESPONDING FIELDS OF i_values FROM zauvvselscr WHERE matnr LIKE lv_srch_str
GROUP BY matnr werks maktx j_3asean /afs/collection mvgr5.
APPEND i_values.
ENDSELECT.
DELETE ADJACENT DUPLICATES FROM i_values.
SORT i_values BY matnr werks.
*&&--passing the above selected records to the selection
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
value_org = 'S'
TABLES
value_tab = i_values[]
field_tab = fieldtab_rt
return_tab = it_ret
dynpfld_mapping = dyn_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc EQ 0.
LOOP AT it_ret.
screen_value-fieldvalue = it_ret-fieldval.
MOVE it_ret-fieldval TO zmatnr.
ENDLOOP.
ENDIF.
My requirement is , In my selection screen i have field ZMATNR , with the above coding i can get the selected MATNR into that, but in addition to the selected matnr i need to get the corresponding WERKS also, which needs to be passed to another variable for further usage, I tried various methods of using "dynpfld_mapping " field tab etc, but nowhere im getting the WERKS value, i dont know whether im doing it correctly. so kindly suggest me to achieve the requirement.
thanks and regs,
RajaHi,
its possible check the below code.
parameters: p_matnr type mara-matnr,
p_werks type marc-werks.
data: i_mara type table of mara with header line,
i_marc type table of marc with header line,
i_dselc type table of dselc with header line,
i_dfies type table of dfies with header line,
v_werks type marc-werks.
at selection-screen on value-request for p_matnr.
select * from marc into table i_marc up to 10 rows where matnr is not null.
i_dfies-tabname = 'MARA'.
i_dfies-fieldname = 'MATNR'.
append i_dfies.
clear i_dfies.
i_dfies-tabname = 'MARC'.
i_dfies-fieldname = 'WERKS'.
append i_dfies.
clear i_dfies.
i_dselc-fldname = 'WERKS'.
i_dselc-fldinh = v_werks.
i_dselc-dyfldname = 'P_WERKS'.
append i_dselc.
clear i_dselc.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
DDIC_STRUCTURE = ' '
retfield = 'MATNR'
PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_MATNR'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = i_marc[]
field_tab = i_dfies[]
RETURN_TAB =
dynpfld_mapping = i_dselc[]
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.
Regards,
Sathish Reddy. -
Hi,
I'm using FM F4IF_INT_TABLE_VALUE_REQUEST to show a pop-up with my internal table values. The internal table has 3 fields, ATINN, ATZHL and a description field ATWTB. ATINN and ATZHL are needed to complete the unique table key, however this FM will only return the value of one field in any line I select.
How can I see all the values in the line I select in the return table?
My code is as follows:
DATA: tbl_cawnt LIKE cawnt OCCURS 0,
wa_cawnt LIKE cawnt,
BEGIN OF tbl_list OCCURS 0,
atinn LIKE cawnt-atinn,
atzhl LIKE cawnt-atzhl,
atwtb LIKE cawnt-atwtb,
END OF tbl_list,
wa_list LIKE tbl_list,
tbl_return LIKE ddshretval OCCURS 0,
wa_return LIKE ddshretval,
tbl_fields LIKE dfies OCCURS 0,
tbl_dynp LIKE dselc OCCURS 0.
REFRESH: tbl_list, tbl_cawnt.
SELECT atinn atzhl atwtb
FROM cawnt
INTO CORRESPONDING FIELDS OF TABLE tbl_cawnt
WHERE spras EQ sy-langu.
LOOP AT tbl_cawnt INTO wa_cawnt.
CLEAR wa_list.
MOVE: wa_cawnt-atwtb TO wa_list-atwtb,
wa_cawnt-atinn TO wa_list-atinn,
wa_cawnt-atzhl TO wa_list-atzhl.
APPEND wa_list TO tbl_list.
ENDLOOP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ATWTB'
dynpprog = sy-repid
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = tbl_list
return_tab = tbl_return
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.
Thanks!Hi,
Use the structure DYNPFLD_MAPPING
With this internal table you can easily define that you want to return
other columns of the hit list in addition to field RETFIELD to the
screen.
In this IT you can MAP the screen fields to the serch help screen fields this has three fields
FLDNAME this is the field anme from the search help
FLDINH This has to be blank which would be field with the field value that you want to map
DYFLDNAME THis is the screen field name.
So here you can get the values for the other fields that you want which are on the search help just populate the name of the fields in FLDNAME.
Regards,
Himanshu -
F4 help for month and Year field in ztable please
I have created a ztable.
The first field in my ztable is a primary key field and it holds MM/YYYY(eg. 08/2011).
How ever my requirement is when ever we want to see the output, uer wants F4 help on that fields and when he selects the range , the ztable should display the values in that range.
For eg.
1). if user selects 01/2011 to 08/2011 using F4 Help,
2). then the ztables should display all the records in that range.
Thanks in advance for your help.
Best regards,Sam
Moderator message : Spec dumping / Outsourcing is not allowed. Thread locked.
Edited by: Vinod Kumar on Aug 8, 2011 11:17 AMHi Sam,
Create an F4 help using this FM
l_t_date" has month and date
l_f_programm = sy-repid.
l_f_dynnr = sy-dynnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'Date'"Field name of coloum of value tab
dynpprog = l_f_programm
dynpnr = l_f_dynnr
dynprofield = <>"Screen field name'
value_org = 'S'
callback_program = l_f_programm
callback_form = ''
TABLES
value_tab = l_t_date"Value table for date and month
* FIELD_TAB = L_T_RETURN
return_tab = l_t_return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
READ TABLE l_t_return_tab INDEX 1.
IF sy-subrc = 0 .
<fields> = l_t_return_tab-fieldval.
ENDIF.
Regards,
Amit
then filter the ztable accordingly -
Search Help Not show/display the data
Dear All,
I have created a search help whith mannual itab of 4 entries. Itab is filled correctly, but when i see in the screen field it show the search help and display no record with the message 4 entries found; but I can't see the data.
pls. guide me what can be the problem
Thanks and Regards,
SohailHi,
If you want to Show the Search help for Particular Field in Screen painter , You must give the Code In PROCESS ON VALUE REQUEST(POV).
ie.
process on value-request.
field P9611-REQ_STATUS module GET_REQ_STATUS.
and in Program Give the internal table Fieldname in Capital Letter while Passing in Fuctional Module.
like.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'REQ_STATUS2' "internal table field
dynpprog = sy-dynnr
dynpnr = sy-dynnr
dynprofield = 'P9611-REQ_STATUS' "screen field name
value_org = 'S'
TABLES
value_tab = req_status_tab "internal table
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
With Regards
Kesavaperumal -
Help required when using Function module F4_INT_TABLE_VALUE_REQUEST
Hi,
I wrote the logic as follows.
Select-options: s_lgart FOR pa0015-lgart.
SELECT lgart FROM t512z INTO TABLE it_temp WHERE infty = '0015' AND lgart IN rlgart.
IF NOT it_temp[] IS INITIAL.
SORT it_temp BY lgart.
DELETE ADJACENT DUPLICATES FROM it_temp COMPARING lgart.
LOOP AT it_temp.
SELECT SINGLE lgtxt FROM t512t INTO it_temp-description
WHERE lgart = it_temp-lgart AND
sprsl = 'EN'.
IF sy-subrc = 0.
MODIFY it_temp INDEX sy-tabix.
ENDIF.
ENDLOOP.
at present in internal table it_temp having following fields.
5100 Relolump sum
5111 SIP
my requirement is : when i press F4 help on wage type in selection screen i am able to see two fieexample:
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'VBELN'
DYNPPROG = W_PROGNAME
DYNPNR = W_SCR_NUM
DYNPROFIELD = 'KUNNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = INT_F4
RETURN_TAB = RETURN_VALUES
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3. -
Search help for SKAT-SAKNR OR SKAT-SAKNR is not working
Hi All,
I have created a Search Help for F4 in a dialog program for SKAT-SAKNR OR SKAT-SAKNR. While i click F4 on that field, it displays blank values.
Here is the module:
module HELP_FOR_SAPGL_ACC input.
CLEAR t_SAPGL.
SELECT SAKNR TXT20
FROM SKAT
INTO CORRESPONDING FIELDS OF TABLE t_SAPGL UP TO 1000 ROWS
WHERE SPRAS = SY-LANGU.
WHERE L_GL_ACC = v_FIELD_VALUE-FIELDVALUE.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'SAKNR'
PVALKEY = ' '
DYNPPROG = PROGNAME
DYNPNR = DYNNUM
DYNPROFIELD = 'SKA1-SKANR'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = t_SAPGL
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.
In the above code I am selecting 1000 rows from SKAT table and in the Search Help Popup it is also displaying 1000 rows but all are blank.
Please help me.
Regards,
AvaneetHi check my weblog on search help exit codeing..
https://wiki.sdn.sap.com/wiki/x/du0
\* Prepare for output
CALL FUNCTION 'F4UT_RESULTS_MAP'
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
source_tab = lt_result
CHANGING
shlp = shlp
callcontrol = callcontrol
EXCEPTIONS
illegal_structure = 1
OTHERS = 2.
IF rc = 0.
callcontrol-step = 'DISP'.
ELSE. -
F4IF_INT_TABLE_VALUE_REQUEST with Maximum Number of Hits.
Hi, all,
Currently i'm doing a customized F4 help for a selection-option filed on a report by using the function module 'F4IF_INT_TABLE_VALUE_REQUEST'. When i execute my report and go to the selection-option filed just now i created and press F4, i can see a list of data in my search help. However when i go to the tab 'Restrictions', i can't see the 'Maximum No. of Hits' option.
So anyone have any idea about this? or how to make the 'Maximum No. of Hits' box come out in my F4 help?
Thanks in advance.My full code :-
TABLES : BSIK , DDSHF4CTRL .
DATA: BEGIN OF T_ZUONR OCCURS 0,
ZUONR TYPE BSIK-ZUONR,
END OF T_ZUONR.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : ASGN_CK FOR BSIK-ZUONR.
SELECTION-SCREEN : END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR ASGN_CK-LOW.
SELECT ZUONR FROM BSIK INTO TABLE T_ZUONR.
SORT T_ZUONR BY ZUONR.
DELETE ADJACENT DUPLICATES FROM T_ZUONR.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'DYNR'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
VALUE_ORG = 'S'
CALLBACK_PROGRAM = SY-REPID
CALLBACK_FORM = 'F4CALLBACK'
TABLES
VALUE_TAB = T_ZUONR.
RETURN_TAB = T_ZUONR.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR ASGN_CK-HIGH.
SELECT ZUONR FROM BSIK INTO TABLE T_ZUONR.
SORT T_ZUONR BY ZUONR.
DELETE ADJACENT DUPLICATES FROM T_ZUONR.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'DYNR'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
VALUE_ORG = 'S'
CALLBACK_PROGRAM = SY-REPID
CALLBACK_FORM = 'F4CALLBACK'
TABLES
VALUE_TAB = T_ZUONR.
RETURN_TAB = T_ZUONR.
PERFORM F4CALLBACK.
*& Form F4CALLBACK
text
--> p1 text
<-- p2 text
FORM F4CALLBACK.
*TABLES RECORD_TAB STRUCTURE SEAHLPRES
*CHANGING SHLP TYPE SHLP_DESCR
CALLCONTROL LIKE DDSHF4CTRL.
DATA : SHLP TYPE SHLP_DESCR,
CALLCONTROL LIKE DDSHF4CTRL.
SHLP-INTDESCR-DIALOGTYPE = 'C'. " Dialog type ( Dialog with value restriction )
CALLCONTROL-NO_MAXDISP = '500'. " For getting Maximum no of hits tab
ENDFORM. " F4CALLBACK
*But it is not working, Please help. There is some problem with the Perform F4CALLBACK Module. Please help. -
F4IF_INT_TABLE_VALUE_REQUEST
Hi All,
I have 2 parameters on my selection screen for which i have given on value request help using fm F4IF_INT_TABLE_VALUE_REQUEST.
the 2 para are firstname and lastname.when the user press f4 help he can see both first name and last name.
my requirement is when he click on first name the last name paramters shl aslo get filled or when he chose for last name f4 help the first name shld get filled.
how can we achive this.
pls helpHi pawan,
here a short example how i do it:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FECOD.
REFRESH: T_QPK1CDTAB.
CALL FUNCTION 'QPK1_GP_CODE_SELECTION'
EXPORTING
I_KATALOGART = 'C'
I_CODEGRUPPE = P_FEGRP
I_CODE = '*'
I_SPRACHE = SY-LANGU
I_PICKUP_MODE = 'X'
TABLES
T_QPK1CDTAB = T_QPK1CDTAB
EXCEPTIONS
NO_MATCH_IN_RANGE = 1
NO_USER_SELECTION = 2
NO_AUTHORIZATION = 3
NO_SELECTION_SPECIFIED = 4
OBJECT_LOCKED = 5
LOCK_ERROR = 6
OBJECT_MISSING = 7
OTHERS = 8.
READ TABLE T_QPK1CDTAB INDEX 1.
<b> P_FEGRP = T_QPK1CDTAB-CODEGRUPPE.
P_FECOD = T_QPK1CDTAB-CODE.
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'.</b>*
I set both parameters in the F4. I have 2 F4-Forms for P_FEGRP and P_FECOD.
hope it helps.
Regards, Dieter -
F4IF_INT_TABLE_VALUE_REQUEST -Restrictions dialog box
Hi,
I am using the function module F4IF_INT_TABLE_VALUE_REQUEST in screens, to implement a search help in my program , but instead of directly displaying the hit list , i want the restrictions screen to be displayed first with some default values, and the list should be displayed only based on the valuies entered in thius restrictions screen. How can i do this using this function module.
To be more precise,
i need the restrictions dialog box to be displayed and this will have 6 fields. i have to pass values to 2 fields from my program, the first field need not be filled and teh remaining fields should be left for the user to enter.
how do i achieve this?
Please help.Check the sample code. Using the Event PROCEE ON VALUE-REQUEST we can get the F4 Help.
PROGRAM ztest_duplica.
DATA: kunnr1(10),
kunnr2(10).
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Module get_help INPUT
* text
MODULE get_help INPUT.
DATA:i_retab TYPE TABLE OF ddshretval,
wa_ret TYPE ddshretval.
TYPES: BEGIN OF x_itab,
kunnr TYPE kunnr, "it should be type to some standard data element
END OF x_itab.
FIELD-SYMBOLS: <fs> TYPE ANY.
CLEAR : kunnr1, kunnr2.
DATA: dynfield TYPE help_info-dynprofld,
wa_itab TYPE x_itab,
i_tab LIKE TABLE OF wa_itab WITH HEADER LINE.
CLEAR dynfield.
IF sy-dynnr = '0100'.
dynfield = 'KUNNR1'.
ELSE.
dynfield = 'KUNNR2'.
ENDIF.
SELECT kunnr FROM kna1
INTO TABLE i_tab
UP TO 20 ROWS.
"retfield we will pass the column name we are going to get from f4
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'KUNNR' "<---Return field column name
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = dynfield
value_org = 'S'
TABLES
value_tab = i_tab
return_tab = i_retab.
IF sy-subrc EQ 0.
READ TABLE i_retab INTO wa_ret INDEX 1.
ASSIGN (dynfield) TO <fs> .
<fs> = wa_ret-fieldval .
UNASSIGN <fs>.
ENDIF.
ENDMODULE. " get_help INPUT
Flow logic for 100 screen
screen consists of Input field pointing to KUNNR1
PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
process on value-request.
field kunnr1 module get_help.
Create a Tcode and Intitial screen 100. and check it .
Regards
Vijay Babu Dudla
Maybe you are looking for
-
Hi, i have a problem. I have modified a page made with dreamweaver4 with my new dreamweaver CS, and any links don't work in Internet Explorer! Only the e-mail button works correctly. The old pages continue to work correctly. Help me please! Thanks in
-
Adobe VBScript or COM API fails when Adobe application not already open on a certain machine
Was wondering if anybody might have input on this or observed this themselves. Is there a known issue/bug for this? I'm building scripted tooling to automate tasks in Adobe Illustrator and Photoshop, using the COM API (what Adobe lists as VBScript sc
-
PO Document type change & verson problem in one po
Hai Friends, U used change po document type after creation of po. now For one po i couldn't able to change. what could be the reason ? for that po verson also not coming please tell me
-
I have created quite a mess here, and am not sure what to do about it. I was looking for some photos that were in my iPhoto library and I saw a vault with the same name in Aperture, but none of the photos appeared. The previous versions of Aperture
-
Can I have multiple Oracle drivers installed?
I have a Windows 2000 machine that has Oracle 7.3 drivers installed for one application and now I have another app going on that has 8.01.07.00 of the Oracle driver. I have been having problems getting the new driver installed and then both apps runn