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

SIMPLE REPORTS

Former Member
0 Likes
673

HY FRIENDS

I HAVE TWO SELECT OPTIONS FIRST

THEN FROM THAT SELECTIONS I HAVE 5 LINES IN OUTPUT EACH LINE HAVE A CHECK BOX.

NOW I HAVE ADDED THROUGH GUI ONE BUTTON DISPLY ON APPLICATION TOOLBAR.

NOW MY REQUIREMENT IS THAT WHEN I CLICK 1ST , 3RD AND 5TH CHECKBOX THEN I CLICK DISPLAY THEN RESPECTIVE INFORMATION SHOULD BE AVAILABLE IN MY NEXT LIST.

SEE IF YOU CAN HELP ME

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
634

this is my code

&----


*& Report YTEST_REP9 *

*& *

&----


*& *

*& *

&----


REPORT YTEST_REP9 NO STANDARD PAGE HEADING.

TABLES: EKKO , EKPO.

DATA: BEGIN OF IT_EBELN OCCURS 0,

EBELN TYPE EKKO-EBELN,

LIFNR TYPE EKKO-LIFNR,

check(1) type c,

END OF IT_EBELN.

data chk type c.

SELECT-OPTIONS: S_PO FOR EKKO-EBELN DEFAULT '4500000000'.

SELECT-OPTIONS: S_DATE FOR EKKO-BEDAT DEFAULT '20060823'.

*PARAMETERS PO(10) TYPE C.

*PARAMETERS PO_DATE TYPE D.

START-OF-SELECTION.

SET PF-STATUS '100_S'.

SELECT EBELN LIFNR

FROM EKKO

INTO TABLE IT_EBELN

WHERE EBELN IN S_PO

AND BEDAT IN S_DATE.

LOOP AT IT_EBELN.

AT FIRST.

WRITE:/ 'CHK' , 15 'PO_NUMBER' , 30 'ACCOUNT_NUMBER'.

ULINE.

SKIP.

ENDAT.

WRITE:/ CHK, 15 IT_EBELN-EBELN , 30 IT_EBELN-LIFNR.

ENDLOOP.

*AT LINE-SELECTION .

*WRITE:/ IT_EBELN-EBELN .

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'CANCEL'.

LEAVE TO SCREEN 0.

WHEN 'DISPLAY'.

write: / chk.

ENDCASE.

TOP-OF-PAGE.

WRITE:/ 'THIS IS THE PURCHASE ORDER'.

SKIP.

HERE AFTER CLICKING DISPLAY THAT CHK VALUE IS NOT DISPLAYING

PLEASE REPLY ITS URGENT.

4 REPLIES 4
Read only

Former Member
0 Likes
634

Hi..,

Use HIDE or READ LINE statements...

in your <b>At user-command</b> event

Check this program...

report yh640_030403 line-size 70.

----


  • Program Name: Flight details *

  • Creation: 07/12/2006*

  • *

  • SAP Name : YH640_030403 Application: Test *

  • *

  • Author : Sai Ramesh P Type: 1 *

_____________________________________________________________________

  • Description : This program allows the user to select one or more *

  • carrier ids on the basic list and displays the flight *

  • information from sflight table on the secondary list *

  • with some additional options on the application bar *

  • like SELECT ALL , DESELECT ALL . *

_____________________________________________________________________

  • Inputs: *

  • Tables: *

  • Spfli - Flight schedule *

  • Sflight - Flight *

  • Select options: *

  • N/A *

  • Parameters: *

  • N/A *

  • *

  • Outputs: Displays Fight details *

_____________________________________________________________________

  • External Routines *

  • Function Modules: No *

  • Transactions : No *

  • Programs : No *

_____________________________________________________________________

  • Return Codes: No *

_____________________________________________________________________

  • Ammendments: *

  • Programmer Date Req. # Action *

  • ================ ========== ====== ==============================*

  • *

***********************************************************************

*" Type declarations...................................................

"----


Type declaration of the structure to Flight schedule from spfli table

"----


types :

begin of type_s_spfli,

carrid type spfli-carrid, " Airline carrierID.

connid type spfli-connid, " Connection ID

