Application Development and Automation 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: 
Read only

conversion problem

Former Member
0 Likes
618

hi,

i am updating one ztable from xlfile.

in that xl file i have fields like vbeln and some date fields.

i uploaded file by using alsm_exel_to_internal table.

1 > the ex: vbeln length is 10 in database.

but in file i have vbeln value like 80000004.

when i updated this one this value is going to that z table same as 80000004.

after updating the table.

i am trying to fetch the that vbeln value it is not comming?.

2 > now i tried like this 0080000004 in file i am getting correct.

and getiing correct value when i fetched.

how to correct the 80000004 to 0080000004 before update?

how to tell the user to enter 10 digit.

comming to date part.

in file yyyymmdd .

it will working correct.

if i get the date ddmmyyyy in file how to handle this one?

pls clarify?

4 REPLIES 4
Read only

Former Member
0 Likes
586

Hi

If you declare the internal table data same as Ztable fields with 10 char for Vbeln it is updated with 10 characters only.

You might have used as eight char field in internal table

Similarly take date field as sy-datum and in the formay YYYYMMDD.

then the data is correctly uploaded into the databse table

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
586

Venkat,

I hope this can help you.

You can use the statement CONCATENATE to add zeros before the field.

Check the example:

REPORT ZTESTE1.

DATA: NUMBER(10) TYPE C VALUE '80000004'.

CONSTANTS: C_00(2) TYPE C VALUE '00'.

CONCATENATE C_00 NUMBER INTO NUMBER.

The result will be '0080000004' .

To correct the date follow the example:

DATA: V_DATE_XL(8) TYPE C VALUE '20070626',

V_DAY(2) TYPE C,

V_MONTH(2) TYPE C,

V_YEAR(4) TYPE C,

V_FINAL_DATE(8) TYPE C.

V_YEAR = V_DATE_XL(4).

V_MONTH = V_DATE_XL+4(2).

V_DAY = V_DATE_XL+6(2).

CONCATENATE V_DAY V_MONTH V_YEAR INTO V_FINAL_DATE.

The result will be '26062007'

Reward points if helpful please.

Regards!

Read only

Former Member
0 Likes
586

Hi Venkat,

Converting your field to 10 digits before uploading. You can do that in excel itself. Select the whole column. Right Click. Format Cells. Custom and type in 10 zeros.

Date format: Convert your date to yyyymmdd using FM's. Search the forum for "convert date to external" and you will get the required FM.

Reward if useful.

Thanks

Aneesh.

Read only

0 Likes
586

hi,

i am uploading the file from xl file.

in that 1 st field is vbeln.

posnr ,matnr.

vbeln is charecter.

vbeln length is 10 but i got in file 8

8000064 i want to do like this before updating 008000064.

posnr is numeric that y they r taking zeros in right side.

posnr is length is 6 but i got 2.

in the file is 10 after uploading to internal table it will becomming 000010.

i want to that value 10.

same in matnr value.

how can i resolve this one.