‎2009 Jan 05 10:19 AM
The F4 help is not working properly for the second field.
The requirement is , the second field f4 values shud dipslay only those based on the first field.
if i press enter then its showing the values for the second field.
This is the program.
REPORT Z1159_TEST12.
PARAMETERS: S_VBELN TYPE VBAK-VBELN ,
S_POSNR TYPE VBAP-POSNR.
DATA: BEGIN OF ITAB OCCURS 0,
POSNR TYPE VBAP-POSNR,
END OF ITAB.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_POSNR.
SELECT POSNR FROM VBAP INTO TABLE ITAB WHERE VBELN EQ S_VBELN.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'POSNR'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_POSNR'
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 =
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.
‎2009 Jan 05 10:23 AM
Hi,
Please refer to this link will help you.
http://help.sap.com/saphelp_45b/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm
Cheers.
‎2009 Jan 05 10:30 AM
Hi
Refer this below example FM 'F4IF_INT_TABLE_VALUE_REQUEST'
data: l_retfield type dfies-fieldname,
it_return type ddshretval occurs 0 with header line,
it_help_fields like dfies occurs 0 with header line.
move 'T500P' to it_help_fields-tabname.
move 'PERSA' to it_help_fields-fieldname.
append it_help_fields.
move 'NAME1' to it_help_fields-fieldname.
append it_help_fields.
move 'BUKRS' to it_help_fields-fieldname.
append it_help_fields.
move 'MOLGA' to it_help_fields-fieldname.
append it_help_fields.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = l_retfield
DISPLAY = disp_flag
WINDOW_TITLE = 'Personalbereich'(peb)
TABLES
VALUE_TAB = value_tab
FIELD_TAB = it_help_fields
RETURN_TAB = it_return
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
if it_return[] is not initial.
read table it_return index 1.
q1008-persa = it_return-fieldval.
endif.
Regards,
Syf
‎2009 Jan 05 10:31 AM
hi sushma,
dont give field name in single quote.
if you are taking column use value_org = 'C'
not 'S'.
ex:
Start of Data Declaration for F4IF_INT_TABLE_VALUE_REQUEST
DATA: I_RETURN TYPE DDSHRETVAL OCCURS 0 WITH HEADER LINE,
I_FIELDS LIKE DFIES OCCURS 0 WITH HEADER LINE,
LV_RETFIELD LIKE DFIES-FIELDNAME.
End of Data Declaration for F4IF_INT_TABLE_VALUE_REQUEST
REFRESH I_FIELDS.
LOOP AT I_TABNAME.
I_FIELDS-FIELDNAME = I_TABNAME-FIELDNAME .
I_FIELDS-TABNAME = I_TABNAME-TABNAME.
I_FIELDS-GENKEY = I_TABNAME-SELECTFLAG.
APPEND I_FIELDS.
ENDLOOP.
LV_RETFIELD = 'BLART'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = LV_RETFIELD
WINDOW_TITLE = ' '
MULTIPLE_CHOICE = ' '
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = I_TABFAB
FIELD_TAB = I_FIELDS
RETURN_TAB = I_RETURN
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF I_RETURN IS NOT INITIAL.
S_BLART-LOW = I_RETURN-FIELDVAL.
ENDIF.
‎2009 Jan 05 10:39 AM
Your code is absolutely correct....only press "ENTER" after putting the value of VBELN...then press the F4 help of POSNR.
‎2009 Jan 05 10:55 AM
‎2009 Jan 05 10:58 AM
Then you have to write this code:
PERFORM read_dynprofield USING 'YTDSRATE-TAX_TYPE'
CHANGING ytdsrate-tax_type.
SELECT DISTINCT tax_code
INTO CORRESPONDING FIELDS OF TABLE it_withcd2
FROM ytdsrate
WHERE tax_type EQ ytdsrate-tax_type
AND mark_for_del NE 'X'
.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'TAX_CODE'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'YTDSRATE-TAX_CODE'
value_org = 'S'
TABLES
value_tab = it_withcd2
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
ENDIF.
*&---------------------------------------------------------------------*
*& Form READ_DYNPROFIELD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0387 text
* <--P_YTDSRATE_TAX_TYPE text
*----------------------------------------------------------------------*
FORM read_dynprofield USING p_fieldname
CHANGING p_value.
DATA it_dynfield TYPE STANDARD TABLE OF dynpread WITH HEADER LINE.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
request = 'A'
translate_to_upper = 'X'
TABLES
dynpfields = it_dynfield
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.
READ TABLE it_dynfield WITH KEY fieldname = p_fieldname.
p_value = it_dynfield-fieldvalue.
ENDFORM. " READ_DYNPROFIELD
This is sample code.....First you have to read the value of VBELN from Dynpro..then find POSNR.
Arunima
‎2009 Jan 05 10:51 AM
Hello Sushma,
This is exactly how the F4 functionality will work because this is what you have code for )
What is the functionality you want? If you need any additional functionality you need to change your coding.
Plz revert back with more details.
BR,
Suhas
Edited by: Suhas Saha on Jan 5, 2009 11:52 AM
‎2009 Jan 05 11:04 AM
Hi sushma ,
> TABLES
> VALUE_TAB = ITAB[]
> * FIELD_TAB =
> * RETURN_TAB =
**-> Uncomment the return tab and put it to itab1 where itab1 is same as itab .
Thanks
Sahil
‎2009 Jan 05 11:10 AM
--> if i enter the value manually in s_vbeln and without pressing enter if i click on f4 button for s_posnr
then its gigvign no values foumd error.
--> in debugiing i found that S_VBELN field is initial, so the select statement is not working.
‎2009 Jan 05 12:14 PM
Is this problem solved now?
If so please give the solution
Edited by: Bala Shanmuga Priyan on Jan 5, 2009 1:15 PM
‎2009 Jan 05 12:29 PM
Hi,
use FM
DYNP_VALUES_READto capture the entered screen value ( here s_vbeln ).
‎2009 Jan 05 12:54 PM
HI ,
You need to use DYNP_VALUES_READ fm to capture S_VBELN value , b4 calling F4IF_INT_TABLE_VALUE_REQUEST.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_POSNR.
*Fill Dynpread Table
wa_dynpread-fieldname = 'S_VBELN'.
wa_dynpread-fieldvalue = S_VBELN.
append wa_dynpread to it_dynpread.
*Call Dynp_read to read screen values
call function 'DYNP_VALUES_READ'
exporting
dyname = v_prog
dynumb = v_dynnr
translate_to_upper = 'X'
tables
dynpfields = it_dynpread
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.
if sy-subrc = 0.
read table it_dynpread into wa_dynpread index 1.
S_VBELN = wa_dynpread-fieldvalue .
endif.
SELECT POSNR FROM VBAP INTO TABLE ITAB WHERE VBELN EQ S_VBELN.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'POSNR'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_POSNR'
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 =
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.
Regards
Sandeep Reddy
‎2009 Jan 13 6:34 AM