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

how to display table field data using checkbox

Former Member
0 Likes
450

Dear sir,

I have created PR using ME51N. Our PR datas in EKPO table.

I have created select-option with prdat and Checkbox for to view PR open or closed status.

I want check PR status details from date to date using check box.

I have created the following code, but i will not generate output

DATA: BEGIN OF leban OCCURS 0.

INCLUDE STRUCTURE ekpo.

DATA END OF leban.

DATA new(1).

SELECT-OPTIONS ldat FOR sy-datum. "NO-DISPLAY.

parameters lopen like new AS CHECKBOX USER-COMMAND opn.

parameters lclose like new as checkbox user-command cls.

at selection-screen.

if ldat is initial.

message 'Enter a value' type 'W'.

endif.

case sy-ucomm.

when 'opn'.

perform getpr.

perform findopenpr tables leban.

endcase.

form getpr.

select * from ekpo into leban where PRDAT in ldat.

append leban.

endselect.

endform.

form findopenpr tables ekpo.

IF LOPEN = 'X'.

select single * from ekpo into leban where PRDAT IN LDAT AND banfn = lopen.

SORT leban BY bnfpo.

CLEAR leban.

if not sy-subrc = 0.

message 'PR OPEN' type 'S'.

ENDIF.

WRITE: / LEBAN-BANFN.

ENDIF.

endform.

With Regards,

Baskaran

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
412

Hi,

Try this way,

You shouldnt be writing two select statements into the same internal table. Also i dont see any use of perform getpr. so remove that and try


DATA: BEGIN OF leban OCCURS 0.
INCLUDE STRUCTURE ekpo.
DATA END OF leban.

DATA: BEGIN OF leban1 OCCURS 0.
INCLUDE STRUCTURE ekpo.
DATA END OF leban1.

DATA new(1).

SELECT-OPTIONS ldat FOR sy-datum. "NO-DISPLAY.
parameters lopen like new AS CHECKBOX USER-COMMAND opn.
parameters lclose like new as checkbox user-command cls.


at selection-screen.

if ldat is initial.
message 'Enter a value' type 'W'.
endif.

IF LOPEN = 'X'.
select single * from ekpo into leban where PRDAT IN LDAT AND banfn = lopen.
if sy-subrc = 0.
message 'PR OPEN' type 'S'.
ENDIF.
WRITE: / LEBAN-BANFN.
endif.

if LCLOSE = 'X'.

select single * from ekpo into leban1 where PRDAT IN LDAT AND banfn eq space.
if sy-subrc = 0.
message 'PR CLOSE' type 'S'.
ENDIF.
WRITE: / LEBAN1-BANFN.
ENDIF.

Regards,

Vik

Edited by: vikred on Aug 7, 2009 6:55 PM

Edited by: vikred on Aug 7, 2009 7:23 PM

Dear sir,

I have created PR using ME51N. Our PR datas in EKPO table.

I have created select-option with prdat and Checkbox for to view PR open or closed status.

I want check PR status details from date to date using check box.

I have created the following code, but i will not generate output

DATA: BEGIN OF leban OCCURS 0.

INCLUDE STRUCTURE ekpo.

DATA END OF leban.

DATA new(1).

SELECT-OPTIONS ldat FOR sy-datum. "NO-DISPLAY.

parameters lopen like new AS CHECKBOX USER-COMMAND opn.

parameters lclose like new as checkbox user-command cls.

at selection-screen.

if ldat is initial.

message 'Enter a value' type 'W'.

endif.

case sy-ucomm.

when 'opn'.

perform getpr.

perform findopenpr tables leban.

endcase.

form getpr.

select * from ekpo into leban where PRDAT in ldat.

append leban.

endselect.

endform.

form findopenpr tables ekpo.

IF LOPEN = 'X'.

select single * from ekpo into leban where PRDAT IN LDAT AND banfn = lopen.

SORT leban BY bnfpo.

CLEAR leban.

if not sy-subrc = 0.

message 'PR OPEN' type 'S'.

ENDIF.

WRITE: / LEBAN-BANFN.

ENDIF.

endform.

With Regards,

Baskaran

1 REPLY 1
Read only

Former Member
0 Likes
413

Hi,

Try this way,

You shouldnt be writing two select statements into the same internal table. Also i dont see any use of perform getpr. so remove that and try


DATA: BEGIN OF leban OCCURS 0.
INCLUDE STRUCTURE ekpo.
DATA END OF leban.

DATA: BEGIN OF leban1 OCCURS 0.
INCLUDE STRUCTURE ekpo.
DATA END OF leban1.

DATA new(1).

SELECT-OPTIONS ldat FOR sy-datum. "NO-DISPLAY.
parameters lopen like new AS CHECKBOX USER-COMMAND opn.
parameters lclose like new as checkbox user-command cls.


at selection-screen.

if ldat is initial.
message 'Enter a value' type 'W'.
endif.

IF LOPEN = 'X'.
select single * from ekpo into leban where PRDAT IN LDAT AND banfn = lopen.
if sy-subrc = 0.
message 'PR OPEN' type 'S'.
ENDIF.
WRITE: / LEBAN-BANFN.
endif.

if LCLOSE = 'X'.

select single * from ekpo into leban1 where PRDAT IN LDAT AND banfn eq space.
if sy-subrc = 0.
message 'PR CLOSE' type 'S'.
ENDIF.
WRITE: / LEBAN1-BANFN.
ENDIF.

Regards,

Vik

Edited by: vikred on Aug 7, 2009 6:55 PM

Edited by: vikred on Aug 7, 2009 7:23 PM