天天看點

SAP S4HANA使用ABAP獲得生産訂單的狀态

SAP S4HANA使用ABAP獲得生産訂單的狀态
SAP S4HANA使用ABAP獲得生産訂單的狀态
SAP S4HANA使用ABAP獲得生産訂單的狀态
SAP S4HANA使用ABAP獲得生産訂單的狀态

  METHOD get_prod_order_status.

   DATA: lt_status TYPE TABLE OF j_status,

         lt_text   TYPE TABLE OF tj02t,

         lv_id     LIKE iv_prod_order_id,

         ls_result LIKE LINE OF rt_status_in_s4_format.

   lv_id = iv_prod_order_id.

   CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

     EXPORTING

       input  = lv_id

     IMPORTING

       output = lv_id.

   SELECT stat INTO TABLE lt_status FROM vsaufk WHERE inact = space AND

      aufnr = lv_id.

   CHECK sy-subrc = 0.

   SELECT * INTO TABLE lt_text FROM tj02t FOR ALL ENTRIES IN lt_status

      WHERE istat = lt_status-table_line AND spras = 'EN'.

   LOOP AT lt_text ASSIGNING FIELD-SYMBOL().

     CLEAR: ls_result.

     ls_result-status_id = -istat.

     ls_result-status_code = -txt04.

     ls_result-status_text = -txt30.

     APPEND ls_result TO rt_status_in_s4_format.

   ENDLOOP.

 ENDMETHOD.

SAP S4HANA使用ABAP獲得生産訂單的狀态

繼續閱讀