Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Add object to a transport request by program

Former Member
10,499

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
7,762

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.

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.

16 REPLIES 16
Read only

PeterJonker
Active Contributor
0 Likes
7,762

Maybe Function Module TR_REQUEST_MODIFY  with action = UPDT will do the job for you.

Read only

0 Likes
7,762

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.

Read only

former_member189779
Active Contributor
0 Likes
7,762

Have you checked TR_OBJECTS_INSERT?

Also refer the discussion http://scn.sap.com/thread/2110587

Read only

0 Likes
7,762

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.

Read only

Former Member
0 Likes
7,762

Hi,

Use standard program RSTXTRAN this will be suitable for your requirement.

Thanks,

Ashok.c

Read only

0 Likes
7,762

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.

Read only

0 Likes
6,809

Hi Aditya, could you please send your code, i mean which inputs' you have passed to that FM, when i used this FM, i got error [OB_CHECK_OBJ_ERROR17]  from exceptions

Read only

0 Likes
4,694

Hi Nuthakki, i have the same problem, how you resolved this?

Read only

arindam_m
Active Contributor
0 Likes
7,762

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

Read only

Former Member
0 Likes
7,762

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.

Read only

arindam_m
Active Contributor
0 Likes
7,762

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

Read only

gaurab_banerji
Active Participant
0 Likes
7,762

This one worked for me:

TRINT_CORR_INSERT

Read only

Former Member
0 Likes
7,762

You can also use this FM

RS_CORR_INSERT

Read only

Former Member
0 Likes
7,763

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.

Read only

0 Likes
7,762

Hey Marta,

my TH_TKANL program is empty, can you provide me yours?

Thank you,
Robert

Read only

0 Likes
7,762

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.