airpfrom type spfli-airpfrom, " Departure airport

airpto type spfli-airpto, " Destination airport

deptime type spfli-deptime, " Departure time

arrtime type spfli-arrtime, " Arrival time

check(1) type c,

end of type_s_spfli.

"----


*Type declaration of structure to Flight details from sflight table *

"----


types :

begin of type_s_sflight,

carrid type sflight-carrid, " Airline carrid.

connid type sflight-connid, " Connectin ID

fldate type sflight-fldate, " Flight date.

seatsmax type sflight-seatsmax, " Maximum no.of seats

seatsocc type sflight-seatsocc, " Occupied seats.

end of type_s_sflight.

"----


  • Internal table to hold flight schedule data *

"----


data :

t_spfli type standard table

of type_s_spfli

initial size 0.

"----


  • Work area to hold flight schedule data *

"----


data

wa_spfli type type_s_spfli.

*" Data declarations...................................................

"----


  • Work variables *

"----


data:

w_box(1) type c, " Checkbox.

w_index type i.

"----


  • TOP-OF-PAGE EVENT *

"----


top-of-page.

perform list_headings.

"----


  • TOP-OF-PAGE DURING LINE-SELECTION EVENT *

"----


top-of-page during line-selection.

perform headings.

"----


  • START-OF-SELECTION EVENT *

"----


start-of-selection.

perform retrieve_spfli.

"----


  • END-OF-SELECTION EVENT *

"----


end-of-selection.

set pf-status 'DISPLAY'.

perform flight_schedule.

"----


  • AT USER-COMMAND EVENT *

"----


at user-command.

if sy-lsind lt 2.

case sy-ucomm.

when 'SFLIGHT'.

perform display_sflight.

when 'SELECTALL'.

perform display_all.

when 'DESELECTA'.

perform deselect_all.

endcase. " Case sy-ucomm.

endif. " If sy-lsind lt 2.

&----


*& Form retrieve_spfli

&----


  • This subroutine retrieves the flight schedule data from spfli *

----


  • There are no interface parameters to be passed to this subroutine. *

----


form retrieve_spfli .

select carrid " Airline carrierID.

connid " Connection ID

airpfrom " Departure airport

airpto " Destination airport

deptime " Departure time

arrtime " Arrival time

into table t_spfli

from spfli.

endform. " Form retrieve_spfli

&----


*& Form DISPLAY_SFLIGHT

&----


  • This subroutine displays the flight details for user selected *

  • records.

----


  • There are no interface parameters to be passed to this subroutine. *

----


form display_sflight.

*Declaration of Internal table to hold flight details ...

data

lt_sflight type standard table

of type_s_sflight

initial size 0.

*Declaration of Internal table to hold flight schedule data...

data

lt_spfli type standard table

of type_s_spfli

initial size 0.

  • Work area to hold flight schedule data...

data

lwa_spfli type type_s_spfli.

  • Work area to hold flight schedule data...

data

lwa_sflight type type_s_sflight.

*Declaration of Work variables ...

data:

lw_lines type i, " Holds no.of lines in t_spfli

lw_linno type i value 5,

lw_count type i.

describe table t_spfli lines lw_lines.

do lw_lines times.

read line lw_linno field value :

w_box into w_box,

wa_spfli-carrid into lwa_spfli-carrid,

wa_spfli-connid into lwa_spfli-connid,

wa_spfli-check into wa_spfli-check.

if w_box = 'X' and wa_spfli-check ne '*' .

add 1 to : lw_count, w_index.

append lwa_spfli to lt_spfli.

wa_spfli-check = '*'.

modify current line field value wa_spfli-check

field format w_box input off.

endif. " If w_box = 'X' and...

clear w_box.

add 1 to lw_linno.

enddo.

if lw_count eq 0 and w_index ge 27.

message 'All the records have been read'(002) type 'E'.

elseif lw_count eq 0.

message 'Select at least one record'(003) type 'E'.

else.

select carrid " Airline carrid.

connid " Connection ID

fldate " Fight date.

seatsmax " Maximum no.of seats

seatsocc " Occupied no.of seats

