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

Поле выбора в POPUP_GET_VALUES



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Esh19
Участник
Участник



Joined: 04 May 2011
Posts: 6

PostPosted: Wed May 04, 2011 11:02 am    Post subject: Поле выбора в POPUP_GET_VALUES Reply with quote

Коллеги, подскажите как сделать поле выбора в ФМ POPUP_GET_VALUES

При вызове появляется окошко куда нужно ввести текст, а хотелось бы выбирать значения.

Может какой другой ФМ нужен?

selection-screen не пройдет)
Back to top
View user's profile Send private message
Dmitriy
Аналитик
Аналитик


Age: 46
Joined: 14 Nov 2008
Posts: 300
Location: Russia

PostPosted: Wed May 04, 2011 11:49 am    Post subject: Reply with quote

Code:
*&---------------------------------------------------------------------*
  DEFINE systmess.
    message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  END-OF-DEFINITION.
*&---------------------------------------------------------------------*
  DATA: is_sval TYPE sval,
        it_sval TYPE TABLE OF sval.
  DATA: lv_bukrs TYPE bukrs,
        lv_date TYPE d,
        lv_rcode.

  is_sval-tabname = 'BKPF'.
  is_sval-fieldname = 'BUKRS'.
  APPEND is_sval TO it_sval. CLEAR is_sval.
  is_sval-tabname = 'BKPF'.
  is_sval-fieldname = 'BUDAT'.
  is_sval-value = sy-datum.
  APPEND is_sval TO it_sval. CLEAR is_sval.

  CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
      popup_title     = 'FM POPUP_GET_VALUES'
    IMPORTING
      returncode      = lv_rcode
    TABLES
      fields          = it_sval
    EXCEPTIONS
      error_in_fields = 1
      OTHERS          = 2.
  IF sy-subrc = 0.
    CASE lv_rcode.
      WHEN space.
        LOOP AT it_sval INTO is_sval.
          CASE is_sval-fieldname.
            WHEN 'BUKRS'.
              lv_bukrs = is_sval-value.
            WHEN 'BUDAT'.
              lv_date = is_sval-value.
          ENDCASE.
        ENDLOOP.
      WHEN 'A'.
        MESSAGE 'Отменено пользователем' TYPE 'S'.
    ENDCASE.
  ELSE.
    systmess.
  ENDIF.



POPUP_GET_VALUES.jpg
 Description:
 Filesize:  5.54 KB
 Viewed:  15310 Time(s)

POPUP_GET_VALUES.jpg



_________________
ABAP/4 You
Back to top
View user's profile Send private message
Esh19
Участник
Участник



Joined: 04 May 2011
Posts: 6

PostPosted: Wed May 04, 2011 12:14 pm    Post subject: Reply with quote

Да, знаю читал

но вот почему там есть возможность выбора, а у меня нет не понял

вот код:

Code:
DATA: lv_returncode(3) TYPE c.

      DATA: lt_fields type TABLE OF sval,
            ls_string_of_lt_fields type sval.

      CLEAR lt_fields. REFRESH lt_fields.
      CLEAR ls_string_of_lt_fields.

      ls_string_of_lt_fields-tabname = 'T156'.
      ls_string_of_lt_fields-fieldname = 'BWART'.
*      ls_string_of_lt_fields-value = ''.
      APPEND ls_string_of_lt_fields to lt_fields.

      CALL FUNCTION 'POPUP_GET_VALUES'
        EXPORTING
          popup_title     = 'Введите вид движения'
        IMPORTING
          returncode      = lv_returncode
        TABLES
          fields          = lt_fields
        EXCEPTIONS
          error_in_fields = 1
          OTHERS          = 2.
Back to top
View user's profile Send private message
Dmitriy
Аналитик
Аналитик


Age: 46
Joined: 14 Nov 2008
Posts: 300
Location: Russia

PostPosted: Wed May 04, 2011 12:27 pm    Post subject: Reply with quote

В словаре с T156-BWART на предмет SH всё в порядке? Системы нет, да и отпуск... Wink

UPD: Это же у нас ВДв? Должно быть всё норм. по идее.

_________________
ABAP/4 You
Back to top
View user's profile Send private message
Esh19
Участник
Участник



Joined: 04 May 2011
Posts: 6

PostPosted: Wed May 04, 2011 12:33 pm    Post subject: Reply with quote

а что есть SH?)

недавно только начал с ABAP работать много чего еще не знаю

Quote:
Системы нет, да и отпуск...

в коде что-то поменять надо?
Back to top
View user's profile Send private message
Dmitriy
Аналитик
Аналитик


Age: 46
Joined: 14 Nov 2008
Posts: 300
Location: Russia

PostPosted: Wed May 04, 2011 12:43 pm    Post subject: Reply with quote

Esh19 wrote:
а что есть SH?)

Если коротко - то в словаре можно присвоить SH (Search Help - F4) полю табличной структуры, но опять же, BWART - должно быть...
А код нормален.

_________________
ABAP/4 You
Back to top
View user's profile Send private message
Esh19
Участник
Участник



Joined: 04 May 2011
Posts: 6

PostPosted: Wed May 04, 2011 12:48 pm    Post subject: Reply with quote

Ладно, пока оставлю как есть

Спасибо за помощь)
Back to top
View user's profile Send private message
Dmitriy
Аналитик
Аналитик


Age: 46
Joined: 14 Nov 2008
Posts: 300
Location: Russia

PostPosted: Wed May 04, 2011 12:56 pm    Post subject: Reply with quote

Esh19 wrote:
Ладно, пока оставлю как есть

Спасибо за помощь)

Помощи не было.
Странно, что T156-BWART "не заходит" в этот ФМ. Rolling Eyes

_________________
ABAP/4 You
Back to top
View user's profile Send private message
Dmitriy
Аналитик
Аналитик


Age: 46
Joined: 14 Nov 2008
Posts: 300
Location: Russia

PostPosted: Wed May 04, 2011 1:42 pm    Post subject: Reply with quote

Code:
  DATA: lv_returncode(3) TYPE c.

  DATA: lt_fields TYPE TABLE OF sval,
        ls_string_of_lt_fields TYPE sval.

  CLEAR lt_fields. REFRESH lt_fields.
  CLEAR ls_string_of_lt_fields.

  ls_string_of_lt_fields-tabname = 'MSEG'.
  ls_string_of_lt_fields-fieldname = 'BWART'.
*      ls_string_of_lt_fields-value = ''.
  APPEND ls_string_of_lt_fields TO lt_fields.

  CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
      popup_title     = 'Введите вид движения'
    IMPORTING
      returncode      = lv_returncode
    TABLES
      fields          = lt_fields
    EXCEPTIONS
      error_in_fields = 1
      OTHERS          = 2.

_________________
ABAP/4 You
Back to top
View user's profile Send private message
Dmitriy
Аналитик
Аналитик


Age: 46
Joined: 14 Nov 2008
Posts: 300
Location: Russia

PostPosted: Wed May 04, 2011 1:42 pm    Post subject: Reply with quote

А вот почему... Друг мой, разберётесь! Cool
_________________
ABAP/4 You
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.