Skip to Content
0

ABAP syntax check: No string calculation permitted here - why?

Apr 27 at 08:10 AM

64

avatar image

I have this method:

* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Private Method ZCL_MF01_DP_OUTPUT->EQUIPMENTS_MAP
* +-------------------------------------------------------------------------------------------------+
* | [--->] IO_DP                          TYPE REF TO ZCL_CS01_CONFIRM_DP_ORDER
* | [--->] IT_CONF_T                      TYPE        GTY_T_TIME_CONFS
* | [--->] IT_CONF_M                      TYPE        GTY_T_MAT_CONFS
* | [--->] IT_EQUI                        TYPE        GTY_T_EQUIPMENTS
* | [<-()] RS_RES                         TYPE        ZPO_ORDER_DT_EQUIPMENTS
* +--------------------------------------------------------------------------------------</SIGNATURE>
  method equipments_map.
    rs_res = value #(
      equipment = value #(
        for s_equi in it_equi (
          equipment_number = |{ s_equi-equipment alpha = out }| *<--
          equipment_description = space
          serial_number = space
          time_confirmations = value #(
            time_confirmation = value #(
              for s_conft in it_conf_t where (
                equipment = s_equi-equipment )
              ( time_conf_map( s_conft ) )
            ) " time_confirmation
          ) " time_confirmations
          material_confirmations = value #(
            material_confirmation = value #(
              for s_confm in it_conf_m where (
                equipment = s_equi-equipment )
              ( mat_conf_map( s_confm ) )
            ) " material_confirmation
          ) " mat_confs
          maintenance = value #(
            warranty = space
            warranty_until = space
            maintenance_contract = space
          ) " maint
        ) " table line
      ) " equipment
    ). " equipments.
  endmethod.


On the marked line, i get the syntax error"String calculation not permitted here", but I do not understand, why?

ABAP-Version:
740 SP 0018

10 |10000 characters needed characters left characters exceeded

I think I've seen this before - do you get the same error without

alpha=out

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Horst Keller
Apr 27 at 09:14 AM
1

To make a long thing short:

DATA:
  BEGIN OF line,
    colt type string,
    coli TYPE i,
  END OF line.
line = VALUE #( colt = 1 + 1 ).
line = VALUE #( coli = `...` ).
line-coli = |...|.
line-coli = `...` && `...`.
line = VALUE #( coli = CONV i( |...| ) ).
line = VALUE #( coli = CONV i( `...` && `...` ) ).
line = VALUE #( coli = |...| ).                    "Error
line = VALUE #( coli = `...` && `...` ).           "Error

Let's say, we have a small flaw in assigning string expressions to incompatible structure components in the VALUE operator.

A workaround is the explicit usage of CONV. Development is notified.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Horst,

"Development is notified".

Is this team into Kernel side Development ?

Just curious to know which side of development handles these kind of issues.

K.Kiran.

0

Sure, Kernel development, who else ...

0