Application Development 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: 

SELECT

Former Member
0 Kudos
102

hi all

i have a select statement

*SELECT * FROM BKPF*

  • INTO CORRESPONDING FIELDS OF TABLE it_bkpf1*

  • WHERE bukrs = p_bukrs AND gjahr = p_gjahr.*

In the above statement i have bukrs and gjahr which is selected from the parameters statement as mentione below.

PARAMETERS : P_BUKRS TYPE BKPF-BUKRS OBLIGATORY. "Company Code

PARAMETERS : P_GJAHR TYPE BKPF-GJAHR OBLIGATORY. "Fiscal Year

Now i need to create a SELECT statement which along with the bukrs and gjhar also filters the BELNR field.The problem is the belnr field is SELECT-OPTIONS statement and it has two values low and high.

SELECT-OPTIONS : s_belnr FOR bkpf-belnr. "Document number.

Please help and tell me how to use the select statement along with the belnr field.

Vijay

4 REPLIES 4

Former Member
0 Kudos
69

PARAMETERS : P_BUKRS TYPE BKPF-BUKRS OBLIGATORY. "Company Code

PARAMETERS : P_GJAHR TYPE BKPF-GJAHR OBLIGATORY. "Fiscal Year

SELECT-OPTIONS : s_belnr FOR bkpf-belnr. "Document number.

SELECT * FROM BKPF

INTO CORRESPONDING FIELDS OF TABLE it_bkpf1

WHERE belnr in s_belnr and

bukrs = p_bukrs

AND gjahr = p_gjahr.

- Selva

0 Kudos
69

Hi

i got it but the real problem is when am giving entries it is giving me all the unncessary data.But if am saving the input as a variant its coming exactly right.Please help

Vijay

0 Kudos
69

Put a validation for BUKRS field.

and also include all the primary key fields in the SELECT statements(Already u've given).

if possible paste ur selection screen code and the first SELECT statements.

- S

Former Member
0 Kudos
69

h