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

ABAP code

Former Member
0 Likes
806

friends,

hope u r well and doing good.

This is jain as bw consultant and not having any abap knowlege.could u please help me to send a few line code.

requierment is -

I have created one structure , based on pa0001 table and they are having 10 frields from pa0001 table.

now i just want a write a simple prog where my structre will get a data from pa0001 table and pass the date to structure.

the strucutre name is 0 ZTEST.

data base tasble pa0001

as there is requierment to fetch the data through infoset query. so please help me

regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
777

Select * into corresponding fields of Ztest

from pa0001.

Regards

Anurag

7 REPLIES 7
Read only

Former Member
0 Likes
778

Select * into corresponding fields of Ztest

from pa0001.

Regards

Anurag

Read only

0 Likes
777

Anurag, thanks..but could u please send me full prog as i have to declear table or strucutre ...

it weould be nice help for me

Read only

0 Likes
777

You can do something like this.

data: ztest type pa0001.
data: ipa0001 type table of pa0001.

Select * into corresponding fields 
           of ipa0001 from pa0001.

loop at ipa0001 into ztest.
write:/ ztest.
endloop.

Regards,

Rich Heilman

Read only

0 Likes
777

Thanks to all of you.

Read only

0 Likes
777

Report Ztest.

data: ztest1 type standard table of pa0001

inital size 0.

data: ztest type pa0001.

Select * into corresponding fields of ztest1

from pa0001.

loop at ztest1 into ztest.

write:/ ztest.

endloop.

Regards

Anurag

Read only

Former Member
0 Likes
777

hi jain,

tables: pa0001.

data: ztest like pa0001.

select * from pa0001

into ztest.

endselect.

Message was edited by: Priya

Read only

Former Member
0 Likes
777

Hi,

if your need is to obtain data from PA0001 and pass it on to a structure, why should you maintain two structures : ztest and pa0001.

If you want to select data from PA0001 and pass it to your query, then one structure would serve the need.

Find the sample code :


select <required fields> from PA0001 into corresponding fields of ztest (structure name)where <fieldname> = <condition>.

endselect.

*** This select query will fetch values from PA0001 and places them in the workarea one-by-one as per the given condition. If you can maintain a internal table based on your local structure you can use the following :

select <required fields> from PA0001 into corresponding fields of table <internaltable> (structure name)where <fieldname> = <condition>.

Hope this serves the purpose, if not kindly revert back and i`ll clarify you further.

Reward if helpful.

Regards