‎2014 Aug 20 4:42 AM
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
‎2014 Aug 20 5:03 AM
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
‎2014 Aug 20 4:45 AM
Hello Sowmya,
Declare <fs> as FIELD-SYMBOLS: <fs> TYPE ANY.
Thanks
‎2014 Aug 20 4:52 AM
Hi,
I had already tried that too.... But still getting the same dump.
-Sowmya
‎2014 Aug 20 4:56 AM
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
‎2014 Aug 20 5:12 AM
‎2014 Sep 11 1:43 PM
‎2014 Aug 20 5:03 AM
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
‎2014 Aug 20 5:12 AM