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: 

Regd ABAP HR prog involving Q structure..

Former Member
0 Kudos

Hi

Please giv eme some sample programs which involves the data retrival from Q structure.

Thanks & Regards,

Preeti

1 ACCEPTED SOLUTION

dustyplanet
Active Participant
0 Kudos

Sorry the field from T522T should have been ATEXT... my apologies...

Sample code as follows...

PARAMETERS: p_pernr TYPE pa0001-pernr.

DATA: anrex TYPE q0002-anrex.

SELECT SINGLE t522t~atext  INTO anrex FROM pa0002 INNER JOIN
t522t ON pa0002~anred = t522t~anred WHERE pernr = p_pernr AND
t522t~sprsl = sy-langu.

Regards,

Dushyant Shetty

6 REPLIES 6

dustyplanet
Active Participant
0 Kudos

If you don't mind me asking, what exactly is a Q structure ?!?!

Are you talking about Q000... structures, the ones used for infotypes on screen ?

Dushyant Shetty

0 Kudos

Hi Dushyant,

I have a requirement where i have to pull a record (ANREX) from infotype 0002. In this infotype, field ANREX is getting populated with the data stored in Q0002-ANREX where Q0002 is a structure.

Now i want to know how can i do that.

Rgds

Preeti

0 Kudos

Like Balaji mentioned, Get ANRED From PA0002, for a PERNR, then use that ANRED to read ANREX from T522T where SPRSL = sy-langu. Simple !

Regards,

Dushyant Shetty

<u><b>P.S. Correction.... field name from T522T should be ATEXT...</b></u>

Message was edited by:

Dushyant Shetty

former_member225631
Active Contributor
0 Kudos

Use ANRED from PA0002.

Former Member
0 Kudos

HI Preeti,

You are taking about the strutures that begins with 'Q', for retrienving the data for the fields present in that you can see the where used list in the SE11 itself...

Generally data from the field also comes from the PA tables, also first check if there is some check table associated iwth it..if there is then please take the values for the field from there... ot else you have ot go for where used list ..where you will get the appropraitre PA table...

Regards,

Jayant

dustyplanet
Active Participant
0 Kudos

Sorry the field from T522T should have been ATEXT... my apologies...

Sample code as follows...

PARAMETERS: p_pernr TYPE pa0001-pernr.

DATA: anrex TYPE q0002-anrex.

SELECT SINGLE t522t~atext  INTO anrex FROM pa0002 INNER JOIN
t522t ON pa0002~anred = t522t~anred WHERE pernr = p_pernr AND
t522t~sprsl = sy-langu.

Regards,

Dushyant Shetty