on 03-02-2007 12:16 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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.
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
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.