2012 Mar 19 3:42 AM
Hi,
1. Translate statement wont work in ABAP OO context. What is the alternative for Translate <f> using ‘0’ & how to use?.
2. Write <f1> TO <f2>. wont work in ABAP OO context. So how to write the below statement in ABAP OO
Write itab-f1 To itab2-f2
ROUND -2
DECIMALS 0
NO-GROUPING
LEFT-JUSTIFIED.
3. Normal write statement & Subroutines will work in ABAP OO?
4. Modify statement is not working. My Declaration
TYPES: BEGIN OF it_tab,
F1(3) TYPE c,
F2(15) TYPE c,
END OF it_hdr.
DATA : itab TYPE STANDARD TABLE OF it_tab,
wa like line of itab.
Select * from <db> into wa.
move wa_marc-werks to wa-werks.
Check sy-subrc eq 0.
Modify itab from wa. “But here modify statement is not working
Please help me to do these statement in ABAP OO. As i have release 4.7 only.
2012 Mar 19 4:16 AM
Hi,
Cheers,
Mahesh
2012 Mar 19 5:29 AM
please reply as soon as possible.
Moderator Message: Please don't expect members to react ASAP to your problems.
Message was edited by: Suhas Saha
2012 Mar 19 5:42 AM
2012 Mar 19 7:22 AM
Hi Mahesh,
I read in ABAP Obsolete statement. In that they mentioned "Translate " statement also obsolete. If you are using ECC 6, then check this Translate statement works are not.
I am using Modify statement inside the loop. But still it gives sy-subrc is 4. please check whether i need to change the declaration?
2012 Mar 19 10:36 AM
Kelvin,
Why can't you use a Select * from <Database table> into TABLE ITAB ?
Then you can Loop or Read and move the required WERKS to your other internal table lines.
Also, try using a Field symbol, it would save you some time over the Modify.
For example:
DATA: ITABA type table of TABLEA,
ITABB type table of TABLEB.
FIELD-SYMBOLS: <f_a> type TABLEA,
<f_b> type TABLEB.
Select * from TABLEA into table ITABA.
if sy-subrc = 0.
Select * from TABLEB into table ITABB
for all entries in ITABA
where SOMEFIELD = ITABA-SOMEFIELD.
endif.
LOOP at ITABA assigning <F_A>.
READ TABLE ITABB assigning <F_B> with KEY SOMEFIELD = ITABA-SOMEFIELD.
IF SY_SUBRC = 0.
<F_A>-WERKS = <F_B>-WERKS.
ENDIF.
ENDLOOP.
At line 14 above, the value of WERKS field of your table line would be changed and you would not need to write the MODIFY statement.
2012 Mar 28 6:26 AM
Hi,
MODIFY TABLE itab FROM wa will work in ABAP OO.
First you have to use correct syntax. Both work area's werks field should have same type.
Follow the following steps.
1) you have to use either loop or read statement.
2) use move statement or wa-werks = wa_marc-werks.
3)Modify that table with work area with index.
I hope it will solve your problem.
Thanks,
Mamta Kumari
2012 Mar 31 2:52 PM
Hello Kelvin ,
Always a modify internal statement should be inside a loop for a internal tab without header line.
Best way to avoid confusion is
loop at it_tab into w_itab1
modify w_itab into it_itab.
clear w_itab1.
endloop.
2012 Apr 02 8:28 AM
Vijay Simha wrote:
Hello Kelvin ,
Always a modify internal statement should be inside a loop for a internal tab without header line.
Er.... no. This is not correct. You can modify an internal table outside a loop by specifying the correct syntax, and using a key or index, depending on the type of the table.