Skip to Content

SPLIT command not working

Hi Experts,

I am uploading a note pad file separated with tab to application server using CG3Z.

Please find the screen shot of CG3Z from attachment.

But while using :

TYPES : BEGIN OF tys_strc,

bp_num(10) TYPE c,

reltyp(6) TYPE c,

partner2(10) TYPE c,

pavip(1) TYPE c,

abtnr(4) TYPE c,

pafkt(4) TYPE c,

paauth(1) TYPE c,

parem(40) TYPE c,

fnctn(40) TYPE c,

dprtmnt(40) TYPE c,

roomnum_c(10) TYPE c,

floor_c(10) TYPE c,

building_c(10) TYPE c,

tel_number(30) TYPE c,

tel_extens(10) TYPE c,

mob_number(30) TYPE c,

fax_number(30) TYPE c,

fax_extens(10) TYPE c,

smtp_addr(241) TYPE c,

END OF tys_strc.

IF sy-subrc EQ 0.

DO.

READ DATASET file_path INTO lv_str.

IF sy-subrc <> 0.

EXIT.

ELSE.

* Data coming to lv_str with separator '#'.

SPLIT lv_str AT '#' INTO lwa_strc-bp_num lwa_strc-reltyp lwa_strc-partner2 lwa_strc-pavip

lwa_strc-abtnr

lwa_strc-pafkt

lwa_strc-paauth

lwa_strc-parem

lwa_strc-fnctn

lwa_strc-dprtmnt

lwa_strc-roomnum_c

lwa_strc-floor_c

lwa_strc-building_c

lwa_strc-tel_number

lwa_strc-tel_extens

lwa_strc-mob_number

lwa_strc-fax_number

lwa_strc-fax_extens

lwa_strc-smtp_addr.

APPEND lwa_strc TO lt_strc.

ENDIF.


Problem: Here in split command only BP number is coming into the structure.


Please Help.


Thanks.....

CG3Z.png (11.0 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jun 06, 2014 at 04:23 PM

    Hi,

    Split using cl_abap_char_utilities=>horizontal_tab .

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2014 at 08:10 PM

    Hi Amit,

    Tabs are represented by # while doing a debugging.

    Try split lv_str at CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB into

    lwa_strc-bp_num

    lwa_strc-reltyp

    lwa_strc-partner2

    lwa_strc-pavip

    lwa_strc-abtnr

    lwa_strc-pafkt

    lwa_strc-paauth

    lwa_strc-parem

    lwa_strc-fnctn

    lwa_strc-dprtmnt

    lwa_strc-roomnum_c

    lwa_strc-floor_c

    lwa_strc-building_c

    lwa_strc-tel_number

    lwa_strc-tel_extens

    lwa_strc-mob_number

    lwa_strc-fax_number

    lwa_strc-fax_extens

    lwa_strc-smtp_addr.

    APPEND lwa_strc TO lt_strc.

    ENDIF.

    Hope it will be helpful for you.

    Regards,

    Kannan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2014 at 03:07 AM

    data : lt_string type string.


    SPLIT lt_strc AT cl_abap_char_utilities=>newline INTO TABLE lt_string.

    Thanks.

    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.