Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC report

former_member515329
Participant
0 Likes
563

*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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
495

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

2 REPLIES 2
Read only

Former Member
0 Likes
495

This is related to

Would you please mark that one as solved; otherwise, I will have to lock it.

Thanks

Rob

Read only

Former Member
0 Likes
496

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