on 2025 May 07 12:18 PM
Hello everyone,
Context:
We have a web application which communicates with SAP using Rest ABAP API. The user set for communications is a global web user. At some point, when creating object in SAP, like deliveries, sales order, we have to set NOT the web user but another sap user (which can vary) which i get from a custom function. What i do simply is before calling my function module, i check if the interface of the FM contains a parameter like UNAME i fill it, but sometimes it doesn't exists so i tried changing the SY-UNAME with the OTHER_USER_SAP that i have.
It was working until i changed some functions modules (WS_DELIVERY_UPDATE, WS_LM_TRANSFER_ORDER_CREATE, WS_LM_GOODS_MOVEMENT) to update delivery, make the goods issue and do the transfert order by one function module (L_TO_CREATE_DN) which does everything listed above plus it was handling splitting batches on the delivery so it was a good finding.
Problem:
When the good issue is done on the delivery, a custom output message is triggered on the delivery, to print a sapscript using a custom program. Even though i have setted the sy-uname = OTHER_USER_SAP and passed the parameter i_bname = OTHER_USER_SAP to FM L_TO_CREATE_DN, all my objects are created in association to the OTHER_USER_SAP except the spool in SP01 which is associated to th web user (TSP01-RQOWNER = WEB_USER_SAP) and i don't understand why...
NAST entries contain only my OTHER_USER_SAP reference so i don't understand why the spool is associated to the WEB_SAP_USER.
I tried the ST12 to check where the insert is done, but it seems it's a kernel function trigger while handling the sapscript and i don't have the hand on the RQOWNER field...
Any idea on how to do this please?
Best regards,
Alexandre
Request clarification before answering.
Hello,
Late on this.
I used, JOP OPEN....SUBMIT <program> USER <user> JOB CLOSE and EXPORT TO SHARED MEMORY to send complex data to the job.
With this, everything was done with the relevant user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
34 | |
21 | |
10 | |
8 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.