on 04-02-2009 3:34 PM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
change the line...
DATA: wa TYPE STANDARD TABLE OF tys_SC_1.
its wrong,
correct one is
DATA: wa TYPE tys_SC_1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.