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

Падение в дамп при динамическом assign


Goto page 1, 2  Next
 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
request
Участник
Участник



Joined: 25 Oct 2007
Posts: 25

PostPosted: Wed Feb 13, 2008 5:14 pm    Post subject: Падение в дамп при динамическом assign Reply with quote

В user-exit, представлющем собой формулу для Conditions происходит падение при Assign

Code:
FIELD-SYMBOLS: <fs_txvbrp> TYPE ttvbrp.
ASSIGN ('(SAPLV60A)XVBRP[]') TO <fs_txvbrp>.


Какую проверку вставить, чтобы убедиться, что assign возможен?

Перед этим assign на другой объект в той же группе функций происходит нормально, что само по себе уже странно. Значит SAPLV60A уже загружена в память.

Code:
      ASSIGN ('(SAPLV60A)VBRP') TO <fs_vbrp>.
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 45
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Wed Feb 13, 2008 5:24 pm    Post subject: Reply with quote

Убедитесь, что таблица XVBRP такого же типа, что и объявленный филд-симбол, т.е. ttvbrp. Дамп видимо из-за разных типов.
Back to top
View user's profile Send private message Blog
request
Участник
Участник



Joined: 25 Oct 2007
Posts: 25

PostPosted: Wed Feb 13, 2008 5:29 pm    Post subject: Reply with quote

Дело в том, что не работает только в двух транзакциях - vf02 и vf03.
В других транзакциях, использующих прайсинговую процедуру падений нет, assign нормально назначается.

Исследования показали, что XVBRP определена не как таблица в глобальной области видимости, а является tables аргументом функции
RV_INVOICE_PRICE_PBO. А для атрибутов этой функции стоит галочка Global.

Смотрю по стеку вызовов, эта функция не вызывалась, а вызывалась
PRICING_SUBSCREEN_PBO. Получется, что атрибуты функции, определенные как глобальные, видимы только если эта функция стоит выше по стеку вызовов. В этом отличие от таблиц, определенных глобально.


Причины падения понятны, вопрос, как проверить допустимость assign остается открытым Crying or Very sad



pic2.JPG
 Description:
галочка Global в атрибутах Функции
 Filesize:  38.79 KB
 Viewed:  27002 Time(s)

pic2.JPG



pic1.JPG
 Description:
 Filesize:  24.86 KB
 Viewed:  27004 Time(s)

pic1.JPG




Last edited by request on Wed Feb 13, 2008 5:47 pm; edited 2 times in total
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 45
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Wed Feb 13, 2008 5:37 pm    Post subject: Reply with quote

Дамп случайно не такого типа:
Code:
ДинамОшибка            ASSIGN_TYPE_CONFLICT
Краткий текст
    Type conflict with ASSIGN in program "Z********".


Что произошло?
    Error in the ABAP Application Program

    The current ABAP program "Z********" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.


Анализ ошибки
    You attempted to assign a field to a typed field symbol,
    but the field does not have the required type.


Сейчас специально создал филд-симбол с типизацией, отличной от линкуемого объекта...
Back to top
View user's profile Send private message Blog
request
Участник
Участник



Joined: 25 Oct 2007
Posts: 25

PostPosted: Wed Feb 13, 2008 5:48 pm    Post subject: Reply with quote

не, дамп такой

Quote:
ABAP runtime errors GETWA_NOT_ASSIGNED
Occurred on 13.02.2008 at 13:44:32

Field symbol has not yet been assigned.
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 45
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Wed Feb 13, 2008 6:04 pm    Post subject: Reply with quote

Так вроде линковать нельзя. Только данные из топ-инклюда можно.
А галочка эта говорит о том, что внутри самого ФМ-ника можно будет работать с интерфейсными параметрами, как с глобально-определенными.
К примеру, при вызове подпрограммы внутри ФМ можно узнать, что в этой таблице не передавая ее в подпрограмму.
Back to top
View user's profile Send private message Blog
John Doe
Модератор
Модератор


