on 04-18-2013 1:35 PM
Hello to all
I have build a WDA interface, where I load flat file data into the UI Table element. In the context of the componentcontroller I use a dictionary structure, which is then mapped to the context in the viewcontroller. In the viewcontroller I use a method (onactionupload) to read the flat file data. There I get the following error, while activation:
In google and SDN I found some comments about reference issues regarding 'amount' and 'currency'.
However in my opinion my structure is correctly defined as following ( my structure uses data types used for BW infoobjects, I am on a BW 7.01 installation- 😞
..and as well the reference in the structure is defined as following:
My work around, which didn't work:
I use following coding to assign dynamically the reference. I did it in the onactionupload method used in the viewcontroller
------------------------------------------------------------------------------------
* Set currency reference field for 'AMOUNT' in context node
* Describe object for 'root' node (description object)
DATA: lo_nd_info_root type REF to if_wd_context_node_info,
lo_nd_info type REF to if_wd_context_node_info.
* Get information für root node and navigate to context node
lo_nd_info_root = wd_context->get_node_info( ).
lo_nd_info = lo_nd_info_root->get_child_node('SOURCE_ISDE' ).
* Set explicitely the currency reference for 'AMOUNT'
lo_nd_info->set_attribute_reference_field(
name = 'AMOUNT'
reference_field = 'CURRENCY'
reference_field_type = if_wd_context_node_info=>reffieldtype_curr ).
--------------------------------------------------------------------------------------
My issue:
I couldn't solve the issue /error of data type for amount. I also can't understand, that amount makes such issue as I have defined a Dic structure with reference.
So please let me know, where you see the issue and what you think and how I could solve this issue.
Best regards and thanks very much for your help
Christian
System info is:
Hi Christian,
The error is that the field amount is expected to be character type but instead its of type currency. Try to change the structure and make AMOUNT to type CHAR20 and see if that works.
If it works, you can copy the char20 field to currency type field later on.
Also, please share the code extract at line 236 where the error is coming.
-Manish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Manish
Thanks for your answer and now it is working.
Nevertheless how would you then upload an 'amount' into WDA? You said to bring back the char20 value into currency type field later. So where would you do it? In the context for the view? However there I need to change the context attributes?
Bellow my coding too.
Thanks again fpr your short feedback and inputs
Best regards
Christian
***************
Code with error see bellow (... ls_source_isde-amount )
get single attribute
lo_el_file_up->get_attribute(
exporting
name = `FILE_CONTENT`
importing
value = lv_file_content ).
"XSTRING to BINARY
call function 'SCMS_XSTRING_TO_BINARY'
exporting
buffer = lv_file_content
importing
output_length = lv_outlen
tables
binary_tab = lt_bin.
"Binary to Text file
call function 'SCMS_BINARY_TO_TEXT'
exporting
input_length = lv_outlen
tables
binary_tab = lt_bin
text_tab = lt_txt.
* Structure of the flat file
clear lt_source_isde.
loop at lt_txt into ls_txt.
split ls_txt at ';' into
ls_source_isde-sreptyp
ls_source_isde-cvtype
ls_source_isde-fiscper
ls_source_isde-ccompany
ls_source_isde-cprofctr
ls_source_isde-cpgraccoa
ls_source_isde-cpgracacc
ls_source_isde-cgfncarea
ls_source_isde-cpacctgrp
ls_source_isde-cmaterial
ls_source_isde-cshipto
ls_source_isde-cbillto
ls_source_isde-cpcompany
* here next line is the error
ls_source_isde-amount
ls_source_isde-currency
ls_source_isde-quantity
ls_source_isde-unit.
append ls_source_isde to lt_source_isde.
clear ls_source_isde.
endloop.
Hi,
Can I know is that error coming in the below method (Row No 236) or some where else.
* Set explicitely the currency reference for 'AMOUNT'
lo_nd_info->set_attribute_reference_field(
name = 'AMOUNT'
reference_field = 'CURRENCY'
reference_field_type = if_wd_context_node_info=>reffieldtype_curr ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.