Skip to Content
0

BAPI_SALESORDER_CHANGE for structure conditions_in and conditions_inX question (help)

Jul 28, 2017 at 02:39 AM

60

avatar image
Former Member

hello experts.

i want to change the condition value for BAPI_SALESORDER_CHANGE.

but, first value is not change and second value is change.

And, i want to change the line. but add line (same)

help experts.

please.

ps. the bottom add to picture ( error )

*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.

error.jpg (138.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers