delivery Shipping condition copy as shipment shipping condition
dear all
Delivery shipping condition copy as shipment shipping condition
go to SE38 – LXV56U15 here you find the include ZXV56U1 , you must activate this include then you write below logic
DATA:
BEGIN OF l_last_data,
vsbed
LIKE vttk–vsbed, “Shipping condition
*….
*Further data
END OF l_last_data,
BEGIN OF l_is_not_identical,
vsbed LIKE rv56a–selkz, “Shipping condition
*….
*Further data
END OF l_is_not_identical,
l_start_tabix LIKE sy–tabix,
l_tabix LIKE sy–tabix.
*****************************************************************
* Analyse Data from deliveries
*****************************************************************
CLEAR: l_last_data, l_is_not_identical.
READ TABLE i_xvttp WITH KEY tknum = c_xvttk–tknum
BINARY SEARCH.
l_start_tabix = sy–tabix.
IF sy–subrc = 0.
LOOP AT i_xvttp FROM l_start_tabix.
l_tabix = sy–tabix.
IF i_xvttp–tknum NE c_xvttk–tknum. EXIT. ENDIF.
READ TABLE i_xtrlk WITH KEY vbeln = i_xvttp–vbeln
BINARY SEARCH.
IF sy–subrc = 0.
* Shipping condition
IF l_is_not_identical–vsbed IS INITIAL AND
NOT i_xtrlk–vsbed IS INITIAL. “ignore initial entries
IF l_tabix = l_start_tabix.
l_last_data–vsbed = i_xtrlk–vsbed.
ELSE.
IF l_last_data–vsbed NE i_xtrlk–vsbed.
l_is_not_identical–vsbed = ‘X’.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
******************************************************
* Are data identical in all deliveries ?
* Copy only in this case !
******************************************************
* Shipping condition
IF l_is_not_identical–vsbed IS INITIAL.
c_xvttk–vsbed = l_last_data–vsbed.
ELSE.
* MESSAGE ID ‘ZSD’ TYPE ‘I’ NUMBER 000.
message ‘Ship.Cond.not identical-Cannot copy ship.Cond.’ type ‘I’.
ENDIF.
once apply this , then create the shipment assign the delivery , then comes main screen click on planing then delivery shipping condition copy as a shipment shipping condition .
regards
sankar
Dear Bojja gee thanks for posting this but Could you say exactly what is the use of this i am failed to understand for what we are applying plz give business example
HI VENU
business process customer pay the transportation amount to company , then company pay to vendor ,
so user need to know when creation of shipment based on shipping condition , transportation amount payed direct company or vendor , this purpose you copy the customer master shipping condition ( this condition copy to order and delivery) as shipment shipping condition .
regard
sankar