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
创建销售订单
本文详细介绍了如何在SAP系统中利用ABAP编程语言创建销售订单,包括必要的步骤、关键函数调用和业务逻辑处理。通过实例代码演示,帮助读者理解ABAP在销售流程中的应用。
摘要由CSDN通过智能技术生成