2007 Jan 16 5:15 PM
how to read data from the fields nachn and vorna from the table pa0002
how to read data from the fields nachn and vorna from the table pa0002
2007 Jan 16 5:18 PM
2007 Jan 16 5:18 PM
Hi,
Use FM: HR_99S_READ_INFOTYPE
You can read data frm any infotype.
Regards
Subramanian
2007 Jan 16 5:21 PM
If you have the personnel number (v_pernr)
data: v_nachn type pa0002-nachn,
v_vorna type pa0002-vorna,
v_pernr type pa0002-pernr.
select single nachn vorna
into (v_nachn, v_vorna)
from pa0002
where pernr = v_pernr.
please note that pernr is part of primary key and the above select can return multiple rows. If you have other key fields like subty (subtype) , you can get better results
2007 Jan 16 5:23 PM
Hi,
I believe this is in Continuation of other post..Changes are marked in bold..
TABLES: ZFM_HANDY , PA0002.
TYPE-POOLS : SLIS.
DATA: G_REPID LIKE SY-REPID,
GS_PRINT TYPE SLIS_PRINT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_LIST_END_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_EVENTS TYPE SLIS_T_EVENT,
GT_SORT TYPE SLIS_T_SORTINFO_ALV,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
COL_POS TYPE I.
data : BEGIN OF ty_MOBLIST occurs 0.
include structure zfm_handy.
data : NACHN type pa0002-nachn,
VORNA type pa0002-vorna,
END OF ty_MOBLIST.
data : BEGIN OF ty_zfm_handy occurs 0.
include structure zfm_handy.
data : END OF ty_zfm_handy.
data : BEGIN OF ty_pa0002 occurs 0,
<b>PERNR Type PA0002-PERNR,</b>
NACHN type pa0002-nachn,
VORNA type pa0002-vorna,
END OF ty_pa0002.
data : it_MOBLIST like table of ty_MOBLIST,
wa_MOBLIST like ty_MOBLIST ,
it_zfm_handy like table of ty_zfm_handy,
wa_zfm_handy like ty_zfm_handy ,
it_pa0002 like table of ty_pa0002,
wa_pa0002 like ty_pa0002 .
INITIALIZATION.
G_REPID = SY-REPID.
PERFORM PRINT_BUILD USING GS_PRINT. "Print PARAMETERS
START-OF-SELECTION.
SELECT * from
zfm_handy
into table it_zfm_handy.
if not it_zfm_handy[] is initial.
select <b>PERNR</b> NACHN
VORNA
from pa0002
into table it_pa0002
for all entries in it_zfm_handy
where pernr = it_zfm_handy-pernr.
endif. " not it_zfm_handy
loop at it_zfm_handy into wa_zfm_handy.
read table it_pa0002 into wa_pa0002 with key pernr = wa_zfm_handy-pernr.
if sy-subrc = 0.
clear wa_MOBLIST.
move wa_zfm_handy to wa_MOBLIST.
move wa_pa0002 to wa_MOBLIST.
append wa_MOBLIST to it_MOBLIST .
endif. " sy-subrc
endloop.
Thanks,
Naren
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |