cancel
Showing results for 
Search instead for 
Did you mean: 

Data type with String and Proxy

former_member474221
Participant
0 Kudos

Hi

I have create a DT with all the fields as STRING.....a Proxy is created out of it in the ECC system...

However some of the fields( like MatPrice) should have been DECIMAL/DATE/INTEGER.....Do I need to change my data type in PI or can the ABAP guy directly use this STRING fields in his coding .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, i suggest defining proper datatypes in PI already using xsd:integer, xsd:date and xsd:decimal since you get proper datatypes generated in ABAP then. Similar discussion here .

Regards, Martin

Answers (3)

Answers (3)

former_member184681
Active Contributor
0 Kudos

Hi,

You don't actually HAVE TO change the data types, as string is more general than decimal, date or integer. If your ABAPper ensures proper data formatting, you can leave it as it is. However, you might want to decide to change the data types and regenerate the proxy just to enforce the data being formatted properly.

All in all, using string variables might give more flexibility, but also might lead to errors and inconsistencies, for instance during message mapping. If you asked me for an advice, I would tell you to switch to narrower data types and regenerate the proxy.

Hope this helps,

Greg

Former Member
0 Kudos

Do I need to change my data type in PI or

you dont need to change any data type and use STRING because string accepts any value like char,date,....symb..

Former Member
0 Kudos

Until you are not validating that field you do not required to change it.

If you want to validate that field then either you (in PI) or ABAPer (in proxy code) needs to validate.

In PI you are validating then you have to change from String.

Regards,

Venkata Ramesh

Former Member
0 Kudos

Hi,

Using proper data types is preferrable but that is not mandatory.

You no need to change any thing in PI, if you want to validate that amount field in PI(like this field contains ant characters.....) then you can change it or by using string type also you can validate that field.

If you are not doing any thing in PI then no need to change, ABAPEr needs to validate that field in proxy code before updating in database tables. If you handle the validation in PI then no need to check that again in ECC.

Regards,

Venkata Ramesh

former_member474221
Participant
0 Kudos

I am not doing any validation in PI. It is one to one interface...

However will the STRING data types create a problem in the ABAP code if say for e.g that field has to go into a BAPI where that particular field is INTEGER instead of string...

Can the ABAPer directly assign the Proxy field to the BAPI field

Former Member
0 Kudos

Hi,

You can sure, that field comes with proper data then you can go for it, no need to change any thing.

Regards,

Venkata Ramesh

Former Member
0 Kudos

no need to change data type ,if field comes with proper data

former_member184681
Active Contributor
0 Kudos

Actually this is a real problem: you cannot assign a Proxy string parameter to BAPI integer parameter. You would require a temporary variable for this purpose. Which is again why you might want to switch to dedicated data types.

I am not doing any validation in PI. It is one to one interface...

Even thouth you don't validate your data in PI, incorrect data (that might potentially be sent) can lead to exceptions both in: PI processing and target system processing.

Hope this helps,

Greg