• Bapi_Quotation_Createfromdata2VA21


    report test3.
    *代码摘抄
    Data: loc_bp type BAPIBUS1006_HEAD-BPARTNER.
    data: re_return like BAPIRET2 occurs 0.
    data: wa_return type BAPIRET2.
    data: re_order_header_in like BAPISDHD1.
    data: wa_BAPISDH1X type BAPISDH1X.
    data: order_partners like BAPIPARNR occurs 0 with header line.
    data: order_items_in like BAPISDITM occurs 0 with header line.
    data: order_items_sched LIKE bapischdl OCCURS 0 WITH HEADER LINE.
    data: g_vbeln like smovbak-vbeln,
    l_vbeln like smovbak-vbeln.

    move BUSINESSPARTNER to loc_bp.
    *delete line if middleware active.
    *loc_bp = '0030000309'.

    re_order_header_in-DOC_TYPE = 'TA'.
    re_order_header_in-SALES_ORG = 'NL01'.
    re_order_header_in-DISTR_CHAN = '02'.
    re_order_header_in-DIVISION = '01'.

    order_partners-partn_role = 'AG'.
    order_partners-partn_numb = loc_bp.
    append order_partners.
    order_partners-partn_role = 'WE'.
    order_partners-partn_numb = loc_bp.
    append order_partners.

    order_items_in-itm_number = '000010'.
    order_items_in-MATERIAL = MATERIAL.

    order_items_sched-itm_number = '00010'.
    order_items_sched-req_qty = '1'.

    append order_items_sched.
    append order_items_in.

    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    *DESTINATION 'zorder'
    EXPORTING
    ORDER_HEADER_IN = re_order_header_in
    TESTRUN = ' '
    importing
    salesdocument = g_vbeln
    TABLES
    RETURN = re_return
    ORDER_ITEMS_IN = order_items_in
    ORDER_PARTNERS = order_partners
    order_schedules_in = order_items_sched.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *DESTINATION 'zorder'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = wa_return.

  • 相关阅读:
    【hdu4285】 circuits
    java代码获取ip地址
    java覆写hashcode方法
    java覆写equals方法
    Linux下Apache服务器并发优化
    异常:cvc-complex-type.2.4.a: Invalid content was found starting with element
    SpringMVC请求访问不到静态文件解决方式
    mina教程
    分布式session
    jsp自定义标签
  • 原文地址:https://www.cnblogs.com/xiaomaohai/p/6157350.html
Copyright © 2020-2023  润新知