on 10-04-2015 11:03 AM
Dear Experts,
I was trying to insert new record into 583 infotype from Webdyn pro Abap, for this i was using hr_infotype_operations function module.
The issue is 583 infotype screen fields are of structure P0583, except for one field Convayence type Field is of Q0583 and this field is mandatory field, so now when i pass all the values of structure P0583 into HR_INFOTYPE_OPERATIONS all the field values of P0583 structure values are getting populated, except for Convayence Type field. becoz of which i am getting error as enter all required fields.
So i how do i achieve this requirement from webdynpro abap. Thanks in advance.
Sample Code:
Data ls_0583 type p0583.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0583'
NUMBER = ls_0583-PERNR
* SUBTYPE =
* OBJECTID =
* LOCKINDICATOR =
VALIDITYEND = ls_0583-ENDDA
VALIDITYBEGIN = ls_0583-BEGDA
** RECORDNUMBER =
RECORD = ls_0583
OPERATION = 'INS'
* TCLAS = 'A'
DIALOG_MODE = '2'
* NOCOMMIT =
* VIEW_IDENTIFIER = '07'
* SECONDARY_RECORD =
IMPORTING
RETURN = l_return
** KEY =
* .
* call function 'BAPI_EMPLOYEE_DEQUEUE'
* exporting
* number = ls_0583-pernr
* IMPORTING
* RETURN = l_return
*
* .
Regards,
Siva
Guys my issue got resolved, but it is a work a round. Hope the solution will be helpful.
Requirement:
Have to update 583 infotype & 0008 infotype.
Solution:
As HR_INFOTYPE_OPERATION is not working 583 infotype so i called function module in method,
This FM internally calls a report with submit syntax. the purpose of this report is to run a bdc internally and update 583 infotype.
and for 0008 i was using HR_INFOTYPE_OPERATION operations.
Regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have you checked the data type & is there any conversion exits for CONTY field?
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna,
I have put break point in the method but break-point is not getting triggered, hope the method is not being called.
Now i have done a work around, from webdynpro i am calling function module and in the function module i am running a BDC to update 583 infotype, so it updating the 583 infotype.
But the issue now is, when i maintain 583 infotype from pa30 click on save it is opening 0008 infotype, with internal calculation and i have to click on save. i.e for a record entry in 583 a record also is getting created in 0008.
so i have recorded using SHDB but here 0008 screen is not called so only 583 is being updated and no record in 0008.
can anyone help how to achive this either using BDC recording or using HR_INFOTYPE_OPERATIONS,
Regards,
Siva
Hi Siva,
Please share the test data & please check in debugging the value you are passing is passing to Q structure .
Thanks
Nishant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Nishant,
As i was unable to check the values being passed to screen from WDA, so i have made Zprogram and changed Dialog Mode in HR_INFOTYPE_OPERATIONS to '2', so i found out that all the values are getting passed to relevant screen fields, except for Convanence Type screen field as it is of Q0583 Structure and whereas all other fields are of P0583 structure, so how do i pass the value to conveyance type field.
Regards,
Siva
Basically the Q* fields are used because they display a different value on the screen as to what is in the underlying tabel i.e. the value goes through a conversion process.
The reason your program is not working is you are putting the wrong value in P0583-CONTY field. If you go to SE11 and PA0583 and then do a dropdown you wuill see your values there that you should be entering in your program.
To give you another example, if you look at infotype 0002, in PA0002 the ANRED field has a '1' or a '2' in the dictionary, however on the screen i.e. Q0002-ANRED you will see 'Mr' or 'Mrs' because obviously a 1 or a 2 is meaingless on the screen output.
The same logic is for your PA0583 field, so you need to make sure you are passing the correct values then this will work.
Hi Glen,
I have checked screen field for Mr&Mrs, it is of structure P0002 structure ie (P0002-ANRED) and all the fields in 0002 infotype screen are from P0002, so we can pass single structure into HR_INFOTYPE_OPERATIONS.
But in 0583 infotype all the fields are of structure P0583 except Conveyance Type field is (Q0583), so how to pass two structures into HR_INFOTYPE_OPERATIONS.
Regards,
Siva
No it's not.
The Q* structures are only used to pass values to the dynpro, and only where conversion or mapping is required. In the case of CONTY this is also in P0583 and works exactly the same as P0002.
In P0002 there is field ANRED, whereas the screen field is Q0002-ANREX.
For P0583 the field is CONTY, and screen field is Q0583-CNVCD.
You must fill CONTY with values ranging from 1 to 8, or whatever your range is.
Hi Glen,
Please find the image which shows how the data is being saved in table level for convayence type, so as per my above source code i am passing as fallows:
if gs_ZHR_CMER-VECHILE_TYPE = '01'.
ls_0583-CONTY = '4'. "'Own Four Wheeler'. "4.
else.
ls_0583-CONTY = '5'. "'Own Four Wheeler'. "5.
endif.
am i missing anything here? in case of reference please refer my code above and let me know if i am missing anything.
Hi Glen,
I am getting return parameter from Function Module as: No data stored for 0583 in the selected period when i changed it to MOD. it is not working .
I am not getting any dump but i am getting fill in required fields. only fields mandatory in 583 screen is start period & Conveyance type. am i missing anything else.
Regards,
Siva
Any inputs on this...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Gautham,
I am passing key value '4'. for coveyance type.
please check my code as below:
data ls_0583 TYPE p0583.
data gs_ZHR_CMER TYPE ZHR_CMER.
CLEAR ls_0583.
ls_0583-BEGDA = gs_ZHR_CMER-ZDATE.
ls_0583-ENDDA = '99991231'.
ls_0583-PERNR = gs_ZHR_CMER-PERNR.
if gs_ZHR_CMER-VECHILE_TYPE = '01'.
ls_0583-CONTY = '4'. "'Own Four Wheeler'. "4.
else.
ls_0583-CONTY = '5'. "'Own Four Wheeler'. "5.
endif.
ls_0583-VECHILE_TYPE = gs_ZHR_CMER-VECHILE_TYPE.
ls_0583-ENGINE_HP = gs_ZHR_CMER-ENGINE_HP.
ls_0583-MAKE_MODEL = gs_ZHR_CMER-MAKE_MODEL.
ls_0583-DOP_VECHILE = gs_ZHR_CMER-DOP_VECHILE.
ls_0583-USE_VECH_DATE = gs_ZHR_CMER-USE_VECH_DATE.
ls_0583-REG_NO = gs_ZHR_CMER-REG_NO.
ls_0583-REG_NO_FROM = gs_ZHR_CMER-REG_NO_FROM.
ls_0583-REG_NO_TO = gs_ZHR_CMER-REG_NO_TO.
ls_0583-INSURE_POL_NO = gs_ZHR_CMER-INSURE_POL_NO.
ls_0583-POLICY_FROM = gs_ZHR_CMER-INSURE_DATE.
ls_0583-POLICY_TO = gs_ZHR_CMER-INSURE_DATE_to.
ls_0583-INFTY = '0583'.
call function 'BAPI_EMPLOYEE_ENQUEUE'
exporting
number = ls_0583-pernr
importing
return = l_return.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0583'
NUMBER = ls_0583-PERNR
* SUBTYPE =
* OBJECTID =
* LOCKINDICATOR =
VALIDITYEND = ls_0583-ENDDA
VALIDITYBEGIN = ls_0583-BEGDA
* RECORDNUMBER =
RECORD = ls_0583
OPERATION = 'INS'
* TCLAS = 'A'
DIALOG_MODE = '0'
* NOCOMMIT =
* VIEW_IDENTIFIER =
* SECONDARY_RECORD =
IMPORTING
RETURN = l_return
* KEY =
.
call function 'BAPI_EMPLOYEE_DEQUEUE'
exporting
number = ls_0583-pernr
IMPORTING
RETURN = l_return
.
The above code i have made in action of approve button.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.