Routing BDC
Routing BDC
Routing BDC
*&--------------------------------------------------------------------*
*& Form bdc_populate
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
form bdc_populate.
*{ INSERT &$&$&$&$ 1
* Change to Add Material Number to Each Line in the Internal Table
data : l_matnr type matnr.
loop at ty_data.
if ty_data-matnr is not initial .
clear l_matnr.
l_matnr = ty_data-matnr.
endif.
if ty_data-matnr is initial.
ty_data-matnr = l_matnr .
modify ty_data transporting matnr.
endif.
endloop.
*
*} INSERT
sort ty_data by matnr vornr.
delete adjacent duplicates from ty_data comparing all fields .
*delete adjacent duplicates from ty_data COMPARING VORNR .
clear ty_data.
loop at ty_data.
on change of ty_data-matnr.
clear counter .
perform bdc_dynpro using 'SAPLCPDI' '1010'.
perform bdc_field using 'BDC_CURSOR'
'RC271-PROFIDNETZ'.
perform bdc_field using 'BDC_OKCODE'
'=ALD1'.
perform bdc_field using 'RC27M-MATNR'
ty_data-matnr.
perform bdc_field using 'RC27M-WERKS'
ty_data-werks.
perform bdc_field using 'RC271-PLNNR'
''.
perform bdc_field using 'RC271-STTAG'
'31.01.2005'.
perform bdc_field using 'RC271-PROFIDNETZ'
'1'.
perform bdc_dynpro using 'SAPLCPDI' '1200'.
perform bdc_field using 'BDC_CURSOR'
'RC27X-ENTRY_ACT'.
perform bdc_field using 'BDC_OKCODE'
'=ANLG'.
perform bdc_dynpro using 'SAPLCPDA' '1200'.
perform bdc_field using 'BDC_OKCODE'
'=VOUE'.
* Commented out on 02/02/2005
* perform bdc_field using 'PLKOD-PLNAL'
* '1'.
* End of Comment
perform bdc_field using 'PLKOD-VERWE'
ty_data-verwe.
perform bdc_field using 'PLKOD-STATU'
ty_data-statu.
*perform bdc_field using 'PLKOD-LOSBS'
* '99,999,999'.
*perform bdc_field using 'PLKOD-PLNME'
* 'MTS'.
perform bdc_field using 'BDC_CURSOR'
'PLKOD-PPKZTLZU'.
perform bdc_field using 'PLKOD-SLWBEZ'
'320'.
perform bdc_field using 'PLKOD-PPKZTLZU'
'2'.
*perform bdc_dynpro using 'SAPLCPDI' '1400'.
*perform bdc_field using 'BDC_CURSOR'
* 'PLPOD-VORNR(01)'.
*perform bdc_field using 'BDC_OKCODE'
* '=VOD1'.
endon.