Application Development and Automation 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: 
Read only

append all rows

Former Member
0 Likes
1,185

there is an internal table xvbap, in my user exit i need to create a work area out of it and an internal table? Do i need to declare xvbap as a table before declaring its wa and itab

also i want to append all rows of xvbap to itab

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,090

Santosh

I cannot use occurs 0 with header line, its obsolete

Your code does work, but is there a non obsolete statement to declare itab

11 REPLIES 11
Read only

Former Member
0 Likes
1,090

Hi Megan,

data: itab like table of xvbap,

wa type xvbap.

append lines of xvbap to itab.

Regards,

Vidya.

Read only

Former Member
0 Likes
1,090

If Xvbapis passed as a parameter to your FM, you do not need to declare it again. You will have to declare your internal itab and work area, though. Look at the type of xvbap and declare accordingly.

use itab[] = xvbap[] to copy the entire internal table.

Please use separate threads for multiple questions.

Sudha

Read only

Former Member
0 Likes
1,090

hi Megan,

declare this way.


data : itab like xvbap occurs 0 with header line,
         wa_xvbap like xvbap.

itab[] = xvbap[].

Regards,

Santosh

Message was edited by:

Santosh Kumar Patha

Read only

Former Member
0 Likes
1,090

if xvbap an internal table, you don't need to create a workarea....Because the user-exit is working inside the calling program...

If you need to append all rows of xvabp to another internal table, you can do this...


FIELD-SYMBOLS: <XVBAP> LIKE LINE OF VBAP.

LOOP AT XVBAP ASSIGNING <XVBAP>.
MOVE <XVBAP> TO ITAB.
APPEND ITAB.
ENDLOOP.

Greetings,

Blag.

Read only

Former Member
0 Likes
1,090

Try this:

append lines of xvbap to <your itab>.

Best!

Jim

Read only

Former Member
0 Likes
1,090

it says xvbap type is unknown

Read only

0 Likes
1,090

did you check my post ?? try it in that way you will get it

Read only

Former Member
0 Likes
1,090

Flores,

declare the itab and workarea as below.

data: wa_xvbap type vbap.

data: itab_xvbap type standard table of vbap.

*move the data as below

itab_xvbap[] = xvbap[].

Regards,

Bhasha

Read only

Former Member
0 Likes
1,091

Santosh

I cannot use occurs 0 with header line, its obsolete

Your code does work, but is there a non obsolete statement to declare itab

Read only

0 Likes
1,090

Hi Megan,

In that case ... declare it in this way ..


data : begin of itab1 occurs 0,
        vbeln like vbap-vbeln,
       end of itab1.

data : itab like standard table of itab1 with header line.

Read only

ferry_lianto
Active Contributor
0 Likes
1,090

Hi,

Please try this.


DATA: ITAB TYPE TABLE OF VBAPVB.

ITAB[] = XVBAP[].

Regards,

Ferry Lianto