‎2013 Aug 21 7:42 AM
Hi All,
I have a requirement to update a VND amount of 11 field size (e.g.10462963140 ) into PRPS-USR06. I am using BAPI_PROJECT_MAINTAIN to do the updating. But the system is throwing out ABAP dump when trying to assign this amount to BAPI_WBS_ELEMENT-USER_FIELD_CURR1.
This is due to field size differences in BAPI_WBS_ELEMENT-USER_FIELD_CURR1 (length 10,3). If I use txn code CJ20 to update USR06, the system is able to save the VND amount of 11 field size correctly.
I have already input 'VND' as the currency for BAPI_WBS_ELEMENT-USER_FIELD_CUKY1.
Does anybody have clue how to save the figures correctly?
Regards,
PY
‎2013 Aug 21 9:36 AM
How are you calling this Function? Is it when you call this function you are getting the dump?
‎2013 Aug 21 9:36 AM
How are you calling this Function? Is it when you call this function you are getting the dump?
‎2013 Aug 21 9:52 AM
Hi Glen,
I hit the error when I was assigning the value to BAPI_WBS_ELEMENT-USER_FIELD_CURR1.
e.g.
data: lvl_amt type bapicurr-bapicurr.
lvl_amt = 10462963140.
BAPI_WBS_ELEMENT-USER_FIELD_CURR1 = lvl_amt. <abap dump at this point
If I shift the lvl_amt with decimal place
e.g.
lvl_amt = 10462963.140
I able to assign the value to BAPI_WBS_ELEMENT-USER_FIELD_CURR1.
But when i run the BAPI_PROJECT_MAINTAIN, the system is saving '10462963' into USR06. I want to save 10462963140 into USR06.
Regards,
PY
‎2013 Aug 21 10:29 AM
Hi,
Try passing currency key "BAPI_WBS_ELEMENT-USER_FIELD_CUKY1".
Srikanth.
‎2013 Aug 21 10:41 AM
I am not sure, but is the issue not that you try to place a number of 11 long in a field that can only hold 10 characters ? (10.3)
It would also help if you tell us what the dump says. Most of the time it will give you a clue.
So how you manage to store a value of 11 long before the decimal point is a mystery to me. Especially because both bapi and the transaction have the same data element.
The F1 help for this field states:
User-defined
field in which you can enter quantities with a length of up to 10
characters before the decimal point and three characters after it.
‎2013 Aug 21 11:43 AM
Hi Peter,
I tried to play around with the decimal places but still not able to save the data that i wants. I have also maintained user_field_cuky1 as 'VND'.
| Input data | Data saved in PRPS-USR06 |
| 10462963.140 | 10462963 |
| 104629631.400 | 104629631 |
| 1046296314.000 | 1046296314 |
Data that I want to save is '10462963140'. It seems like the standard BAPI cut off the amount after the decimal place.
Any idea?
Regards,
PY
‎2013 Aug 21 10:26 AM
| Value | Currency has x decimals | Stored on database |
|---|---|---|
| 123 | 0 | 0.123 |
| 123.0 | 1 | 1.230 |
| 123.00 | 2 | 12.300 |
| 123.000 | 3 | 123.000 |
‎2013 Aug 21 11:40 AM
I tried to play around with the decimal places but still not able to save the data that i wants. I have also maintained user_field_cuky1 as 'VND'.
| Input data | Data saved in PRPS-USR06 |
| 10462963.140 | 10462963 |
| 104629631.400 | 104629631 |
| 1046296314.000 | 1046296314 |
Data that I want to save as '10462963140'. It seems like the standard BAPI cut off the amount after the decimal place.
Any idea?
Regards,
PY
‎2013 Aug 21 12:17 PM
Well then you are trying to save 11 characters into a 10 character field. It's not going to happen.
‎2013 Aug 21 12:57 PM
But it works online and it is the same field (also 10 long) and still stores an 11 long value.
That is the strange thing about PY's problem.
If you open up the element again after save it shows the 11 long value. So it HAS been stored.
‎2013 Aug 21 2:16 PM
The domain for the field is USRCURR13, and this has an output length of 18.
When it is being run in foreground it is working as it is not using the BAPI. The BAPI is not going to allow this I don't think.