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

HR: Чтение структуры в OO-контексте



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



Joined: 28 Aug 2009
Posts: 3

PostPosted: Fri Aug 28, 2009 1:22 pm    Post subject: HR: Чтение структуры в OO-контексте Reply with quote

Добрый день,

При написании BAdI столкнулся с проблемой. Хорошо знакомый ФМ для чтения структуры 'RH_STRUC_GET' отказывается работать (падает в дамп) из-за того, что таблица, в которую возвращается результат (result_tab), имеет рабочую область. Подскажите способ (на классах?), как получить структуру по пути анализа в OO-контексте.
Back to top
View user's profile Send private message
XXX_:)
Аналитик
Аналитик


Age: 40
Joined: 01 Feb 2008
Posts: 387
Location: Воронеж

PostPosted: Fri Aug 28, 2009 1:27 pm    Post subject: Reply with quote

А почему вы не сделайте таблицу result_tab без рабочей области?
_________________
Hормальные люди делают вещи намного более безумные чем всё, что делают сумасшедшие (c) С.Лем
Back to top
View user's profile Send private message Blog
vga
Мастер
Мастер


Age: 200
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Fri Aug 28, 2009 1:33 pm    Post subject: Reply with quote

вот пример из sap

CL_WAPI_WF_START~GET_TASKS_WITHOUT_IMPORT

Code:
METHOD get_tasks_without_import .
  CONSTANTS: cl_search_path TYPE gdstr-wegid VALUE 'US_TASKW'.

  DATA: l_planvariant     TYPE objec-plvar.
  DATA: lt_result_tab     TYPE STANDARD TABLE OF swhactor.
  DATA: lt_general_tasks  TYPE STANDARD TABLE OF swhactor.
  DATA: lt_tasks          TYPE STANDARD TABLE OF swhactor.
  DATA: l_task_attributes TYPE rhwftskatt.
  DATA: ls_task_detail    TYPE swu_select.
  DATA: ls_task           TYPE swhactor.
  DATA: lt_contdef        TYPE STANDARD TABLE OF swcontdef.
* ...
  REFRESH e_executable_tasks.

*- get workflow tasks via hr path US_TASKW
  CALL FUNCTION 'RH_STRUC_GET'
       EXPORTING
            act_otype      = 'US'
            act_objid      = my_user
            act_wegid      = cl_search_path
       IMPORTING
            act_plvar      = l_planvariant
       TABLES
            result_tab     = lt_result_tab
       EXCEPTIONS
            no_plvar_found = 01
            no_entry_found = 00
            OTHERS         = 99.
  IF syst-subrc = 0.
    lt_tasks[] = lt_result_tab[].
  ENDIF.
Back to top
View user's profile Send private message Blog Visit poster's website
ex
Участник
Участник



Joined: 28 Aug 2009
Posts: 3

PostPosted: Fri Aug 28, 2009 1:46 pm    Post subject: Reply with quote

Разобрался, спасибо, с модулем все было в порядке, в отличие от меня Smile
Back to top
View user's profile Send private message
Удав
Гуру
Гуру


Age: 48
Joined: 25 Jan 2008
Posts: 580
Location: Москва

PostPosted: Fri Aug 28, 2009 4:32 pm    Post subject: Reply with quote

логично, что нужно было передавать itab[] Very Happy
_________________
С уважением,
Удав.
Back to top
View user's profile Send private message
ex
Участник
Участник



Joined: 28 Aug 2009
Posts: 3

PostPosted: Mon Aug 31, 2009 5:37 pm    Post subject: Reply with quote

Удав wrote:
логично, что нужно было передавать itab[] Very Happy

Да нет, я вообще параметры попутал (там в TABLES их несколько). А дамп про несовпадение типов трактовал по-своему Smile . И передавать "itab[]" незачем, "itab" прекрасно работает (объявлен как TABLE OF).
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.