SAP joy

BAPI_SALESORDER_CHANGE 에서 금액 변경 오류

SD [레벨:1]밍밍히 2017.07.28 14:42

전문가 분들 안녕하세요.


BAPI_SALESORDER_CHANGE 를 통해 금액을 변경하려한답니다


여기서 2가지 문제가 생기네요 ㅠ



첨부1.JPG



첨부2.JPG 




첨부3.JPG



1. 금액을 변경했지만 ZLME 부분은 반영이 안되고있습니다 ㅠㅠ


2. ZLME 와 ZPRE 두부분을 변경하려고 IMPORT 로 값을 받고있는데 IMPORT 로 받은 두 건이 아래 첨부사진과 같이 라인이 한개 더 생성됩니다 ㅠ




어느 부분이 문제일까요?ㅠㅠ



------------------------------------------------------------------------------

*LGOIC _SWITCH 
CLEAR LOGIC_SWITCH.
LOGIC_SWITCH-PRICING = 'B'.
LOGIC_SWITCH-NOSTRUCTURE = 'X'.
APPEND LOGIC_SWITCH.


BAPISDH1X-DLV_BLOCK = 'X'.   " Delivery block
BAPISDH1X-UPDATEFLAG = 'U'.


*ITEM IN
CLEAR ORDER_ITEMS_IN.
ORDER_ITEMS_IN-ITM_NUMBER = I_ITM_ITM_NUMBER1.   
ORDER_ITEMS_IN-MATERIAL = I_ITM_MATERIAL1.
APPEND ORDER_ITEMS_IN.


*ITEM INX
CLEAR ORDER_ITEMS_INX.
ORDER_ITEMS_INX-ITM_NUMBER = I_ITM_ITM_NUMBER1.   
ORDER_ITEMS_INX-UPDATEFLAG = 'U'.
APPEND ORDER_ITEMS_INX.




*ORDER SCHEDULE
CLEAR ORDER_SCHEDULES_IN.
ORDER_SCHEDULES_IN-ITM_NUMBER = I_SC_ITM_NUMBER1.  
ORDER_SCHEDULES_IN-SCHED_LINE = '0001'.
ORDER_SCHEDULES_IN-REQ_QTY = I_SC_REQ_QTY1. 
APPEND ORDER_SCHEDULES_IN.


*ORDER SCHEDULE_INX
CLEAR ORDER_SCHEDULES_INX.
ORDER_SCHEDULES_INX-ITM_NUMBER = I_SC_ITM_NUMBER1.  
ORDER_SCHEDULES_INX-SCHED_LINE = '0001'.
ORDER_SCHEDULES_INX-REQ_QTY = 'X'.
ORDER_SCHEDULES_INX-UPDATEFLAG  = 'U'. 
APPEND ORDER_SCHEDULES_INX.


* Pricing CONDITION  IN
CLEAR ORDER_CONDITIONS_IN.
ORDER_CONDITIONS_IN-ITM_NUMBER = I_SC_ITM_NUMBER1.
ORDER_CONDITIONS_IN-COND_ST_NO = '011'.
ORDER_CONDITIONS_IN-COND_COUNT = '01'.
ORDER_CONDITIONS_IN-COND_TYPE = 'ZLME'.
ORDER_CONDITIONS_IN-COND_VALUE = I_ZLME_VALUE1.
ORDER_CONDITIONS_IN-CURRENCY = 'USD'.
ORDER_CONDITIONS_IN-CURR_ISO = 'USD'.
APPEND ORDER_CONDITIONS_IN.


ORDER_CONDITIONS_IN-ITM_NUMBER = I_SC_ITM_NUMBER1.
ORDER_CONDITIONS_IN-COND_ST_NO = '110'.
ORDER_CONDITIONS_IN-COND_COUNT = '01'.
ORDER_CONDITIONS_IN-COND_TYPE = 'ZPRE'.
ORDER_CONDITIONS_IN-COND_VALUE = I_ZPRE_VALUE1.
ORDER_CONDITIONS_IN-CURRENCY = 'USD'.
ORDER_CONDITIONS_IN-CURR_ISO = 'USD'.
APPEND ORDER_CONDITIONS_IN.




* Pricing CONDITION INX
CLEAR ORDER_CONDITIONS_INX.
ORDER_CONDITIONS_INX-ITM_NUMBER = I_SC_ITM_NUMBER1.
ORDER_CONDITIONS_INX-COND_ST_NO = '011'.
ORDER_CONDITIONS_INX-COND_COUNT = '01'.
ORDER_CONDITIONS_INX-COND_TYPE = 'ZLME'.
ORDER_CONDITIONS_INX-UPDATEFLAG = 'U'.
ORDER_CONDITIONS_INX-COND_VALUE = 'X'.
ORDER_CONDITIONS_INX-CURRENCY = 'X'.
APPEND ORDER_CONDITIONS_INX.


ORDER_CONDITIONS_INX-ITM_NUMBER = I_SC_ITM_NUMBER1.
ORDER_CONDITIONS_INX-COND_ST_NO = '110'.
ORDER_CONDITIONS_INX-COND_COUNT = '01'.
ORDER_CONDITIONS_INX-COND_TYPE = 'ZPRE'.
ORDER_CONDITIONS_INX-UPDATEFLAG = 'U'.
ORDER_CONDITIONS_INX-COND_VALUE = 'X'.
ORDER_CONDITIONS_INX-CURRENCY = 'X'.
APPEND ORDER_CONDITIONS_INX.




*……..Call Sales Order Create RFC………………………………
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
             SALESDOCUMENT = ORDER_NUMBER
             ORDER_HEADER_INX = BAPISDH1X
             LOGIC_SWITCH = LOGIC_SWITCH


        TABLES
              RETURN              = RETURN
              ORDER_ITEM_IN = ORDER_ITEMS_IN
              ORDER_ITEM_INX = ORDER_ITEMS_INX
              CONDITIONS_IN = ORDER_CONDITIONS_IN
              CONDITIONS_INX = ORDER_CONDITIONS_INX
              SCHEDULE_LINES = ORDER_SCHEDULES_IN
              SCHEDULE_LINESX = ORDER_SCHEDULES_INX.




IF SY-SUBRC = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ELSE.
  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF.


  E_MESSAGE =  RETURN-MESSAGE.


------------------------------------------------------------------------------



첨부
의견 (0)

답변등록

현재 답변들 0

서비스 링크

X
Login

브라우저를 닫더라도 로그인이 계속 유지될 수 있습니다. 로그인 유지 기능을 사용할 경우 다음 접속부터는 로그인을 하실 필요가 없습니다. 단, 게임방, 학교 등 공공장소에서 이용 시 개인정보가 유출될 수 있으니 꼭 로그아웃을 해주세요.

X