cancel
Showing results for 
Search instead for 
Did you mean: 

How to append <FS_WA> to <FS_IT>

Former Member
0 Kudos

I want to apped <fs_items> TO <ft_items>.But the source code is dump.How can solve it.

dump area: apped <fs_items> TO <ft_items>.

dump info:Field symbol has not yet been assigned.

***********************************

      DATA:
      ltd_item TYPE STANDARD TABLE OF bbp_pds_conf_item_d,
      lth_item TYPE bbp_pds_conf_item_d,
      lo_core_object TYPE REF TO /sapsrm/cl_pdo_update_buf_conf.

    FIELD-SYMBOLS:
      <fs_header> TYPE bbp_pds_header,
      <fs_items>  TYPE bbp_pds_conf_item_icu,
      <ft_items>  TYPE bbpt_pd_conf_item_icu.

    lo_core_object = me->core_object.

    IF lo_core_object->ms_buffer-items IS INITIAL.
      ASSIGN lo_core_object->ms_buffer-items->* TO <ft_items>.

      CALL FUNCTION 'BBP_PD_CONF_GETDETAIL'
        EXPORTING
          i_guid = lo_core_object->mv_header_guid
        TABLES
          e_item = ltd_item.

      LOOP AT ltd_item ASSIGNING <fs_items> CASTING.
        APPEND <fs_items> TO <ft_items>.
        CLEAR: lth_item,<fs_items>.
      ENDLOOP.
    ENDIF.

Accepted Solutions (0)

Answers (2)

Answers (2)

Kartik2
Contributor
0 Kudos

Hi,

As your dump clearly says that it is due to non assignment of field symbol. Here <fs_items> cannot be the case because it is being assigned at loop statement, and if the loop statement fails then it will not be assigned and also the append statement will not be executed.

Study the following statement carefully:

ASSIGN lo_core_object->ms_buffer-items->* TO <ft_items>.

Here as you can see, all the technical details of a data reference lo_core_object->ms_buffer-items are being assigned to the field symbol <ft_items>, there may be chance that lo_core_object->ms_buffer-items does not contain any data reference, in that case <ft_items> will not be assigned and subsequently when an append statement is executed on this variable, it will result in dump.

To avoid this place the entire logic in an if condition.

IF NOT lo_core_object->ms_buffer-items IS INITIAL.

     ASSIGN lo_core_object->ms_buffer-items->* TO <ft_items>.

     Entire logic comes here

ENDIF.

Regards,

Kartik

Former Member
0 Kudos

Hi Liu Yujia,

There is a type mismatch with work area <fs_items> and table <ft_items>.

That's why you are getting dump.

Please place below code instead of your loop statatement.

LOOP AT ltd_item INTO  lth_item.

         MOVE CORRESPONDING lth_item TO <fs_items>.

        APPEND <fs_items> TO <ft_items>.

        CLEAR: lth_item,<fs_items>.

      ENDLOOP.

I hope this will help you.

Thanks & Regards

Praveen Gupta

Former Member
0 Kudos

HI,

This is not becuase of type mismatch. It is because the field symbol <ft_items> is not yet assigned as like <fs_items>. Either assign the fs table or dont use field symbol instead append to a normal table of same type.

Data lt_items type bbpt_pd_conf_item_icu.

Append <fs_items> to lt_items.

~Rupachandran

Former Member
0 Kudos

Hi Rupta,

We can use below statement also.

Correct me if i am wrong.

APPEND INITIAL LINE TO <lt_items> ASSIGNING <fs_items>.

Thanks

Praveen Gupta