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

Reg : DO..END DO in ECC 6.0

hi,

Iam getting syntax error for this statement

(DO MAX_VAL TIMES VARYING CHAR FROM WS-01 NEXT WS-02) in ECC 6.0.

The error is : ADDITION RANGE is missing.I dont know how to use the statement with ADDITION RANGE.

Can anyone look at this and rectify it.plz copy the below code and paste in ECC 6.0 and solve this error.

DATA : MAX_VAL(2) TYPE N VALUE '31'.

DATA: WS-01(1) TYPE C VALUE '1',

WS-02(1) TYPE C VALUE '2',

CHAR LIKE WS-01.

DATA: BEGIN OF NUM_TAB OCCURS 35,

CHAR(1) TYPE C,

VAL LIKE SY-INDEX,

END OF NUM_TAB.

  • initializes internal table with character values from data

DO MAX_VAL TIMES VARYING CHAR FROM WS-01 NEXT WS-02.

MOVE: CHAR TO NUM_TAB-CHAR,

SY-INDEX TO NUM_TAB-VAL.

APPEND NUM_TAB.

ENDDO.

regards

VAJA.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jan 28, 2008 at 11:08 AM

    It is not ADDITION RANGE.

    just add RANGE

    See this as an example:

    DATA: BEGIN OF text,

    word1(4) TYPE c VALUE 'AAAA',

    word2(4) TYPE c VALUE 'BBBB',

    word3(4) TYPE c VALUE 'CCCC',

    word4(4) TYPE c VALUE 'DDDD',

    END OF text.

    DATA: word(4)  TYPE c,

    char1(1) TYPE c,

    char2(1) TYPE c,

    leng TYPE i.

    DESCRIBE FIELD text LENGTH leng IN CHARACTER MODE.

    leng = leng / 2.

    DO leng TIMES VARYING char1 FROM text(1)

    NEXT text+2(1) RANGE text

    VARYING char2 FROM text+1(1)

    NEXT text+3(1) RANGE text.

    WRITE: char1, char2.

    char1 = 'x'.

    char2 = 'y'.

    ENDDO.

    DO 4 TIMES VARYING word FROM text-word1 NEXT text-word2.

    WRITE / word.

    ENDDO.

    Regards,

    Ravi Kanth

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      thanks ravi.

      yes I checked this.

      but my question is after RANGE what should we put.

      In the example you given its like this

      DO leng TIMES VARYING char1 FROM text(1)

      NEXT text+2(1) RANGE text

      VARYING char2 FROM text+1(1)

      NEXT text+3(1) RANGE text.

      but in my casewhat should i keep after range

      DO MAX_VAL TIMES VARYING CHAR FROM WS-01 NEXT WS-02 RANGE.........-->>HERE after RANGE what I should KEEP?

      plz answer this..better try once in ECC 6.0 my code.

      regards

      VAJA

      Edited by: Mallikarjun vaja on Jan 28, 2008 12:15 PM

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 11:11 AM

    hi,

    try DO MAX_VAL TIMES VARYING CHAR FROM WS-01 NEXT WS-02 range WS-02.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 28, 2008 at 11:40 AM

    hi Vaja,

    First problem is here that the DO would have value WS-03 in the third round, but it is not defined in your program. Than it would be WS-04, which is also not defined, etc.

    Could you please let me know, what do you want to achieve with this small piece of code?

    thanks

    ec

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      thanks ERIC fro your answer.

      here is the full code.

      DATA: WS-01(1) TYPE C VALUE '1',

      WS-02(1) TYPE C VALUE '2',

      WS-03(1) TYPE C VALUE '3',

      WS-04(1) TYPE C VALUE '4',

      WS-05(1) TYPE C VALUE '5',

      WS-06(1) TYPE C VALUE '6',

      WS-07(1) TYPE C VALUE '7',

      WS-08(1) TYPE C VALUE '8',

      WS-09(1) TYPE C VALUE '9',

      • WS-10(1) TYPE C VALUE 'A', "Omit letter 'A'

      WS-10(1) TYPE C VALUE 'B',

      WS-11(1) TYPE C VALUE 'C',

      WS-12(1) TYPE C VALUE 'D',

      • WS-14(1) TYPE C VALUE 'E', "Omit letter 'E'

      WS-13(1) TYPE C VALUE 'F',

      WS-14(1) TYPE C VALUE 'G',

      WS-15(1) TYPE C VALUE 'H',

      • WS-18(1) TYPE C VALUE 'I', "Omit letter 'I'

      WS-16(1) TYPE C VALUE 'J',

      WS-17(1) TYPE C VALUE 'K',

      WS-18(1) TYPE C VALUE 'L',

      WS-19(1) TYPE C VALUE 'M',

      WS-20(1) TYPE C VALUE 'N',

      • O TYPE N VALUE '24', "Omit letter 'O'

      WS-21(1) TYPE C VALUE 'P',

      WS-22(1) TYPE C VALUE 'Q',

      WS-23(1) TYPE C VALUE 'R',

      WS-24(1) TYPE C VALUE 'S',

      WS-25(1) TYPE C VALUE 'T',

      • WS-29(1) TYPE C VALUE 'U', "Omit letter 'U'

      WS-26(1) TYPE C VALUE 'V',

      WS-27(1) TYPE C VALUE 'W',

      WS-28(1) TYPE C VALUE 'X',

      WS-29(1) TYPE C VALUE 'Y',

      WS-30(1) TYPE C VALUE 'Z',

      WS-31(1) TYPE C VALUE '0',

      NUM_LENGTH TYPE N VALUE '8'. " Length of stored no.

      DATA : MAX_VAL(2) TYPE N VALUE '31'.

      DATA: BEGIN OF NUM_TAB OCCURS 35,

      CHAR(1) TYPE C,

      VAL LIKE SY-INDEX,

      END OF NUM_TAB.

      • initializes internal table with character values from data

      DO MAX_VAL TIMES VARYING CHAR FROM WS-01 NEXT WS-02 .

      MOVE: CHAR TO NUM_TAB-CHAR,

      SY-INDEX TO NUM_TAB-VAL.

      APPEND NUM_TAB.

      ENDDO.

      this is my code.

      I could noy understand what it does.but my question is what should I keep at the end of statement

      DO MAX_VAL TIMES VARYING CHAR FROM WS-01 NEXT WS-02 RANGE------>>>>here after range what should I keep??

      PLZ HELP me eric in solving this.

      regards

      VAJA

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.