Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Alternative for Append Lines of

Former Member
0 Kudos

Hi techies,

I have two internal tables  .

I need append itab 2 with the entries of one.

I don't want to overwrite.

I want to append.

Append lines is not working.

Suggest me alternative of append lines.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

loop at itab2 into wa2.

wa1-field = wa2-field.

append wa1 to itab1.

endloop.

16 REPLIES 16

Former Member
0 Kudos

loop at itab2 into wa2.

wa1-field = wa2-field.

append wa1 to itab1.

endloop.

raymond_giuseppi
Active Contributor
0 Kudos

Can you elaborate on :


Append lines is not working.

As APPEND LINES OF jtab [FROM idx1] [TO idx2] [USING KEY keyname] usually do the job ?

If your itab is a sorted type of itab, then you may be required to use INSERT LINES OF jtab [FROM idx1] [TO idx2] [USING KEY keyname]

Regards,

Raymond

Former Member
0 Kudos

append lines will work on a standard table. Once it is not standard, you can't use it. So first show us your code

Former Member
0 Kudos

Please check code and suggest accordingly

0 Kudos

Are table *Sys* and logfile of the same structure ? They must be otherwise it won't work.

Do you get an error message when this statement is performed ?

0 Kudos

what does the syntax asdf-*sys* mean?

0 Kudos

They are of the same type holding one structure as LINE(255) .

0 Kudos

*SYS*  is used when call 'system' is used to capture the command.

Even am not very clear regaring the statement  :

CALL SYSTEM ID 'COMMAND'  FIELD uxcmdfile ID 'TAB FIELD xoutput-*sys* '

0 Kudos

Even am not very clear regaring the statement  :

CALL SYSTEM ID 'COMMAND'  FIELD uxcmdfile ID 'TAB FIELD xoutput-*sys* '

Is it a custom code? If yes, then why are you using something which you don't understand?

Anyway C-calls should not be used in customer code unless there is no suitable alternative available. Can you tell us what business case do you want to achieve?

- Suhas

0 Kudos

i have a logfile in which am maintaining my log , and i want to append the error lines which are captured in xoutput-*sys*   .

it is customcode , but developer is not me .

0 Kudos

"tabl-*sys* is the outdated and undocumented way of writing tabl[] in order to address the table body of an internal table with header line. That's all." described by Horst Keller inhttp://scn.sap.com/community/abap/blog/2013/03/06/a-word-about-call-system

0 Kudos

Well I think that this one answered the question - as xoutput-*sys* is another way to access the header line, one can't touch it's lines, as it has none.

0 Kudos

Have you tried:

append lines of xoutput to logfile.


Can't see a reason for this not to work.


Cheers,

Custodio

0 Kudos

do you know the structure of xoutput? It probably is not a flat structure

0 Kudos

He said they are the same structure, no?


Praveen Bindla wrote:

They are of the same type holding one structure as LINE(255) .

Former Member
0 Kudos

i have edited my code with loop append endloop.

hope this should work .

can you techies explain me what the line mean :

CALL 'SYSTEM' ID 'COMMAND' FIELD uxcmdfile  ID 'TAB' FIELD xoutput-*sys*.

what it will do ?

can you explain me ?