Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with PRPS-USR06 field length using BAPI_PROJECT_MAINTAIN

Former Member
0 Likes
2,304

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

1 ACCEPTED SOLUTION
Read only

former_member201275
Active Contributor
0 Likes
1,877

How are you calling this Function? Is it when you call this function you are getting the dump?

10 REPLIES 10
Read only

former_member201275
Active Contributor
0 Likes
1,878

How are you calling this Function? Is it when you call this function you are getting the dump?

Read only

0 Likes
1,877

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

Read only

0 Likes
1,877

Hi,

Try passing currency key "BAPI_WBS_ELEMENT-USER_FIELD_CUKY1".

Srikanth.

Read only

0 Likes
1,877

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.

Read only

0 Likes
1,877

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 dataData saved in PRPS-USR06
10462963.14010462963
104629631.400104629631
1046296314.0001046296314

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

Read only

former_member213275
Contributor
0 Likes
1,877
Hi Peng,
The user field values of WBS-Element are always stored with 3 decimals in table PRPS (SAP Note: 1646349) and are shown with correct decimals in transaction CJ20 based on currency settings defined.
For example take currency value 123 it is saved in database in different formats based on settings defined.
ValueCurrency has x decimalsStored on database
12300.123
123.011.230
123.00212.300
123.0003123.000
BAPI_WBS_ELEMENT-USER_FIELD_CURR1 uses same component type USR06PRPS so the length of the same value stored in table PRPS-USR06 is same as bapi field. so check the corresponding value in PRPS table. Check the same value which is shown in CJ20 how it is saved in data base and manuplate the value of VND accordingly.
Hope you understood and would be helpful.
Srikanth.
Read only

0 Likes
1,877
Hi Srikanth,

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 dataData saved in PRPS-USR06
10462963.14010462963
104629631.400104629631
1046296314.0001046296314

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

Read only

0 Likes
1,877

Well then you are trying to save 11 characters into a 10 character field. It's not going to happen.

Read only

0 Likes
1,877

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.

Read only

0 Likes
1,877

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.