cancel
Showing results for 
Search instead for 
Did you mean: 

Start Routine ABAP upgrade

Former Member
0 Kudos

Hi Guys,

I have a problem to upgrade an OSD-Cube Start Routine to the new ABAP version.

This is the original initial definition code

data:
  		data_package type standard table of data_package_structure
       with header line
       with non-unique default key initial size 0.

and this is the original routine code.

delete data_package where /bic/zposition = ' '.
 loop at data_package.

 case data_package-/bic/zposition.

  when '02'.
  data_package-act1_unit = data_package-act2_unit.
  data_package-conf_act1 = data_package-conf_act2.

  endcase.
modify data_package index sy-tabix.
endloop.

I tried to upgrade the code in following way:

Definition code

TABLES: /bic/cs8zgr_od52.

Routine code

DATA: wa TYPE STANDARD TABLE OF _ty_s_SC_1.

DELETE SOURCE_PACKAGE WHERE /bic/zposition = ' '.

   LOOP AT SOURCE_PACKAGE into wa.

      CASE SOURCE_PACKAGE-/bic/zposition.

        WHEN '02'.
          SOURCE_PACKAGE-act1_unit = SOURCE_PACKAGE-act2_unit.
          SOURCE_PACKAGE-conf_act1 = SOURCE_PACKAGE-conf_act2.

      ENDCASE.
      MODIFY TABLE SOURCE_PACKAGE FROM wa.
    ENDLOOP.

Checking the code the system show me the this message error: "WA" cannot be converted to the line type of "SOURCE_PACKAGE".

Can anybody help me?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

former_member205352
Active Contributor
0 Kudos

Try this:

DATA: wa TYPE  _ty_s_SC_1.
 
DELETE SOURCE_PACKAGE WHERE /bic/zposition = ' '.
 
   LOOP AT SOURCE_PACKAGE into wa.
 
      CASE wa-/bic/zposition.
 
        WHEN '02'.
          wa-act1_unit = SOURCE_PACKAGE-act2_unit.
          wa-conf_act1 = SOURCE_PACKAGE-conf_act2.
 
      ENDCASE.
      MODIFY TABLE SOURCE_PACKAGE FROM wa.
    ENDLOOP.

Former Member
0 Kudos

Hi,

and in addition to Praveen: delete the tables statement.

Siggi

former_member205352
Active Contributor
0 Kudos

Missed this :

wa-act1_unit = wa-act2_unit.

wa-conf_act1 = wa-conf_act2.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

change the line...

DATA: wa TYPE STANDARD TABLE OF tys_SC_1.

its wrong,

correct one is

DATA: wa TYPE tys_SC_1.

Former Member
0 Kudos

Hi Macro...

wa is one line of table but not table...........so in declaration change like this ...use below code...

DATA: wa TYPE tys_SC_1.

DELETE SOURCE_PACKAGE WHERE /bic/zposition is initial.

LOOP AT SOURCE_PACKAGE into wa.

if wa-/bic/zposition = '02' .

wa-act1_unit = wa-act2_unit.

wa-conf_act1 = wa-conf_act2.

endif.

MODIFY SOURCE_PACKAGE FROM wa.

ENDLOOP.

***use act1-unit,act2-unit names declared as above in strtucre tys_SC_1.

Regards

vamsi