Age: 45
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Wed Feb 13, 2008 6:08 pm    Post subject: Reply with quote

Так говорит справка:
Quote:
Индикатор для глобального интерфейса
You mark this field if the interface of the function module was made known globally through Edit -> Interface -> Globalize Parameters.

In this case, all the parameters that are fully typed and are defined for value transfer are treated as if global data objects with the same name were declared in the top-include - that is, they are visible in the entire function group and keep their value when the function module is exited. When the function module is called, all the parameters of a global interface are initialized and they get their defalut value.

All the other parameters are treated as if data objects of the same name were declared in the top Include (for table parameters, these are two in each case - one for the table body, one for the header line). But they can only be used during execution of the function module. This means they are visible in the entire function group, but they can only be accessed during execution of the function module. If such a parameter is accessed outside of actual execution of the function module, you get a runtime error GETWA_NOT_ASSIGNED with the meaning "Field symbol is not yet assigned" (such parameters are implemented internally through field symbols to which a data object is assigned during execution of the function module).

In the function group, no global data objects with the same name - such as a parameter of a global interface - may be created. If several function modules of a function group have global interfaces, parameters of the same name must be defined identically.

Note
The use of global interface parameters is obsolete and, in the new function modules, interfaces should generally not be globalized.
Back to top
View user's profile Send private message Blog
request
Участник
Участник



Joined: 25 Oct 2007
Posts: 25

PostPosted: Wed Feb 13, 2008 6:19 pm    Post subject: Reply with quote

Программа в наследство досталась. Придется искать другую таблицу.
Спасибо John Doe.

Попробую еще, может этот exception будет ловиться.
Back to top
View user's profile Send private message
mike1
Модератор
Модератор



Joined: 22 Nov 2007
Posts: 82

PostPosted: Wed Feb 13, 2008 6:55 pm    Post subject: Reply with quote

Code:
 if <fs_txvbrp> is assigned.
чтобы не было дампа.
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 45
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Wed Feb 13, 2008 7:33 pm    Post subject: Reply with quote

mike1 wrote:
Code:
 if <fs_txvbrp> is assigned.
чтобы не было дампа.

Он до этой проверки дойти не успеет... catch тоже не помогает, какой-то "неотлавливаемый" эксепшн.
Back to top
View user's profile Send private message Blog
request
Участник
Участник



Joined: 25 Oct 2007
Posts: 25

PostPosted: Wed Feb 13, 2008 8:34 pm    Post subject: Reply with quote

mike1 wrote:
Code:
 if <fs_txvbrp> is assigned.
чтобы не было дампа.



Валится прямо на строке
ASSIGN ('(SAPLV60A)VBRP') TO <fs_vbrp>.
поэтому до
if <fs_txvbrp> is assigned.
не дойдет.
Back to top
View user's profile Send private message
mike1
Модератор
Модератор



Joined: 22 Nov 2007
Posts: 82

PostPosted: Thu Feb 14, 2008 12:23 pm    Post subject: Reply with quote

может быть надо указать именно таблицу а не рабочую область?
ASSIGN ('(SAPLV60A)VBRP[]') TO <fs_vbrp>.
Back to top
View user's profile Send private message
request
Участник
Участник



Joined: 25 Oct 2007
Posts: 25

PostPosted: Thu Feb 14, 2008 12:35 pm    Post subject: Reply with quote

mike1 wrote:
может быть надо указать именно таблицу а не рабочую область?
ASSIGN ('(SAPLV60A)VBRP[b][]/b]') TO <fs_vbrp>.



Mike1, извините, ввел в заблуждение. Падение на строке, как указано в самом первом сообщении.

FIELD-SYMBOLS: <fs_txvbrp> TYPE ttvbrp.
ASSIGN ('(SAPLV60A)XVBRP[]') TO <fs_txvbrp>.


Строка
ASSIGN ('(SAPLV60A)VBRP[b][]/b]') TO <fs_vbrp>
нормально отрабатывает, но и VBRP - это таблица, объявленная в TOP, а не в глобальных параметрах функции.
Back to top
View user's profile Send private message
mike1
Модератор
Модератор



