cancel
Showing results for 
Search instead for 
Did you mean: 

Data Typ error for 'AMOUNT' missing reference for currency?

Former Member
0 Kudos

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:

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hello Manish

You are probably right and I didn't see this simple reason and solution. Thanks a lot;

It seems, that the special data type CUKY for amount ( used in BI) is not managed by WDA.

I will try your proposal next week and give you feedback.

Thanks a lot and have a nice weekend

Christian

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

former_member217546
Participant
0 Kudos

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 ).