Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Do Varying statement in ECC6 ERROR

Former Member
0 Likes
450

Hi Friends,

I am working for upgrade project i getting some error on Do Varring statement,before searching i have some code changes but its not working.

please help on this.

some code

Declaration part:


DATA: BEGIN OF EVNT1,                         "Event data field string 1

          OCDXX LIKE P0082-OCD01,                       "Event identifier

          ODTXX LIKE P0082-ODT01,                             "Event date

          OTMXX LIKE P0082-OTM01,                             "Event time

       END OF EVNT1.


Do Varying statement used:

DO 25 TIMES                                         "25 variable lines

     VARYING EVNT1 FROM P0082-OCD01        "Strange arrangement in I0082

                   NEXT P0082-OCD02          "We need to vary both field

     VARYING EVNT2 FROM P0082-VDT01                             "Strings

                   NEXT P0082-VDT02.

Please send me replace code.

Thanks,

Santhosh

2 REPLIES 2
Read only

Former Member
0 Likes
405

Hi Santhosh,

You should use ASSIGN + INCREMENT as mentioned in the below thread and the SAP document;

http://scn.sap.com/thread/1084362

http://help.sap.com/abapdocu_70/en/ABAPDO_VARYING.htm

Hope this helps.

Regards,

Karthik

Read only

Former Member
0 Likes
405

Hi,

please try

DO 25 TIMES                                             

VARYING EVNT1-OCDXX FROM P0082-OCD01                    

                                       NEXT P0082-OCD02         

VARYING EVNT2-VDTXX FROM P0082-VDT01

                                      NEXT P0082-VDT02.

The fields have to be of the same type, and your structure EVNT1 doesn't fit for P0082-OCD01 !

Or use Karthik's solution.

Regards,

Klaus