06-14-2011 12:21 PM
Hi!!
I read data from an excel to an internal table using function 'ALSM_EXCEL_TO_INTERNAL_TABLE'.
I read a field (from excel) and I need to store it in a field ( within the internal table) whose data element is quote.
I have used function ISM_CONVERT_CHAR_TO_DEC but I get a blank before the data I read from excel.
Thanks in advance.
06-14-2011 3:42 PM
ISM_CONVERT_CHAR_TO_DEC return a "packed" numeric field, where do you see this blank character. Once you move the result to your field don't forget that QUOTE is signed, and reserves a character for the sign.
Regards,
Raymond
06-15-2011 8:57 AM
I have got this code:
DATA:li_intern TYPE TABLE OF alsmex_tabline WITH HEADER LINE,
lv_start_col TYPE i VALUE 1,
lv_start_row TYPE i VALUE 2,
lv_end_col TYPE i VALUE 256,
lv_end_row TYPE i VALUE 65536,
lw_linea TYPE REF TO data,
pi_lineas_cab TYPE i VALUE 1.
DATA: BEGIN OF itab OCCURS 0,
row(4),
matnr LIKE equk-matnr,
werks LIKE equk-werks,
bdatu LIKE equk-bdatu, " valido hasta
lifnr LIKE equp-lifnr,
quote LIKE equp-quote,
borrar(1),
END OF itab.
After reading data from excel into internal table li_intern
In li_intern I have read value "60"
DATA: c_input(10) TYPE c.
DATA: p_output TYPE p DECIMALS 0.
c_input = li_intern-value.
CALL FUNCTION 'ISM_CONVERT_CHAR_TO_DEC'
EXPORTING
i_char = c_input
IMPORTING
e_dec = p_output.
itab-quote = p_output.
iAfter this operation in itab-quote I get " 60".
What should I do?
Thanks.
06-15-2011 9:12 AM
With a similar test program i get the following values for fied output (type quote)
- internally x'060C' - value 060 sign +
- externally (WRITE output) ' 60'
For me those values are correct
DATA: input TYPE c LENGTH 5,
packed TYPE p DECIMALS 0,
output TYPE quote,
text TYPE c LENGTH 4,
numc TYPE n LENGTH 4.
input = '60'.
CALL FUNCTION 'ISM_CONVERT_CHAR_TO_DEC'
EXPORTING
i_char = input
IMPORTING
e_dec = packed
EXCEPTIONS
OTHERS = 0.
output = packed.
numc = output.
WRITE output TO text.
BREAK-POINT. " check value of output here
Regards,
Raymond
06-15-2011 10:04 AM
Hi!!!
I am trying to read datat from an excel and make a batch input in meq1 transaction. The value I have problems with is the quote in this transaccion. I am not able to store values with a blank (" 60" for example) in EQUP-QUOTE field.
How could I convert data read from an excel into quote withoudt any blank?
In the way you told me I still get a blank and tehrefore an error when trying the batch-input.
Thanks in advance.
06-15-2011 10:42 AM
Thanks for all.
I have just changed the field definition from
itab-quote like equp-quote to itab-quote type int3 and now it´s working.
Thanks.