cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC to File - number formatting

Former Member
0 Kudos

We have an IDOC coming to PI which is failing sometimes in our partner system because of the number format (comma or decimal notation)

We found that it is dependent on the ERP user setting who generates the IDOC. For example, if end user number format includes commas, then the IDOC and file output do also. If ERP user is set to decimal, the output is decimal (which is what our partner system expects)

Problem: We want to override number formatting in PI so that the output is always decimal notation. We can't force them to use decimal because they need comma notation for other work. I would prefer if we can achieve this at the IDOC level or File Adapter and not get into specific field mappings to convert the number formats.

Any ideas for us?

Many thanks,

Aaron

Accepted Solutions (1)

Accepted Solutions (1)

PeterJonker
Active Contributor
0 Kudos

You need to take away all decimal notations when the Idoc is created (so it will be amount x 100). When this is a standard SAP IDoc (I don't think so), you will need to find a user exit and adjust the  segment/field values. If it is a custom IDoc you will need to adapt the source code accordingly.

Former Member
0 Kudos

Interesting approach, yes I think this is a custom IDOC so I can ask the ABAP guys to have another look at it. Is it a general best practice in IDOCs to have numbers x100?

Answers (3)

Answers (3)

former_member190624
Active Contributor
0 Kudos

Hi Aaron,

you can handle this in Message mapping and use Date Trans (Date transformation function).

Thanks

Hari.

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

you can solve it in the Mapping Program, Use the standar function FormatNum.

you can validate if the input value has a comma in it. if so, call the fuction FormatNum if not map the value directly.

Regards

Rodrigo

vedrankubelka
Explorer
0 Kudos

The simplest way is to do this in mapping. You can use same source and target message and put your User-Defined  Java function for formatting

Best regards

  Vedran

Former Member
0 Kudos

Hi Aaron,

As suggested by Vedran you can easily solve this in mapping level.

Thanks,

Satish.

Former Member
0 Kudos

As mentioned I want to stay out of field level mappings. It could be easy to start, but not the best approach because it will be error prone (missing a field here or there, maybe the zIDOC changes later, etc).

Thanks for your suggestions!

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

As mentioned I want to stay out of field level mappings. It could be easy to start, but not the best approach because it will be error prone (missing a field here or there, maybe the zIDOC changes later, etc).

No matter where you handle the conversion (PI or ABAP) you will need to do this field by field.

if the IDOC change you will need to consider the changes also in ABAP or PI.

related to error prone as you mentioned i desagree with you because you can validate missing fields or changes in the IDOC. With PI 7.1 and above you have the functionality to solve "mapping inconsistences" when an structure of mapping changes to avoid the mapping from the scratch.

IS JUST up to you where you want to handle the conversion.

Regards.

Rodrigo

Former Member
0 Kudos

Yes, I agree with you Rodrigo, we could do it in mapping, and it must be done one place or the other. But in this case we have something that is working/not working based on the user setting in ERP. I think fixing the problem closest to the source is best (zIdoc) because for this scenario we aren't using any other mapping logic. I was hoping there might be some setting I could put on the IDOC/RFC connection or somewhere else in receiver Adapter which might override the decimal notation for all fields generically.

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

HI Aaron,

as you said, it could be solved in one place or other, what i can post is a sugguestion because i dont have the whole context. hope you can solve it quick and as you explain before seam the best solution is in the client side.

Regards

Rodrigo