Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OBJECTS_NOT_CHARLIKE Dump

Former Member
0 Likes
5,343

Hello Experts,

I'm trying to extract BSEG Entries into a Txt File in Application Server.

Getting Dump at this place:


IF NOT <fs> IS INITIAL.

  CONCATENATE xout <fs> INTO xout SEPARATED BY space.

ENDIF.

Error Analysis:

In statement
  "CONCATENATE"
the argument "<FS>" can only take a character-type data object.

In this case, the operand "<FS>" has the non-character type "P".

When I debugged & checked, the value of <fs> was 100.00.

Code :


FIELD-SYMBOLS: <fs>.

DATA:

     xout                     TYPE string.

      LOOP AT g_t_bseg INTO g_wa_bseg.

        DO.

          ASSIGN COMPONENT sy-index OF STRUCTURE g_wa_bseg TO <fs>.

          IF sy-subrc <> 0.

           EXIT.

          ENDIF.

          IF sy-index = 1.

            xout = <fs> .

          ELSE.

            IF NOT <fs> IS INITIAL.

              CONCATENATE xout <fs> INTO xout

                     SEPARATED BY space. "cl_abap_char_utilities=>horizontal_tab.

            ENDIF.

          ENDIF.

        ENDDO.

        w_count = w_count + 1.

        TRANSFER xout TO p_ofile.

      ENDLOOP.

Please advise on this.

Thanks & Regards,

Sowmya

1 ACCEPTED SOLUTION
Read only

former_member212124
Active Participant
0 Likes
3,505

Hi Sowmya,

Please create a new variable with type 'string'.

pass value from <FS> to that variable.

and then try to concatenate.

This will work.

thanks,

vidyasagar

7 REPLIES 7
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
3,505

Hello Sowmya,

Declare <fs> as FIELD-SYMBOLS: <fs> TYPE ANY.


Thanks

Read only

0 Likes
3,505

Hi,

I had already tried that too.... But still getting the same dump.

-Sowmya

Read only

0 Likes
3,505

Hi Sowmya,

Instead of

ASSIGN COMPONENT sy-index OF STRUCTURE g_wa_bseg TO <fs>.

Try this.

Declare 

DATA: new_line TYPE REF TO data.

CREATE DATA new_line LIKE LINE OF intab.

ASSIGN new_line->* TO <fs>.

In the DO-ENDDO loop, use CONCATENATE, MOVE-CORRESPONDING, etc. It should work.

The catch here is since <fs> doesnt have any structure, it is not able to cast/determine the values your are trying to pass.

Regards,

Jai

Read only

0 Likes
3,505

Thanks Jai.

I tried as suggested by Vidyasagar.

Read only

0 Likes
3,505

This message was moderated.

Read only

former_member212124
Active Participant
0 Likes
3,506

Hi Sowmya,

Please create a new variable with type 'string'.

pass value from <FS> to that variable.

and then try to concatenate.

This will work.

thanks,

vidyasagar

Read only

0 Likes
3,505

Thank you Vidyasagar. It worked.