Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create a production order automatically triggered by SAP

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains how to create a production order automatically triggered by SAP. The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to create a production order automatically triggered by SAP.

Create a sales order using the following code:

DATA: ls_header TYPE bapisdhd1, ls_headerx TYPE bapisdhd1x, lt_bapiret2 LIKE bapiret2 OCCURS 0 WITH HEADER LINE, po_order_number TYPE bapivbeln-vbeln, lt_partners TYPE TABLE OF bapiparnr, lt_order_items_in TYPE TABLE OF bapisditm, lt_order_item_x TYPE TABLE OF bapisditmx, ls_order_item_x LIKE LINE OF lt_order_item_x Ls_order_items_in LIKE LINE OF lt_order_items_in, lt_schdlin TYPE TABLE OF bapischdl, ls_schdlin LIKE LINE OF lt_schdlin, lt_schdlinx TYPE TABLE OF bapischdlx, ls_schdlinx LIKE LINE OF lt_schdlinx, ls_partners LIKE LINE OF lt_partners, lt_order_text TYPE TABLE OF bapisdtext Ls_order_text TYPE bapisdtext.ls_header-serv_date = '20200101'.ls_header-doc_type =' TA'.ls_header-purch_no_c = 'a'.ls_headerx-purch_no_c =' X'.*ls_header-sales_org = '0001'.*ls_header-distr_chan =' 01'.*ls_header-division = '01'.ls_header-comp_cde_b =' 0001mm. Cde_b = 'X'.ls_headerx-doc_type =' X'.ls_headerx-updateflag = 'I'.ls_partners-partn_role =' WE'. "ship to partyls_partners-partn_numb = '0000000001'.APPEND ls_partners TO lt_partners.ls_partners-partn_role =' AG'." Sold to partyls_partners-partn_numb = '0000000001'.APPEND ls_partners TO lt_partners.ls_order_items_in-item_categ =' TAN'.ls_order_items_in-material = 'REDUCER_A'.ls_order_items_in-target_qty = 999.ls_order_items_in-itm_number = 10.ls_order_item_x-item_categ =' X'.ls_order_item_x-material = 'X'.ls_order_item_x -target_qty = 'X'.ls_order_item_x-itm_number =' X'.ls_order_item_x-updateflag = 'I'.APPEND ls_order_item_x TO lt_order_item_x.APPEND ls_order_items_in TO lt_order_items_in.ls_schdlin-itm_number = 10.ls_schdlin-req_qty = 3.ls_schdlinx-itm_number =' X'.ls_schdlinx-itm_number = 'X'.ls_schdlinx -updateflag = 'X'.APPEND ls_schdlin TO lt_schdlin.APPEND ls_schdlinx TO lt_schdlinx. "ls_order_text-doc_number = SALESDOCUMENT.ls_order_text-itm_number =' 000010'.ls_order_text-text_id = '0006 years." ls_order_text-langu =' E'.ls_order_text-langu_iso = 'ZH'.ls_order_text-format_col =' *'. Ls_order_text-text_line = 'Test 2 DSFSDFDSFDS'.ls_order_text-function = '006'.APPEND ls_order_text TO lt_order_text.CALL FUNCTION' SD_SALESDOCUMENT_CREATE' EXPORTING sales_header_in = ls_header sales_header_inx = ls_headerx int_number_assignment ='X' IMPORTING salesdocument_ex = po_order_number TABLES return = lt_bapiret2 sales_items_in = lt_order_items_in Sales_items_inx = lt_order_item_x sales_schedules_in = lt_schdlin sales_schedules_inx = lt_schdlinx sales_partners = lt_partners sales_text = lt_order_text.LOOP AT lt_bapiret2 ASSIGNING FIELD-SYMBOL () WHERE type = 'eyed. WRITE:/ 'Error:',-message COLOR COL_NEGATIVE. RETURN.ENDLOOP.IF po_order_number IS INITIAL. WRITE:/'PO number initial'. RETURN.ENDIF.CLEAR: lt_bapiret2.CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait =' X' IMPORTING return = lt_bapiret2.LOOP AT lt_bapiret2 ASSIGNING. WRITE:/ 'Message:',-message COLOR COL_POSITIVE.ENDLOOP.

Using transaction code SAT to analyze, it is found that the total creation time is 3.98 seconds.

Of these, 1.84 seconds were spent on the EIGENFERTIGUNG_BEARBEITEN subroutine.

Use Google Translate:

It is found that the meaning of EIGENFERTIGUNG is related to production: own production

BEARBEITEN means TO eidt:

Look at this function CO_61_ORDER_EDIT:

The description of this function indicates that it is used for production:

The package in which this function is located also reveals its role, which is responsible for the production-related implementation:

Take a look at the parameter values passed into this function:

Thank you for your reading, the above is the content of "SAP automatically triggers production orders how to create". After the study of this article, I believe you have a deeper understanding of how to create production orders automatically triggered by SAP, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report