cancel
Showing results for 
Search instead for 
Did you mean: 

ODS Start routine-Abap Code

Former Member
0 Kudos

I have an ODS1 with key elements X1,X2 and I have another ODS2 with key elements X1 X3,I am not a ABAP guy but tried a start routine code that is not working ,which is trying to look up for field X3 which is same as field X2 in ODS1 using common field X1 in both ODS ,kindly help me on this .I have tried to debug it and it error out on selct statement,Here is my code.

Start routine

TABLES:/BIC/AZODS200.

data:begin of t_inttab occurs 0,

X1 like /BIC/AZODS200-X1,

X2 like /BIC/AZODS200-X2,

end of t_inttab.

select X1 X2 into corresponding fields of table t_inttab

from /BIC/AZODS200

where X1 = /BIC/AZODS200-X1.

ABORT = 0.

Routine for X3 field:

Read table t_inttab with key X2 = t_inttab-X2.

RESULT = t_inttab-RT_LOCATIO.

RETURNCODE = 0.

ABORT = 0.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Samuel,

The code would be like this:

select X1 X2 into corresponding fields of table t_inttab
from /BIC/AZODS200
where X1 = Data_package-X1.

Also you would have the sy-subrc statement after the select statement.

Bye

Dinesh

Former Member
0 Kudos

I tried it and still it gives me the same error

Answers (1)

Answers (1)

Former Member
0 Kudos

Samuel

i think that is not correct put your select in your start routine. in the routine you haven't the internal table you are loade in start routine.

you can create this in the first rule of your update rule.

if i.e. the first rule is comp_code you create a routine...

TABLES:/BIC/AZODS200.

data:begin of t_inttab occurs 0,

X1 like /BIC/AZODS200-X1,

X2 like /BIC/AZODS200-X2,

end of t_inttab.

select X1 X2 into corresponding fields of table t_inttab

from /BIC/AZODS200

where X1 =comm_structrue.... /BIC/AZODS200-X1.

ABORT = 0.

result = comm_structure.comp_code

*******************************************************+

or......

insert all in routine for x3 field

TABLES:/BIC/AZODS200.

data:begin of t_inttab occurs 0,

X1 like /BIC/AZODS200-X1,

X2 like /BIC/AZODS200-X2,

end of t_inttab.

select X1 X2 into corresponding fields of table t_inttab

from /BIC/AZODS200

where X1 =comm_structrue.... /BIC/AZODS200-X1.

ABORT = 0.

Routine for X3 field:

Read table t_inttab with key X2 = t_inttab-X2.

RESULT = t_inttab-RT_LOCATIO.

RETURNCODE = 0.

ABORT = 0.

alessandro

Former Member
0 Kudos

TABLES:/BIC/AZODS200.

data:begin of t_inttab occurs 0,

X1 like / BIC/AZODS200-X1,

X2 like /BIC/AZREV_O0400-X2,

end of t_inttab.

select X1 X2into corresponding fields of table t_inttab

from //BIC/AZODS200

where X1 = //BIC/AZODS200-X1.

Read table t_inttab with key X2= t_inttab-X2.

RESULT = t_inttab-RT_LOCATIO.

RETURNCODE = 0.

ABORT = 0.

THis is the code i have in update routine for X3 ,but it doesnt work when i check it gives me an error that result is not a data element ,therefore i commented it and tried to run the code to see if select works but select also fails,kindly help me

Former Member
0 Kudos

SAMUEL

COPY ALL ROUTINE PROGRAM.

ALESSANDRO.

Former Member
0 Kudos

Here is the all the program

TABLES:/BIC/AZREV_O0400.

data:begin of t_inttab occurs 0,

RPA_EID like /BIC/AZREV_O0400-RPA_EID,

RT_LOCATIO like /BIC/AZREV_O0400-RT_LOCATIO,

end of t_inttab.

select RPA_EID RT_LOCATIO into corresponding fields of table t_inttab

from /BIC/AZREV_O0400

where RPA_EID = /BIC/AZREV_O0400-RPA_EID.

*where RPA_EID = /BIC/CSZ_IS_REV04-RPA_EID

*ABORT = 0.

*Routine for X3 field:

Read table t_inttab with key RT_LOCATIO = t_inttab-RT_LOCATIO.

*if sy-subrc = 0.

*RESULT = t_inttab-RT_LOCATIO.

*endif

*Clear itab

*RETURNCODE = 0.

*ABORT = 0.

Thanks

Sam

Former Member
0 Kudos

SAM,

PARDONNE MOI...

ALL PROGRAM

FROM ROW 1 TO THE END

ALESSANDRO

Former Member
0 Kudos

This might be dumb question ,Are you telling me to copy this whole thing below in my in my routine that i am writing for X3 field ie rt_locatio.

TABLES:/BIC/AZODS200.

data:begin of t_inttab occurs 0,

X1 like /BIC/AZODS200-X1,

X2 like /BIC/AZODS200-X2,

end of t_inttab.

select X1 X2 into corresponding fields of table t_inttab

from /BIC/AZODS200

where X1 =comm_structrue.... /BIC/AZODS200-X1.

ABORT = 0.

result = comm_structure.comp_code

*******************************************************+

or......

insert all in routine for x3 field

TABLES:/BIC/AZODS200.

data:begin of t_inttab occurs 0,

X1 like /BIC/AZODS200-X1,

X2 like /BIC/AZODS200-X2,

end of t_inttab.

select X1 X2 into corresponding fields of table t_inttab

from /BIC/AZODS200

where X1 =comm_structrue.... /BIC/AZODS200-X1.

ABORT = 0.

Routine for X3 field:

Read table t_inttab with key X2 = t_inttab-X2.

RESULT = t_inttab-RT_LOCATIO.

RETURNCODE = 0.

ABORT = 0.

Former Member
0 Kudos

Hi Samuel,

your itab t_inttab has no header line. That's why your READ doesn't know where to put in the selected record of your itab. And in your KEY-clause you refer to the table itself (X2= t_inttab-X2) which can't work either for the same reason. I assume "t_inttab-X2" should represent your X3? (Here I'm not quite sure wether I understood your situation correctly, sorry.)

I tried to fit in a header line into your definition but "begin of t_inttab occurs 0 with header line etc" doesn't work.

Perhaps you might like to try this version:

data:begin of t_inttab occurs 0,

X1 like / BIC/AZODS200-X1,

X2 like /BIC/AZREV_O0400-X2,

end of t_inttab,

<b>wa_inttab like line of t_inttab.</b>

select X1 X2 into corresponding fields of table t_inttab

from //BIC/AZODS200

where X1 = /BIC/AZODS200-X1.

Read table t_inttab into <b>wa_inttab</b> with key X2= <b>X3</b>. ??

RESULT = <b>wa_inttab</b>-RT_LOCATIO.

Hope this might help you a little bit.

Cheers, Iris