12-11-2007 1:10 PM
Hi,
I have faced problem writing in BDC for standard transaction code VA01. For one sales order creation two or more line items will be there. Then how to write code for the BDC for the VA01. Please help me.
regards
Mohan.
12-11-2007 2:05 PM
Hi
take two internal tables, one for header and second for item details. But use one field called serial no(what ever you want and length also) with length 5 or 6 in both internal tables first field. This field is the link between the two internal tables.
pass all header information from flat file to header internal table and pass item information in item details internal table. In program recording pass header itab values to header screen fields and in loop pass item itab field to item screen fields.
Reward if it helps
Thanks
Siva Kumar
12-11-2007 3:33 PM
imp. the foll. code to handle the multiple line items in sales order.
declare 2 variables:
data: lv_text(100) type c,
lv_cnt(02) type n.
loop at header .
perofrm BDC...
lv_cnt = lv_cnt + 1.
loop at item where vbeln = header-vbeln.
i am giving an ex. for one of the item field, menge i.e, quantity..
u can use same for req. item fields
CONCATENATE 'RV45A-KWMENG' '(' cnt ')' INTO lv_text.
PERFORM bdc_field USING lv_text ' 100'.
here the lv_text contains 'RV45A-KWMENG(01)'.
CLEAR lv_text.
cnt = cnt + 1.
CONCATENATE 'RV45A-KWMENG' '(' cnt ')' INTO lv_text.
PERFORM bdc_field USING lv_text ' 200'.
here lv_text contains 'RV45A-KWMENG(02)'
u can like this upto 99 line items...
clear: lv_text, lv_cnt.
endloop.
call transaction VA02..........using...
endloop.
hope it willbe helpful for u...