12-10-2014 9:26 AM
Haw to get negative numeric values using BAPI_OBJCL_GETCLASSES? This BAPI returns in table ALLOCVALUESNUM positive values only.
When i set positive numeric value (for example 21) to characteristic, then BAPI_OBJCL_GETCLASSES returns 21 (images 1-2), and when i set negative value (for example -35), then BAPI_OBJCL_GETCLASSES returns 0 (images 3-4). Why?
12-10-2014 9:33 AM
Could it be that the associated datatype does not allow negative values or +/- sign ?
12-10-2014 9:42 AM
Datatype allow negative values and +/- sign too. And value in AUSP table is correct (see screenshot, 1 row).
12-10-2014 10:04 AM
OK, did you check the RETURN table for any messages ? Is the class in the table ALLOCLIST ?
Looking in the sourcecode I could imagine something goes wrong in the perform convert_tables_cacl_to_bapi /CTCV_SYNTAX_CHECK.
If I look at the code then when the call to this FM fails for some reason the values will be empty. Maybe you can check in debug.
12-10-2014 10:30 AM
This is RETURN table content
This is ALLOCLIST content. My class name is PM_TR+UC_RD (6 row)
12-10-2014 10:34 AM
Source code fragment:
DATA:
OBJECTNUM TYPE OBJNUM,
IT_CLASSLIST TYPE STANDARD TABLE OF BAPI1003_ALLOC_LIST INITIAL SIZE 1,
WA_CLASSLIST TYPE BAPI1003_ALLOC_LIST,
IT_ALLOCVALUESCHAR TYPE STANDARD TABLE OF BAPI1003_ALLOC_VALUES_CHAR INITIAL SIZE 1,
WA_ALLOCVALUESCHAR TYPE BAPI1003_ALLOC_VALUES_CHAR,
IT_ALLOCVALUESCURR TYPE STANDARD TABLE OF BAPI1003_ALLOC_VALUES_CURR INITIAL SIZE 1,
WA_ALLOCVALUESCURR TYPE BAPI1003_ALLOC_VALUES_CURR,
IT_ALLOCVALUESNUM TYPE STANDARD TABLE OF BAPI1003_ALLOC_VALUES_NUM INITIAL SIZE 1,
WA_ALLOCVALUESNUM TYPE BAPI1003_ALLOC_VALUES_NUM,
IT_RETURN2 TYPE STANDARD TABLE OF BAPIRET2 INITIAL SIZE 1,
WA_RETURN2 TYPE BAPIRET2.
OBJECTNUM = PPLS_DATA-EQUNR.
CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
EXPORTING
OBJECTKEY_IMP = OBJECTNUM
OBJECTTABLE_IMP = 'EQUI'
CLASSTYPE_IMP = '002'
READ_VALUATIONS = 'X'
TABLES
ALLOCLIST = IT_CLASSLIST
ALLOCVALUESCHAR = IT_ALLOCVALUESCHAR
ALLOCVALUESCURR = IT_ALLOCVALUESCURR
ALLOCVALUESNUM = IT_ALLOCVALUESNUM
RETURN = IT_RETURN2.
READ TABLE IT_RETURN2 INTO WA_RETURN2 WITH KEY TYPE = 'E' .
IF SY-SUBRC = 0.
MESSAGE ID WA_RETURN2-ID TYPE WA_RETURN2-TYPE NUMBER WA_RETURN2-NUMBER
WITH WA_RETURN2-MESSAGE_V1 WA_RETURN2-MESSAGE_V2 WA_RETURN2-MESSAGE_V3 WA_RETURN2-MESSAGE_V4.
ENDIF.
12-10-2014 10:41 AM
Looking in the sourcecode I could imagine something goes wrong in the perform convert_tables_cacl_to_bapi /CTCV_SYNTAX_CHECK. If I look at the code then when the call to this FM fails for some reason the values will be empty. Maybe you can check in debug for your situation what happens at that moment.
I am trying to think here together with you, in no means I am trying to claim that I know what is wrong. Your code looks good, the table has the value stored as negative and you are calling a standard SAP BAPI. Weird indeed.
Sorry I cant be of any more help but I am out of ideas. 😞
12-10-2014 2:08 PM
Thank You for help.
You are right, the problem is in convert_tables_cacl_to_bapi /CTCV_SYNTAX_CHECK - sy-subrc = 6 (i.e. pattern_check exception).
numeric value is 35,000- (negative sign after number), and pattern is -__,___ (negative sign before number). But i can't change pattern in characteristic options. Even if i set negative sign after number, then, after saving characteristic options, it is again before!
Any ideas?
12-10-2014 2:34 PM
I see that the mask comes from CABN-ATSCH. Does that mean that this has been set when the characteristic was created ?
Maybe you can change this mask for this characteristic with CT04 ?
In the system I am working on now there are no characteristics so I cannot test anything out.
12-10-2014 2:55 PM
If you go to transaction code SM30 fill in table name TCPA and click customizing. Now you are in customizing where this mask is defined. Hope this helps you finding a solution.
12-11-2014 5:41 AM
Yes, template has been set when the characteristic was created.
But i can't change template in characteristic options. Even if i set negative sign after number (__,___-), then, after saving characteristic options, it is again before (-__,___)!
12-11-2014 6:10 AM
In SM30 i fill the table TCPA with template __,___-, but when i try to use it, message appears...
03-11-2015 11:02 AM
Hello, have a similar problem .. has this issue been solved already?
03-11-2015 11:46 AM
03-11-2015 12:37 PM
03-11-2015 1:18 PM
Hello Alexander,
Good Day,
This is a mere guess.. Check, whether the characteristics has any dependency in the back end.
Tcode : CU03/CU33
If there is a dependency, check the function module attached to the dependency.
There could be some code which may change the negative value to 0.
Thank you,
Regards,
Kavitha.
03-11-2015 2:04 PM
CTCV_SYNTAX_CHECK or PATTERN_CHECK brings back subrc = 6 .. for pattern_error..
Either this is a real poorly documented feedback message or simply a fault in standard coding.
It did not happen before implementation of a service pack.. so it should make me wonder service packs to create any kind of displayable dependencies... that return 0 values
I will evaluate changes using version history...
Message Class C4 Message Number 002