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

how to get the report output with fields padded with double quotes?

the report output fields should be padded with double quotes in the beggining and at the end of the field. Ex

matnr matrt

"1233434","xrt",

"2343434","we",

...........

lilke wise all fields should be padded with double quotes and separated with comma, and output should be in .csv format.

Message was edited by: vinod

Vinod Devo

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 02:22 PM

    Do like this WRITE:/ '''itab-matnr''' , '''itab-mtart'''.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 02:40 PM

    Hi Vinod,

    Check this sample code...

    REPORT  zreport.
    TABLES eban.
    DATA : BEGIN OF itab OCCURS 100,
            matnr LIKE eban-matnr,
            menge LIKE eban-menge,
           END OF itab.
    DATA : BEGIN OF itab2 OCCURS 0,
            text type  string,
          END OF itab2.
    
    DATA : menge type char18.
    
    SELECT-OPTIONS : s_matnr FOR eban-matnr.
    
    START-OF-SELECTION.
    
    SELECT matnr menge INTO CORRESPONDING FIELDS OF TABLE itab
    FROM eban UP TO 20 ROWS WHERE matnr IN s_matnr and matnr NE space.
    
    
    LOOP AT itab.
    menge = itab-menge.  "assign numerics to char fields
    CONCATENATE '"' itab-matnr '"' ',' '"' menge '"' INTO itab2-text.
    APPEND itab2.
    ENDLOOP.
    
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = 'C:TEMPTEST.CSV'
      tables
        data_tab                        = itab2
              .
    IF sy-subrc <> 0.
    " message
    ENDIF.
    

    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.