cancel
Showing results for 
Search instead for 
Did you mean: 

How to control character length in .dat file generated through OCC tool

ashish25bp
Participant
0 Kudos

Hello All,

I am trying to create .dat file through OCC tool by uploading .txt unicode format file. This file contains material number (MATNR) field with 18 character i.e 000000000002126781. Now the .dat file generated through OCC tool has additional 22 leading zeros. We do not need this extra leading zeros. How can I control this ?

Regards,

Ashish

Accepted Solutions (0)

Answers (5)

Answers (5)

satya11719
Active Contributor
0 Kudos

Hello ashish25bp

By default it will take 40 CHAR if you use SP52 OCC, may be ask your basis to degrade the version they will do that , but if you load in S4 it will perfectly works, we are doing that as a part our project.

I hope this helps, please hit correct answer if it helps.

Best

Satya

ashish25bp
Participant
0 Kudos

Hi Satyanarana

You are right it is now changed to 40 Char. in S/4. And it is also true that the same .txt file when converted with OCC version SP45 it generates the material num with 18 char as desired. Unfortunately I cannot use that machine, nor can I request. My version is SP52 which seems to have 40 Char length as defaulted. I am not sure if there is any sub files in OCC folders which has any adjustment possibility for MATNR field.

Regards,

Ashish

satya11719
Active Contributor
0 Kudos

Hello ashish25bp

Im not sure why it is happening for you , in ECC MATNR was 18 char length field now in S/4 its 40 Chars , Just try to enter ' before the number and check if it is still creating leading zeros , meanwhile check the OCC version you are using as well.

Try to use the old version OCC tool and check ,

Best

Satya

ashish25bp
Participant
0 Kudos

Hi Satyanarayana,

Thank you for the response.

Yes initially I converted the excel file into Unicode text format and then I loaded the same it into Occ to generate .dat file.

But based on new suggestions, I tried saving the same .txt file in UTF-8 format again and tried to output the .dat file from Occ, but still the leading zeros are there for MATNR field.

Just a thought, is there any where in the OCC file setup the character length for field MATNR maintained as 40 which we can be changed to 18 charct ?

Regards,

Ashish

satya11719
Active Contributor
0 Kudos

Hello Ashish

Please save the txt.file in unicode mode(if unicode didn't work try to save in UTF-8) , before feeding that OCC tool , this will not create any leading zeros.

Best

Satya