2006 Oct 17 9:41 AM
In one of my applications, I need to put the "PATTERN" button which we find on Workbench next to Pretty Printer. How should I go about it?
2006 Oct 17 9:44 AM
put a button on application tool bar and
when u press that button call a modal dialog box with an input value of TFDIR-FUNCNAME having a F4 functionality with all the function modules from table TFDIR
Regards
- Gopi
2006 Oct 17 9:45 AM
Hello,
U can set it using the PF-STATUS. Then set a Fcode for that button. In the PAI copy this code
SET PF-STATUS 'PGPS' OF PROGRAM 'SAPLLOCAL_EDT1'.
CHECK IS_INITIALIZED = FALSE.
clear rstxp-tdanweisng.
IF NOT ( EDIT-APP_ID EQ 'DY' OR TRANSPORT_KEY-SUB_TYPE EQ 'DYNP' ).
clear: rstxp-tdselect, rstxp-tdfunction, rstxp-tdmessage,
rstxp-tdanweisng, tdauto.
CLEAR TDAUTO.
MARK2 = 'X'.
MARK1 = MARK3 = MARK4 = MARK5 = MARK6 = MARK7 = MARK8 = '.'.
MARK9 = MARK10 = MARK11 = MARK12 = MARK13 = '.'.
clear: message_id.
X_INCLNAME = EDIT-BUF_NAME.
CALL FUNCTION 'RS_GET_MAINPROGRAMS'
EXPORTING
DIALOG = 'X'
NAME = X_INCLNAME
IMPORTING
NUMBER_OF_MAINPROGRAMS = I1
TABLES
MAINPROGRAMS = MAINTAB
EXCEPTIONS
CANCELLED = 1.
IF SY-SUBRC NE 0. EXIT. ENDIF.
IF I1 NE 1.
CALL FUNCTION 'RS_PROGNAME_SPLIT'
EXPORTING
PROGNAME_WITH_NAMESPACE = X_INCLNAME
IMPORTING
NAMESPACE = T_NAMESPACE
PROGNAME_WITHOUT_NAMESPACE =
T_PROGNAME_WITHOUT_NAMESPACE
EXCEPTIONS
DELIMITER_ERROR = 1
OTHERS = 2.
NAME(3) = 'SAP'.
name+3 = edit-buf_name(5).
STR_LEN = STRLEN( T_PROGNAME_WITHOUT_NAMESPACE ) - 3.
IF STR_LEN > 0.
NAME+3 = T_PROGNAME_WITHOUT_NAMESPACE(STR_LEN).
ELSE.
NAME+3 = T_PROGNAME_WITHOUT_NAMESPACE.
ENDIF.
CONCATENATE T_NAMESPACE NAME INTO NAME.
ELSE.
READ TABLE MAINTAB INDEX 1.
NAME = MAINTAB-NAME.
ENDIF.
IF RSTXP-TDID = SPACE.
SELECT SINGLE * FROM TRDIRE WHERE REPORT = NAME.
IF SY-SUBRC = 0.
MESSAGE_ID = TRDIRE-MSGID.
ELSE.
clear message_id.
ENDIF.
RSTXP-TDID = MESSAGE_ID.
ENDIF.
RSTXP-TDTYP = 'E'.
TDZEILEN = 1.
ELSE.
MARK4 = 'X'.
MARK1 = MARK3 = MARK2 = MARK5 = MARK6 = MARK7 = MARK8 = '.'.
MARK9 = MARK10 = MARK11 = MARK12 = MARK13 = '.'.
ENDIF.
SET CURSOR FIELD 'RSTXP-TDFUNCTION'.
IS_INITIALIZED = TRUE.
IF VALUE_REQ NE SPACE.
SUPPRESS DIALOG.
ENDIF.
If useful reward.
Vasanth
2006 Oct 17 9:53 AM
Hi Govind,
Refer sample program -
1) DEMO_SEL_SCREEN_PUSHBUTTON (<b>for button on Selection
screen)</b> 2) DEMO_DYNPRO_PUSH_BUTTON.
<b> IF you want to add button in the Application Toolbar</b>.
TABLES SSCRFIELDS.
SELECTION-SCREEN FUNCTION KEY 2.
Regular selection screen for Online Processing.
SELECTION-SCREEN : BEGIN OF BLOCK 100 WITH FRAME TITLE text-001.
Radio buttons
PARAMETERS : r_text1 TYPE c RADIOBUTTON GROUP a USER-COMMAND usr,
r_text2 TYPE c RADIOBUTTON GROUP a DEFAULT 'X'.
Team
PARAMETERS : p_team LIKE zoroleuid-zteam,
Account Analyst
p_aa LIKE eanld-zzactanlst.
Start date of report
SELECT-OPTIONS: s_date FOR sy-datum NO-EXTENSION.
SELECTION-SCREEN : END OF BLOCK 100.
INITIALIZATION.
MOVE 'My text' TO sscrfields-functxt_02.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'FC02'.
WRITE:/ 'Push button '.
ENDIF.
START-OF-SELECTION.
WRITE:/ 'Execute button '.
Reward Points if this Helps.
Manish
Message was edited by: Manish Kumar
2006 Oct 17 9:57 AM
HI,
Check this Function pool :
SAPLLOCAL_EDT1
In this LLOCAL_EDT1O01 include.
Put break points and debug u may find some hint how to use...
Regards,
Santhosh