2006 Dec 05 1:40 PM
Hi everybody.
Here is the program I trie to compile but i got a problem as <fs> is without header.
in seltab I have all table I want to modify records.
data: xtablename(30) type c.
LOOP AT seltab.
IF seltab-low NE 'PA0000' AND seltab-low NE 'PA0001' AND seltab-low NE 'PA0002'.
concatenate 'I_' SELTAB-LOW into xtablename.
assign (xtablename) to <fs>.
LOOP AT <fs> WHERE pernr = hiring-pernr
AND begda LE I_PA0001-BEGDA
AND endda GE I_PA0001-BEGDA.
<fs>-begda = I_PA0001-BEGDA.
MODIFY <fs>.
ENDLOOP.
ENDIF.
ENDLOOP.
Thanks for your help
Message was edited by:
Raynald Hauduc
Message was edited by:
Raynald Hauduc
Hi everybody.
Here is the program I trie to compile but i got a problem as <fs> is without header.
in seltab I have all table I want to modify records.
data: xtablename(30) type c.
LOOP AT seltab.
IF seltab-low NE 'PA0000' AND seltab-low NE 'PA0001' AND seltab-low NE 'PA0002'.
concatenate 'I_' SELTAB-LOW into xtablename.
assign (xtablename) to <fs>.
LOOP AT <fs> WHERE pernr = hiring-pernr
AND begda LE I_PA0001-BEGDA
AND endda GE I_PA0001-BEGDA.
<fs>-begda = I_PA0001-BEGDA.
MODIFY <fs>.
ENDLOOP.
ENDIF.
ENDLOOP.
Thanks for your help
Message was edited by:
Raynald Hauduc
Message was edited by:
Raynald Hauduc
2006 Dec 05 1:44 PM
try like this...
modify <fs> from wa...
and wa-begda = I_PA0001-BEGDA.
Regars,
Satya
2006 Dec 05 1:51 PM
Hi Raynald,
I've done something like that a few times ago :
DATA : w_tab(10) type c,
w_temp(10) type c.
W_TAB = 'MARA'.
CONCATENATE w_tab '[]' INTO w_temp.
UNASSIGN <NEW_TAB>.
ASSIGN (w_temp) TO <NEW_TAB>.
ASSIGN LOCAL COPY OF (w_tab) TO <NEW_WA>.
LOOP AT <NEW_TAB> INTO <NEW_WA>.
..........
ENDLOOP.
Hope it helps,
Mathieu
2006 Dec 05 3:19 PM
ASSIGN LOCAL COPY OF (w_tab) TO <NEW_WA> is not working
I can compile but <NEW_WA> is not assign
2006 Dec 05 3:29 PM
The SAP help on LOCAL COPY is :
<i>ASSIGN LOCAL COPY OF f TO <fs>.
Effect
Has largely the same effect as a normal ASSIGN statement.
However, this variant of ASSIGN can only be used within a subroutine. The system creates a local copy of the field f, to which the field symbol points.
</i>
As you are using local table, it won't work... And without the LOCAL COPY OF? Is it working?
2006 Dec 05 3:36 PM
Not as I need a header with the same structure as my filed symbol.
2006 Dec 05 3:38 PM
HI
Why dont you declare
<fs_wa> type any.
loop at <fs> assigning <fs_wa>.
logic for your loop
endloop.
Hope this helps
2006 Dec 05 3:47 PM
How do you define your field symbol <fs> ??
When you do such a thing :
<i>LOOP AT <fs> WHERE pernr = hiring-pernr
AND begda LE I_PA0001-BEGDA
AND endda GE I_PA0001-BEGDA.</i>
He replies <i>The line types of the table must be statically defined</i>... O_o
2006 Dec 05 3:58 PM
2006 Dec 05 1:54 PM
Try like this
REPORT zkb_test.
DATA: dref TYPE REF TO data.
FIELD-SYMBOLS: <fs_i_scarr> TYPE table,
<fs_w_scarr> TYPE ANY,
<fs_field> TYPE ANY.
CREATE DATA dref TYPE TABLE OF scarr.
ASSIGN dref->* TO <fs_i_scarr>.
SELECT * FROM scarr INTO TABLE <fs_i_scarr>.
LOOP AT <fs_i_scarr> ASSIGNING <fs_w_scarr>.
ASSIGN COMPONENT 2 OF STRUCTURE <fs_w_scarr> TO <fs_field>.
WRITE / <fs_field>.
IF <fs_field> EQ 'AA'.
ASSIGN COMPONENT 5 OF STRUCTURE <fs_w_scarr> TO <fs_field>.
<fs_field> = 'www.a-airlines.com'.
ENDIF.
ENDLOOP.
Regards
Kathirvel
2006 Dec 05 3:57 PM
hi Raynald.
The table xtablename does not have the workarea.
1. Either define the table xtablename with work area.
DATA : I_PA1234 TYPE TABLE OF xxx WITH HEADER LINE.
2. Or define an explicit work area and loop the table into that work area.
LOOP AT <fs> INTO <fsw> WHERE pernr = hiring-pernr
AND begda LE I_PA0001-BEGDA
AND endda GE I_PA0001-BEGDA.
<fsw>-begda = I_PA0001-BEGDA.
MODIFY <fs>.
ENDLOOP.Hope this helps.
Regards,
Richa
2006 Dec 05 4:01 PM
1)How can I declare xtablename with work area as it's a field symbol?
for the 2) how fsw had to be declare?
Thanks for yourhelp
2006 Dec 06 9:55 AM
I trie to do somthing like this
LOOP AT I_PAxxx0 WHERE pernr = hiring-pernr
AND begda LE I_PA0001-BEGDA
AND endda GE I_PA0001-BEGDA.
I_PAxxx0-begda = I_PA0001-BEGDA.
MODIFY I_PAxxx0.
ENDLOOP.
DELETE I_PA9xxx0 WHERE pernr = hiring-pernr
AND endda LT I_PA0001-BEGDA.
LOOP AT I_PAxxx1 WHERE pernr = hiring-pernr
AND begda LE I_PA0001-BEGDA
AND endda GE I_PA0001-BEGDA.
I_PAxxx1-begda = I_PA0001-BEGDA.
MODIFY I_PAxxx1.
ENDLOOP.
DELETE I_PAxxx1 WHERE pernr = hiring-pernr
AND endda LT I_PA0001-BEGDA.
but without a duplicate code
2006 Dec 06 10:32 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |