10-22-2014 9:10 PM
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
10-23-2014 4:36 AM
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,
10-23-2014 10:58 AM
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.
10-23-2014 4:03 PM
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
10-23-2014 6:35 PM
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
10-23-2014 9:28 PM
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