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

how to create the stack in abap

Former Member
0 Likes
2,314

like data structures in i want to build the stackthe situation is like

in the table vekp we will accpt exidv

now for this exidv there are corresponding venum's in the vepo.

now i want to display the all elements of venum.

the venum can also contain the other venum's.

like data structures in i want to build the stackthe situation is like

in the table vekp we will accpt exidv

now for this exidv there are corresponding venum's in the vepo.

now i want to display the all elements of venum.

the venum can also contain the other venum's.

4 REPLIES 4
Read only

Former Member
0 Likes
1,306

to make a stack you need two itabs if you want to append a new record then first you have to move data of final itab to temp itab and then append record and again append temp table to final table.

to remove any record you need to delete first record.

Aditya

Read only

Former Member
0 Likes
1,306

Hi Javed,

For that u have to create nested types. Here the code for that,

TYPES: BEGIN OF TY_NAME,

FNAME TYPE NAME1,

MNAME TYPE NAME1,

LNAME TYPE NAME1,

END OF TY_NAME.

TYPES: BEGIN OF TY_ADDRESS,

NAME TYPE TY_NAME,

NO TYPE I,

END OF TY_ADDRESS.

Now defin one table which has type of ty_address .

Rewards points if it useful.

Read only

Former Member
0 Likes
1,306

You ll have to use object oriented programming if u want to implement stack..

the following link gives u the logic:

http://en.wikipedia.org/wiki/Stack_(data_structure)

the following link gives you the examples and syntax for Object oriented abap

http://www.erpgenie.com/abap/OO/index.htm

all the best!!

Aparna

Read only

0 Likes
1,306

Hi ,

I have a blog link .

https://mysapnuts.blogspot.com/2021/07/stack-implementation-using-sap-abap.html

But for your requirement either you can use two internal table or you can use mesh .