‎2013 Dec 11 4:33 AM
Dear Gurus !!!
Good Day.
the scenario is as below.
" I have created 2 Z table ( one header and one detail ). I made the DB View on these tables. Then I created a elementary search help on the view.
I added 2 field from detail table ( say po_no and po_item_no) in standard table EKPO include CI_EKPO. In screen exit I added these two field in "Customer Data" Tab and attach the elementary search help on the field po_no."
the issue is .
"When I press F4 help on field po_no and selected a record, only po_no field value is being filled up. I want that along with po_no field , po_item_no field should also be field up."
Please help.
Regards,
‎2013 Dec 11 6:18 AM
Hi rawal,
you are selecting values in search help only for po_no , so values are getting populate only to it.
To fill all other field values , use FM DYNP_VALUES_UPDATE.
‎2013 Dec 11 6:23 AM
Hi
Do one thing call your search help via Function module and once user has choosen value use dynpro_value_update to update other field
Nabheet
‎2013 Dec 11 6:36 AM
Hii Rawal,
You need dynamic field filling based on other filed value.
If your two fields po_no and po_item_no are from same table than you can achieve it through the below code. Here the material type is filled based on material number,
REPORT zr05_test.
PARAMETERS: p_matnr TYPE matnr, "Material number,
p_mtart TYPE mtart. "Material type
DATA: t_f4 TYPE STANDARD TABLE OF mara, "Will hold the data to display in f4 screen
t_dd TYPE TABLE OF dselc,
t_ft TYPE TABLE OF dfies,
x_dd TYPE dselc,
x_ft TYPE dfies.
AT SELECTION-SCREEN on VALUE-REQUEST FOR p_matnr. "In your case it will be po_no field
PERFORM dynamic_f4.
*&---------------------------------------------------------------------*
*& Form DYNAMIC_F4
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM DYNAMIC_F4 .
IF t_f4 IS INITIAL.
SELECT *
FROM Mara
CLIENT SPECIFIED
INTO TABLE t_f4
UP TO 500 ROWS
WHERE mandt eq sy-mandt.
ENDIF.
REFRESH t_dd.
x_dd-fldname = 'MTART'.
x_dd-dyfldname = 'P_MTART'. "For field based on this other filled need to fill automatically i.e po_no
APPEND x_dd TO t_dd.
CLEAR x_dd.
REFRESH t_ft.
x_ft-tabname = 'MARA'. "table name ie. your custom table name
x_ft-fieldname = 'MATNR'. "field name i.e your custom table field name po_no
APPEND x_ft TO t_ft.
CLEAR x_ft.
x_ft-tabname = 'MARA'. "table name
x_ft-fieldname = 'MTART'. "your field po_item_no
APPEND x_ft TO t_ft.
CLEAR x_ft.
IF NOT t_f4 IS INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR' "should be same as table field name
DYNPPROG = sy-repid
DYNPNR = sy-dynnr
DYNPROFIELD = 'P_MATNR' "screen field name or parameter name
WINDOW_TITLE = 'Search Help Selection'
VALUE_ORG = 'S'
tables
value_tab = t_f4
FIELD_TAB = t_ft
DYNPFLD_MAPPING = t_dd
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDIF.
ENDFORM. " DYNAMIC_F4
regards
Syed
‎2013 Dec 11 7:08 AM
Hi,
Please assign the search help which you create manually to the table field from SE11.
Once you assing the search help at table level other field will come automatically provided both the fields are Export in search help.
Regards
Sachin
‎2013 Dec 11 7:29 AM
Dear gurus !!!
thanks for reply.
i am facing issue in module pool i.e. customer data tab in tcode ME21/22N. there i have put two field for doing entry of po_no and po_item_no. the search help ( made thru SE11) is linked to po_no field.
know the scenario is clear i think.
Regards.
‎2013 Dec 11 8:39 AM
Hii Rawal,
In module pool, you can add a module in PAI after Module user_command xxx like below,
PROCESS AFTER INPUT.
MODULE user_command_xxx. " xxx---> screen number
process ON VALUE-REQUEST.
FIELD po_no MODULE f4_help. "module for f4_help And make sure po_no is same as screen field name.
Module f4_help.
DATA: t_f4 TYPE STANDARD TABLE OF <your detail table name>, "Will hold the data to display in f4 screen
t_dd TYPE TABLE OF dselc,
t_ft TYPE TABLE OF dfies,
x_dd TYPE dselc,
x_ft TYPE dfies.
IF t_f4 IS INITIAL.
SELECT *
FROM <your detail table>
INTO TABLE t_f4.
ENDIF.
REFRESH t_dd.
x_dd-fldname = 'detail table fieldname i.e po_item_no or whatever name it is in detail table'. "you want to fill automatically based on po_no field
x_dd-dyfldname = 'screen fieldname i.e po_item_no'. "screen field name of po_item_no
APPEND x_dd TO t_dd.
CLEAR x_dd.
REFRESH t_ft.
x_ft-tabname = 'custom table name i.e detail table'. "table name ie. your detail table
x_ft-fieldname = 'detail table-fieldname i.e po_no or what ever is it in custom table'.
APPEND x_ft TO t_ft.
CLEAR x_ft.
x_ft-tabname = 'custom table name i.e detail table'. "table name i.e detail table
x_ft-fieldname = 'details table-fieldname i.e po_item_no or whatever name it has in detail table'.
APPEND x_ft TO t_ft.
CLEAR x_ft.
IF NOT t_f4 IS INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'detail table field name i.e po_no ' "should be same as detail table field name
DYNPPROG = sy-repid
DYNPNR = sy-dynnr
DYNPROFIELD = 'screen field name of po_no' "screen field name
VALUE_ORG = 'S'
tables
value_tab = t_f4
FIELD_TAB = t_ft
DYNPFLD_MAPPING = t_dd
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDIF.
ENDFORM. " DYNAMIC_F4
ENDMODULE.
regards
Syed
‎2013 Dec 12 4:24 AM
Dear Gurus !!!
Good Day.
thanks for your kind help/guidelines to make me able to resolve the issue.
Regards,
RRSuthar