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

help

Former Member
0 Likes
396

Here is my selection screen and my select statement.

Having this stament I am able to fetch data against kg or dg with reference to doc number. My qyestion is that suppose if I dont give doc number in the selection screen and only giving doc type then it should show all the kg or dg whatever is in the record.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

parameter : p_blart like bkpf-blart,

p_belnr like bseg-belnr,

b_bukrs like bseg-bukrs OBLIGATORY DEFAULT '1000',

G_gjahr like bseg-gjahr.

SELECTION-SCREEN END OF BLOCK b1.

-


data: wa_bkpf like bkpf.

select single * from bkpf into wa_bkpf

where belnr = p_belnr and

blart = p_blart and

bukrs = b_bukrs and

gjahr = G_gjahr.

if p_blart = 'KG' or p_blart = 'DG'.

select * from bseg into corresponding fields of table itab

where belnr = wa_bkpf-belnr.

endif.

-


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
378

Hi,

if you work with select-options instead of parameters, it will work

Regards

Nicole

2 REPLIES 2
Read only

Former Member
0 Likes
379

Hi,

if you work with select-options instead of parameters, it will work

Regards

Nicole

Read only

Former Member
0 Likes
378

Hi Abhay,

Use Ranges in place of parameters.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

RANGES p_blart FOR BKPF-BLART.

PARAMETERS : p_belnr like bseg-belnr,

b_bukrs like bseg-bukrs OBLIGATORY DEFAULT '1000',

G_gjahr like bseg-gjahr.

SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.

p_blart -SIGN = 'I'.

p_blart -OPTION = 'EQ'.

p_blart -LOW = 'KG.

APPEND p_blart .

CLEAR p_blart .

p_blart -SIGN = 'I'.

p_blart -OPTION = 'EQ'.

p_blart -LOW = 'DG'.

APPEND p_blart .

CLEAR p_blart .

START OF SELECTION.

select single * from bkpf into wa_bkpf

where belnr = p_belnr and

bukrs = b_bukrs and

gjahr = G_gjahr AND

BLART IN P_BLART.

REWARD POINTS IF HELPFUL.

Regards,

Hemant