2009 May 05 7:45 PM
Hi,
I want to do as follows.
I have 2 parameters on selection screen P1 and P2.
If i hit F4 on P1 it brings value list with 2 columns. I want to fill parameter P1 with C1 value and P2 with C2 value when i select any row in the list. I am just wondering to know how it can be done using the following FM.
F4IF_INT_TABLE_VALUE_REQUEST. I appreciate your response.
Thanks
Raj
2009 May 05 7:50 PM
Hi,
I think you know everything........Better try at your end and come with the Problem.
Follow this
http://help.sap.com/saphelp_nw2004s/helpdata/EN/9f/dbaac935c111d1829f0000e829fbfe/content.htm
You would be writing your all code in the PAI
Hi
on selection of F4 help for P1, the value C1 and C2 will be stored in memory separated by space as shown below import from memory split record_tab at space into C1 and C2 , remove leading zeros from C2 and call FM-DYNP_VALUES_UPDATE preparing DYNPFIELDS as .....
fill fieldname as P2, field value as C2.
record_tab is a internal table.
IMPORT record_tab FROM MEMORY ID 'mcx_record_tab'.
Edited by: Lavanya K on May 6, 2009 7:27 AM
2009 May 05 7:50 PM
Hi,
I think you know everything........Better try at your end and come with the Problem.
Follow this
http://help.sap.com/saphelp_nw2004s/helpdata/EN/9f/dbaac935c111d1829f0000e829fbfe/content.htm
You would be writing your all code in the PAI
2009 May 05 9:50 PM
Hi,
Problem is i could able to pass only one value. ex C1 to P1 but not C2 to P2.
Thx for your response.
Raj
2009 May 06 6:20 AM
Hi
on selection of F4 help for P1, the value C1 and C2 will be stored in memory separated by space as shown below import from memory split record_tab at space into C1 and C2 , remove leading zeros from C2 and call FM-DYNP_VALUES_UPDATE preparing DYNPFIELDS as .....
fill fieldname as P2, field value as C2.
record_tab is a internal table.
IMPORT record_tab FROM MEMORY ID 'mcx_record_tab'.
Edited by: Lavanya K on May 6, 2009 7:27 AM
2009 May 06 6:22 AM
Hi,
Check this code...
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.
2009 May 06 6:15 AM
Hi,
Use the following code as per ur requirement. Give the select query according to ur requirement.
DATA: BEGIN OF INTTAB OCCURS 10,
CODE LIKE QPCT-CODE,
KURZTEXT LIKE QPCT-KURZTEXT,
END OF INTTAB.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR CODE-LOW.
SELECT CODE KURZTEXT FROM QPCT INTO TABLE INTTAB WHERE CODEGRUPPE = 'QCREMARK'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'CODE'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'CODE-LOW'
WINDOW_TITLE = 'Select Quality Remark Code'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = inttab
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
2009 May 06 6:46 AM
at selection-screen on value-request for p1.
perform f4_p1.
form f4_p1.
refresh it_p1.
select c1 from table
into corresponding fields of table it_p1.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'Ref field of P1 parameter'
dynpprog = sy-repid
dynpnr = '1000'
dynprofield = 'P1'
value_org = 'S'
tables
value_tab = it_p1.
endform.
Hope this helps.
Vidhi
2009 May 06 2:31 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |