on 09-23-2008 9:52 AM
Hi Experts,
Is there any standard BAPI available to upload employee data or the steps involved in LSMW to upload the employee data into HR tables.
Thanks in Advance.
Regards,
IFF
REWARDED POINTS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI IFF,
You could use the following code to read data in the Application server :
&----
*& Form check_file_exists
&----
Check file exists or not
----
FORM check_file_exists USING p_file.
DATA: wa_file LIKE rlgrap-filename,
msg(255) TYPE c. "#EC NEEDED
wa_file = p_file.
OPEN DATASET
OPEN DATASET wa_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
OPEN DATASET wa_file FOR INPUT IN TEXT MODE MESSAGE msg.
IF sy-subrc = 8.
MESSAGE e001
WITH text-m01 p_file text-m02.
ELSE.
CLOSE DATASET
CLOSE DATASET wa_file.
ENDIF.
ENDFORM. " check_file_exists
&----
*& Form f4_dxfilename
&----
Search help for file name
----
FORM f4_dxfilename USING p_file.
DATA: wa_file LIKE dxfields-longpath.
CLEAR: wa_file.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
i_server = ' '
i_path = search_dir
filemask = c_fnh_mask
fileoperation = 'R'
IMPORTING
o_path = wa_file
EXCEPTIONS
rfc_error = 1
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
p_file = wa_file.
ENDIF.
ENDFORM. " f4_dxfilename
&----
*& Form sub_get_data_app
&----
Get data from Application Server
----
FORM sub_get_data_app.
DATA: pa_upld(255) TYPE c,
msg(255) TYPE c, "#EC NEEDED
im_parameter_1(13) TYPE c,
im_parameter_2(10) TYPE n,
im_parameter_3(4) TYPE c,
fname TYPE text255.
For getting the more files from server.
gv_sq_no = gv_sq_no + 1.
im_parameter_1 = 'EmployeeNew_'.
im_parameter_3 = '.CSV'.
CONCATENATE gv_day_1 gv_sq_no INTO im_parameter_2.
CLEAR: gv_day_1.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = 'ZLFN_FILE'
operating_system = sy-opsys
parameter_1 = im_parameter_1
parameter_2 = im_parameter_2
parameter_3 = im_parameter_3
IMPORTING
file_name = fname
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
Assign the phical file path to pa_upld.
pa_upld = fname.
Open dataset.
OPEN DATASET pa_upld FOR INPUT IN TEXT MODE MESSAGE msg.
OPEN DATASET pa_upld FOR INPUT IN TEXT MODE ENCODING DEFAULT.
If successful, then only open the file. Or else it will dump.
IF sy-subrc = 0.
Transfer all the data to the internal table.
DO.
READ DATASET pa_upld INTO wa_csvfile.
IF sy-subrc <> 0.
EXIT.
ENDIF.
APPEND wa_csvfile TO it_csvfile.
CLEAR: wa_csvfile.
ENDDO.
We have to explicitly mention to close the dataset. this is mandatory.
CLOSE DATASET pa_upld.
ENDIF.
ENDIF.
ENDFORM. " sub_get_data_app
And then using FM: HR_MAINTAIN_MASTERDATA to maitain the value you get.
. I just also coding for one customer which need me to do the same as you.
Hope this helps.
David.
Edited by: David Li on Sep 29, 2008 11:28 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Either you can use both the above said ways
apart from you can create BDC also
Which is bit easier way
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try using FM HR_INFOTYPE_OPERATION...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi , these are the steps involved and it reads data from a flat file which would be in note pad
1 Maintain Object Attributes
2 Maintain Source Structures
3 Maintain Source Fields
4 Maintain Structure Relations
5 Maintain Field Mapping and Conversion Rules
6 Maintain Fixed Values, Translations, User-Defined Routines
7 Specify Files
8 Assign Files
9 Read Data
10 Display Read Data
11 Convert Data
12 Display Converted Data
13 Create Batch Input Session
14 Run Batch Input Session
Or u can ask any abaper to write a bdc if u have a huge data
Regards
Anu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
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.