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 for appending data for t-code FK02

Former Member
0 Likes
771

Hi,

I want to append data for t-code FK02 through BDC.

Like if for particular lifnr and bukrs, there is existing 2 line items

then my BDC should starting appending data from 3rd line item.

Thanks

Hi,

I want to append data for t-code FK02 through BDC.

Like if for particular lifnr and bukrs, there is existing 2 line items

then my BDC should starting appending data from 3rd line item.

Thanks

4 REPLIES 4
Read only

Former Member
0 Likes
722

HI,

In FK02 there is nothing such as header and line item data.

What is you exact requirement?

Could you specifyi n more details?

Regards,

Ankur Parab

Read only

Former Member
0 Likes
722

Hello,

While recording ... position must be getting according to the number of line items....

if there are 4 line items ... it will be appending on 5 line......

logic for this can be........

These line items must be there in some table ... do a select statement on that table calculating the number of line items and then appending 1 to the total and supplying to the new line item to be added.....

I faced the same problem for maintaining the output types for billing documents..... in that case the line items were stored in NAST table ... so i calculated the number of line items and appended on the next line....

for more clarification you can ask ...

Thanks

manish

Read only

0 Likes
722

Thanks manish.

I have done the same , i fetched data from the actual table.

then took the count of no of lines.

but m unable to insert the new data.

can u help with sum sample code if poss.

Thanks in advance

Read only

Former Member
0 Likes
722

first u count line item


 select count(*) into cnt
           from LFBW as a
           where a~lifnr = itab-lifnr
             and a~bukrs = itab-bukrs.

then put logic for


if cnt > '06'.
        tme = cnt / 6.
        cnt = cnt mod 6.
        do tme times.
            perform bdc_dynpro using 'SAPMF02K' '0610'.
            perform bdc_field using 'BDC_CURSOR' 'LFBW-QSREC(01)'.
            perform bdc_field using 'BDC_OKCODE' 'P+'.
        enddo.
    endif.