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: 

DATA from structure

Former Member
0 Kudos
77

hi firends,

i need to retreive data from table and structure is it possible

eg-- AAA is table having atr no

BBB is strucrure in run time its having some data related to AAA table atrno

i want a select query for this plz some one provide me with example code

but i know structure will not store value.my requirement is for IDOC so structure carries data so ineed to track that

pointe will be rewarded

thanks in advance

raj

9 REPLIES 9

0 Kudos
54

Hi,

Can you be more detialed, Table (Database or internal table), Just be more detailed so that you can get the answers quickly.

Former Member
0 Kudos
54

hi,

as u already have wrote the str wouldnt store any records. the best way to retrieve the data then would be use export/import to memory id. that way u can export the required data to ABAp memory in one program and then import it in ur idoc generation program.

santhosh

Former Member
0 Kudos
54

You can do a select query from a DB table.

Like you said, there is no data stored in structure as such. it is only available at runtime.

the value in the DB can be put into a structure.

select * from DBTAB into gs_structure

where <cond>.

does this help ?

0 Kudos
54

hi,

i am creating extended idoc with few fields added

so that new fields data are from some table moving to idoc

segment which is an structure.basically data from table moves in single field

for all new fields [field is SDATA] this then its divided for the structure.

so need to track that structure data

regards

raj

0 Kudos
54

hi,

I couldnt make out what you wanted raj,

basically the data is picked up from the DB tables and then concatenated into the SDATA field which is of length 1000, and then the IDOC is sent to the other system along with the struc i.e the segment in the control record.

a split command can be used in the reciever system to split the sdata field into thier respective structure containing the same segment you have passed.

santhosh ( hope this helps).

0 Kudos
54

hi santhosh,

u r almost nearing me

my sdata is having 4 fields value .when i see in idoc its in separate field

my requirment is that sdata value i should display in seperat column using internal table in report

and what is FM for prefix and suffix the mat no.

and vijay can u tell me in which FM i should look in

regards

raj

0 Kudos
54

hi,

create a itab. generally the size of the fields will be thier actual SAP lenghts

data:begin of t_xxx occurs 0,

x1(5) type x1,

x2(6) type x2,

........

.................

end of t_xxx.

then u can

say split idoc-sdata seperated by ' ' into t_xxx-x1

t_xxx-x2.....

try this and let me know.

santhosh

Former Member
0 Kudos
54

Hi Raj ,

basically addition or deletion of segments the data holds in the data record structure.

all the data pertaining to the idoc is stored and processed

in the structures

EDIDC--> Control Records.

EDIDD --> Data srecords.

goto se37 and enter the FM name

f7

u 'll see

TABLES

*" IDOC_CONTRL STRUCTURE EDIDC

*" IDOC_DATA STRUCTURE EDIDD

now if i want to know the data this is is structure EDIDD now in itab

IDOC_DATA.

BREAK-POINT.
LOOP AT IDOC_DATA.
ITAB-F1 = ID0C_DATA-F1.
ITAB-F2 = ID0C_DATA-F2.
ITAB-F3 = ID0C_DATA-F3.

APPEND ITAB.
CLEAR ITAB.
ENDLOOP.

this way u can fetch the data .

regards,

VIjay

Former Member
0 Kudos
54

that u have to tell us ..

it is just like for message type matmas

the idoc is idoc_input_matmas .

now goto ur message type

tcode we57

give ur message type over here

and it will give u the fm for that ..

and steps follow the prev post of mine.

regards,

vijay