Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SY-UCOMM

Former Member
0 Likes
625

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

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

4 REPLIES 4
Read only

Former Member
0 Likes
571

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.

Read only

0 Likes
571

hI, THANK YOU FOR UR QUICK REPLY. HOWEVER IT HAS SOME MORE ISSUES THATS WHY ITS NOT DISPLAYING THE TWO BUTTONS.

REGARDS

VIVEK

Read only

0 Likes
571

try setting the PF-STATUS

START-OF-SELECTION.

SET PF-STATUS 'STATUS'.  " double click on status

Read only

Former Member
0 Likes
571

always use ucomm as upper case and letter shoud be 4 char,

case sy-ucomm.

when 'PRIN'.

when 'EXIT'.

Endcase.