Help on value request
Hi all,
can anyone help me out with the following code in finding F4 help for the fiscal year .
while executing it is going to dump. The problem I fing is with the value_org = 'S'.
thanks....
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_GJAHR.
SELECT DISTINCT GJAHR FROM COSS
INTO CORRESPONDING FIELDS OF TABLE LT_GJAHR
UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'GJAHR'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_GJAHR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = LT_GJAHR
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.
Check the decleration of LT_GJAHR.
Update: This works fine in my system... except its taking time to get the help..
REPORT zj_test LINE-SIZE 162.
PARAMETER: p_gjahr TYPE vbrk-gjahr.
DATA: BEGIN OF lt_gjahr OCCURS 0,
gjahr TYPE vbrk-gjahr,
END OF lt_gjahr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_gjahr.
SELECT DISTINCT gjahr FROM coss
INTO TABLE lt_gjahr
UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'GJAHR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_GJAHR'
value_org = 'S'
TABLES
value_tab = lt_gjahr
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
Similar Messages
-
Any Functions can I use Search Help on VALUE-REQUEST in PAI.
Hi~!! Experts.
I want to know some functions or methods of Search Help.
I have made a ZHxxxx Search Help in SE11.
And I applied a screen field by using screen painter.
But I want to fill up the other fields, using selected value.
So I made a Module under th PROCESS On VALUE-REQUEST.
unfortunately, I can't use no more The Search that I made.
I want to using the Search Help(ZHxxxx), and I want to fill up the other fields by using that's values.
I guess some F4 functions can use Search Help. Right?
Anyone know how to deal it. Please answer me,. The program Type is Module Pool program.Hi Insik,
Proceed as below :-
First of all declare the module below in the flow logic of your screen then create it in your main program.
You declare the module in the PROCESS ON VALUE-REQUEST.
PROCESS ON VALUE-REQUEST.
FIELD TXT_DOCNO MODULE VALUE_BELNR.
You also need to create an internal table where you wil store results of the select query fired below in the module.
Here you will get a F4 help on the filed Document Number(TXT_DOCNO) based on the field Company code (TXT_CODCO)
MODULE VALUE_BELNR INPUT.
progname = sy-repid.
dynnum = sy-dynnr.
CLEAR: field_value, dynpro_values.
field_value-fieldname = 'TXT_CODCO'.
APPEND field_value TO dynpro_values.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'BKPF'
fieldname = 'BUKRS'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'TXT_CODCO'.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
TABLES
dynpfields = dynpro_values.
READ TABLE dynpro_values INDEX 1 INTO field_value.
SELECT BUKRS BELNR
FROM BKPF
INTO CORRESPONDING FIELDS OF TABLE it_doc1
WHERE BUKRS = field_value-fieldvalue.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'BELNR'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'TXT_BELNR'
value_org = 'S'
TABLES
value_tab = it_doc1.
ENDMODULE. " VALUE_BELNR INPUT
Regards
Abhii -
F4 help needed in Process on value-request
Hi,
I have two fields on screen: region and its description in a dialog program. I want region description to be populated as soon as I select F4 help for region. Description field is output only . I want to do it using a module in Process On value-request. Field p_region MODULE GET_REGION_DESCRIPTION.
Using standard F4 help I can do it. If in my table I assign search help at field level for region. For example :
Search Help: ZREGION_SHLP. Selection method: ZREGION. Fields: Region and Description.
Table name : ZREGION.
i) 1st Fields: REGION , Data Element - ZREGN, Domain: ZZREGN ( CHAR2), Value table: ZREGN. Assign Search help at field level instead of data element level.
ii) 2nd Field: REGION_DESC, Data Element - BEZEI30.
in program: DATA: p_region like zregion-region. So if I press F4 help and select one region, description field gets populated.
I don't want to use standard functionality but want to write code in POV event. If I use F4IF_INT_TABLE_VLUE_REQUEST function module, I will get all the values associated with the field region. Since I don't know which region user has selected, i can't populate description. How to get the selected value in POV for that particular field. How can I get the value selected for region and then use DYNP_VALUES_UPDATE function module to update the description field. I tried search help exit event return to return the selected value. How to pass that value in POV module as you cannot use FORM ENDFORM . inside MODULE ENDMODULE.
Regards,
DPM1st step is:
choose screen 2000 for the program using t-code se80.
at the end of the coding enter the below code:
process ON VALUE-REQUEST.
FIELD screen field name module f4_zsearchhelp.
after typing the code double click on f4_zsearch help.
it ll ask for includes, Choose as main program.
then enter the below code after choosing:
DATA : t_dynpro_value TYPE TABLE OF dynpread,
v_field_value LIKE LINE OF t_dynpro_value,
lt_fields TYPE TABLE OF dfies,
t_return_str TYPE TABLE OF ddshretval,
w_return_str TYPE ddshretval,
v_text TYPE char25.
DATA: t_ty_prov_id TYPE STANDARD TABLE OF ty_prov_id,
w_ty_prov_id TYPE ty_prov_id.
CLEAR: t_ty_prov_id], w_ty_prov_id, t_return_str[, w_return_str.
enter the select query from the description table to get the description for the particular code.
in this i had mentioned with an example that i m getting description for massg :
p9001-massg ll have the value and v_text ll have the description.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'TY_TAB'
retfield = 'MASSG'------>returning field
PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P9001-ZMASSG'----
> pass the screen field name
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ''
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = t_ty_prov_id
field_tab = lt_fields
return_tab = t_return_str
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.
READ TABLE t_return_str INTO w_return_str WITH KEY retfield = 'P9001-ZMASSG'.
IF sy-subrc IS INITIAL.
READ TABLE t_ty_prov_id INTO w_ty_prov_id WITH KEY zmassg_desc = w_return_str-fieldval.
IF sy-subrc eq 0.
DATA: et_desc(20) TYPE c.
et_desc = w_ty_agrtx-v_gtext.
MODIFY SCREEN.
CLEAR : v_field_value,t_dynpro_value[].
v_field_value-fieldname = 'P9001-ZMASSG'.
v_field_value-fieldvalue = w_ty_prov_id-action_resn.
APPEND v_field_value TO t_dynpro_value .
CLEAR : v_field_value.
v_field_value-fieldname = 'V_TEXT'.
v_field_value-fieldvalue = w_ty_prov_id-zmassg_desc.
APPEND v_field_value TO t_dynpro_value .
CLEAR : v_field_value.
ENDIF .
ENDIF.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = t_dynpro_value
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
you can add the v_text in layput .
hope it ll satisfy your requirement. -
I want parameters with f4 help for program names in value request
I want parameters with f4 help for program names in value request
points will be awarded if usefullv_name1 TYPE name1, "Vendor Name
CALL FUNCTION 'POPUP_TO_SEARCH_VALUE'
EXPORTING
textline1 = 'Vendor Name'(f09)
titel = 'Enter'(f17)
valuelength = 35
IMPORTING
value = lv_name1.
try this out .. -
dear all ,
i am using the code .
data : begin of i_bidst OCCURS 0,
bidstd(10) type c , ( DEFINED BY ME)
bidst like zvesim-bidst, ( DATA DICTIONARY FIELD)
end of i_bidst.
i_bidst-bidst = 'A'.
i_bidst-bidstd = 'APPROVED'.
append i_bidst.
i_bidst-bidst = 'R'.
i_bidst-bidstd = 'REJECTED'.
append i_bidst.
i_bidst-bidst = 'S'.
i_bidst-bidstd = 'SUBMITTED'.
append i_bidst.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BIDST.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'BIDST'
DYNPROFIELD = 'P_BIDST'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
VALUE_ORG = 'S'
TABLES
VALUE_TAB = I_BIDST.
the internal table consists of data what i had appended.
I want to know how display both the fields on value request but the selection field is DICTONARY field only For Description only I am using the user defined field.
regards,
balaji.parameters: p_bukrs(4) type c,
p_butxt(50) type c.
data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.
at selection-screen on value-request for p_bukrs.
call function 'F4IF_FIELD_VALUE_REQUEST'
exporting
tabname = 'T001'
fieldname = 'BUKRS'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_BUKRS'
tables
return_tab = return
exceptions
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
others = 5.
read table return with key fieldname = 'P_BUKRS'.
* Add it back to the dynpro.
dynfields-fieldname = return-retfield.
dynfields-fieldvalue = return-fieldval.
append dynfields.
* Get the company code from db and add to dynpro
dynfields-fieldname = 'P_BUTXT'.
select single butxt into dynfields-fieldvalue
from t001
where bukrs = return-fieldval.
append dynfields.
* Update the dynpro values.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = dynfields
exceptions
others = 8.
start-of-selection.
Refer this too
F4IF_INT_TABLE_VALUE_REQUEST
This FM is used to dsiplay values stored in an internal table as input
help.This FM is used to program our own custom help if no such input help
exists in ABAP dictionary for a particular field. The parameter VALUE_TAB is used to pass the internal table containing input values.The parameter RETFIELD
is used to specify the internal table field whose value will be returned to the screen field or RETURN_TAB.
If DYNPNR,DYNPPROG and DYNPROFIELD are specified than the user selection is passed to the screen field specified in the DYNPROFIELD. If RETURN_TAB is specified the selectionis returned in a table.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = field from int table whose value will be returned
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'screen field'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = internal table whose values will be shown.
RETURN_TAB = internal table of type DDSHRETVAL
EXCEPTIONS
parameter_error = 1
no_values_found = 2
others = 3.
Refer if this helsp.
http://sap.niraj.tripod.com/id27.html -
How to use F4 help in screens(Process on Value-request) ?
Hi experts,
Can someone provide me some code which uses Process on Value-request in dialog programming? I have a requirement of entering a path on a modal dialog box that i have designed and i need to attach the f4_filename function module to it ?Please help...
Thanks in advance,
regards
Ashwin.Hi Ashwin,
Can use the function module HELP_VALUES_GET_NO_DD_NAME.
Here is the sample code that can help you using this for F4 help.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_field-low.
PERFORM F4_HELP.
*& Form F4_HELP
FORM F4_HELP .
CLEAR : I_FIELDS1,I_CONTENTS1.
REFRESH : I_FIELDS1,I_CONTENTS1.
I_FIELDS1-TABNAME = 'YHPA0TPROJ'.
I_FIELDS1-FIELDNAME = 'YHPPROJ'.
I_FIELDS1-SELECTFLAG = 'X'.
APPEND I_FIELDS1.
CLEAR I_FIELDS1.
I_FIELDS1-TABNAME = 'YHPA0TPROJ'.
I_FIELDS1-FIELDNAME = 'YHPPDES'.
I_FIELDS1-SELECTFLAG = ' '.
APPEND I_FIELDS1.
CLEAR I_FIELDS1.
SELECT YHPPROJ
YHPPDES
FROM YHPA0TPROJ
INTO TABLE I_CONTENTS1.
IF NOT I_CONTENTS1[] IS INITIAL.
CALL FUNCTION 'HELP_VALUES_GET_NO_DD_NAME'
EXPORTING
SELECTFIELD = 'YHPPROJ'
IMPORTING
IND = V_IND1
TABLES
FIELDS = I_FIELDS1
FULL_TABLE = I_CONTENTS1
EXCEPTIONS
FULL_TABLE_EMPTY = 1
NO_TABLESTRUCTURE_GIVEN = 2
NO_TABLEFIELDS_IN_DICTIONARY = 3
MORE_THEN_ONE_SELECTFIELD = 4
NO_SELECTFIELD = 5
OTHERS = 6.
IF SY-SUBRC EQ 0.
READ TABLE I_CONTENTS1 INDEX V_IND1.
P_PROJ = I_CONTENTS1-YHPPROJ.
P_YHPDES = I_CONTENTS1-YHPPDES.
ENDIF.
ELSE.
MESSAGE I000(YHPA0K) WITH 'No projects available'.
MESSAGE I519(YHPA0K). " No projects available
EXIT.
ENDIF.
ENDFORM.
Hope this helps you.
Regards,
Saumya -
Process on Help request and Process on value request events examples
HI All,
Can anybody please give me some examples of Process on Help request and Process on value request events.
Thanks in advanceHI,
Check programs
<b>demo_selection_screen_f1</b>.
<b>demo_selection_screen_f4.</b>
Regards,
Sesh -
Process On Value Request with Search Help Problem
I have a screen with a field that has a custom search help attached to it. I am using Process On Value-Request which ultimately uses function module F4IF_FIELD_VALUE_REQUEST to return the selected value from the search help. The value is then moved to the screen field.
THE PROBLEM: If I enter a value in a field on the screen, then use the search help from a different field the first value I entered gets cleared. Here is a code sample. Any suggestions as to why this is happening?
NOTE: The values that get cleared are fields on the screen that I do not reference at all in user_command_2501.
*****SCREEN 2500 FLOW LOGIC*********
PROCESS BEFORE OUTPUT.
MODULE status_2500.
PROCESS AFTER INPUT.
MODULE user_command_2500.
PROCESS ON VALUE-REQUEST.
FIELD makt-matnr MODULE user_command_2501.
MODULE user_command_2501 INPUT.
ok_code = sy-ucomm.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
searchhelp = 'ZWS_ASSETMATR'
fieldname = ' '
tabname = ' '
TABLES
return_tab = search_itab
EXCEPTIONS
no_values_found = 1.
MOVE search_itab-fieldval TO: makt-matnr.
REFRESH search_itab.
SELECT SINGLE maktg FROM makt INTO crea_description
WHERE matnr = search_itab-fieldval.
MOVE 'I' TO scrn_attr_sw.
sy-ucomm = 'ENTER'.
LEAVE SCREEN.
CALL SCREEN 2500.
ENDMODULE. " user_command_2501 INPUT
Message was edited by: Jason DeLuca
Message was edited by: Jason DeLucaHi Jason
It seems you should first revise your code since your POV is not implemented so good.
Regards
*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a> -
Help on PROCESS ON VALUE-REQUEST
Is it possible for getting values into mulitple fields based on the selection made with in a PROCESS ON VALUE-REQUEST Block.
In the F4 based on POV there are 4 fields, when the user select any one is it possible to get the other 3 into respective fields?hi saji
Thats very much possible if you just want to populate any of the possible values in the fields.
Write a piece of code which selects the other field values apart form the one you enter in the at selection-screen output event.
for Example if the field entered is matnr for suppose then you can write a select single for other fields say plant and storage location in this event so these fields automatically gets populated once you hit the enter key as this event acts as a PBO for selection screen.
I hope I have made things clear. if any do ask me, I can answer the same.
Regards
Santosh -
Error During Creation of Table Value Request /Simple Value Request Express
Hi,
I am on SAP CRM ABAP 7.0 with enhancement pack 2.0.
The requirement is to create a decision table which would have value(search helps) requests for some of the condition columns in it. For example, Value Request for condition column Y would come according to condition column X . As per my understanding,this could only be achieved by maintaining foreign key relationship. So I tried to create a Table Value Request which I could assign in the domain values in the data object of the corresponding condition column.
But,when I am trying to create a Table Value Request or Simple Value Request in BRF+ application, it is throwing an error message "Table FDT_EXPR_1950S is not part of the Customizing object FDT0001 T".
Could you please help me out !!Hi Carsten,
Thanks for your quick response.
Just wondering whether or not I can achieve the requirement without Table Value Request. Do you have any idea on this? -
How to get parameter value from report in event of value-request?
Hi everyone,
The customer want to use particular F4 help on report, but some input value before press enter key are not used in event of "at selection-screen on value-request for xxx", How to get parameter value in this event?
many thanks!
JackYou probably want to look at function module DYNP_VALUES_READ to allow you to read the values of the other screen fields during the F4 event... below is a simple demo of this - when you press F4 the value from the p_field is read and returned in the p_desc field.
Jonathan
report zlocal_jc_sdn_f4_value_read.
parameters:
p_field(10) type c obligatory, "field with F4
p_desc(40) type c lower case.
at selection-screen output.
perform lock_p_desc_field.
at selection-screen on value-request for p_field.
perform f4_field.
*& Form f4_field
form f4_field.
*" Quick demo custom pick list...
data:
l_desc like p_desc,
l_dyname like d020s-prog,
l_dynumb like d020s-dnum,
ls_dynpfields like dynpread,
lt_dynpfields like dynpread occurs 10.
l_dynumb = sy-dynnr.
l_dyname = sy-repid.
*" Read screen value of P_FIELD
ls_dynpfields-fieldname = 'P_FIELD'.
append ls_dynpfields to lt_dynpfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = l_dyname
dynumb = l_dynumb
tables
dynpfields = lt_dynpfields
exceptions
others = 1.
check sy-subrc is initial.
*" See what user typed in P_FIELD:
read table lt_dynpfields into ls_dynpfields
with key fieldname = 'P_FIELD'.
*" normally you would then build your own search list
*" based on value of P_FIELD and call F4IF_INT_TABLE_VALUE_REQUEST
*" but this is just a demo of writing back to the screen...
*" so just put the value from p_field into P_DESC plus some text...
concatenate 'This is a description for' ls_dynpfields-fieldvalue
into l_desc separated by space.
*" Pop a variable value back into screen
clear: ls_dynpfields.
ls_dynpfields-fieldname = 'P_DESC'.
ls_dynpfields-fieldvalue = l_desc.
append ls_dynpfields to lt_dynpfields.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = l_dyname
dynumb = l_dynumb
tables
dynpfields = lt_dynpfields
exceptions
others = 0.
endform. "f4_field
*& Form lock_p_desc_field
form lock_p_desc_field.
*" Make P_DESC into a display field
loop at screen.
if screen-name = 'P_DESC'.
screen-input = '0'.
modify screen.
exit.
endif.
endloop.
endform. "lock_p_desc_field -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR not input value in input field
Dear All,
I make search help for field ARBPL in selection screen are not excepted selected value.
Code is
SELECT-OPTIONS: p_arbpl FOR zdmde-arbpl MODIF ID two.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl-low.
REFRESH sh_arbpl.
SELECT * from crhd into CORRESPONDING FIELDS OF TABLE sh_arbpl.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'P_ARBPL'
DYNPROFIELD = 'P_ARBPL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = sh_arbpl.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl-high.
REFRESH sh_arbpl.
SELECT * from crhd into CORRESPONDING FIELDS OF TABLE sh_arbpl.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'P_ARBPL'
DYNPROFIELD = 'P_ARBPL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = sh_arbpl.
Please tell how to input selected field from search help into input field in both low and high.
Would appreciate your reply .
Regards,
PoojaHi Pooja,
For getting the response back from the user selection , please get the return code too. Before that instead of directly using the table crhd structure.. please do create a type declaration of that table , make sure that the field that you wanted to get using search help be specified at last of declaration type like this
TYPES: BEGIN OF ty,
OBJTY TYPE CR_OBJTY,
ARBPL TYPE ARBPL,
END OF ty.
this is because the return parameter t_rtn will holds the last value of type which been selected by user.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'P_ARBPL'
DYNPROFIELD = 'P_ARBPL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = sh_arbpl
return_tab = t_rtn.
LOOP AT t_rtn INTO x_rtn .
ENDLOOP.
try executing this code.
TABLES crhd.
TYPES: BEGIN OF ty,
OBJTY TYPE CR_OBJTY,
ARBPL TYPE ARBPL,
END OF ty.
DATA: sh_arbpl TYPE TABLE OF ty.
DATA: dynpfields TYPE TABLE OF DYNPREAD,
x_dynpfields TYPE dynpread,
t_rtn TYPE STANDARD TABLE OF DDSHRETVAL ,
x_rtn TYPE DDSHRETVAL.
SELECT-OPTIONS: p_arbpl FOR crhd-ARBPL MODIF ID two.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl-low.
REFRESH sh_arbpl.
SELECT * from crhd into CORRESPONDING FIELDS OF TABLE sh_arbpl WHERE werks eq '1000'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'P_ARBPL'
DYNPROFIELD = 'P_ARBPL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = sh_arbpl
return_tab = t_rtn.
LOOP AT t_rtn INTO x_rtn .
ENDLOOP.
x_dynpfields-fieldname = 'P_ARBPL-LOW' .
x_dynpfields-fieldvalue = x_rtn-fieldval.
APPEND x_dynpfields TO dynpfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dynpfields
* EXCEPTIONS
* INVALID_ABAPWORKAREA = 1
* INVALID_DYNPROFIELD = 2
* INVALID_DYNPRONAME = 3
* INVALID_DYNPRONUMMER = 4
* INVALID_REQUEST = 5
* NO_FIELDDESCRIPTION = 6
* UNDEFIND_ERROR = 7
* OTHERS = 8
Regards,
Sivaganesh -
AT SELECTION SCREEN OUTPUT ON VALUE REQUESt problem
hi I am fetching the values into second field based on first field by reading them like this
<b>
AT SELECTION-SCREEN ON VALUE-REQUEST FOR ST_NAME.
CLEAR: FIELD_VALUE, DYNPRO_VALUES.
REFRESH DYNPRO_VALUES.
FIELD_VALUE-FIELDNAME = 'EXCH'.
APPEND FIELD_VALUE TO DYNPRO_VALUES.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = DYNPRO_VALUES.
READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.
IF FIELD_VALUE-FIELDVALUE IS NOT INITIAL.
IF SY-SUBRC = 0 AND FIELD_VALUE-FIELDVALUE = 1.
FIELD_VALUE-FIELDVALUE = 'BSE'.
ELSEIF SY-SUBRC = 0 AND FIELD_VALUE-FIELDVALUE = 2.
FIELD_VALUE-FIELDVALUE = 'NSE'.
ENDIF.
SELECT STOCK ST_NAME
FROM
ZEXCH
INTO TABLE TEMP_ITAB
WHERE EXCH = FIELD_VALUE-FIELDVALUE.
IF SY-SUBRC = 0.
FLAG = 'X'.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'ST_NAME'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'ST_NAME'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = TEMP_ITAB.
ENDIF.
</b>
This is working fine, now my requirement is to fetch a value into 3rd field from database table when the user selects a value through 'F4IF_INT_TABLE_VALUE_REQUEST'
Please help me with this, hope u got my problem, i want to know how to continue and fill value into third field after filling the field ST_NAME
points guaranteedHi,
If you have two parameters, you want to display values(f4) in parameter 2
depending on the values entered in parameter 1.
REPORT Z_SRI_HELP_VALUE_FOR_TABLES .
tables tcurt.
DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
PARAMETERS: P_WAERS LIKE TCURT-WAERS, "Currency
P_LTEXT LIKE TCURT-LTEXT, "Long Text
P_KTEXT LIKE TCURT-KTEXT. "Short Text
*--- Example of updating value of another field on the screen -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.
CLEAR: DYFIELDS[], DYFIELDS.
*--- select currency
CALL FUNCTION 'HELP_VALUES_GET'
EXPORTING
fieldname = 'WAERS'
tabname = 'TCURT'
IMPORTING
SELECT_VALUE = P_WAERS.
*--- get long text for the selected currency
SELECT SINGLE LTEXT FROM TCURT
INTO DYFIELDS-FIELDVALUE
WHERE SPRAS = SY-LANGU
AND WAERS = P_WAERS.
IF SY-SUBRC <> 0.
CLEAR DYFIELDS-FIELDVALUE.
ENDIF.
*--- update another field
DYFIELDS-FIELDNAME = 'P_LTEXT'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
tables
dynpfields = DYFIELDS .
*--- Example of reading value of another field -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KTEXT.
*--- read another field
CLEAR: DYFIELDS[], DYFIELDS.
DYFIELDS-FIELDNAME = 'P_WAERS'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYFIELDS .
READ TABLE DYFIELDS INDEX 1.
*--- get short text and update current field
SELECT SINGLE KTEXT FROM TCURT
INTO P_KTEXT
WHERE SPRAS EQ SY-LANGU
AND WAERS EQ DYFIELDS-FIELDVALUE.
How to add F4 functionality to a paramter variable? Say P_name ie Parameters: P_name like dbtab-fieldname
in At selection-screen on value-request for p_name. How should I add the values john, abraham, linga etc so that these values appear when f4 is pressed on the field in the selection screen?
PARAMETERS: p_name(10).
DATA: BEGIN OF value_tab OCCURS 0,
name(10),
END OF value_tab.
DATA :field_tab LIKE dfies OCCURS 0 WITH HEADER LINE.
DATA : return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE. DATA : x TYPE string.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
REFRESH value_tab[].
REFRESH field_tab[].
REFRESH return_tab[].
field_tab-fieldname = 'ERNAM'.
field_tab-tabname = 'VBAK'.
APPEND field_tab.
value_tab-name = 'John'.
APPEND value_tab.
value_tab-name = 'Abraham'.
APPEND value_tab.
value_tab-name = 'Lingam'.
APPEND value_tab.
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
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
p_name = return_tab-fieldval.
ENDIF.
Regards
Sudheer -
Setting multiple parameters in "ON VALUE-REQUEST FOR"
Hello experts,
I have a dynpro with two parameters on it, called PA_LABKY and PA_LABTX. The first field PA_LABKY is extended by a value help (see the code below). Normally when a user chooses a value from f4 help the field is filled with the value. That works correct. Now not the first but both fields PA_LABKY and PA_LABTX should be filled when the user chooses a value from f4 help.
I tried it with following code:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_labky.
get the values from database
SELECT * FROM zrec_001t INTO TABLE lt_rec001t.
set the first output field
CLEAR ls_dynfieldmap.
ls_dynfieldmap-fldname = 'LABKY'.
ls_dynfieldmap-dyfldname = 'PA_LABKY'.
APPEND ls_dynfieldmap TO lt_dynfieldmap.
set the second output field
CLEAR ls_dynfieldmap.
ls_dynfieldmap-fldname = 'LABTX'.
ls_dynfieldmap-dyfldname = 'PA_LABTX'.
APPEND ls_dynfieldmap TO lt_dynfieldmap.
display the f4 help
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
ddic_structure = 'ZREC_001T'
retfield = 'LABKY'
value_org = 'S'
TABLES
value_tab = lt_rec001t
return_tab = lt_returntab
dynpfld_mapping = lt_dynfieldmap
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
the first row contains the value for PA_LABKY
READ TABLE lt_returntab INDEX 1 INTO ls_returntab.
set the value on the dynpro
pa_labky = ls_returntab-fieldval.
the second row contains the value for PA_LABTX
READ TABLE lt_returntab INDEX 2 INTO ls_returntab.
set the value on the dynpro
move ls_returntab-fieldval to pa_labtx. " <--- NOW THAT DOESN'T WORK
It's the last row that doesn't work, it nothing happens with this field. How can I fill that field?
Thanks in advance.
DanielIn order to set the second field you must use the function module DYNP_VALUES_UPDATE. Replace that last statement with a call to this function module, you must pass the parameter name and the value.
Regards,
RIch Heilman
Correct function module name
Message was edited by:
Rich Heilman -
At selection-screen on value-request
Hi experts,
Pls see the below code.
When ever plant is enterd in screen i have to get material no. and material group based on that plant dynamically.
I am getting F4 list of values for the first one.But For the second one i am not getting.
What may be teh problem?
*& Report ZRA_SELECTIONSCTREEN *
REPORT ZRA_SELECTIONSCTREEN .
tables: mara,marc.
parameters: p_werks like marc-werks,
p_matnr like marC-matnr,
p_matkl like mara-matkl.
data: begin of it_matnr occurs 0,
matnr like mara-matnr,
end of it_matnr.
data: begin of it_matkl occurs 0,
matkl like mara-matkl,
end of it_matkl.
at selection-screen on value-request for p_matnr.
select matnr into table it_matnr from marc where werks = p_werks.
if not it_matnr[] is initial.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MATNR'
PVALKEY = ' '
DYNPPROG = SY-CPROG
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 = it_matnr
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.
ENDIF.
select matkl from mara into table it_matkl for all entries IN it_matnr
WHERE MATNR = IT_MATNR-MATNR.
if not it_matkl[] is INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MATKL'
PVALKEY = ' '
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'p_matkl'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_MATKL
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.
ENDIF.
Regards
Ravi.hi
good
i tried your report, f4 help is coming for all the fields but dynamic field selection is ot coming because ther eis a prob with your select statment,
you select the data from the database table for the another two fields as the value you r entering for werks(plant).
thanks
mrutyun^
Maybe you are looking for
-
IPod 3g works with usb, not through firewire
Hello everybody. That's a long time the problem happened, but now it gives me a big trouble because I can't change music on my iPod 3G 10go. In fact, iPod was recognized through firewire by my iMac G3 until I installed Tiger. But charging is OK. Afte
-
hello Gurus, I have assigned action profile to a trnasaction type and assigned a action that should sent the same SMS details to same Business partner.But this doesnt work is same busines partner is used. Do I need to do any extra settings. cheers
-
Grant a user the permission to view only specified objects
Hi all, I want a such user to connect to my SQL Server 2008R2 instance but I wish that: 1) it can't view all database listed, I want that it can see only the database it has the permission 2) it can see only some object in the list for example I want
-
Can't access music store, Help!
Hi, I'm running windows XP, Service Pack 2. I've updated my itunes software to 5.01.4 Every time I click on the iTunes music store I get a windows error: "iTunes has encountered a problem and needs to close. We are sorry for the inconvenience" What s
-
Hi All I am implementing SAP Note 1337240. In which I need to run report RSTXSCRP and enter parameters , radio button FORM, object name HR_GB_P11D_2009 mode IMPORT form/on front end C:\temp\HR_GB_P11D_2009.txt but when I try to exectue it, it ask to