07-30-2007 10:31 AM
Well I have designed a screen on which there are 2 entry fields, one for Sales Order No. and other for Delivery Doc. No. The user will enter the Sales Order No.
I want to provide F4 help to user on Delivery Doc. No. field which will be based on the Sales Order No. entered.
i.e. on pressing F4 all the deliveries related to that Sales Order No. will be displayed.
How can I achieve this?
07-30-2007 10:37 AM
HI,
initially the user will enter the sales order number
now pass this sales order number and get the delivery document
numbers
and store it in one internal table
now pass this internal to the function module
f4_int_table_value_request
reward points if helpful
thanks & reagards,
venkatesh
07-30-2007 10:37 AM
hi,
You can acheive this by assigning a function code to the Delivery Doc. No. field on the screen.
Whenever user press the F4 button for Delivery Doc. No. u can select Delivery Doc. No. corresponding to the sales document entered and u can display them in the f4 help.
use fm 'F4IF_INT_TABLE_VALUE_REQUEST' to display values present in internal table.
Regards,
Sankar
07-30-2007 10:37 AM
Check the below sample code.Here based on soldto party I will display Ship to party in F4 help.
In screen give as
Process on value-request .
Field KUWEV-KUNNR Module Disp_Shipto..
----
module Disp_Shipto input.
data: begin of t_ship occurs 0,
KUNNR like KUWEV-KUNNR,
end of t_ship.
DATA t_return_Ship LIKE ddshretval OCCURS 0 WITH HEADER LINE..
clear t_Ship.
refresh t_ship.
*data l_ship like KUAGV-KUNNR.
*get parameter id 'VAG' field KUAGV-KUNNR.
*if not KUAGV-KUNNR is initial. "C
data:begin of it_dynpfields occurs 0.
include structure dynpread.
data end of it_dynpfields.
data wa_dynpfields like DYNPREAD .
refresh it_dynpfields.
wa_dynpfields-fieldname = 'I_SOLDTO'.
append wa_dynpfields to it_dynpfields.
wa_dynpfields-fieldname = 'VBAK-VKORG'.
append wa_dynpfields to it_dynpfields.
wa_dynpfields-fieldname = 'VBAK-SPART'.
append wa_dynpfields to it_dynpfields.
wa_dynpfields-fieldname = 'VBAK-VTWEG'.
append wa_dynpfields to it_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TRANSLATE_TO_UPPER = ' '
REQUEST = ' '
PERFORM_CONVERSION_EXITS = ' '
PERFORM_INPUT_CONVERSION = ' '
DETERMINE_LOOP_INDEX = ' '
tables
dynpfields = it_dynpfields.
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11
.
if sy-subrc = 0 .
read table it_dynpfields index 1.
i_soldto = it_dynpfields-fieldvalue.
clear it_dynpfields.
read table it_dynpfields index 2.
vbak-vkorg = it_dynpfields-fieldvalue.
clear it_dynpfields.
read table it_dynpfields index 3.
VBAK-SPART = it_dynpfields-fieldvalue.
clear it_dynpfields.
read table it_dynpfields index 4.
VBAK-VTWEG = it_dynpfields-fieldvalue.
clear it_dynpfields.
if not i_Soldto is initial.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = i_soldto
IMPORTING
output = i_soldto.
select kunn2 from KNVP into table t_ship
*where KUNNR = KUAGV-KUNNR and "C
Where KUNNR = i_soldto and
VKORG = VBAK-VKORG and
SPART = VBAK-SPART and
VTWEG = VBAK-VTWEG and
PARvW = 'WE'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'KUNN2'
PVALKEY = ' '
DYNPPROG = SY-
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = t_ship
FIELD_TAB =
return_tab = t_return_SHIP
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF sy-subrc = 0.
kuwev-kunnr = t_return_SHIP-fieldval.
ENDIF.
endif.
endif.
endmodule. " Disp_Shipto INPUT
07-30-2007 11:21 AM