Application Development 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: 

iDOC inbound- NUMC fields are populated/appended with zeros

Former Member
0 Kudos

Hi,

We are trying to send iDOC to SAP system from our service. In that service, we are just settings the values which are required leaving the rest. But we observed that all NUMC datatype fields are getting set to zeros and appending with zeros. We just dont want this to default like that and it is creating issues in our system.

Can you please tell me how to avoid that default behavior?

Thanks

5 REPLIES 5

former_member205763
Active Contributor
0 Kudos

That's inherent property of Numc values, are these custom fields? If yes you should consider changing them to char if changing type is not possible b then ask your middleware team to do this, they should be able to remove leading zeroes before sending to target,

Former Member
0 Kudos

If you look at standard SAP IDocs. All fields are CHAR. A NUMC field cannot contain a space, hence it is populated with a zero.

alessandroieva
Active Participant
0 Kudos

Hi,

you has zero because when you valorizes a char field with numc initial, you move the zeros.

if you want  to avoid this, use this condition:

if <variable_numc> is not initial.

move <variable_numc> to <field_idoc>.

endif.

let me know,

AI

Former Member
0 Kudos

Hi,

just compare the observed behavior of your IDOC, the other answers and the SAP-Documentation:

http://help.sap.com/abapdocu_70/en/abenbuilt_in_types_values.htm

The field is filleed with "0"s until you Change it to character of the same length...

regards

Jan Martin

former_member306787
Active Participant
0 Kudos

Hi,

There are multiple places where you can change the data going to the target system. Assuming that you don't use a third party middleware, you can remove the leading zeros at the source client, just before the IDOC data structures are filled.

Or you can remove the leading zeros during the inbound processing.

Again, more than 1 method to remove leading zeros. One is pointed out by Alessandro Leva, another way is using a conversion exit. I believe the FM 'CONVERSION_EXIT_ALPHA_OUTPUT' is the one you can use.

Just make sure you don't have numeric fields for holding the converted values 🙂

Best regards,

Zhou