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

SPLIT at semicolon

Hello All,

I have a customized table, whose fields are sold to party, sales organization, distribution channel and email recipients. The email recipient field will be populated with not just one email address. The separator of each email address from another is semi-colon. My question now is how can i efficiently split the email address from one another? Like how will i know that there are 4 email address entered in email field for one combination of sold to/sales org/distribution channel?

Thanks for your help!

Jim

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Oct 03, 2006 at 05:03 AM

    HI Jim,

    Ranges : r_mail for tablename-field.

    data : str1(30) type c,

    str2(30) type c,

    mail(30) type c.

    mail = 'a@abc.com;b@abc.com;c@abc.com;d@abc.com'.

    str2 = mail.</b>

    r_mail-sign = 'I'.

    r_mail-option = 'EQ'.

    <b>do.

    split str2 at ';' into str1 str2.

    append str1 to r_mail.

    if str2 cs ';'.

    else.

    exit.

    endif.

    enddo.</b>

    At the end, r_mail will have all the mail ids.

    Best regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 03, 2006 at 04:26 AM

    hi,

    take ur itab-field( email field.).

    use

    replace all occurences of ';' with ' '.

    this will seperate the ; field

    rgds

    anver

    pls mark all hlpful answers

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 03, 2006 at 04:38 AM

    hi jim,

    one mre option is there.

    let itab-email be the field

    SPLIT itab-email AT ';' INTO: str1 str2 str3.

    so str1, str2..will contain the seperated email id.

    rgds

    anver

    if helped mark points

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 03, 2006 at 04:50 AM

    Hi,

    As far I know,this is the easiest way.

    data : c1(30) type c value 'x@yahoo.com;y@yahoo.com',

    c2(11),

    c3(11).

    split c1 at ';' into c2 c3.

    write c2.

    write c3.

    Kindly reward points by clicking the star on the left of reply,if it helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 03, 2006 at 04:58 AM

    Hi Jim,

    Try this logic.

    DATA: BEGIN OF t_email OCCURS 0,

    email(40) type c,

    END OF t_email.

    data: begin of i_email occurs 0,

    email(255) type c,

    end of i_email.

    select email into table i_email from your_table.

    Loop at i_email into w_email.

    split w_email at ';' into table t_email.

    loop at t_email.

    lv_email = t_email-email.

    endloop.

    endloop.

    Regards

    Arun

    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.