ā2015 Feb 19 6:03 PM
I am trying to create via a Dynamic Actino in the background a new IT0008 with certain values already defined when certain IT0000 Actions occur.
Here is the T588Z code:
Here is the ZZ_DYNAMIC_ACTION_PROCESSES Code
*&---------------------------------------------------------------------*
*& Form MILCALLUP_BRDCOMM_NOMONEY New Form Issue 4168
*&---------------------------------------------------------------------*
FORM MILCALLUP_BRDCOMM_NOMONEY.
SELECT SINGLE * FROM PA0000
WHERE PERNR = P0000-PERNR
AND ENDDA = zdate99
AND ( MASSN = 'YB' OR
MASSN = 'YC' OR
MASSN = 'ZZ' ).
IF SY-SUBRC = 0.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = PA0000-pernr.
PERFORM BUILD_IT0008_SCREEN.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = PA0000-pernr.
ENDIF.
ENDFORM. "MILCALLUP_BRDCOMM_NOMONEY
*&---------------------------------------------------------------------*
* BUILD_IT0008_SCREEN New Form Issue 4168
*&---------------------------------------------------------------------*
FORM BUILD_IT0008_SCREEN.
WRITE: PA0000-BEGDA TO ZBEG_DATE_CHAR.
WRITE: PA0000-ENDDA TO ZEND_DATE_CHAR.
CLEAR: T_BDCDATA.
REFRESH: BDCDATA.
PERFORM dynpro USING:
'X' 'SAPMP50A' '1000', "FIRST SCREEN
' ' 'BDC_CURSOR' 'RP50G-CHOIC', "CURSOR
' ' 'BDC_OKCODE' '=INS', "COPY
' ' 'RP50G-TIMR6' 'X',
' ' 'RP50G-PERNR' PA0000-PERNR,
' ' 'RP50G-BEGDA' zbeg_date_char,
' ' 'RP50G-ENDDA' zend_date_char,
' ' 'RP50G-CHOIC' '0008'.
PERFORM dynpro USING:
'X' 'MP000800' '2010',
' ' 'BDC_CURSOR' 'Q0008-BETRG(01)', "CURSOR
' ' 'P0008-PREAS' 'ZZ',
' ' 'BDC_OKCODE' '/00'. "ENTER
PERFORM dynpro USING:
'X' 'MP000800' '2010',
' ' 'P0008-ENDDA' ZEND_DATE_CHAR,
' ' 'BDC_OKCODE' '=UPD'. "UPDATE
PERFORM dynpro USING:
'X' 'MP000800' '2010',
' ' 'BDC_OKCODE' '/EBCK'. "BACK
REFRESH: T_MESSAGES.
CALL TRANSACTION L_TRANS_CODE USING BDCDATA MODE 'P' UPDATE 'A'
MESSAGES INTO T_MESSAGES.
IF SY-SUBRC = 0.
ELSE.
PERFORM sub_get_error_message.
MESSAGE I099 WITH wc_temp_msg.
ENDIF.
ENDFORM. "BUILD_IT0008_SCREEN
The problem I'm having is that the Call Transactions is executing(I've proved that) and returns a SY-SUBRC = 0, but no IT0008 is created. Can anybody give me a clue way?
ā2015 Feb 19 6:58 PM
The first thing to do is remove the IF sy-subrc = 0. check before looking at the messages. Look at them in all cases (at least while testing and developing).
Rob
ā2015 Feb 19 6:58 PM
The first thing to do is remove the IF sy-subrc = 0. check before looking at the messages. Look at them in all cases (at least while testing and developing).
Rob
ā2015 Feb 19 7:44 PM
You were right, there are 3 messages showing and none of them are errors they are type W and S. In real time you have to green check thru them and then you can save the record, but in the recording I guess the Green Checks don't show up.
ā2015 Feb 26 4:54 PM
Ok, even though I am getting a SY-SUBRC = 0 when I check T_MESSAGES there is a PG 200 "Save Your Entries" message. I don't understand why it is there, the '=UPD' in this code is the "SAVE" is it not?
PERFORM dynpro USING:
'X' 'MP000800' '2010',
' ' 'P0008-ENDDA' ZEND_DATE_CHAR,
' ' 'BDC_OKCODE' '=UPD'. "UPDATE
ā2015 Feb 26 5:01 PM
Have you tried running this in the foreground? Try running it looking at only errors and if that doesn't help, you can go through all screens.
Rob
ā2015 Feb 26 6:53 PM
I added logic to create an Error BDC and then executed the Error BDC, it rolls through the screens and my last screen comes up with the "Save Your Entries" message and the "OK Code" box is showing the "=UPD" but when I click to execute the OK Code I get the last screen shown and no new IT0008 has been created so something isn't working.:
ā2015 Feb 26 7:00 PM
Are you sure that '=UPD' is the correct OK code? If you click on that and nothing happens, that's what I would suspect.
Did you run a recording of this to see what is actually generated?
Rob
ā2015 Feb 26 7:11 PM
Yep, this straight from the SHDB and I thought it worked, however this time I did the recording and then afterwards did a PA20 on the record and lo and behold there is no Basic Pay record, but what is weird is I can run PA30 outside of SHDB and say Create, my screen comes up, I click Save, and my record is there when I check.
ā2015 Feb 26 7:19 PM
Maybe it's time to consider alternatives. Have you tried FM HR_INFOTYPE_OPERATION?
Rob
ā2015 Feb 26 7:30 PM
I love that FM and tried it, but there is a problem running it in the program that is executed via Dynamic Action like we are doing. I couldn't get the PERNR out from under control of PA40, I would execute the FM BAPI_EMPLOYEE_DEQUEUE the same as I'm doing now, but HR_INFOTYPE_OPERATION would return the message that the Employee was locked.
ā2015 Feb 26 7:39 PM
OK - do you need the last three lines of the BDC where you press the back button? I've created many sessions and never done this after the update.
Rob
ā2015 Feb 26 7:49 PM
Probably not really needed. They are just there for the simple reason that we are in the habit of clicking back once we finish with what we are recording so they will be in the SHDB. If you look a the picture of the SHDB session, that didn't insert a record, you will notice that they aren't on it so for that reason I don't think they have anything to do with it.
I have multiple other BDC sessions in the program for Benefits Infotypes (0167-0169) and the Back button are on most if not all of them and they work fine.