‎2007 Dec 29 5:30 AM
Hi all
In the code below am debugging at the select statement.I can see both my values of p_gjahr and p_bukrs but the field s_belnr is not showeing any value though i gave a input range in the input screen.I also tried using the START-OF-SELECTION but its not working.Please help.
Vijay
REPORT ZABAP9.
TABLES:BKPF.
TYPES:BEGIN OF t_bkpf ,
usnam type BKPF-USNAM,
belnr TYPE BKPF-belnr,
END OF t_bkpf.
DATA : t_return TYPE STANDARD TABLE OF ddshretval WITH HEADER LINE.
DATA:it_bkpf TYPE STANDARD TABLE OF t_bkpf WITH HEADER LINE.
PARAMETERS : P_BUKRS TYPE BKPF-BUKRS OBLIGATORY.
PARAMETERS : P_GJAHR TYPE BKPF-GJAHR OBLIGATORY.
DATA:belnr TYPE bkpf-belnr.
SELECT-OPTIONS : s_belnr FOR bkpf-belnr.
PARAMETERS : P_USNAM TYPE BKPF-USNAM .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_USNAM.
PERFORM read_selection_screen.
SELECT * FROM BKPF
INTO CORRESPONDING FIELDS OF TABLE it_bkpf
WHERE bukrs eq p_bukrs AND gjahr eq p_gjahr
and belnr IN s_belnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'USNAM'
dynpprog = SY-REPID
dynpnr = '1000'
dynprofield = 'P_USNAM'
value_org = 'S'
TABLES
value_tab = it_bkpf
return_tab = t_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF NOT it_bkpf[] IS INITIAL.
SORT it_bkpf BY belnr.
DELETE ADJACENT DUPLICATES FROM it_bkpf COMPARING USNAM.
IF sy-subrc = 0.
READ TABLE it_bkpf INDEX 1.
ENDIF.
ENDIF.
FORM read_selection_screen.
DATA: lv_dyname LIKE d020s-prog VALUE 'ZABAP9',
lv_dynumb LIKE d020s-dnum VALUE '1000'.
DATA: BEGIN OF lt_dynpfields OCCURS 3.
INCLUDE STRUCTURE dynpread.
DATA: END OF lt_dynpfields.
lt_dynpfields-fieldname = 'P_BUKRS'.
APPEND lt_dynpfields.
lt_dynpfields-fieldname = 'P_GJAHR'.
APPEND lt_dynpfields.
lt_dynpfields-fieldname = 'S_BELNR-LOW'.
APPEND lt_dynpfields.
lt_dynpfields-fieldname = 'S_BELNR-HIGH'.
APPEND lt_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = lv_dyname
dynumb = lv_dynumb
translate_to_upper = 'X'
TABLES
dynpfields = lt_dynpfields
EXCEPTIONS
invalid_abapworkarea = 01
invalid_dynprofield = 02
invalid_dynproname = 03
invalid_dynpronummer = 04
invalid_request = 05
no_fielddescription = 06
invalid_parameter = 07
undefind_error = 08
double_conversion = 09
stepl_not_found = 10
OTHERS = 11.
if sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
CLEAR: lt_dynpfields.
LOOP AT lt_dynpfields.
CASE lt_dynpfields-fieldname.
WHEN 'P_BUKRS'.
p_bukrs = lt_dynpfields-fieldvalue.
WHEN 'P_GJAHR'.
p_gjahr = lt_dynpfields-fieldvalue.
WHEN 'S_BELNR-LOW'.
p_usnam = lt_dynpfields-fieldvalue.
WHEN 'S_BELNR-HIGH'.
p_usnam = lt_dynpfields-fieldvalue.
ENDCASE.
ENDLOOP.
ENDFORM. " read_selection_screen
‎2007 Dec 29 5:47 AM
Hi,
May be because of conversion exits.
use one of the these...
CONVERSION_EXIT_ALPHA_INPUT
CONVERSION_EXIT_ALPHA_OUTPUT function module .you will get data.
regards,
paras
‎2007 Dec 29 5:47 AM
Hi,
May be because of conversion exits.
use one of the these...
CONVERSION_EXIT_ALPHA_INPUT
CONVERSION_EXIT_ALPHA_OUTPUT function module .you will get data.
regards,
paras
‎2007 Dec 29 5:48 AM
Hi paras
Can u tell me exactly where i need to use the function module.
Vijay
‎2007 Dec 29 5:54 AM
hi,
before your select query...
PERFORM read_selection_screen.
*****Here you need to call *****
SELECT * FROM BKPF
INTO CORRESPONDING FIELDS OF TABLE it_bkpf
WHERE bukrs eq p_bukrs AND gjahr eq p_gjahr
and belnr IN s_belnr.
regards,
paras
‎2007 Dec 29 5:59 AM
Hi paras
Is the code correct but am still not getting getting.Please help.
Vijay
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = s_belnr
IMPORTING
OUTPUT = s_belnr.
‎2007 Dec 29 5:51 AM
Hi,
In the bottom part of debugging screen enter field name or double click on the field u want to see
Regards
‎2007 Dec 29 6:01 AM
Hi
When am debugging and clicking am getting the field.My question is the value am entering is not coming.Please help
‎2007 Dec 29 6:09 AM
Hi evryone,
AFter entering the values if i hit enter then if i debug and diuble click on s_belnr i can see that s_belnr is taking its value.Please help
VIjay
‎2007 Dec 29 6:16 AM
Hi,
in ur code clear statement is there after reading using fm do u think it is affecting it
Regards
‎2007 Dec 29 6:20 AM
‎2007 Dec 29 5:51 AM
Hai,
It is because of this statement:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_USNAM.
If you remove the above statement and try again, you can get the values of s_belnr also.
‎2007 Dec 29 5:54 AM
Hi eswar
i cant remove that piec of code AT_SELECTIOn....because its an input field with F4 functioanlity
VIjay
‎2007 Dec 29 10:14 AM
Hi Vijay Krishna,
add the following statements in bold to your program.
WHEN 'S_BELNR-LOW'.
s_belnr-low = lt_dynpfields-fieldvalue.
p_usnam = lt_dynpfields-fieldvalue.
WHEN 'S_BELNR-HIGH'.
s_belnr-sign = 'I'.
s_belnr-option = 'BT'.
s_belnr-high = lt_dynpfields-fieldvalue.
APPEND s_belnr.
p_usnam = lt_dynpfields-fieldvalue.
‎2007 Dec 29 10:46 AM
Hi rajesh
added your statements the s_belnr i can see the values when am debuging.BUt in the select statement is not executing.
SELECT * FROM bkpf
INTO CORRESPONDING FIELDS OF TABLE it_bkpf
WHERE bukrs EQ p_bukrs AND gjahr EQ p_gjahr
AND belnr IN s_belnr.
What i mean is the check condition of p_gjahr and p_bukrs is checking but the selection is not applybg to the line
belnr IN s_belnr.
‎2007 Dec 29 10:58 AM
Hi Vijay,
Please ensure that you are filling both LOW and HIGH values in the selection screen, otherwise the option 'BT' doesn't work. Also add the following statement before APPEND statement
CLEAR s_belnr[].
APPEND s_belnr.
‎2007 Dec 29 11:00 AM
Hi rajesh
Its not working stll...but if hit 'ENTER' its working good.Please help
Vijay
‎2007 Dec 29 11:12 AM
Please post the table entries(s_belnr) that you see in debugging mode before the SELECT..statement
(Assuming that the problem is with the SELECT statement as you have explained before, if this is not the problem, kindly elaborate your problem, also explain the way you are expecting the program to behave)
‎2007 Dec 29 11:30 AM
Hi Vijay,
Try changing the order of selection screen fields and/or try making belnr range as obligatory, also keep all data declerations before selection screen definition.
Award points if useful.
With Regards,
Zafar Ali