创建销售订单

本文详细介绍了如何在SAP系统中利用ABAP编程语言创建销售订单,包括必要的步骤、关键函数调用和业务逻辑处理。通过实例代码演示,帮助读者理解ABAP在销售流程中的应用。
摘要由CSDN通过智能技术生成
  DATA:LT_ALV  LIKE GT_ALV[],
       LW_ALV  LIKE LINE OF GT_ALV[].
  DATA:LT_REPT LIKE GT_ALV[],
       LW_REPT LIKE LINE OF GT_ALV[].
  DATA:LS_SALES_HEADER_IN  TYPE BAPISDHD1,
       LS_SALES_HEADER_INX TYPE BAPISDHD1X,
       LV_SALESDOCUMENT_EX  LIKE BAPIVBELN-VBELN,
       LV_LOGIC_SWITCH      TYPE BAPISDLS,
       LT_SALES_ITEMS_IN    LIKE TABLE OF BAPISDITM  WITH HEADER LINE,
       LT_SALES_ITEMS_INX   LIKE TABLE OF BAPISDITMX WITH HEADER LINE,
       LT_SALES_CONDITIONS_IN  LIKE TABLE OF BAPICOND WITH HEADER LINE,
       LT_SALES_CONDITIONS_INX LIKE TABLE OF BAPICONDX WITH HEADER LINE,
       LT_SALES_SCHEDULES_IN   LIKE TABLE OF BAPISCHDL WITH HEADER LINE,
       LT_SALES_SCHEDULES_INX  LIKE TABLE OF BAPISCHDLX WITH HEADER LINE,
       LT_SALES_PARTNERS_IN LIKE TABLE OF BAPIPARNR WITH HEADER LINE,
       LT_RETURN TYPE STANDARD TABLE OF BAPIRET2,
       LW_RETURN TYPE BAPIRET2.
  DATA:LV_MSG TYPE CHAR255,
       L_KALKS TYPE KNVV-KALKS.

  CHECK GV_FLG IS INITIAL.
  CLEAR LT_ALV.
  LT_ALV = GT_ALV[].

  DELETE LT_ALV WHERE MSG IS NOT INITIAL.
  CLEAR LT_REPT.
  LT_REPT = LT_ALV.
  SORT LT_REPT BY ZXH ASCENDING.
  DELETE ADJACENT DUPLICATES FROM LT_REPT COMPARING ZXH.

  LOOP AT LT_REPT INTO LW_REPT.
    CLEAR:LS_SALES_HEADER_IN,
    LS_SALES_HEADER_INX,
    LT_SALES_PARTNERS_IN[],
    LT_SALES_ITEMS_IN[],
    LT_SALES_ITEMS_INX[],
    LT_SALES_CONDITIONS_IN[],
    LT_SALES_CONDITIONS_INX[],
    LT_SALES_SCHEDULES_IN[],
    LT_SALES_SCH
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值