into table lt_sflight

from sflight

for all entries in lt_spfli

where carrid eq lt_spfli-carrid

and connid eq lt_spfli-connid.

if sy-subrc eq 0.

set pf-status space.

loop at lt_sflight into lwa_sflight.

write :

/ lwa_sflight-carrid,

10 lwa_sflight-connid,

25 lwa_sflight-fldate,

45 lwa_sflight-seatsmax,

57 lwa_sflight-seatsocc.

endloop.

else.

message 'No data found'(004) type 'E'.

endif. " If sy-subrc eq 0.

clear lwa_sflight.

endif. " If lw_count=0 and w_index>= 27.

endform. " DISPLAY_SFLIGHT

&----


*& Form DISPLAY_ALL

&----


  • This subroutine selects all the records in the basic list. *

----


  • There are no interface parameters to be passed to this subroutine. *

----


form display_all .

*Declaration of Work variables...

data:

lw_lines type i, " Holds no.of lines in t_spfli

lw_linno type i value 5.

describe table t_spfli lines lw_lines.

do lw_lines times.

read line lw_linno field value wa_spfli-check into wa_spfli-check.

if wa_spfli-check ne '*'.

w_box = 'X'.

modify line lw_linno field value w_box .

endif. " If wa_spfli-check ne '*'.

add 1 to lw_linno.

clear wa_spfli-check.

enddo. " Do lw_lines times.

endform. " DISPLAY_ALL

&----


*& Form DESELECT_ALL

&----


  • This subroutine deselects all the lines selected on the list *

----


  • There are no interface parameters to be passed to this subroutine. *

----


form deselect_all .

data:

lw_lines type i, " Holds no.of lines in t_spfli

lw_linno type i value 5,

lw_count type i.

describe table t_spfli lines lw_lines.

do lw_lines times.

read line lw_linno field value

wa_spfli-check into wa_spfli-check.

if wa_spfli-check ne '*'.

w_box = ' '.

modify line lw_linno field value w_box .

add 1 to lw_count .

endif. " If wa_spfli-check ne '*'.

add 1 to lw_linno.

clear wa_spfli-check.

enddo. " Do lw_lines times.

endform. " Form deselect_all

&----


*& Form flight_schedule

&----


  • This subroutine prints the flight schedule on basic list.

----


  • There are no interface parameters to be passed to this subroutine. *

----


form flight_schedule .

loop at t_spfli into wa_spfli.

write :

/ w_box as checkbox,

5 wa_spfli-carrid,

12 wa_spfli-connid,

20 wa_spfli-airpfrom,

30 wa_spfli-airpto,

40 wa_spfli-deptime,

52 wa_spfli-arrtime,

65 wa_spfli-check .

endloop. " Loop at t_spfli into wa_spfli.

clear wa_spfli.

endform. " Form flight_schedule

&----


*& Form headings

&----


  • This subroutine displays the top of page during line selection.*

----


  • There are no interface parameters to be passed to this subroutine. *

----


form headings.

write : 'Flight Information'(001), 65 sy-lsind.

uline.

format color col_heading.

write:

/'Carrid'(005),10 'Connid'(006),25 'Flight Date'(007),

48 'Max.Seats'(008),62 'Occ.seats'(009).

format color off.

uline.

endform. " Form headings

&----


*& Form list_headings *

&----


  • This subroutine displays the top of page *

----


  • There are no interface parameters to be passed to this subroutine. *

----


form list_headings .

format color col_heading.

write:

/3'Carrid'(005),10 'Connid'(006),18 'Airp-fr'(010),

27 'Airp-to'(011),40 'Dep-time'(012),

52 'Arr-time'(013),66 'Check'(014).

format color off.

uline.

endform. " List_headings

Read only

0 Likes
634

this is quite complecated any thing simple

Read only

Former Member
0 Likes
635

this is my code

&----


*& Report YTEST_REP9 *

*& *

&----


*& *

*& *

&----


REPORT YTEST_REP9 NO STANDARD PAGE HEADING.

TABLES: EKKO , EKPO.

DATA: BEGIN OF IT_EBELN OCCURS 0,

