将表行添加到传输请求 [英] Add table rows to the transport request

查看:154
本文介绍了将表行添加到传输请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在以编程方式向传输请求中添加表行时遇到问题.

I have a problem with adding rows of table to the transport request in programming way.

当我写下运输请求编号时,出现错误:

When i wrote down the transport request number i get the error:

您不能使用请求EAMK913244

You cannot use request EAMK913244

我用于运输日期的代码是:

the code that i used for transporting date is:

form add_data_to_transaction .
  data lt_variable_changed type table of ztable_task2 .

  data:
    l_request   type trkorr,
    lt_e071     type tr_objects,
    lt_e071k    type tr_keys,
    lv_position type ddposition,
    lv_tabkey   type trobj_name,
    ls_e071     type e071,
    ls_e071k    type e071k.


  "before adding to transort request check for transport query
  if var_query is not initial.

    call method grid->get_selected_rows                              " get index of row
      importing
        et_index_rows = lt_rows.

    "rows that i need to add to the table
    if lt_rows is not initial.
      loop at lt_rows into ls_row.
        read table lt_variable index ls_row into ls_variable.
        append ls_variable to lt_variable_changed.
      endloop.
    else.
      message 'Select 1 or more rows' type 'I'.
    endif.
    if lt_rows is not initial.
      ""e071 contains only one row per table. the objfunc is 'K' if we need to transport //specific entries as specified in the e071k structure.
      "ls_e071-trkorr   = var_query.
      "ls_e071-as4pos   = 1.
      ls_e071-pgmid    = 'R3TR'.
      ls_e071-object   = 'TABU'.                            "for table
      ls_e071-obj_name = 'ZTABLE_TASK2'.
      ls_e071-objfunc  = 'K'.
      ls_e071-lang     = sy-langu.

      append ls_e071 to lt_e071.
      clear ls_e071.
      clear lv_position.
      "add all table entries in table zxa_header that need to be transported to lt_e071k
      loop at lt_variable_changed into ls_variable.

        lv_position = lv_position + 1.

        lv_tabkey = ls_variable-num.

        "ls_e071k-trkorr     = var_query.
        ls_e071k-pgmid      = 'R3TR'.
        ls_e071k-object     = 'TABU'.
        ls_e071k-objname    = 'ZTABLE_TASK2'.
        "ls_e071k-as4pos     = lv_position.
        ls_e071k-mastertype = 'TABU'.
        ls_e071k-mastername = 'ZTABLE_TASK2'.
        ls_e071k-lang       = sy-langu.
        ls_e071k-tabkey     = lv_tabkey.


        append ls_e071k to lt_e071k.
        clear ls_e071k.
      endloop.

      call function 'TR_REQUEST_CHOICE'
        exporting
          iv_suppress_dialog   = 'X'
          iv_request           = var_query
          it_e071              = lt_e071
          it_e071k             = lt_e071k.

      message 'Ok' type 'I'.
    endif.
  else.
    message 'Fill in tranport request number' type 'I'.
  endif.
endform.

来自se01的屏幕:

感谢您的帮助和好运!

推荐答案

应使用三个功能模块来传输更改

three function modules shall be used to transport changes

call function 'TR_ORDER_CHOICE_CORRECTION'
  exporting
    iv_category            = 'CUST'
  importing
    ev_order               = ev_request
    ev_task                = ev_task
  exceptions
    invalid_category       = 1
    no_correction_selected = 2
    others                 = 3.

  call function 'TR_OBJECTS_CHECK'
    exporting
      iv_no_show_option       = abap_true
    tables
      wt_ko200                = lt_ko200_customizing
      wt_e071k                = lt_e071k_customizing
    exceptions
      cancel_edit_other_error = 1
      show_only_other_error   = 2
      others                  = 3.

  call function 'TR_OBJECTS_INSERT'
    exporting
      wi_order                = lv_request
      iv_no_show_option       = abap_true
    tables
      wt_ko200                = lt_ko200_customizing
      wt_e071k                = lt_e071k_customizing
    exceptions
      cancel_edit_other_error = 1
      show_only_other_error   = 2
      others                  = 3.

这篇关于将表行添加到传输请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