‎2007 Mar 29 6:38 AM
Hi All,
am displaying a list in the list output i need add to buttons in the application toll bar .
how to do this.
Thanks&Regards.
Ramu.
‎2007 Mar 29 6:40 AM
Hi,
Use SET PF-STATUS 'AAA' in the program. double click on it and it will take you to SE41 screen where you can put two buttons and design as per your wish.
Write the code in the programs, for the function codes assigned for those buttons and do accordingly
reward if useful
regards,
ANJI
‎2007 Mar 29 6:40 AM
Check this link.
http://help.sap.com/saphelp_47x200/helpdata/en/ce/cd7c47c24d11d2bd8d080009b4534c/frameset.htm
and
http://help.sap.com/saphelp_47x200/helpdata/en/ce/cd7c53c24d11d2bd8d080009b4534c/content.htm
Run this Program.. enter the Tcode. u'ii get teh BADI's exist for the Tcode
REPORT Z_FIND_BADI .
TABLES : TSTC,
TADIR,
MODSAPT,
MODACT,
TRDIR,
TFDIR,
ENLFDIR,
SXS_ATTRT ,
TSTCT.
DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
DATA : FIELD1(30).
DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
PARAMETERS : P_TCODE LIKE TSTC-TCODE,
P_PGMNA LIKE TSTC-PGMNA .
DATA wa_tadir type tadir.
START-OF-SELECTION.
IF NOT P_TCODE IS INITIAL.
SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
ELSEIF NOT P_PGMNA IS INITIAL.
TSTC-PGMNA = P_PGMNA.
ENDIF.
IF SY-SUBRC EQ 0.
SELECT SINGLE * FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'PROG'
AND OBJ_NAME = TSTC-PGMNA.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
IF SY-SUBRC NE 0.
SELECT SINGLE * FROM TRDIR
WHERE NAME = TSTC-PGMNA.
IF TRDIR-SUBC EQ 'F'.
SELECT SINGLE * FROM TFDIR
WHERE PNAME = TSTC-PGMNA.
SELECT SINGLE * FROM ENLFDIR
WHERE FUNCNAME = TFDIR-FUNCNAME.
SELECT SINGLE * FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'FUGR'
AND OBJ_NAME EQ ENLFDIR-AREA.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
ENDIF.
ENDIF.
SELECT * FROM TADIR INTO TABLE JTAB
WHERE PGMID = 'R3TR'
AND OBJECT in ('SMOD', 'SXSD')
AND DEVCLASS = V_DEVCLASS.
SELECT SINGLE * FROM TSTCT
WHERE SPRSL EQ SY-LANGU
AND TCODE EQ P_TCODE.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) P_TCODE,
45(50) TSTCT-TTEXT.
SKIP.
IF NOT JTAB[] IS INITIAL.
WRITE:/(105) SY-ULINE.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
Sorting the internal Table
sort jtab by OBJECT.
data : wf_txt(60) type c,
wf_smod type i ,
wf_badi type i ,
wf_object2(30) type C.
clear : wf_smod, wf_badi , wf_object2.
Get the total SMOD.
LOOP AT JTAB into wa_tadir.
at first.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 SY-VLINE,
2 'Enhancement/ Business Add-in',
41 SY-VLINE ,
42 'Description',
105 SY-VLINE.
WRITE:/(105) SY-ULINE.
endat.
clear wf_txt.
at new object.
if wa_tadir-object = 'SMOD'.
wf_object2 = 'Enhancement' .
elseif wa_tadir-object = 'SXSD'.
wf_object2 = ' Business Add-in'.
endif.
FORMAT COLOR COL_GROUP INTENSIFIED ON.
WRITE:/1 SY-VLINE,
2 wf_object2,
105 SY-VLINE.
endat.
case wa_tadir-object.
when 'SMOD'.
wf_smod = wf_smod + 1.
SELECT SINGLE MODTEXT into wf_txt
FROM MODSAPT
WHERE SPRSL = SY-LANGU
AND NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
when 'SXSD'.
For BADis
wf_badi = wf_badi + 1 .
select single TEXT into wf_txt
from SXS_ATTRT
where sprsl = sy-langu
and EXIT_NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
endcase.
WRITE:/1 SY-VLINE,
2 wa_tadir-OBJ_NAME hotspot on,
41 SY-VLINE ,
42 wf_txt,
105 SY-VLINE.
AT END OF object.
write : /(105) sy-ULINE.
ENDAT.
ENDLOOP.
WRITE:/(105) SY-ULINE.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No.of Exits:' , wf_smod.
WRITE:/ 'No.of BADis:' , wf_badi.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'No userexits or BADis exist'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'Transaction does not exist'.
ENDIF.
AT LINE-SELECTION.
data : wf_object type tadir-object.
clear wf_object.
GET CURSOR FIELD FIELD1.
CHECK FIELD1(8) EQ 'WA_TADIR'.
read table jtab with key obj_name = sy-lisel+1(20).
move jtab-object to wf_object.
case wf_object.
when 'SMOD'.
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
when 'SXSD'.
SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
endcase
SET PF-STATUS - List
Syntax
SET PF-STATUS status [OF PROGRAM prog] [EXCLUDING fcode]
[IMMEDIATELY].
Extras:
1. ... OF PROGRAM prog
2. ... EXCLUDING fcode
3. ... IMMEDIATELY
Effect:
During list processing, this statement sets the GUI status specified in status for the display window of the current list, and all subsequent list levels until the next SET PF-STATUS statement. The statement mainly has the same function as for screens.
In contrast to the screen layouts of screens, however, every list level is automatically linked to the GUI status that is set for it. If the user returns from displaying a higher list level to a lower list level, the latter is redisplayed with the GUI status that was set for it.
If the status of the data object is initial, the standard list status is set and the additions OF PROGRAM and EXCLUDING have no effect. The standard list status contains predefined list-specific functions whose functions are handled by the runtime environment during the display of a screen list, and do not lead to the call of event blocks in the ABAP program. If event blocks are also defined with AT LINE-SELECTION or AT PF##, further function keys are automatically assigned function codes in the standard list status:
If AT LINE-SELECTION is used, the F2 key and the double click function of the mouse is assigned the function code PICK and the function text Select. This function is then also automatically displayed in the application toolbar.
If AT PF## is used, all the F## functions of the keyboard that are not handled by the runtime environment are assigned the function codes PF##, where ## is a number between 01 and 24.
If the standard list status is set, sy-pfkey receives the value "STLI".
Note:
When setting the GUI status for the list screen, it is recommended to set a GUI status for which a list status has been included as a template status in the Menu Painter. Including this type of template status copies the list-specific functions of the standard list status into a self-defined GUI status.
Addition 1
... OF PROGRAM prog
Addition 2
... EXCLUDING fcode
Effect
Wie bei screens.
Addition 3
... IMMEDIATELY
Effect:
The addition IMMEDIATELY only has an effect if it is used when creating a details list, that is, within an event block following an interactive list event. The effect of this addition is that SET PF-STATUS has an effect on the current displayed list (sy-listi) and all subsequent list levels, and not only starting from the current details list (sy-lsind).
Example:
In the following program segment, double clicking the mouse or using the function key F2 only enables selection of a single line from the basic list. This function is then deactivated for the basic list and all subsequent list levels.
START-OF-SELECTION.
SET PF-STATUS 'BASIC'.
WRITE / `Pick me!`.
AT LINE-SELECTION.
SET PF-STATUS 'BASIC' EXCLUDING 'PICK' IMMEDIATELY.
WRITE / `Don't pick me!`.
Message was edited by:
sunil kumar
‎2007 Mar 29 6:43 AM
hi,
In menu painter you can define you own gui status for your list .You can add buttons on the aplication tool bar .Mention the program name and give the status name and click the create button and you can add there required buttons.
regards,
veeresh
‎2007 Mar 29 7:49 AM
Hi,
You can create your own application bar in a program through
1.SET PF-STATUS
2. SE41
Try this.
1. SET PF-STATUS 'ALV_MENU'.
double click on 'alv-menu'. click on application bar(+button) and write the commands you want to perform.
2. Or you can copy the standard SAP menu in your program.
a. Goto se41.
b. write 'SAPLSLVC_FULLSCREEN' in the program block.
c. write 'standard_fullscreen' in status block.
d. now goto user interface icon at the top.
e. goto 'copy'. click on status.
f. write your program name and pf-status name in the blocks .
g. press enter and activate.
goto the program and check if its working.
plz rewad points if helpful.
thanks