Joined: 22 Nov 2007
Posts: 82

PostPosted: Thu Feb 14, 2008 1:39 pm    Post subject: Reply with quote

дамп GETWA_NOT_ASSIGNED возникает при попытке обратится к неназначенному указателю, на самом операторе assign возможны дампы:
Quote:
Non-Catchable Exceptions

Cause: The field symbol is structured and the field to be assigned is shorter than the structure.
Runtime Error: ASSIGN_BASE_TOO_SHORT

Cause: The alignment of the field f is too small for the type of the field symbol.
Runtime Error: ASSIGN_BASE_WRONG_ALIGNMENT

Cause: You can only specify simple types for TYPE.
Runtime Error: ASSIGN_CAST_COMPLEX_TYPE

Cause: The source field is longer than 16 bytes and can therefore not be interpreted as a field of type P.
Runtime Error: ASSIGN_CAST_P_TOO_LARGE

Cause: The alignment of the field f is too small for the type specified in TYPE.
Runtime Error: ASSIGN_CAST_WRONG_ALIGNMENT

Cause: The field f has a length which is not compatible with the type specified in TYPE.
Runtime Error: ASSIGN_CAST_WRONG_LENGTH

Cause: The type specified in TYPE is unknown.
Runtime Error: ASSIGN_CAST_WRONG_TYPE

Cause: A maximum of 14 decimal places is allowed.
Runtime Error: ASSIGN_DECIMALS_TOO_HIGH

Cause: Decimal places may only be specified for type P.
Runtime Error: ASSIGN_DECIMALS_WRONG_TYPE

Cause: A length of 0 was specified for the field f.
Runtime Error: ASSIGN_LENGTH_0

Cause: A length less than 0 was specified for the field f.
Runtime Error: ASSIGN_LENGTH_NEGATIVE

Cause: An offset less than 0 was specified for the field f.
Runtime Error: ASSIGN_OFFSET_NEGATIVE

Cause: Offset and length were specified for the field f, and the data type of the field to be assigned does not allow subfield access. (This applies to the data types I, F, and P.)
Runtime Error: ASSIGN_OFFSET_NOTALLOWED

Cause: The offset specified for the field f reaches beyond the range of the ABAP variable.
Runtime Error: ASSIGN_OFFSET_TOOLARGE

Cause: In the area addressed by offset and length specifications for field f, there are deep components (data references, object references, strings, internal tables) that cannot be overwritten.
Runtime Error: ASSIGN_OFF+LENGTH_ILLEGAL_CAST

Cause: The offset and length specified for the field f reach beyond the range of the ABAP variable.
Runtime Error: ASSIGN_OFFSET+LENGTH_TOOLARGE

Cause: The field f is not a data reference. However, the system expected a data reference.
Runtime Error: ASSIGN_REFERENCE_EXPECTED

Cause: The components of the source field type and the target type, which are strings, tables or references, do not have exactly the same offset and type.
Runtime Error: ASSIGN_STRUCTURE_ILLEGAL_CAST

Cause: You cannot assign substrings to a field symbol.
Runtime Error: ASSIGN_SUBSTRING_NOT_ALLOWED

Cause: The field symbol is typed, and the field to be assigned has a type which is incompatible.
Runtime Error: ASSIGN_TYPE_CONFLICT

Cause: The type of the source field contains strings, tables or references.
Runtime Error: ASSIGN_TYPE_ILLEGAL_CAST
Back to top
View user's profile Send private message
dr.killer
Участник
Участник



Joined: 31 Oct 2007
Posts: 24
Location: 4.7, ECC 6.0

PostPosted: Fri Feb 15, 2008 2:12 am    Post subject: Reply with quote

Может так пройдет?
Code:
FIELD-SYMBOLS: <fs_txvbrp> TYPE ANY.
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
Goto page 1, 2  Next
Page 1 of 2

 
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.