‎2007 Dec 26 10:36 AM
Hi all,
i have the below code as input screen.
PARAMETERS : P_BUKRS TYPE BKPF-BUKRS OBLIGATORY. "Company Code
data : belnr type bkpf-belnr.
SELECT-OPTIONS : s_belnr FOR belnr. "Document number
PARAMETERS : P_GJAHR TYPE BKPF-GJAHR OBLIGATORY. "Fiscal Year
PARAMETERS : P_USNAM TYPE BKPF-USNAM .
After the above i have the code
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_USNAM.
After this i neede to use the select statement
SELECT DISTINCT USNAM FROM BKPF
INTO CORRESPONDING FIELDS OF TABLE it_bkpf1
WHERE bukrs eq p_bukrs AND gjahr eq p_gjahr
and belnr IN s_belnr.
But wen am using the above code S_BELNR is a SELECT-OPTION field so its value is not passing when i checked debugging so i kept the SELECT statement above AT SELECTION-SCREEN i can see the S_BELNR is there when i debugged but its not passing into the AT SELECTION-SCREEN.Please help
Vijay
‎2007 Dec 26 10:57 AM
‎2007 Dec 26 11:02 AM
Hai,
Make s_belnr as OBLIGATORY otherwise Initialize s_belnr with default values.
‎2007 Dec 26 11:23 AM
hi,
i got ur solution...
After entering all value, press enter before pressing F4 on user name ...u will get list....
‎2007 Dec 26 11:24 AM
Hi dhwani i know that but we cant give that type of thing to the user..
Vijay
‎2007 Dec 26 11:36 AM
ok...
But i think it is the only option.....
but let me check other option....
‎2007 Dec 26 6:40 PM
hi,
since you are putting the statement in PAI of selection screen (At Selection Screen).
As per your requirement i suppose it should be kept in the PBO module of the selection screen which is AT-SELECTION SCREEN OUTPUT.
Try this one...hope this will help you out to get the values...
Thanks,
Ashish
‎2007 Dec 26 6:50 PM
Give the tables statement before the parameters.
TABLES: BKPF.
Then it hold the value of select options.
Hope it helps.
Reward if it is useful.
Thanks,
Srinivas
‎2007 Dec 28 9:09 AM
Please let me know why have u written fallowing line of code.
data : belnr type bkpf-belnr.
‎2007 Dec 28 9:14 AM
Hi
since you are putting the statement in PAI of selection screen (At Selection Screen).
As per your requirement i suppose it should be kept in the PBO module of the selection screen which is AT-SELECTION SCREEN OUTPUT.
Try this one...hope this will help you out to get the values...
Thnx
Rohit
‎2007 Dec 28 10:08 AM
Hi,
Try using this code.
PARAMETERS : P_BUKRS TYPE BKPF-BUKRS OBLIGATORY. "Company Code
data : belnr type bkpf-belnr.
data it_bkpf1 type table of bkpf.
data dynpro_values TYPE TABLE OF dynpread with header line.
SELECT-OPTIONS : s_belnr FOR belnr. "Document number
PARAMETERS : P_GJAHR TYPE BKPF-GJAHR OBLIGATORY. "Fiscal Year
PARAMETERS : P_USNAM TYPE BKPF-USNAM .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_USNAM.
dynpro_values-fieldname = 'P_BUKRS'.
append dynpro_values.
dynpro_values-fieldname = 'S_BELNR-LOW'.
append dynpro_values.
dynpro_values-fieldname = 'S_BELNR-HIGH'.
append dynpro_values.
dynpro_values-fieldname = 'P_GJAHR'.
append dynpro_values.
*dynpro_values-fieldname = 'P_USNAM'.
*append dynpro_values.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
TRANSLATE_TO_UPPER = 'X'
tables
dynpfields = dynpro_values
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
SELECT DISTINCT USNAM FROM BKPF
INTO CORRESPONDING FIELDS OF TABLE it_bkpf1
WHERE bukrs eq p_bukrs AND gjahr eq p_gjahr
and belnr IN s_belnr.
After this u have to read the table dynpro_values for ur corresponding screen fields.
Reward points if useful
With regards,
Vamsi
‎2007 Dec 28 10:25 AM
ae you using this selection screen as subscreen
if it is so then this scree is to be called twice , once in both pai and pbo in flow logic of screen
‎2007 Dec 28 5:41 PM
Hi..Vijay
Can You please explain your REQUIREMENT indetail.
So that I can Help you.
Regards
Sandeep.
‎2007 Dec 29 3:27 AM
Hi,
Jus change the below code alone.
data : belnr like bkpf-belnr.
Cheers,
Hakim