Skip to Content

read dataset

Hi guys..

I am reading a file from application server into sap using OPEN DATA SET and then READ dataset..

The file data is a s follows

H#12/10/07#integrity#1000#12000#interface

d########40#12

When I read the dataset into work area I dont see # but '/h/' in place of #,,

ands i cant split the wwork area at # into fields.

Please help me out why its happening like this..

I am using 4.6c

regards,

nazeer

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 Nov 20, 2007 at 12:35 PM

    Then why to worry Split at '/h/'.

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 20, 2007 at 12:37 PM

    hi,

    use cl_abap_character utility for split values.

    DO.
        CLEAR lv_file_line.
        READ DATASET phy_name_out INTO lv_file_line.
        IF sy-subrc EQ 0.
          lv_file_line+0(1) = ' '.
          SHIFT lv_file_line LEFT DELETING LEADING space.
    
          SPLIT lv_file_line AT cl_abap_char_utilities=>horizontal_tab INTO
           wa_ctab-bukrs
           wa_ctab-fkdat
           wa_ctab-vbeln
           wa_ctab-kunag
           wa_ctab-zterm
           wa_ctab-inco1
           wa_ctab-inco2
           wa_ctab-matnr
           wa_ctab-fkimg
           wa_ctab-vrkme
           wa_ctab-netwr
           wa_ctab-waerk
           wa_ctab-fkart
           wa_ctab-lgort
           wa_ctab-charg
           wa_ctab-vkorg
           wa_ctab-vtweg
           wa_ctab-spart
           wa_ctab-kunnr
           wa_ctab-gjahr.
          APPEND wa_ctab TO ctab.
        ELSE.
          CLOSE DATASET phy_name_out.
          EXIT.
        ENDIF.
      ENDDO.

    Rewards if helpful.

    Regards

    Gagan

    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.