On-value request and cl_abap_structdescr
Hi,
I want to use on-value request to get the field names of a table, but I can't make it work.
I already tried finding a solution on the forum but without success.
This is my code:
DATA:
lt_order TYPE TABLE OF crmd_orderadm_h,
g_container TYPE scrfname VALUE 'G_CONTAINER',
g_filter TYPE string,
g_custom_container TYPE REF TO cl_gui_custom_container,
g_grid TYPE REF TO cl_gui_alv_grid,
ls_variant TYPE disvariant,
lv_select TYPE string,
lr_struct TYPE REF TO cl_abap_structdescr,
lt_tab TYPE ddfields.
SELECTION-SCREEN BEGIN OF BLOCK sel1 WITH FRAME TITLE text-123.
PARAMETERS:
p_number TYPE i,
p_fname TYPE string,
p_varian TYPE c AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK sel1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
CALL METHOD lr_struct->get_ddic_field_list
EXPORTING
p_langu = SY-LANGU
p_including_substructres = ABAP_FALSE
receiving
p_field_list = lt_tab
EXCEPTIONS
not_found = 1
no_ddic_type = 2
others = 3
If u run my program and press F4 I get the following error:
Runtime Errors OBJECTS_OBJREF_NOT_ASSIGNED
Except. CX_SY_REF_IS_INITIAL
Short text
Access via 'NULL' object reference not possible.
This is where it goes wrong: CALL METHOD lr_struct->get_ddic_field_list
What do i need to do with lr_struct before the method call?
Edited by: Kevv00 on Sep 20, 2011 4:11 PM
lr_struct ?= CL_ABAP_STRUCTDESCR=>describe_by_name( p_name = 'crmd_orderadm_h' ).
thanks, but I'm still missing something because it doesn't do anything now.. when I click it twice I get this in the status bar: 'Function code cannot be selected'
Could you also explain the method DESCRIBE_BY_NAME please? I tried the description but I don't understand what it actually does.
Maybe I misplaced the at selection screen code? This is my whole program:
DATA:
lt_order TYPE TABLE OF crmd_orderadm_h,
g_container TYPE scrfname VALUE 'G_CONTAINER',
g_filter TYPE string,
g_custom_container TYPE REF TO cl_gui_custom_container,
g_grid TYPE REF TO cl_gui_alv_grid,
ls_variant TYPE disvariant,
lv_select TYPE string,
lr_struct TYPE REF TO cl_abap_structdescr,
lt_tab TYPE ddfields.
SELECTION-SCREEN BEGIN OF BLOCK sel1 WITH FRAME TITLE text-123.
PARAMETERS:
p_number TYPE i,
p_fname TYPE string,
p_varian TYPE c AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK sel1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
lr_struct ?= CL_ABAP_STRUCTDESCR=>describe_by_name( p_name = 'crmd_orderadm_h' ).
CALL METHOD lr_struct->get_ddic_field_list
EXPORTING
p_langu = SY-LANGU
p_including_substructres = ABAP_FALSE
receiving
p_field_list = lt_tab
EXCEPTIONS
not_found = 1
no_ddic_type = 2
others = 3
FORM subr_select.
CONCATENATE '%' g_filter '%' INTO lv_select.
SELECT (p_fname)
FROM crmd_orderadm_h
INTO CORRESPONDING FIELDS OF TABLE lt_order
UP TO p_number ROWS
WHERE description LIKE lv_select.
ENDFORM. "subr_select
START-OF-SELECTION.
PERFORM subr_select.
IF p_varian = 'X'.
ls_variant-variant = '/ZSTD8'.
ENDIF.
IF g_grid IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING
container_name = g_container.
CREATE OBJECT g_grid
EXPORTING
i_parent = g_custom_container.
ls_variant-report = sy-cprog.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'CRMD_ORDERADM_H'
is_variant = ls_variant
i_save = 'A'
CHANGING
it_outtab = lt_order
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
ELSE.
CALL METHOD g_grid->refresh_table_display
* EXPORTING
* is_stable =
* i_soft_refresh =
EXCEPTIONS
finished = 1
OTHERS = 2
ENDIF.
CALL SCREEN 100.
INCLUDE zst08_alv_ex1_status_0100o02.
INCLUDE zst08_alv_ex1_user_command_i01.
Similar Messages
-
PAI process on value-request.
Hi
In PAI of one of the screens I have module that has to be triggered on value request and show table with possible entries for that screen field (lbl_printer) .
When transaction is executed the module is not called when i hit icon close to input field (lbl_printer)so I cannot get entry help. I set up break point in the module but I didn't get in to module " request printer". It looks like program do not recognize this module at all.
Please advice .
Krsto
process after input.
module user_command_0105.
process on value-request.
field lbl_printer module request_printer.FIELD dynp_field MODULE mod [ {ON INPUT}
| {ON REQUEST}
| {ON *-INPUT}
| {ON {CHAIN-INPUT|CHAIN-REQUEST}}
| {AT CURSOR-SELECTION}.
[http://help.sap.com/saphelp_nw73/helpdata/en/4a/3bb5668c412baee10000000a421937/frameset.htm]
BR,
Robert -
Synchronous interface udf to remember value between request and response
Hello,
I have two synchronous message interfaces bundled in an operation mapping and a message mapping for the request and one for the response.
I need to remember a value obtained during request message mapping so that I can access it in the response message mapping.
Is there any place where I can put a value and then access it later on the way back?
I tried global container in udf, but the scope of that object seems to be just the current message mapping.
Any ideas appreciated!
Thanks
MatthiasHi Matthias,
the fact is that the Integration Engine is stateless and not statefull, hence it cannot remember anything between two messages.
Perhaps, the correct way for this needs could be to use a BPM.
At any rate, when I need of this persistence I write the data on ABAP stack via UDF/Lookup function.
If you choose this way, remember to clean the table when you used it and forecast a way to manage the exceptions that could leave dirty in your temporary table.
Ciao.
Nicola -
Matchcode and process on value request
hi
i have a doubt...
i have created a matchcode object and declared in my report program.
i am using process on value request event.
which one will it trigger?
its urgent ....from highest to lowest priority:
1) PROCESS ON VALUE-REQUEST in your program
2) MATCHODE OBJECT in your selection-screen
3) MATCHCODE linked to data domain in DDIC -
Js-confirm box with request and passing value: incorrect url
Hi folks!
Scenario: User clicks on link-column field in tablular form, Confirm box pops up with a confirmation message, with "OK" generates a request and should pass a value from the form into an item for further processing.
The URL in the column link as of now looks like that:
javascript: apex.confirm("message goes here...", {request:"EQDONE", set:{"P2100_X": "#EQMID#"}});For some reason just nothing happens. When I omit the "javascript:", I get an unvalid-url error message. But if I change the procedure name, shoudln't I get some error message also?
Please tell me what's wrong. Thank you! :)Hmm... Ok, makes sense... a little.
The use of (in my case) #EQMID# works, if the target is not URL but "Page in App", and you use the Column Link Dialog fields "Name" and "Value", but maybe because at this point it gets renderes into html and not when called from a javaScript function? Thats how I understand it now.
However: I have just looked into the html-sourcecode. The java Script call IS actually fully rendered with the corrosponding IDs.
This is a sample of one table row:
<tr class="even"><td align="left" headers="Erfasst">13.08.2012</td><td align="left" headers="KundenNr">4784668</td><td align="left"
headers="Kontrolle">XML-Abrechnung - Abrechnungsart überprüfen bei KundenNr: 4784668</td><td align="left" headers="Details">TD, STEWEAGSTEG_LF:
Papier+Archiv (GK)</td><td align="left" headers="Ausnahme bis">-</td><td align="left" headers="bearbeitet von">-</td><td align="center" headers=
"'ERLEDIGT'"><a href="javascript: apex.confirm("message goes here...", {request:"EQDONE", set:{"P2100_X": "34"}});" ><img src="wwv_flow_file_mgr.get_file?
p_security_group_id=6519817386341009&p_flow_id=150&p_fname=ausnahmeBtn_check.png" alt="" title="Fehlerhaften Verrechnungstyp im SDK-PS ausbessern
und Eintrag als erledigt kennzeichnen."></a></td><td align="center" headers="'AUSNAHMEREGELUNG'"><a href="f?p=150:2100:1212226464451606:EINGAU
SNAHME:NO::P2100_KUNU_AUSNAHME,P2100_EQMID,P2100_DATEPICK_AUSN:4784668,34," ><img src="wwv_flow_file_mgr.get_file?p_security_group_id=
6519817386341009&p_flow_id=150&p_fname=ausnahmeBtn.jpg" alt="" title="Diesen Kunden als Ausnahmeregelung bis zu vorgegebenem Datum deklarieren.">
</a></td></tr>The set statement containe the correct ID in each row! Here 34.
So, according to http://docs.oracle.com/cd/E17556_01/doc/apirefs.40/e15519/javascript_api.htm#AEAPI274 , it should work.
Anyway, I will try your suggestion using the fnn array.
Edited by: tpetri on 16.08.2012 08:34 -
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 -
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 -
How to have multi select dropdowns for web request and adobe forms
Hi All,
I am working on interactive forms for CRM 7.0 using web request and ZCI layout.
When I say web request we define the fields required for the form in CRM that becomes the context for WDA and passed onto Adobe form.
This web request is a flat structure which mean if I have a node and attributes with in that you cant have multiple values to wards this node as in WDA.
Now My query:
I have a field called "xyz" since web request is a flat structure i just defined it as a string.
In WDA I made it a enumrated field and added key value pairs to it.
In Adobe form I binded this field to a WD native enum dropdown list every thing is fine untill here.
Now in the form I need this as a multiple select, so i changed the dropdown field to list box it works.
The form has to be submitted as a draft version when did so, it will not execute any APIs but saves the data to the web request.
When the same form is opened for the next time, with the data in web request it should reopen this field with the multiple seleced values high lighted.
since the field xyz is a single filed of string, how can i maintain multiple values in that...?
if there is a form status auto save function in Adobe form this might solve a bit but not sure when the form is opened 2nd time from web reqest view does it consider it as a new one or open the same form...?
I have such dropdown fields and problems including ones with depenedt values on one another.
I tried my best to explain the problem, if somebody can help me with this its much appriciated.
Note: Since this is dependent on CRM web request I am posting the same query in that block also apologies if this mean a duplicacy.
Thanks & Regards,
SaiI got the solution and problem is solved.
Iterating & processing a enumrated dropdown is like any other dropdown /list box in adobe forms.
Regards,
Sai Krishna -
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 -
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. -
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 -
Problem in opening 'Find Service Request' and 'Create Service Request' HTML forms
Hi,
I am working on creating some date for EBS Service, and I am unable to open 'Find Service Request' and 'Create Service Request' HTML forms.
I keep getting the error message :
Oracle error - 20001: ORA-20001: APP-FND-02902: Multi-Org profile option is required. Please set either MO: Security Profile or MO: Operating Unit profile option. has been detected in MO_GLOBAL_INIT.
I have min knowledge of EBS set up and configuration. We just use EBS as a source system for our ETLs. Please suggest any workaround to get resolve the issue.
Thanks,
KishoreNavigate to System Administrator responsibility > Profile > System. Search for the profile MO: Operating Unit and under responsibility field, put in the responsibility name you are using for creating the service request, click OK and enter the desired operating unit value in the next window. It pulls up all operating units defined and you can chose the desired one.
Thanks
Shree -
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^ -
AT SELECTION-SCREEN ON VALUE-REQUEST needed
hi,
i want code for atselection-screen for one parameter.
pls check the code i am sending.i am not understanding that if any one knows pls explain me.and it is correct or not.
parameters: P_LDCTY(2).
DATA: BEGIN OF IHELP_FIELDS OCCURS 20.
INCLUDE STRUCTURE HELP_VALUE.
DATA: END OF IHELP_FIELDS.
DATA: BEGIN OF HELPTAB OCCURS 100,
FELD(50),
END OF HELPTAB.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LDCTY matchcode object ZSDOTC_VOYAGE.
REFRESH IHELP_FIELDS.
MOVE 'VBAK' TO IHELP_FIELDS-TABNAME.
MOVE 'ZZLOADCTY1' TO IHELP_FIELDS-FIELDNAME.
MOVE 'X' TO IHELP_FIELDS-SELECTFLAG.
APPEND IHELP_FIELDS.
REFRESH HELPTAB.
SELECT *
FROM ZPORT
ORDER BY ZZCNTRY INTO IHELP_FIELDS.
MOVE ZPORT-ZZCNTRY TO HELPTAB.
APPEND HELPTAB.
ENDSELECT.
CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'
EXPORTING
DISPLAY = ' '
FIELDNAME = 'ZZCNTRY'
TABNAME = 'ZPORT'
IMPORTING
SELECT_VALUE = SELECTED_VALUE
TABLES
FIELDS = IHELP_FIELDS
VALUETAB = HELPTAB
EXCEPTIONS
FIELD_NOT_IN_DDIC = 01
MORE_THEN_ONE_SELECTFIELD = 02
NO_SELECTFIELD = 03.
IF SELECTED_VALUE <> SPACE.
P_LDCTY = SELECTED_VALUE.
ENDIF.
pls help mein this issue.
points will be awarded for right answer,
thanks and regards
suneethaHi suneetha,
1. we have to juse like this.
2. a) use FM F4IF_INT_TABLE_VALUE_REQUEST
b) syntax is : AT SELECTION-SCREEN ON VALUE-REQUEST FOR MYFIELD.
3. just copy paste in new program.
4.
Hi prakash,
1. sample code (just copy paste)
2.
REPORT ABC.
DATA : BEGIN OF ITAB OCCURS 0,
UNAME LIKE USR01-BNAME,
END OF ITAB.
data : RETURN_TAB LIKE DDSHRETVAL occurs 0 .
data : RETURN_wa LIKE DDSHRETVAL .
PARAMETERS : A(12) TYPE C.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR A.
ITAB-UNAME = 'U01'. APPEND ITAB.
ITAB-UNAME = 'U02'. APPEND ITAB.
ITAB-UNAME = 'U03'. APPEND ITAB.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'ITAB-UNAME'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'A'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = ITAB
FIELD_TAB = FTAB
RETURN_TAB = return_tab
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
break-point.
regards,
amit m.
Maybe you are looking for
-
How can I load photos on a new iPad for a customer?
Now this is something that I've done before. But iOS has gone through some changes since then, and now I can't remember what to do. Basically, I have a new iPad which was purchased for a customer. I need to load some photos on the iPad for the custom
-
Bulletin Board boot does not bring up services
Hello, I am trying to create a new tuxedo server, i have built it successfully and have included the server name in the servers section of the Config File . The Config File was built to create the Tuxconfig file.It successfully created the binary fil
-
WD ABAP: Recursion Nodes that Repeat Tree Nodes with Embedded Tables ???
At Rich H's suggestion, I'm posting this here as well as in the blogs. Suppose you've got a tree context with a node that has a table embedded under it. (For example, the TREE_WITH_TABLE view of WDR_TEST_EVNT has this kind of context substructure.) C
-
MIDP 2.0 Compilation Errors
Hello, I am trying to compile MIDP2.0 on linux redhat 9.0. But I am seeing the following errors : /home/test/src/java/linux/midp2.0_01rr/build/linux/../../src/share/classes/com/sun/midp/io/ConnectionBaseAdapter.java:12: cannot resolve symbol symbol :
-
Hi expets, When trying to open attachment of an work item(which is a pdf) the system opens a transaction and generates pdf and saves it in the local path c:\documents and settings\user2\test.pdf but while trying to open it trys try's to open the path