11-18-2005 1:28 AM
Hi,
I have a function which prints out a list, on pf-status screen I have defined 'PICK' , and used F2.
But it does not seem to go the command AT LINE-SELECTION.
It seems easier with reports than functions, what am I doing wrong?
FUNCTION zfs_spool_history.
*"----
""Local interface:
*" IMPORTING
*" REFERENCE(ID_LIST) TYPE SP01R_ID_LIST OPTIONAL
*"----
DATA: wa_tsp02 TYPE tsp02,
check_box(1) TYPE c.
DATA: l_date LIKE sy-datum,
l_time LIKE sy-uzeit,
pjdest TYPE rspopname.
DATA: colour_code(3) TYPE c VALUE '0'.
SET PF-STATUS 'SPOOLPF'.
SELECT * FROM tsp02 INTO wa_tsp02
FOR ALL ENTRIES IN id_list
WHERE pjident = id_list-id.
ENDSELECT.
WRITE: /(84) sy-uline.
FORMAT INTENSIFIED ON COLOR COL_HEADING.
WRITE:/01 sy-vline, 04'Spool no.' , 14 sy-vline,
15'OutpReqNo', 26 sy-vline,
'Date', 39 sy-vline,
'Time', 50 sy-vline,
'ODev', 57 sy-vline,
'Format', 76 sy-vline,
'Status', 84 sy-vline.
WRITE: /(84) sy-uline.
SELECT * FROM tsp02 INTO wa_tsp02.
FOR ALL ENTRIES IN id_list
WHERE pjident = id_list-id.
WRITE: /01 sy-vline.
FORMAT COLOR COL_KEY.
FORMAT INTENSIFIED ON.
mypjident = wa_tsp02-pjident.
REPLACE ',' IN mypjident WITH ''.
WRITE:02 check_box AS CHECKBOX.
WRITE AT (10) mypjident RIGHT-JUSTIFIED.
WRITE AT 14 sy-vline.
HIDE mypjident.
WRITE AT (9) wa_tsp02-pjnummer CENTERED.
WRITE sy-vline.
IF colour_code = '0'.
FORMAT INTENSIFIED OFF COLOR COL_NORMAL.
colour_code = '1'.
ELSE.
FORMAT INTENSIFIED ON COLOR COL_NORMAL.
colour_code = '0'.
ENDIF.
MOVE wa_tsp02-pjcreatime(8) TO l_date.
MOVE wa_tsp02-pjcreatime+8(6) TO l_time.
MOVE wa_tsp02-pjdest(4) TO pjdest.
WRITE: l_date, sy-vline.
WRITE: l_time, sy-vline.
WRITE pjdest.
WRITE AT 57 sy-vline.
WRITE: wa_tsp02-pjpaper, sy-vline.
WRITE: wa_tsp02-pjstatus, 84 sy-vline.
ENDSELECT.
WRITE: /(84) sy-uline.
ENDFUNCTION.
form display_spool_document.
write 'Item picked '.
endform.
AT LINE-SELECTION.
PERFORM display_spool_document.
11-18-2005 12:52 PM
Hi u cannot use the statement at line-selection in a function module since its an event in a report.
better change ur logic accordinly topush the data to the internal table and then call theis FM in the report and get access to this Internal table and display the contents as per ur choice.
satish
11-18-2005 2:47 AM
'At line selection' is a report event. With function module it will not work. If you want to use such functionality then write Report.
11-18-2005 4:20 AM
Hi,
AT line-selection is an event for interactive reporting .
That is why it is not working in your fM
Regards
Beena
11-18-2005 7:04 AM
Hi sims,
1. In FM, we cannot use write statement
to directly show data on screen.
2. Can u let us know, how u have attempted
to display using write statement.
I mean is it using a new screen (using the screen editor)
and calling that screen?
or some other technique ?
Regards,
AmitM.
11-18-2005 7:54 AM
Hi,
AT LINE-SELECTION wont get triggered inside the FM.
Thanks,
Abdul
11-18-2005 11:12 AM
Hi,
It needs to be in a function as it get called from a report, which I have written. What events do get called from a function? I basically have Icons, which I want to ewpons to and line selection?
11-18-2005 12:45 PM
Hi Sims,
When execute the function module results will be displayed in function module workarea.(On screen).
If you check the system status you can see datails
displyed on SE37 transaction screen.
Coming to your requirement, in the fucntion module
get data and process data and finally you pass to one itab. When you are calling that function module in your program take data from the itab and now you can play around and do whatever you want.
Hope this will help you.
Thanks & Regards,
Siri.
kindly reward points if it is useful.
Message was edited by: Srilatha T
11-18-2005 12:52 PM
Hi u cannot use the statement at line-selection in a function module since its an event in a report.
better change ur logic accordinly topush the data to the internal table and then call theis FM in the report and get access to this Internal table and display the contents as per ur choice.
satish
11-18-2005 2:22 PM
HI,
I managed to solve the problem of events in functions myself, sample code below for refernce purposes, Screen 500 is just a dummy screen, the pf-status have been defined.
FUNCTION ZJUNK1.
CALL SCREEN 500.
endfunction.
MODULE create_list OUTPUT.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
SET PF-STATUS 'SCREEN_600'.
TABLES demo_conn.
Global Data
DATA: wa_spfli TYPE spfli.
SELECT carrid connid cityfrom cityto
FROM spfli
INTO (wa_spfli-carrid, wa_spfli-connid,
wa_spfli-cityfrom, wa_spfli-cityto).
WRITE: / wa_spfli-carrid, wa_spfli-connid,
wa_spfli-cityfrom, wa_spfli-cityto.
ENDSELECT.
LEAVE SCREEN.
ENDMODULE. "create_list OUTPUT
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'TEST'.
WRITE 'TESTER'.
WHEN 'CHOOSE'.
write 'PICK'.
ENDCASE.
AT LINE-SELECTION.
WRITE 'fdfdfdgdgfdgd*****'.
TOP-OF-PAGE.
WRITE text-001 COLOR COL_HEADING.
ULINE.