BAPI创建数据之后查询不到数据

        CALL FUNCTION 'BAPI_PRODORD_CREATE'
          EXPORTING
            orderdata    = orderdata
          IMPORTING
            return       = return
            order_number = order_number
            order_type   = order_type.
        IF return-type = 'E'.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          CONCATENATE '生产订单创建失败:' return-message INTO wa_data-l_mess.
          wa_data-line_color = co_color_red.
          MODIFY itab_data FROM  wa_data.
        ELSE.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              wait = 'X'.
          wa_data-l_mess = '生产订单创建成功'.
          wa_data-line_color = co_color_yellow.
          wa_data-zdd = order_number.
          MODIFY itab_data FROM  wa_data.
          MOVE-CORRESPONDING wa_data  TO  lt_result.
          lt_result-mandt = sy-mandt.
          APPEND lt_result.
        
          CLEAR: item ,item[].
          item-aufnr = order_number.
          item-flg_oview = 'X'.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = item-aufnr
            IMPORTING
              output = item-aufnr.

          wait UP TO 3 SECONDS.   "数据产生以后没有存储到后台表中,需要等待系统3秒

          SELECT SINGLE gamng INTO l_gamng
          FROM afko WHERE aufnr = item-aufnr.
          SELECT SINGLE terkz fhori gltrp gstrp INTO (item-terkz,item-fhori,item-gltrp,item-gstrp)
          FROM afko WHERE aufnr = item-aufnr.

你可能感兴趣的:(BAPI创建数据之后查询不到数据)