Hi,
requirement overview : An interface is needed to send related stocks periodically to sales force for every stock update. only free stock from standard storage location of standard plants need to be selected. already allocated stock for sales order or deliveries need to be subtracted
select options : .logsys - 'SFDC_DE' (edp13-rcvprn)
vkorg - 'BVHC
matnr - (mard-matnr)
werks - 'BV80' 'BV84' (mard-werks)
lgort - 'V080' V084' (mard- lgort)
mestyp - invcon (edp13-mestyp) - no display
4 radio button :
total stock
updated stock
zero stock
non zero stock
logic for total stock :
call the function module : availability_check and pass the table p_atpdsxand p_atpca parameter and these total stock should be sent to idoc, for this call
function module : master_idoc_distribute
logic for updated stock :
for each matnr, lgort,werks combintion on selction screen fetch mard-labst based on mvke-prat3 = 'x' and special stock from vendor also needs to be considered from mkol-slabs
for each matnr, lgort,werks combination on selection screen, fetch and add special stock from vendor (mkol-slabs) to total stock (mard-labst) ->x
for each matnr, select order number (vbap-vbeln) coresponding to vbap-tnr and calculate sum of vbap-kwmeng, and vbap-lsmng to each other ->y
now substract sum(y) from (x) and acall the function module : master_idoc_distribute to send the updated stock to th idoc
logic for zero stock : send value to idoc even if stock equal to zero
logic for non zero :send the stocks to idoc which are not equal to zero
note : idoc header data for edidc needs to be selected from edpp1 with logical system and message type invcon.
idoc segments are : e1cmcco - sprog - prog name
e1icslo (mtnr,wers,lgort,labst)
can you please clarify properly how to code ??