‎2009 Jun 10 5:26 PM
*Hi all,*
*i m writing a BDC report for creating sales order using VA01 tcode...i have four fields in a upload file..the file will contain something like this...*
*soldto shipto matnr quantity*
*880 770 112 4*
*881 771 113 5*
*881 771 114 6*
*882 772 115 7*
*882 772 116 8*
*883 773 117 7*
*883 773 118 7*
*883 773 119 7*
*from above file i need to write the code based on soldto and shipto fields...A separate Sales Order will be created for each combination of Sold-To & Ship-To parties. A Sold-To party may have several Ship-To parties assigned to it. Lines having same combination of SoldTo u2013 ShipTo parties should be added to one Sales Order. A separate Sales Order will be created if a line has different Ship-To party even if the Sold-To remains same*
*based on above logic i wrote below code..but some how..its not working..pls hlp*
LOOP AT i_input_bdc." INTO wa_input_bdc.
on change of i_input_bdc-shipto.
on change of i_input_bdc-soldto.
...................................................
{code for perform statements}
.....................................................
PERFORM insert_bdc USING 'VA01'.
CLEAR wa_input_bdc.
REFRESH i_bdcdata.
endon.
endon.
ENDLOOP.
Onchange of is not working......pls hlp
‎2009 Jun 10 7:43 PM
HI,
The field order in internal table should be ..
soldto
shipto
matnr
quantity
Check this code..
SORT ITAB BY SOLDto Shipto.
LOOP AT i_input_bdc." INTO wa_input_bdc.
AT END of i_input_bdc-shipto.
...................................................
{code for perform statements}
.....................................................
PERFORM insert_bdc USING 'VA01'.
CLEAR wa_input_bdc.
REFRESH i_bdcdata.
endat.
ENDLOOP.Use AT END of Event
‎2009 Jun 10 7:40 PM
This is related to
Would you please mark that one as solved; otherwise, I will have to lock it.
Thanks
Rob
‎2009 Jun 10 7:43 PM
HI,
The field order in internal table should be ..
soldto
shipto
matnr
quantity
Check this code..
SORT ITAB BY SOLDto Shipto.
LOOP AT i_input_bdc." INTO wa_input_bdc.
AT END of i_input_bdc-shipto.
...................................................
{code for perform statements}
.....................................................
PERFORM insert_bdc USING 'VA01'.
CLEAR wa_input_bdc.
REFRESH i_bdcdata.
endat.
ENDLOOP.Use AT END of Event