‎2009 Jan 01 7:02 AM
Hello,
I have created a F$ serach help for a filed of a tbale on a selection screen using the FM F4IF_INT_TABLE_VALUE_REQUEST ,everything is working fine but now my doubt is,
If I want to add more values to this filed thorugh the search help, means when I press F4 on the textbox presetn on the screen it should ask me the name of the table or value to enetr and when I enter the value it automaticcaly append the data in the table from where search help redaing the data.
Can I do it this way or I have to add the values in the table through SM30 or SE16 only to finally reflect back the values at time of PROCESS_ON_VALUE REQUEST EVENT.
Hope to get an answer quickly.
Pooja
search before posting and use meaningful subject
Edited by: Vijay Babu Dudla on Jan 2, 2009 4:18 AM
‎2009 Jan 01 7:13 AM
Dear Pooja
i think its not possible,
if you want to add data to the your search help table you have to make another separate program part for that.
‎2009 Jan 01 7:33 AM
Hello Nelson,
Can you elaborate your answer with the help of sample code or something.
Pooja
Edited by: Pooja Gupta on Jan 1, 2009 8:34 AM
‎2009 Jan 01 8:02 AM
pooja,
please try this code. u can always append new values to internal table to get f4 help
tables: ekko.
data: begin of itab occurs 0,
ekgrp like t024-ekgrp,
eknam like t024-eknam,
end of itab.
data: v1 like DFIES-FIELDNAME.
CONSTANTS: c_s_parnr LIKE help_info-dynprofld VALUE 'S_EKGRP-LOW',
c_s_parnr_high LIKE help_info-dynprofld VALUE 'S_EKGRP-HIGH'.
SELECT-OPTIONS: S_EKGRP FOR EKKO-EKGRP OBLIGATORY.
*PARAMETERS: V_EKGRP LIKE T024-EKGRP.
V1 = 'EKGRP'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_EKGRP-LOW.
Values to be appended into the Internal table
itab-ekgrp = 'P01'.
itab-eknam = 'CORP'.
append itab.
clear itab.
itab-ekgrp = 'P02'.
itab-eknam = 'MFG'.
append itab.
clear itab.
SORT itab BY ekgrp ASCENDING.
DELETE ADJACENT DUPLICATES FROM itab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = v1
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = c_s_parnr
window_title = 'Search help'
value_org = 'S'
TABLES
value_tab = itab
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 S_EKGRP-HIGH.
Values to be appended into the Internal table
itab-ekgrp = 'p01'.
itab-eknam = 'corp'.
append itab.
clear itab.
itab-ekgrp = 'p02'.
itab-eknam = 'mfg'.
append itab.
clear itab.
SORT itab BY ekgrp ASCENDING.
DELETE ADJACENT DUPLICATES FROM itab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = v1
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = c_s_parnr_high
window_title = 'Search help'
value_org = 'S'
TABLES
value_tab = itab
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.
‎2009 Jan 01 7:14 AM
you have to add the values in the table through SM30 or SE16.
or design a screen where you can add new entries and save to table.
‎2009 Jan 01 9:03 AM
hi, Pooja Gupta
i think that following code will help you out.
at selection-screen on value-request for sorsmid-low.
types: begin of t_sh_rsmid,
rsmid like zsdo-rsmid,
ename like pa0001-ename,
end of t_sh_rsmid.
data: it_sh_rsmid type standard table of t_sh_rsmid with header line.
select distinct zsdo~rsmid pa0001~ename
into corresponding fields of table it_sh_rsmid
from zsdo left outer join pa0001 on ( zsdo~rsmid = pa0001~pernr and pa0001~endda = '99991231' )
where zsdo~kunnr in sokunnr.
delete it_sh_rsmid where rsmid = '00000000'.
sort it_sh_rsmid by rsmid.
" here Before calling the FM you can append some more values to your internal table "IT_SH_RSMID".
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'RSMID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'rsmid'
value_org = c
tables
value_tab = it_sh_rsmid
return_tab = i_return.replay if any problem,
Kind Regards,
Faisal
‎2009 Jan 01 9:30 AM
Thanks Krishna and Faisal but still my question is unanswered, I want to append the itab at run time as user might not know latter how to write an ABAP program to append the value in the itab,and in both of the code provided we are appending the itab before calling the f4 help. Is there any way we can do it or this is the only way to append into itab.
Pooja
‎2009 Jan 01 4:54 PM
Hi U ill be using at selection-screen event and
code for a POP up to ask the user to enter the table name.. use that table and write a select and fetch data.. and append to the table before passing to F4IF_INT_TABLE_VALUE_REQUEST..FM
if in the pop up user hits X or close .. you need to go with ur usual process.. plan some thing like this... its possible.... sample code is not available you got to figure out with this inputs...
‎2009 Jan 02 9:26 AM
Hi
Please check the following Import parameters of the FM
CALLBACK_PROGRAM
CALLBACK_FORM
Read the Corresponding documentation about how to use it and check if suits your requirement.
Regards,
Arun
‎2009 Jan 02 9:52 AM
Hi,
Below code will may help you out.
SELECT SETNAME DESCRIPT INTO CORRESPONDING FIELDS OF TABLE IT_GRUOP FROM
SCTHEADERT WHERE SET CLASS = 'Q106' SUBCLASS = 'SETS'.
LOOP AT IT_GOPUP.
VALUETAB = IT_GROPU-SETNAME.
APPEND VALUETAB.
ENDLOOP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'SETNAME'
DYNPROG = 'ZF1R0052' (PROGAME NAME)
DYNPNR = 1000
DYNPROFIELD = 'P_GROUP' (FIELD NAME)
WINDOW-TITLE = 'ALLOED VALUES'
TABLES
VALUE_TAB = VALUETAB.
FIELD_TAB = LV_FIELDTAB.
EXCEPTIONS.
Regards
Md.MahaboobKhan