on 04-17-2012 11:30 AM
Hi All,
We have a z function module which calls program RPRPOSTD that should transfer travel expenses to FI.
I did not develop this function module and up to now it has been working correctly. Today a particular employee was inputting her expenses (This is done via workflow in our company) and the expenses failed to be transferred to FI.
The workflow was getting caught when implementing this function module. I have debugged and the error message being displayed in program RPRPOSTD is
"No posting run number could be found -> Start FIN and POST in same job!". I have looked through some SDN forums but I cannot seem to find a reason for this error message.
Any assistance will be greatly appreciated.
Kind regards,
Elaine
This is the function module:
FUNCTION Z_WF_POST_RUN.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(PERNR) TYPE BAPIEMPL-PERNR
*" REFERENCE(REINR) TYPE BAPITRIP-TRIPNO
*" REFERENCE(TEST) TYPE XFELD
*"----------------------------------------------------------------------
data: v_name type P_EVNAME.
CLEAR SELTAB_WA.
if test is initial.
MOVE: 'BOOKING' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
'X' TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
MOVE: 'CHECKING' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
' ' TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
else.
MOVE: 'CHECKING' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
'X' TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
MOVE: 'BOOKING' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
' ' TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
endif.
CLEAR SELTAB_WA.
MOVE: 'ALLRUNID' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
'X' TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
CLEAR SELTAB_WA.
MOVE: 'FINRUNID' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
' ' TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
CLEAR SELTAB_WA.
MOVE: 'ONERUNID' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
' ' TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
* Run Name
move PERNR to v_name.
move reinr+3 to v_name+8.
MOVE: 'RUNNAALL' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
v_name TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
submit RPRPOSTD WITH SELECTION-TABLE seltab
exporting list to memory
and return.
Hi Elaine,
I do not know the whole use case of your workflow, but the error message clearly says that there is no posting run. RPRPOSTD can only post to FI if report RPRFIN00_40 has created a posting run beforehand. Albeit you did not write the FM yourself, I find the following fact a bit appalling:
MOVE: 'ALLRUNID' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
'X' TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
All run IDs are executed in a workflow task in a user context (did I understand this correctly?) is very dangerous in my humble opinion and could cause inconsistencies. I mean, you can't really distinguish this way whether the error comes from the affected end user himself or somewhere else.
Anyway, bottom line: RPRFIN00_40 did not create a posting run, that's your error cause.
Cheers, Lukas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lukas,
Thank you for your reply!
The workflow does call program : RPRFIN00_40 and from my records that executed successfully.
So not sure why program RPRPOSTD could not pick up the posting run number.
We decided to use transaction PRRW and manually process the expenses and this worked.
Thanks again,
Elaine
User | Count |
---|---|
99 | |
9 | |
9 | |
5 | |
4 | |
3 | |
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.