‎2007 Jun 25 5:33 PM
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?
‎2007 Jun 25 5:42 PM
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
‎2007 Jun 25 5:51 PM
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!
‎2007 Jun 25 6:04 PM
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.
‎2007 Jun 26 10:11 AM
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.