EBELN TYPE EKKO-EBELN,

LIFNR TYPE EKKO-LIFNR,

check(1) type c,

END OF IT_EBELN.

data chk type c.

SELECT-OPTIONS: S_PO FOR EKKO-EBELN DEFAULT '4500000000'.

SELECT-OPTIONS: S_DATE FOR EKKO-BEDAT DEFAULT '20060823'.

*PARAMETERS PO(10) TYPE C.

*PARAMETERS PO_DATE TYPE D.

START-OF-SELECTION.

SET PF-STATUS '100_S'.

SELECT EBELN LIFNR

FROM EKKO

INTO TABLE IT_EBELN

WHERE EBELN IN S_PO

AND BEDAT IN S_DATE.

LOOP AT IT_EBELN.

AT FIRST.

WRITE:/ 'CHK' , 15 'PO_NUMBER' , 30 'ACCOUNT_NUMBER'.

ULINE.

SKIP.

ENDAT.

WRITE:/ CHK, 15 IT_EBELN-EBELN , 30 IT_EBELN-LIFNR.

ENDLOOP.

*AT LINE-SELECTION .

*WRITE:/ IT_EBELN-EBELN .

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'CANCEL'.

LEAVE TO SCREEN 0.

WHEN 'DISPLAY'.

write: / chk.

ENDCASE.

TOP-OF-PAGE.

WRITE:/ 'THIS IS THE PURCHASE ORDER'.

SKIP.

HERE AFTER CLICKING DISPLAY THAT CHK VALUE IS NOT DISPLAYING

PLEASE REPLY ITS URGENT.

Read only

0 Likes
634

Hi..,

I have modified your code and added the functionality.......chck it once !!!!!!!

REPORT YTEST_REP9 NO STANDARD PAGE HEADING.

TABLES: EKKO , EKPO.

DATA: BEGIN OF IT_EBELN OCCURS 0,

EBELN TYPE EKKO-EBELN,

LIFNR TYPE EKKO-LIFNR,

check(1) type c,

END OF IT_EBELN,

<b>BEGIN OF IT_EBELN1 OCCURS 0,

EBELN TYPE EKKO-EBELN,

LIFNR TYPE EKKO-LIFNR,

END OF IT_EBELN1.</b>

data : chk type c,

<b> w_lines type i,

w_record type i value 6.</b>

SELECT-OPTIONS S_PO FOR EKKO-EBELN DEFAULT <b>'3000000006' to '3000000010'.</b>

SELECT-OPTIONS S_DATE FOR EKKO-BEDAT DEFAULT '20001102'.

START-OF-SELECTION.

SET PF-STATUS '100_S'.

SELECT EBELN LIFNR

FROM EKKO

INTO TABLE IT_EBELN

WHERE EBELN IN S_PO

AND BEDAT IN S_DATE.

LOOP AT IT_EBELN.

AT FIRST.

WRITE:/ 'CHK' , 15 'PO_NUMBER' , 30 'ACCOUNT_NUMBER'.

ULINE.

SKIP.

ENDAT.

WRITE:/ <b>it_ebeln-CHECK as checkbox,</b>

15 IT_EBELN-EBELN , 30 IT_EBELN-LIFNR.

ENDLOOP.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'CANC'.

LEAVE TO SCREEN 0.

WHEN 'DISP'.

<b>describe table it_ebeln lines w_lines.

do w_lines times.

read line w_record : field value it_ebeln-check into chk,

field value it_ebeln-ebeln into it_ebeln1-ebeln,

field value it_ebeln-lifnr into it_ebeln1-lifnr.

if sy-subrc ne 0.

exit.

endif.

if chk eq 'X'.

append it_ebeln1.

endif.

clear : chk, it_ebeln1.

add 1 to w_record.

enddo.

loop at it_ebeln1.

WRITE:/15 IT_EBELN1-EBELN , 30 IT_EBELN1-LIFNR.

endloop.

</b>

ENDCASE.

TOP-OF-PAGE.

WRITE:/ 'THIS IS THE PURCHASE ORDER'.

SKIP.

Reward all helpful ansers..

regards,

Sai ramesh