11-02-2006 1:08 AM
Hello,
Is there a BAPI or FM which updates the Pricing Condition in an outbound delivery document. UPS Freight charges needs to be stored with the condition type "ZFRT".
Any help highly appreciated.
Regards
Manik
11-02-2006 3:33 AM
11-02-2006 3:42 AM
Hi Mani,
Have you looked BAPI BAPI_PRICES_CONDITIONS?
Please check below sample codes.
wtable1-table_no = '306'.
wtable1-applicatio = 'V'.
wtable1-cond_type = 'ZPR0'.
wtable1-operation = '009'.
wtable1-varkey = '13001001USD 000000000050068946'.
wtable1-valid_to = '99991231'.
wtable1-valid_from = '20051101'.
wtable1-cond_no = '$000000001'.
APPEND wtable1 TO table1.
wtable2-operation = '009'.
wtable2-cond_no = '$000000001'.
wtable2-created_by = sy-uname.
wtable2-creat_date = '20051022'.
wtable2-cond_usage = 'A'.
wtable2-table_no = '110'.
wtable2-applicatio = 'V'.
wtable2-cond_type = 'ZPR0'.
wtable2-varkey = '13001001USD 000000000050068946'.
wtable2-valid_from = '20051101'.
wtable2-valid_to = '99991231'.
APPEND wtable2 TO table2.
wtable3-operation = '009'.
wtable3-cond_no = '$000000001'.
wtable3-cond_count = '01'.
wtable3-applicatio = 'V'.
wtable3-cond_type = 'ZPR0'.
wtable3-scaletype = 'A'.
wtable3-scalebasin = 'C'.
wtable3-scale_qty = '1'.
wtable3-cond_p_unt = '1'.
wtable3-cond_unit = 'EA'.
wtable3-calctypcon = 'C'.
wtable3-cond_value = '454'.
wtable3-condcurr = 'USD'.
APPEND wtable3 TO table3.
CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
EXPORTING
PI_initialmode = 'X'
PI_BLOCKNUMBER =
TABLES
ti_bapicondct = table1
ti_bapicondhd = table2
ti_bapicondit = table3
ti_bapicondqs = table4
ti_bapicondvs = table5
to_bapiret2 = table6
to_bapiknumhs = table7
to_mem_initial = table8
EXCEPTIONS
update_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE table6 WITH KEY type = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
loop at table6 into ret.
write: / ret-type, ret-message, ret-id, RET-LOG_NO, RET-LOG_MSG_NO,
RET-MESSAGE_V1, RET-MESSAGE_V2, RET-MESSAGE_V3, RET-MESSAGE_V4,
RET-PARAMETER,RET-ROW,RET-FIELD.
endloop.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*EXPORTING
WAIT =
IMPORTING
return = ret
.
ENDIF.
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
11-02-2006 2:10 PM
Thank You very much. Will try this and get back to you.
Regards
Manik
11-02-2006 6:18 PM
Ferry,
Where do I map the delivery number and what are the contents in varkey field?
Manik
11-02-2006 6:49 PM
Fery,
Thanks. What do I map the outbound delivery number field?
Manik
11-02-2006 6:44 PM
Hi,
Varkey is the key of the condition table Axxx where xxx is from 001 to 999.
Hope this will help.
Regards,
Ferry Lianto
11-02-2006 6:58 PM
Hi Manik,
I don't think you need to map delivery number.
Once the pricing condition updated, delivery number should get the new pricing.
Regards,
Ferry Lianto
11-02-2006 7:10 PM
Ferry,
I apologize for my ignorance. But how does the BAPI know which delivery number should the pricing condition be added?
Manik
11-02-2006 7:46 PM
Hi Manik,
The BAPI will not recognized the outbound delivery number.
Basically, once the pricing condition 'ZFRT' updated, the delivery number will get new conditon from this links.
LIKP-KNUMH <> KONV-KNUMH <> Axxx-KNUMH
Again, hope this will answer your doubt.
Regards,
Ferry Lianto
Please reward points if helpful.
11-15-2006 5:24 PM
I tried to use this BAPI, but didn't work. It created entry in A306 and KONH and return KNUMH number. But there is no entry created in KONV talbe and condition has not added to the delivery document.
08-22-2007 2:07 AM
04-19-2021 3:34 PM
06-22-2021 4:02 PM
So appreciate for your comment. That's what I'm looking for. It helps a lot.
Bye BDC. lol.
02-06-2022 5:20 AM
Hello Xin
Did the FM work?? I am trying to update pricing condition in delivery header via BAPI, I had no success with BAPI_OUTB_DELIVERY_CHANGE, WS_DELIVERY_UPDATE_2 and BAPI_DELIVERYPROCESSING_EXEC. Some help will be really appreciated.
Thank you
Shounak