Skip to Content
author's profile photo Former Member
Former Member

Concatenate BSEG fields.

Hi Guys,

I ahve to download data in a text file from SAP.The format must be ' | ' or pipe delimiter.So i am using SAP_to_convert_tex_format.But this is not working for BSEG table.so i am using concatenate for all the fields and seperated by ' | '.while conatenating i am getting syntax error for the result it_bseg1.That declare it_bseg1 as character type .i declared it_bseg1 as

data : it_bseg1(4096) type c occurs 0.

can any body tell me how to solve this one.

i wrote concatenate all fields................into it_bseg1 seperated by '|'.

Thanks,

Gopi.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2007 at 04:49 PM

    You'll probably want to convert you currency fields to character first.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2007 at 04:49 PM

    hi gopi anne,

    define like this,

    data: it_bseg1 type string.

    try to avoid this.

    data : it_bseg1(4096) type c occurs 0.

    reward points if helpful,

    regards,

    seshu.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 12, 2007 at 04:50 PM

    Please try this example program.

    
    report zrich_0001 .
    
    data: ibseg type table of bseg.
    data: xbseg like line of ibseg.
    
    data: istr type table of string,
          xstr type string.
    data: xtmp type string.
    field-symbols: <fs>.
    
    
    select * into table ibseg from bseg
               up to 100 rows.
    
    loop at ibseg into xbseg.
    
      do.
        assign component sy-index of structure xbseg to <fs>.
        if sy-subrc <> 0.
          exit.
        endif.
        xtmp = <fs>.
        if sy-index = 1.
          xstr = xtmp.
        else.
          concatenate xstr xtmp into xstr separated by '|'.
        endif.
      enddo.
      append xstr to istr.
    
    endloop.
    
    call method cl_gui_frontend_services=>gui_download
      exporting
        filename                = 'c:test.txt'
      changing
        data_tab                = istr.
    
    

    Regards,

    RIch Heilman

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.