on 05-17-2007 9:03 AM
hi gurus,
I just started working on ABAP Hr ,can any body send me a basic program in HR aswell as how can i acesses infotypes data through abap codes.
thanks in advance
regards,
hema
Hi Hema,
Basic coding in fetch the infotype data.
tables: pernr.
infotypes: 0000,
0001.
get pernr.
u want use provide and endprovide statement
provide * from p0000 between pn-begda and pn-endda.
write:/ p0000-pernr,
p0000-massn,
p0000-massg,
p0000-stat2,
p0000-endda,
p0000-begda.
endprovide.
provide * from p0001 between pn-begda and pn-endda.
write:/ p0001-pernr,
p0001-werks,
p0001-btrtl,
p0001-persg,
p0001-persk.
endprovide.
Another way you have to use macros
rp-provide-from-last space pn-begda pn-endda.
if pnp-sw-found eq 1.
write:/ p0000-pernr,
p0000-massn,
p0000-massg,
p0000-stat2,
p0000-endda,
p0000-begda.
else.
reject.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hema,
Basic coding in fetch the infotype data.
tables: pernr.
infotypes: 0000,
0001.
get pernr.
u want use provide and endprovide statement
provide * from p0000 between pn-begda and pn-endda.
write:/ p0000-pernr,
p0000-massn,
p0000-massg,
p0000-stat2,
p0000-endda,
p0000-begda.
endprovide.
provide * from p0001 between pn-begda and pn-endda.
write:/ p0001-pernr,
p0001-werks,
p0001-btrtl,
p0001-persg,
p0001-persk.
endprovide.
Another way you have to use macros
rp-provide-from-last space pn-begda pn-endda.
if pnp-sw-found eq 1.
write:/ p0000-pernr,
p0000-massn,
p0000-massg,
p0000-stat2,
p0000-endda,
p0000-begda.
else.
reject.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi hema,
this might give some idea.
Process Infotypes
RMAC Modules - RMAC module as referred to Macro, is a special construct of ABAP/4 codes. Normally, the program code of these modules is stored in table 'TRMAC'. The table key combines the program code under a given name. It can also be defined in programs.The RMAC defined in the TRMAC can be used in all Reports. When an RMAC is changed, the report has to be regenerated manually to reflect the change.
Reading Infotypes - by using RMAC (macro) RP-READ-INFOTYPE
REPORT ZHR00001.
INFOTYPE: 0002.
PARAMETERS: PERNR LIKE P0002-PERNR.
RP-READ-INFOTYPE PERNR 0002 P0002 <BEGIN> <END>.
PROVIDE * FROM P0002
if ... then ...endif.
ENDPROVIDE.
Changing Infotypes - by using RMAC (macro) RP-READ-INFOTYPE.
Three steps are involved in changing infotypes:
1. Select the infotype records to be changed;
2. Make the required changes and store the records in an alternative table;
3. Save this table to the database;
The RP-UPDATE macro updates the database. The parameters of this macro are the OLD internal table containing the unchanged records and the NEW internal table containing the changed records. You cannot create or delete data. Only modification is possible.
INFOTYPES: Pnnnn NAME OLD,
Pnnnn NAME NEW.
GET PERNR.
PROVIDE * FROM OLD
WHERE .... = ... "Change old record
*Save old record in alternate table
NEW = OLD.
ENDPROVIDE.
RP-UPDATE OLD NEW. "Update changed record
for more information on the same plz send your e-mail id. i ll send you the document related to it
anuj
plz award point for each helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Check this very useful link.
/thread/238726 [original link is broken]
Regards,
Shrinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.