Application Development 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: 

Add object to a transport request by program

Former Member

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

Former Member
0 Kudos

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.

14 REPLIES 14

PeterJonker
Active Contributor
0 Kudos

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

0 Kudos

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.

former_member189779
Active Contributor
0 Kudos

Have you checked TR_OBJECTS_INSERT?

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

0 Kudos

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.

Former Member
0 Kudos

Hi,

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

Thanks,

Ashok.c

0 Kudos

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.

arindam_m
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

arindam_m
Active Contributor
0 Kudos

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

gaurab_banerji
Active Participant
0 Kudos

This one worked for me:

TRINT_CORR_INSERT

Former Member
0 Kudos

You can also use this FM

RS_CORR_INSERT

Former Member
0 Kudos

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.

0 Kudos

Hey Marta,

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

Thank you,
Robert

0 Kudos

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.