05-24-2013 8:33 AM
Hello.
I need to add objects to a transport request by program( well, to a transport task, in fact). I have used FM 'TR_REQUEST_CHOICE', but it adds objects directly to request, no to task, and when I try releasing the task, it gets an error, because task is no classified.
I have tried to with FM 'TR_APPEND_TO_COMM_OBJS_KEYS' and 'TR_INSERT_REQUEST_WITH_TASKS' but these don't work, or perhaps I don't know how use them.
Please, do somebody know a way to add objects to a transport task by program?
Thanks a lot.
Marta.
05-24-2013 12:29 PM
Hi all.
Finally I have solved my problema with function 'TRINT_MODIFY_COMM'. We can see how it works in program TH_TKANL.
It's wonderful to have so much help.
Thanks a lot!!!!!!
Marta.
05-24-2013 9:33 AM
Maybe Function Module TR_REQUEST_MODIFY with action = UPDT will do the job for you.
05-24-2013 10:24 AM
Hi Peter.
Sorry. I don't know where write objects to add in request in this Function Module. Could you say to me what parameter I can use to pass the objects?
Thanks a lot.
Marta.
05-24-2013 9:55 AM
Have you checked TR_OBJECTS_INSERT?
Also refer the discussion http://scn.sap.com/thread/2110587
05-24-2013 10:33 AM
Hi Vinit.
Please, could you say to me how I should fill this function? I'm trying working with it but I can't get it.
Thanks a lot.
Marta.
05-24-2013 10:05 AM
Hi,
Use standard program RSTXTRAN this will be suitable for your requirement.
Thanks,
Ashok.c
03-31-2020 1:31 PM
Low key genius reply 🙂
I looked in this program and found that
TR_APPEND_TO_COMM_OBJS_KEYS is used to insert objects in tasks. I used that in my code and it worked perfectly well.
05-24-2013 11:17 AM
Hi,
Try the following :
gs_authorlist-task_owner = <ID_USRNAME>.
APPEND gs_authorlist to gt_authorlist.
gs_authorlist-task_owner = <ID_USRNAME>'.
APPEND gs_authorlist to gt_authorlist.
CALL FUNCTION 'IW_C_CREATE_TRANSPORT_REQUEST'
EXPORTING
DESCRIPTION = <DESCRIPTION>
TRANSPORT_KIND = 'K'
LANGU = sy-langu
IMPORTING
COMMFILE = var_req_no
EXCEPTIONS
LANGUAGE_MISSING = 1
NUMBER_RANGE_FULL = 2
UNALLOWED_TRFUNCTION = 3
NO_AUTHORIZATION = 4
CREATE_TRANSPORT_ERROR = 5
OTHERS = 6
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'BAPI_CTREQUEST_CREATE_TASKS'
EXPORTING
REQUESTID = var_req_no
* IMPORTING
* RETURN =
TABLES
AUTHORLIST = gt_authorlist
TASK_LIST = gt_task_list
.
Cheers,
Arindam
05-24-2013 11:30 AM
Hi Ashok, I think program RSTXTRAN is to add SAPSCRIPT text in a task, but not objects like programs, tables, ...
Hi Arindam. I have got to create a request with a task, but I have problems when I want to add a object to the task. With FM 'TR_REQUEST_CHOICE' I can add the object to the request, but not to the task.
Thanks a lot.
Marta.
05-24-2013 11:43 AM
Hi,
Please check the FM
CALL FUNCTION 'BAPI_CTREQUEST_CREATE_TASKS'
EXPORTING
REQUESTID = var_req_no
* IMPORTING
* RETURN =
TABLES
AUTHORLIST = gt_authorlist
TASK_LIST = gt_task_list
.
Cheers,
Arindam
05-24-2013 11:48 AM
05-24-2013 12:11 PM
05-24-2013 12:29 PM
Hi all.
Finally I have solved my problema with function 'TRINT_MODIFY_COMM'. We can see how it works in program TH_TKANL.
It's wonderful to have so much help.
Thanks a lot!!!!!!
Marta.
07-01-2015 5:35 PM
Hey Marta,
my TH_TKANL program is empty, can you provide me yours?
Thank you,
Robert
03-31-2020 1:31 PM
TR_APPEND_TO_COMM_OBJS_KEYS is the simplest FM of all. I used it to saving objects in a sub task and it worked.