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

Insert objects in Transport request from program.

Former Member
0 Likes
4,721

I am trying to insert table entries in a transport request thorugh program.

Program Id :R3TR

Object Id :TABU

I have tried FM :  TR_REQUEST_CHOICE, but it is raising exception no 4.

  NO_OBJECTS_APPENDED  = 4

Code Snippet:LL FUNCTION '


CALL FUNCTION 'TR_REQUEST_CHOICE'

     EXPORTING

       IV_SUPPRESS_DIALOG   = 'X'

      IV_REQUEST_TYPES     = 'K'

*     IV_CLI_DEP           = ' '

       IV_REQUEST           = gs_request_header-TRKORR

       IT_E071              = gt_e071

       IT_E071K             = gt_e071k

*     IV_LOCK_OBJECTS      = ' '

*     IV_TITLE             =

*     IV_START_COLUMN      = 3

*     IV_START_ROW         = 7

      IV_WITH_ERROR_LOG    = 'X'

*     IV_NO_OWNER_CHECK    = ' '

*     IV_FOREIGN_REQUEST   = '   '

*     IT_E071K_STR         =

*     IT_OBJ_ENTRIES       =

     IMPORTING

       ES_REQUEST           = gs_request

     EXCEPTIONS

       INVALID_REQUEST      = 1

       INVALID_REQUEST_TYPE = 2

       USER_NOT_OWNER       = 3

       NO_OBJECTS_APPENDED  = 4

       ENQUEUE_ERROR        = 5

       CANCELLED_BY_USER    = 6

       RECURSIVE_CALL       = 7

OTHERS               = 8.


debugger snapshot:

Now, i am trying to achieve same using FM TR_EDIT_CHECK_OBJECTS_KEYS.

It is also raising exception  CANCEL_EDIT_SYSTEM_ERROR

Message:

No key fields are defined for table ZTABL_PROCESSHDR.


Please guide me how to rectify this.

6 REPLIES 6
Read only

paul_bakker2
Active Contributor
0 Likes
2,759

There appears to be a problem with your Z table ZTABL_PROCESSHDR.

Check that first.

cheers

Paul

Read only

0 Likes
2,759

This is not the case however, i have used table VBAK instead of Ztable.

The error msg remains same and so does exception raised.

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Likes
2,759

Check this wiki:

Transporting Table Entries in ABAP programmatically - ABAP Development - SCN Wiki

If you are filling E071 and E071K right way. Do you have table keys in E071K? Do you have e071-objfunc = 'K' etc...

-- Tomas --
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,759

Can you post the code filling E071K (fields MASTERTYPE "TABU" , MASTERNAME table name, TABKEY key value or generic key value)

Regards,

Raymond

Read only

0 Likes
2,759

i am now trying to insert table entries of VBAK  to understand where i am mistaken.

Code snippet:


REFRESH:gt_e071,gt_e071k.

   MOVE 1 TO LV_COUNT.

   gs_e071k-TRKORR = gs_request_header-TRKORR.

     gs_e071k-PGMID = 'R3TR'.

     gs_e071k-OBJECT = 'TABU'.

     gs_e071k-OBJNAME = 'VBAK'.

     gs_e071k-AS4POS = lv_count.

     gs_e071k-MASTERTYPE 'TABU'.

     gs_e071k-MASTERNAME = 'VBAK'.

     CLEAR lv_key.

     CONCATENATE sy-mandt '0000004969' INTO lv_key."client and sale order no

     gs_e071k-TABKEY = lv_key.

     APPEND gs_e071k to gt_e071k .

     CLEAR gs_e071k .

     gs_e071-TRKORR = gs_request_header-TRKORR.

     gs_e071-AS4POS = lv_count.

     gs_e071-PGMID = 'R3TR'.

     gs_e071-OBJECT = 'TABU'.

     gs_e071-OBJ_NAME = 'VBAK'.

     gs_e071-OBJFUNC = 'K'.

     APPEND gs_e071 to gt_e071.

CLEAR gs_e071 .

This is the screen shot of debugger (internal table gt_e071k), Line 1.

Field tabkey container 800(client) ,0000004969 sale order no in concatenation.,.

Is something wrong in this key?

Read only

Former Member
0 Likes
2,759

okay..above one error is fixed.

Now i am trying to add Ztable entries, which has only 1 key field that too of data type  char 20.

while populating e071k with char values, it says use only numeric values.