on 09-30-2008 9:54 AM
hi experts,
i have a requirement where in i need to inseert data in to infotype:0000,0001,0105,9010,0041 and update the infotypes:0015,0014,0008,0009 by using function module HR_MAINTAIN_MASTERDATA . i have used ACTIO as 'INS' and 'MOD' (since T589A table doesn't contain the 'UPD' operation).
but using this "MOD' i am unable to update all the infotypes, instead it is throwing the error as entry doesn't exist in T589A for P.
i need to know whether the following code is correct or not and also to overcome the error.. Please let me know the changes needed.
DATA: BEGIN OF IT_INFTY,
INFTY TYPE PPROP-INFTY,
END OF IT_INFTY .
DATA: LV_PERNR TYPE PSPAR-PERNR.
LV_PERNR = '430102'.
if ( IT_INFTY-infty = '0000' or IT_INFTY-infty = '0001'
or IT_INFTY-infty = '9010'
or IT_INFTY-infty = '0105' OR IT_INFTY-infty = '0041' ).
LV_OPERATION = 'INS'.
elseif ( IT_INFTY-infty = '0007' or IT_INFTY-infty = '0008'
or IT_INFTY-infty = '0014' or IT_INFTY-infty = '0015').
LV_OPERATION = 'MOD'.
endif.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = LV_PERNR "WA_SOURCE_DATA-pernr
IMPORTING
RETURN =
LOCKING_USER = sy-uname
.
*
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = LV_PERNR
MASSN =
ACTIO = LV_OPERATION "'INS'
TCLAS = 'A'
BEGDA = SY-DATUM
ENDDA = '99991231'
OBJPS =
SEQNR =
SPRPS =
SUBTY = lv_subty
WERKS =
PERSG =
PERSK =
PLANS =
DIALOG_MODE = '2'
LUW_MODE = '1'
NO_EXISTENCE_CHECK = ' '
NO_ENQUEUE = ' '
IMPORTING
RETURN = RC
RETURN1 = RC1
HR_RETURN =
TABLES
PROPOSED_VALUES = PROPOSED_VALUES
MODIFIED_KEYS =
.
write : / rc-message.
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = LV_PERNR "WA_SOURCE_DATA-pernr
IMPORTING
RETURN =
.
kindly suggest.
regards,
joy.
hi,
as far as what i know, the 'MOD' function of FM HR_MAINTAIN_MASTERDATA does not work as required.
when i had the same requirement, i had used 'DEL' and then 'INS' to achieve the required purpose. thus i had to call HR_MAINTAIN_MASTERDATA two times.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joy,
The FM HR_MAINTAIN_MASTERDATA operations is only depend the action type. It also depend on the Infotypes. If the Infotype time constrain 1 is present then it will allow for delimiting option. Else it will give dump.
one of the Easy way is to used SQL queries like (Insert, delete and update) this will help you to slove the problem then and there.
Thanks.
Ganesh R K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
i have a similar situation wherein i need to use the two operations insert and modifications for the infotypes.
the problem i am facing is ,i need to put the logic in a method and it doesnt allow the usage of with header line. so how can we refer to the fields if the following logic is used.
TYPES : begin of ty_infty,
infty TYPE pprop-infty,
END OF ty_infty.
DATA: it_INFTY TYPE STANDARD TABLE OF TY_INFTY,
proposed_values TYPE pprop occurs 0 with header line,
wa_INFTY TYPE TY_INFTY.
*************************updation of 0000***********************
lv_fval = '01'.
wa_proposed_values-infty = '0000'.
wa_proposed_values-fname = 'P0000-MASSG'.
wa_proposed_values-fval = LV_FVAL.
wa_proposed_values-fname = '00'.
append wa_proposed_values to proposed_values.
it_infty-infty = wa_proposed_values-infty.
clear wa_proposed_values.
***similarly we update the values for other infotypes
if ( it_infty-infty = '0000' or it_infty-infty = '0001'
or it_INFTY-infty = '0041' or it_INFTY-infty = '9010'
or it_INFTY-infty = '0105').
lv_operation = 'INS'.
elseif ( it_INFTY-infty = '0007' or it_INFTY-infty = '0014' ).
"or IT_INFTY-infty = '0014' or IT_INFTY-infty = '0015').
lv_operation = 'MOD'.
endif.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = lv_pernr
IMPORTING
RETURN =
LOCKING_USER = sy-uname
.
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = lv_pernr
MASSN =
ACTIO = lv_operation
TCLAS = 'A'
BEGDA = SY-DATUM
ENDDA = '99991231'
OBJPS =
DIALOG_MODE = '2'
LUW_MODE = '1'
NO_EXISTENCE_CHECK = ' '
NO_ENQUEUE = ' '
IMPORTING
RETURN = rc
RETURN1 = rc1
HR_RETURN =
TABLES
PROPOSED_VALUES = proposed_values
MODIFIED_KEYS =
.
write : / rc-message.
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = lv_pernr
IMPORTING
RETURN =
.
here its giving an error that it_infty is a table without headerline and has no field as infty.
how to over come this, please guide me in this regard. if this is not the correct logic please tell me the appropraite one..
thanks in advance,
Durga.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
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.