SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Push button на селекционном экране



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Рустам
Специалист
Специалист



Joined: 26 Dec 2007
Posts: 73

PostPosted: Wed Jan 23, 2008 10:56 am    Post subject: Push button на селекционном экране Reply with quote

Потребовалось создать на селекционном экране свою кнопку

Code:
TABLES SSCRFIELDS.

SELECTION-SCREEN PUSHBUTTON /10(20) btn1 USER-COMMAND BNT1.

INITIALIZATION.
  MOVE 'Exec' TO btn1.

AT SELECTION-SCREEN.
  IF SSCRFIELDS-UCOMM = 'BNT1'.
    ...
  ENDIF.


Когда пользователь нажимает на кнопку, должен показаться отчет, так как если бы он нажал на F8. Что нужно написать в обработчике кнопки?
Back to top
View user's profile Send private message
Armann
Модератор
Модератор



Joined: 01 Jan 2008
Posts: 422
Location: Moscow

PostPosted: Wed Jan 23, 2008 11:18 am    Post subject: Reply with quote

Все выборки и формирование отчета, все то что у вас раньше было в секции start-of-selection и далее - заверните в отдельные процедуры и их вызывайте. Только не забудьте перед выводом отчета выполнить команду LEAVE TO LIST-PROCESSING - иначе рискуете ничего не увидеть
Back to top
View user's profile Send private message Blog
Сергей
Участник
Участник



Joined: 25 Oct 2007
Posts: 49

PostPosted: Wed Jan 23, 2008 11:31 am    Post subject: Reply with quote

мы так делали

Code:
AT SELECTION-SCREEN.

  IF SSCRFIELDS-UCOMM = 'BNT1'.
     SSCRFIELDS-UCOMM = 'ONLI'.
  ENDIF.
Back to top
View user's profile Send private message
Рустам
Специалист
Специалист



Joined: 26 Dec 2007
Posts: 73

PostPosted: Wed Jan 23, 2008 12:29 pm    Post subject: Reply with quote

Спасибо!
Проверил каждый вариант, первый сразу заработал.
По второму, Armann, подскажите пожалуйста, а как назад вернуться из листа? Кнопки BACK, ... не отрабатывают

Code:
REPORT ZTEST.

TABLES SSCRFIELDS.

SELECTION-SCREEN PUSHBUTTON /10(20) btn1 USER-COMMAND BNT1.

INITIALIZATION.
  MOVE 'Exec' TO btn1.

AT SELECTION-SCREEN.
  IF SSCRFIELDS-UCOMM = 'BNT1'.
    SSCRFIELDS-UCOMM = 'ONLI'.
  ENDIF.

START-OF-SELECTION.

WRITE 10 'test'.


Вариант с LEAVE TO LIST-PROCESSING.
Code:
REPORT ZTEST.

TABLES SSCRFIELDS.

SELECTION-SCREEN PUSHBUTTON /10(20) btn1 USER-COMMAND BNT1.

INITIALIZATION.
  MOVE 'Exec' TO btn1.

AT SELECTION-SCREEN.
  IF SSCRFIELDS-UCOMM = 'BNT1'.
    write 10 'test'.
    LEAVE TO LIST-PROCESSING.
  ENDIF.

START-OF-SELECTION.
Back to top
View user's profile Send private message
Armann
Модератор
Модератор



Joined: 01 Jan 2008
Posts: 422
Location: Moscow

PostPosted: Wed Jan 23, 2008 12:47 pm    Post subject: Reply with quote

Вот:
Code:

AT USER-COMMAND.
  CASE SY-UCOMM.
      WHEN 'BACK'. LEAVE LIST-PROCESSING.   
  ENDCASE.
Back to top
View user's profile Send private message Blog
Рустам
Специалист
Специалист



Joined: 26 Dec 2007
Posts: 73

PostPosted: Wed Jan 23, 2008 2:43 pm    Post subject: Reply with quote

Да, все работает, спасибо!

Только код кнопки на серекционном экране у меня:

Code:
AT USER-COMMAND.
  CASE SY-UCOMM.
      WHEN 'E'. LEAVE LIST-PROCESSING.   
  ENDCASE.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.