2008 Feb 12 5:12 AM
Hi
I want to set a button in basic list of a transaction,not an ALV.
I don't want to see the button in the detail list. How should i set this and where. Ideally where should pf-status be set in ?.
Answers will be rewarded.
Thanks
Varun Mathur
Edited by: Varun Mathur on Feb 12, 2008 7:42 AM
2008 Feb 12 5:21 AM
Hi Varun Mathur,
Try set pf-status 'STAT' EXCLUDING fcode syntax
DATA: fcode TYPE TABLE OF sy-ucomm,
wa_fcode TYPE sy-ucomm.
START-OF-SELECTION.
wa_fcode = 'FC1 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC2 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC3 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC4 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC5 '. APPEND wa_fcode TO fcode.
wa_fcode = 'PICK'. APPEND wa_fcode TO fcode.
SET PF-STATUS 'TEST'.
WRITE: 'PF-Status:', sy-pfkey.
AT LINE-SELECTION.
IF sy-lsind = 20.
SET PF-STATUS 'TEST' EXCLUDING fcode.
ENDIF.
WRITE: 'Line-Selection, SY-LSIND:', sy-lsind,
/ ' SY-PFKEY:', sy-pfkey.
AT USER-COMMAND.
IF sy-lsind = 20.
SET PF-STATUS 'TEST' EXCLUDING fcode.
ENDIF.
WRITE: 'User-Command, SY-LSIND:', sy-lsind,
/ ' SY-UCOMM:', sy-ucomm,
/ ' SY-PFKEY:', sy-pfkey.
Plzz reward if it is useful,
Mahi.
Hi Varun,
Where you want the push button you have not define. Well there are two way where you can do this.
1. In Screen
A. With PF-Status.
B. by Screen painter (Must have to give function code for the same)
2. Selection Screen
A. With Pf Status
B. SELECTION-SCREEN PUSHBUTTON fmt name USER-COMMAND ucom.
3. In a List
A. Only With PF Status.
Regards
Swati..
2008 Feb 12 5:21 AM
Hi Varun Mathur,
Try set pf-status 'STAT' EXCLUDING fcode syntax
DATA: fcode TYPE TABLE OF sy-ucomm,
wa_fcode TYPE sy-ucomm.
START-OF-SELECTION.
wa_fcode = 'FC1 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC2 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC3 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC4 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC5 '. APPEND wa_fcode TO fcode.
wa_fcode = 'PICK'. APPEND wa_fcode TO fcode.
SET PF-STATUS 'TEST'.
WRITE: 'PF-Status:', sy-pfkey.
AT LINE-SELECTION.
IF sy-lsind = 20.
SET PF-STATUS 'TEST' EXCLUDING fcode.
ENDIF.
WRITE: 'Line-Selection, SY-LSIND:', sy-lsind,
/ ' SY-PFKEY:', sy-pfkey.
AT USER-COMMAND.
IF sy-lsind = 20.
SET PF-STATUS 'TEST' EXCLUDING fcode.
ENDIF.
WRITE: 'User-Command, SY-LSIND:', sy-lsind,
/ ' SY-UCOMM:', sy-ucomm,
/ ' SY-PFKEY:', sy-pfkey.
Plzz reward if it is useful,
Mahi.
2008 Feb 12 5:39 AM
HI,
check this program. in this the basic list has the gui and not the detail list...here the detail list is done using alv..dont worry abt that.
report z_banks1_rp1.
*----
TABLE
*----
tables : zacc_master2.
*----
TYPE-POOLS
*----
type-pools slis.
*----
*INTERNAL TABLE
*----
data : itab like zacc_master2 occurs 0 with header line.
data : itab1 like zacc_master2 occurs 0 with header line.
*----
DATA
*----
data : gt_fcat type slis_t_fieldcat_alv,
fcat like line of gt_fcat.
data : check type c length 1,
wa type c length 20.
select * from zacc_master2 into table itab.
write : ' ACCOUNT NUMBER' intensified color 3.
loop at itab.
write: / check as checkbox, itab-zaccno.
endloop.
hide : itab.
*----
START OF SELECTION
*----
start-of-selection.
set pf-status 'ZMBANKS1'.
*----
AT LINE SELECTION
*----
at line-selection.
*----
AT USER-COMMAND
*----
at user-command.
case sy-ucomm.
when 'SUBMIT'.
do.
read line sy-index field value check itab-zaccno into wa.
if sy-subrc <> 0.
exit.
elseif check = 'X'.
read table itab with key zaccno = wa.
if sy-subrc eq 0.
move-corresponding itab to itab1.
append itab1.
endif.
endif.
enddo.
*----
CALLING SUB-ROUTINE
*----
perform fieldcatalog.
*----
CALLING FUNCTION MODULE
*----
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
it_fieldcat = gt_fcat[]
tables
t_outtab = itab1.
when 'BACK'.
call screen 0002.
*WHEN 'BACK1'.
*
*CALL SCREEN 0002.
*
endcase.
*----
SUB ROUTINE DECLARATION
*----
form fieldcatalog.
fcat-seltext_l = 'ACCOUNT NUMBER'.
fcat-fieldname = 'ZACCNO'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
fcat-seltext_l = 'CUSTOMER ID'.
fcat-fieldname = 'ZCUSTID'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
fcat-seltext_l = 'ACCOUNT TYPE'.
fcat-fieldname = 'ZACCTYPE'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
fcat-seltext_l = 'ACCOUNT BALANCE'.
fcat-fieldname = 'ZBAL'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
fcat-seltext_l = 'ACCOUNT CREATED DATE'.
fcat-fieldname = 'ZACCDATE'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
fcat-seltext_l = 'STATUS'.
fcat-fieldname = 'ZSTAT'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
endform.
Please reward if it is helpful.
regards,
sri
2008 Feb 12 6:53 AM
Hi Varun,
Where you want the push button you have not define. Well there are two way where you can do this.
1. In Screen
A. With PF-Status.
B. by Screen painter (Must have to give function code for the same)
2. Selection Screen
A. With Pf Status
B. SELECTION-SCREEN PUSHBUTTON fmt name USER-COMMAND ucom.
3. In a List
A. Only With PF Status.
Regards
Swati..
2008 Feb 12 7:02 AM
I want the button to show up in the basic list (first list that shows up). I have tried the set pf-status in the start of selection, but it did'nt work. So i have directly put it in the code for outputting the list.
Another thing i have tried is the excluding with pf-status but with no success.
2008 Feb 12 7:07 AM
Hi,
in the pf-status u will declare push button.
at line-selection.
if sy-lisnd eq 0.
set pf-status 'MAIN'.
endif.
Plzz reward points if it helps.
2008 Feb 13 8:03 AM
Hi Varun.
Sorry for Later Reply. now it is clear that you want the button in List . but where Following answer may help you Please refer
1. At Selection Screen itself
START-OF-SELECTION.
PF-STATUS 'MAIN'.
2. At First List. : Before Writ statment of List.
END-OF-SELECTION.
set pf-status 'SECND'
LOOP at itab
write 😕 itab-matnr.
endloop.
3. Send and onwards.
Same for Onward All List
Regards
Swati...
2008 Feb 14 11:48 AM
thanks for ur reply. That means in any event u can set pf-satus in.
i have set it in start of selection. though i think top-of-page can also be used.
thanks again.
varun
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |