2007 May 29 11:57 AM
Hi,
I want to display a smartform using the user command, however i am unable to display two button - invoice1 and exit. the code is:
AT user-command.
IF SY-UCOMM = 'print1'.
DATA: FM_NAME TYPE RS38L_FNAM.
ENDIF.
IF SY-UCOMM = 'exit'.
LEAVE PROGRAM.
ENDIF.
form invoice1.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_SMART_FORM_TEST2'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
call function FM_NAME
TABLES
IT_SBOOK = IT_SBOOK
EXCEPTIONS
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
endform.
please help me in eliminating the error.
regards
vivek
2007 May 29 11:58 AM
always use UPPER CASE values for sy-ucomm
IF SY-UCOMM = <b>'PRINT1'.</b>
DATA: FM_NAME TYPE RS38L_FNAM.
ENDIF.
IF SY-UCOMM = <b>'EXIT'.</b>
LEAVE PROGRAM.
ENDIF.
2007 May 29 12:06 PM
hI, THANK YOU FOR UR QUICK REPLY. HOWEVER IT HAS SOME MORE ISSUES THATS WHY ITS NOT DISPLAYING THE TWO BUTTONS.
REGARDS
VIVEK
2007 May 29 12:08 PM
try setting the PF-STATUS
START-OF-SELECTION.
SET PF-STATUS 'STATUS'. " double click on status
2007 May 29 12:00 PM
always use ucomm as upper case and letter shoud be 4 char,
case sy-ucomm.
when 'PRIN'.
when 'EXIT'.
Endcase.