2015 Jan 26 3:56 PM
Hi experts,
I am trying to create an infotype 491 when a new insertion of intype 0006 is done.
The creation of the new occurrence of infotype 491 is done in the include of user_exits ZXPADU02 .
Here is what I coded in the user_exit of 0006:
operation = ipsyst-IOPER.
case innnn-infty.
when '0006'.
if operation = 'MOD' or operation = 'INS'.
ls_pvalues-infty = '0491'.
ls_pvalues-fname = 'P0491-OTF01'.
ls_pvalues-fval = 'RCTV'.
ls_pvalues-seqnr = '00'.
APPEND ls_pvalues TO lt_pvalues.
ls_pvalues-infty = '0491'.
ls_pvalues-fname = 'P0491-OTV01'.
ls_pvalues-fval = 'varctv'.
ls_pvalues-seqnr = '00'.
APPEND ls_pvalues TO lt_pvalues.
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA' ZXPADU02
EXPORTING
pernr = '00000001'
actio = 'INS'
tclas = 'A'
begda = '20150601'
endda = '20150630'
seqnr = '000'
SUBTY = '0001'
luw_mode = '0'
dialog_mode = '2'
no_existence_check = ' '
no_enqueue = ''
IMPORTING
return = return0491
RETURN1 = RETURN1
HR_RETURN = hr_RETURN
TABLES
proposed_values = lt_pvalues
modified_keys = lt_keys.
Every thing sems to be right but when I make a new insertion in infotype 0006 through PA30, I get this message error
error PG015-Required screen change cannot be made.
I can see through dialog_mode thhat the new occurence of 491 I is created but at end is not saved because of this message error that I got.
Since 2 days I am trying to resolve this no thing seems to be coming.
Any idea to resolve this is really appreciated.
PS: when create a 491 in a simple report with HR_MAINTAIN_MASTERDATA and with the same data everything goes right and a new 491 is created.
Thank you.
Rachid.
2015 Jan 26 7:35 PM
Hi Rachid, not sure why you are using ZXPADU02 . These kind of insertion can be done through dynamic actions . Table : T588Z . Exit ZXPADU02 can be useful generally when you are adding validations on enhanced fields of standard info types . You mentioned same code working through a report .But your work area ls_pvalues is not mapped completely with PERNR , BEGDA and ENDDA even though you are passing these fields to FM work area must be mapped . Generally these kind of error will be raised when some mandatory field is missed . Did you try passing DIALOG_MODE '2' to run in back ground and see the exactly which field is giving error . Thanks Kamesh
2015 Jan 26 6:40 PM
Hello,
Try to use the FM HR_INFOTYPE_OPERATION instead HR_MAINTAIN_MASTERDATA.
2015 Jan 26 7:16 PM
Hi William,
thanks for answering,
I have already used it. Actually it does not change anything because behind HR_INFOTYPE_OPERATION it is the HR_MAINTAIN_MASTERDATA that is called again.
I went through the debugger and it seems like HR_MAINTAIN_MASTERDATA is doing correctly his job, it goes through all the steps to create the 0491, it even executes the commit work to update the data in the database. Once the commit work is executed I checked if my occurrence of 491 is created but nothing is created.
I think there is something that goes wrong when commit work is done to update the database.
2015 Jan 26 7:21 PM
So my suggestion in this case is change the point that you are calling to BadIs HRPAD00INFTY OR HRPAD00INFTYDB, that will be dependent of your infotype framework configuration (methods IN_UPDATE).
In the past I have received some errors like that in ZXPADU02 that are solved transferring save logic to BadI.
2015 Jan 26 7:41 PM
Ok William, I will try this and let will let you know.
Regarding this database updating problem I found this Note: Note 1876102:Infotype records are not delimited or updated
Its more complicated than I thought
2015 Jan 26 7:35 PM
Hi Rachid, not sure why you are using ZXPADU02 . These kind of insertion can be done through dynamic actions . Table : T588Z . Exit ZXPADU02 can be useful generally when you are adding validations on enhanced fields of standard info types . You mentioned same code working through a report .But your work area ls_pvalues is not mapped completely with PERNR , BEGDA and ENDDA even though you are passing these fields to FM work area must be mapped . Generally these kind of error will be raised when some mandatory field is missed . Did you try passing DIALOG_MODE '2' to run in back ground and see the exactly which field is giving error . Thanks Kamesh
2015 Jan 26 8:07 PM
Hi Kamesh,
There is no mandatory field in It 491. If can't find any solution using user_exit I will use dynamic actions or BADIS like William said. I am just curious and I am trying to understand why this is not working , I tried evey thing, and compared the execution of both programs (creation through simple report and through ZXPADU02 ) Both programs execute same instructions but the final result is different. The creation of 491 is done with HR_INFOTYPE_OPERATION HR_MAINTAIN_MASTERDATA through simple report but not from ZXPADU02 knonwing that the instruction COMMIT WORK in HR_MAINTAIN_MASTERDATA is executed .
I think when we use HR_MAINTAIN_MASTERDATA or HR_INFOTYPE_OPERATION in ZXPADU02
the standard program fails to get data fom the buffer memory when commit work is executed which which maybe explains why the database is not updated in the second case.
2015 Jan 26 8:13 PM
Hi
You might get some clue if you run FM dailog mode. if you debug HR_MAINTAIN_MASTERDATA there are many structures internally and all the structures have current infotype data where as you are trying to insert other info type data .
And there is a method which compares the source and target infotype structure . You can debug routine CALL DIALOG 'HR_MAINTAIN_MASTER_DATA' to understand the comparison .
Thanks
2015 Jan 27 8:04 PM
Hi Kamesh,
I already tried all this.
After analyzing and debugging deeply the HR_MAINTAIN_MASTERDATA when it is called in ZXPADU02 or in a routine that is called by a dynamic action (Yes, I also tried this with dynamic actions) and the result is the same. No occurrence of 0491 is created whereas the commit work in HR_MAINTAIN_MASTERDATA .
Here my analysis when HR_MAINTAIN_MASTERDATA is called in routine that is called by a dynamic action:
The problem is This field PSPAR-PBPFL in HR_MAINTAIN_MASTERDATA is set to 'X', and when I went a little further in debugging I found an OSS note was applied in this perfom
PERFORM RP_INFOTYP(SAPFP50G) USING
* pspar-pernr "XDPK005733
SAVE_PSPAR-PERNR "XDPK005733
ACTIO
INFTY
SUBTY
* pspar-objps "XDPK005733
SAVE_PSPAR-OBJPS "XDPK005733
BEGDA
ENDDA
RCODE.
This perform is located in the PAI module of screen 1000 when CALL DIALOG 'HR_MAINTAIN_MASTER_DATA is triggered in HR_MAINTAIN_MASTERDATA
The OSS note is:
* Begin of note 1727144 - Read indicator COMMIT WORK
CALL FUNCTION 'RH_GET_SUPPRESS_COMMIT_PA'
IMPORTING
EV_SUPPRESS_COMMIT = lv_suppress_commit.
* End of note 1727144
*IF pspar-pbpfl IS INITIAL. "N800743 "N833984
*IF pspar-pbpfl IS INITIAL AND sy-binpt IS INITIAL. "N833984
* Note 1727144 - add lv_suppress_commit
IF pspar-pbpfl IS INITIAL AND
sy-binpt IS INITIAL AND
lv_suppress_commit IS INITIAL.
COMMIT WORK. "N800743
ENDIF.
The problem is that PSPAR-PBPF is set to 'X' by HR_MAINTAIN_MASTERDATA as a result pspar-pbpf is not initial
sy-binpt is initial
lv_suppress_commit is initial
so this condition
IF pspar-pbpfl IS INITIAL AND
sy-binpt IS INITIAL AND
lv_suppress_commit IS INITIAL.
is never true and and the commit work inside it is never executed
Something is wrong with this OSS note it does not process all the cases especially when PSPAR-PBPFL is not Initial.
When I clear out PSPAR-PBPF to get it initial, the condition above is true and the commit work is executed and my occurrence in 0491 is created. All this is in standard code so I can not change antyhing. May be another OSS note is required to fix this issue.
2016 May 04 3:54 PM