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 comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Nov 20, 2007 at 12:35 PM

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

    Regards,

    Satish

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded