Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

AT SELECTION SCREEN

Former Member
0 Likes
1,480

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

13 REPLIES 13
Read only

Former Member
0 Likes
1,340

try AT SELECTION-SCREEN OUTPUT event

Read only

Former Member
0 Likes
1,340

Hai,

Make s_belnr as OBLIGATORY otherwise Initialize s_belnr with default values.

Read only

Former Member
0 Likes
1,340

hi,

i got ur solution...

After entering all value, press enter before pressing F4 on user name ...u will get list....

Read only

0 Likes
1,340

Hi dhwani i know that but we cant give that type of thing to the user..

Vijay

Read only

0 Likes
1,340

ok...

But i think it is the only option.....

but let me check other option....

Read only

Former Member
0 Likes
1,340

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

Read only

Former Member
0 Likes
1,340

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

Read only

Former Member
0 Likes
1,340

Please let me know why have u written fallowing line of code.

data : belnr type bkpf-belnr.

Read only

RahulKeshav
Active Contributor
0 Likes
1,340

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

Read only

former_member219399
Active Participant
0 Likes
1,340

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

Read only

Former Member
0 Likes
1,340

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

Read only

Former Member
0 Likes
1,340

Hi..Vijay

Can You please explain your REQUIREMENT indetail.

So that I can Help you.

Regards

Sandeep.

Read only

abdul_hakim
Active Contributor
0 Likes
1,340

Hi,

Jus change the below code alone.

data : belnr like bkpf-belnr.

Cheers,

Hakim