‎2011 Jun 10 4:12 PM
Morning,
In my screen, i would like to display details of vendor (name, adress) into corresponding fields after select vendor code into first field .
so i use module pool but i must push "enter" to see vendor details.
could you please see me a code to display vendor details just after selection (i mean without push "ENTER").
Thks & regards.
‎2011 Jun 10 4:29 PM
Do you mean get the name displayed after using F4 to get the vendor number?
Rob
‎2011 Jun 10 4:46 PM
‎2011 Jun 10 5:26 PM
Code the logic to populate other fields in POV - Implement your own F4 for that field.
‎2011 Jun 11 8:54 AM
Hi,
Using the Function Module itself we can return multiple value. Please Ref the link hope its very helpful.
2 way we can do that.
1)check the parameter 'DYNPFLD_MAPPING' which is the parameter where you have to specify the additional
field you want to transfer to the screen. see the below example code
http://abap-gallery.blogspot.com/2007/07/help-value-request-f4.html
or
2) Check the parameter called 'callback_form' or 'callback_program'.
Example 1:
The hit list has several columns. When choosing a hit, the values from two columns should be returned to the corresponding fields in the screen.
Normally the column to be returned is specified in RETFIELD. It corresponds to the field to which the F4 help was assigned.
The following coding can be used to return further columns.
FORM F4CALLBACK
TABLES RECORD_TAB STRUCTURE SEAHLPRES
CHANGING SHLP TYPE SHLP_DESCR_T
CALLCONTROL LIKE DDSHF4CTRL.
DATA: INTERFACE LIKE LINE OF SHLP-INTERFACE.
INTERFACE-VALTABNAME = 'DYNP'.
INTERFACE-VALFIELD = 'FELD'.
MODIFY SHLP-INTERFACE FROM INTERFACE
TRANSPORTING VALTABNAME VALFIELD
WHERE SHLPFIELD = 'ADDITIONAL'.
ENDFORM.
see the Example Below .
Regards,
Dhina..
Edited by: Dhina DMD on Jun 11, 2011 11:13 AM
‎2011 Jun 14 10:03 AM
Thks everybody for yur help.
But my specific problem is :
Suppose we have 2 screens fields : Screen 1 and screen 2 .
I put information (A) into screen 1.
And i use information into screen 1 in ABAP Program.
My ABAP Program return some informations (X )
I display this information into screen 2.
Actually, for displaying X into screen 2 i must put ENTER after input A.
Is it possible to display X into screen 2 without put enter ?
Thks again for yur attention...
‎2011 Jun 14 10:16 AM
Hi,
So the user just enters data on 1st screen, and then you wish to call the second screen to show relevant data.WIthout any user interaction... ?
‎2011 Jun 14 11:03 AM
YA, Just enters data on 1st screen and then display relevant data into another field in the same screen wIthout any user interaction...
‎2011 Jun 14 11:15 AM
If the user doesnt do anything, the events wont get triggered.Tricky requirment.
I dont know if there is a way to force the events to execute
‎2011 Jun 14 12:08 PM
May it is possible to use the enjoy control framework.
Create an inputable ALV with one column and one row without any toolbar etc.
So, you can use the events available (check_changed_data or so).
When fireing an event, you can call another screen or use the ALV-Detail list as for the second screen.
But how do you know when the user has finished the input?
Can you explain, where do you need such special function?
Regards,
Christian
‎2011 Jun 15 7:38 AM
Hi,
I think is it not possible without any user interaction how we call the screen 2. Very difficult to do that.
Regards,
Dhina.
‎2011 Jun 17 11:13 AM
Hi,
Just try the following piece of code for your reference.
REPORT ztest_sdn.
PARAMETERS : p_vendor TYPE lfa1-lifnr.
PARAMETERS : p_name TYPE lfa1-name1.
*Class to handle the FINSHED Event Raised by CL_GUI_TIMER
CLASS my DEFINITION.
PUBLIC SECTION.
METHODS : run_handler FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "my DEFINITION
DATA timer TYPE REF TO cl_gui_timer.
DATA myh TYPE REF TO my.
*----------------------------------------------------------------------*
* CLASS my IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS my IMPLEMENTATION.
METHOD run_handler.
CALL METHOD timer->run.
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'REFR'.
ENDMETHOD. "run_handler
ENDCLASS. "my IMPLEMENTATION
AT SELECTION-SCREEN OUTPUT.
SELECT SINGLE name1 FROM lfa1 INTO p_name WHERE lifnr = p_vendor.
CREATE OBJECT timer.
CREATE OBJECT myh.
timer->interval = '1'.
CALL METHOD timer->run.
SET HANDLER myh->run_handler FOR ALL INSTANCES.
Thanks and Regards,
Harish
‎2011 Jun 11 6:32 AM
‎2011 Jun 21 10:52 AM
Please refer below code. I hope it will help you in solving the issue you are facing.
Note : I used FM DYNP_VALUES_UPDATE' to achieve the same functionality
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CYCLE'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_CYCLE'
value_org = 'S'
TABLES
value_tab = it_t811c_hlp
return_tab = gt_tab.
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 gt_tab INDEX 1.
IF sy-subrc = 0.
p_cycle = gt_tab-fieldval.
READ TABLE it_t811c_hlp INTO wa_t811c_hlp WITH KEY cycle = p_cycle.
IF sy-subrc = 0.
field_value-fieldname = 'P_PRD'.
CLEAR : lv_date.
lv_date = wa_t811c_hlp-sdate.
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
input = lv_date
IMPORTING
output = lv_date.
field_value-fieldvalue = lv_date.
APPEND field_value TO dynpro_values.
CALL FUNCTION 'DYNP_VALUES_UPDATE' " Use this FM to update name and address details on the respective fields.
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dynpro_values.
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.
ELSE.
LEAVE TO SCREEN 1000.
ENDIF.Come up with queries if you are still facing some issues.
Cheers
VJ
‎2011 Jun 22 10:41 AM
Thks Vishal Jindal for yur code.
so how do yu fill yur table it_t811c_hlp ?
Suppose yu would like to fill fill yur table it_t811c_hlp with "select".
And yur "select" use data input to screen fields as parameters.
Is it possible to get this data input into "select" automatically ?
Regards.
‎2011 Jun 24 9:07 AM
That's good question!!!
Ok here we go!!
To populate the internal it_t811c_hlp which you are referring to, you need to fire a select query on the vendor master table LFA1 selecting the vendor code, name and address and store the records in the internal table which you can pass to the F4 help FM and proceed further as mentioned in the code. In my case, whenever user selects one entry in f4 help, then corresponding fields used to get populated automatically. Hope I am able to answer your question.
Come up with your queries if any.
Cheers
VJ
‎2011 Jun 24 9:09 AM
That's good question!!!
Ok here we go!!
To populate the internal it_t811c_hlp which you are referring to, you need to fire a select query on the vendor master table LFA1 selecting the vendor code, name and address and store the records in the internal table which you can pass to the F4 help FM and proceed further as mentioned in the code. In my case, whenever user selects one entry in f4 help, then corresponding fields used to get populated automatically. Hope I am able to answer your question.
Come up with your queries if any.
Cheers
VJ
‎2011 Jun 24 10:26 AM
See my code below. In this code "ZTCI_FACPRO-BUKRS" and "ZTCI_FACPRO-WERKS" are input screen fields.
Actually to get these informations in my select i'm must put "ENTER".
Is it possible to have these informations just clic on matchcode for call help function?
"Begin
...
select * from ztci_facpro into corresponding fields of table it_number
where bukrs = ztci_facpro-bukrs
and werks = ztci_facpro-werks.
....
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
...
"end
Thks for yur attention.
‎2011 Jun 24 3:36 PM
Hi, I give you 2 possible solutions.
1- Only if the number of possible values is a small number (no more than 20 imo). Instead of using a search Help F4. Use a Listbox (Combo Box) and asociate that listbox with a Code Function. So when you select a value it will trigger a PAI event. So all the data will be refreshed.
2- Use this function:
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
functioncode = '=00'
EXCEPTIONS
function_not_supported = 1
OTHERS = 2.
this code simulate an ENTER that of course will trigger also a PAI event.
Beware: if you are using this in a Module Pool you can get stuck in a infinite loop.
Regards
Rodrigo
‎2011 Jun 27 12:19 PM
Thks Rodrigo Ariel for yur proposition.
But 2nd options is not appropriate and actually the first is not OK to get input fields content.
Have yu another solution using cursor?
Regards,
Venance OULAI.
‎2011 Jun 27 2:07 PM
You could try this function. I had never used it.
CALL FUNCTION 'SET_DYNP_VALUE' "
EXPORTING
i_field = " dynpread-fieldname
i_repid = " d020s-prog
i_dynnr = " d020s-dnum
i_value = " dynpread-fieldvalue
. " SET_DYNP_VALUEWith that function you could set a value in a dynpro, but I doubt that this would trigger a PAI event.
The problem is not with the cursor the problem is that you need to trigger a PAI event, SAP works that way, until a PAI event is not triggered there will be no refresh.
‎2015 Aug 06 7:51 PM