‎2009 Apr 24 11:56 AM
Hi,
I am facing a problem when i am creating a BDC program for Transaction FV50.
How will i maintain more then one line items for a single header.
Thanks in Advance
‎2009 Apr 24 11:58 AM
Hi anjali,
you will have to loop the all line item for one perticular header data.,append header data only once in BDCDATA table and append all the corresponding line items with the help of a loop.
You will also have to maintan index number for all line items.
‎2009 Apr 24 12:05 PM
hi,
just refer the code below.
loop at it_customer_3 into wa_customer2 where kunnr = mkunnr.
index = mytabix.
n = index.
condense n no-gaps.
CONCATENATE 'MV10A-MATNR(0' n ')' INTO tran.
perform bdc_field using tran
wa_customer-MATNR.
CLEAR tran.
CONCATENATE 'MV10A-KDMAT(0' n ')' INTO tran.
endloop.
take all the data in internal table then loop into internal table for all line items and populate the bdc tab accordingly.
Hope it helps u.
Regards,
Anil N.
‎2009 Apr 25 11:51 AM
when u perform the recording, first u do recording for 1st line item. Then loop the data for more line items.
For eg: when do recording for line items u will see the recorded field as FILED(01) .
here if u notice the value (01). This is occured for first line item. The same way u need to handle for as many line items as u want.
Check the sample code below:
data: count(2) type n.
Loop at itab.
count = count + 1.
Here populate header data.
then Populate item data as below.
perform ......... fields(count).
endloop.