LSMW- line items thru bdc recording
I m creating a lsmw thru bdc recodring for me21.
the prob is ...how to upload the line items ? if i do in general it will only upload one line item for order....help me in solving this.
Hi
When you do the recording in LSMW then if the options for multiple line items are available in ME21 then you can do the same with the LSMW recording also.
All you have to do is map the line items fields of the SAP structure to the line items of your upload source structure.
The Source Structure has to be defined as HEADER structure and the LINE item strucuture at the next level.
Then in the HEADER structure in the Source Field steps ,Name the first field as Record Identiifer and for the properties of the field give the value for Identifying Field Content as 'HEADER'.
Similarily for the LINE structure in the Source Field steps ,Name the first field as Record Identiifer and for the properties of the field give the value for Identifying Field Content as 'LINE'.
This would allow you to identify the HEADER and LINE for the files to be uploaded.
Please check this link also
Conversion - Doc with multiple line items - LSMW
Hope this is clear and is helpful.
Similar Messages
-
Hi experts,
I have one validation its like suppose if u have 999 line items then that record should b closed and the both +ve, -ve values should be equal to 0 n new record should start again.
if any body can help me in this regard then i will b thankful to them.
Regards
BohraBecause there may be automatic entries created, you shouldn't go to 999 entries. It should be OK to use 950.
Let's say you have 1100 entries. the first 950 total 10,000 credit. You create the first transaction with 950 entries and then an entry to a control account for 10,000 debit. Then another transaction with the remaining 150 entries and an entry to the same control account for 10,000 credit.
Rob -
SAPF150D-Dunning Notice Print - With Update of Line Items and Master Record
When I am running this program SAPF150D(Dunning Notice Print - With Update of Line Items and Master Records) with a variant containing run date, runc id, update mode, pimmed & pcount; the job is failing to execute. It is giving message like,
"The field symbol is no longer assigned because there was an attempt makde previously in a Unicode program to set the field symbol using ASSIGN with offset and/or length specification. Here, the memory addressed by the offset/length specification was not within the allowed area."
"GETWA_NOT_ASSIGNED_RANGE" "SAPF150D" or "F150DFS0" "SORTFELDER_ERMITTELN"Hi,
Search for routine FORM SORTFELDER_ERMITTELN
in SAPF150D.
Put a breakpoint in statement
ASSIGN (T047F-FELDN) TO <H1>.
in above routine and debug to the point where error is occuring.
Most likely there is a mismatch in the length assigned to some field FELDN in table T047F.
In that case, simply change the T047F-LENGT field accordingly in change mode.
Cheers,
Vikram
Edited by: Vikram Jalali on May 27, 2008 5:56 PM -
How to upload a file which has more than 999 line item through BDC ?
Hello Techards
Hi to all
Can any body tell me how to upload a file which has more than 999 line item through BDC for traction F-02 ?
Thanks in advance.
ShovanHello Shovan,
You split it up to post two accounting documents with the help of a "suspense" a/c.
Say, you have to post the following line items below:
line 1 - dr. - GL a/c X - $1000
line 2 - cr. - GL a/c Y - $1
line 3 - cr. - GL a/c Y - $1
line 1001 - cr. - GL a/c Y - $1
You cannot post the above as a single doc in SAP (because of technical reasons), so you need to break it up into 2 documents as below:
Doc1
line 1 - dr - GL a/c X - $1000
line 2 - cr - GL a/c Y - $1
line 3 - cr - GL a/c Y - $1
line 998 - cr - GL a/c Y - $1
line 999 - cr - SUSPENSE a/c - $3
Doc2
line 1 - dr - SUSPENSE a/c - $3
line 2 - cr - GL a/c Y - $3
Note that there is no incorrect impact on accounting as first we credit suspense a/c by $3 and next we debit the same suspense a/c by $3 as a result the effect is nil. Similarly, we credit $997 to GL a/c Y (which is less by $3) in the first doc which is compensated by the second doc by crediting the shortfall of $3.
Hope this helps,
Cheers,
Sougata. -
Hi Friends
I'm doing a BDC .... in the recording I have found that I've to change different line items.. the part of recording in which I'm facing problem is as below:
BDC_CURSOR VBAP-ABGRU(06)
VBAP-ABGRU(01) 10
VBAP-ABGRU(02) 10
VBAP-ABGRU(03) 10
VBAP-ABGRU(04) 10
VBAP-ABGRU(05) 10
VBAP-ABGRU(06) 10
now I have counted the item nos in a variable v_count. While filling the internal table of BDCdata how will i approach to fill different line items here as shown above.. for 1 item I have no prob....but for n no of items what will be the code of filling bdctab... please let me know....
Thanks
MoumitaHi moumita ....
Plz have a look......
How to deal with table control / step loop in BDC?
Steploop and table contol is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen? Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen,
our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')
Now, I find a method with which we can determine the number of visible lines on Transaction Screen from our Calling BDC program. Maybe it is useless to you, but I think it will give your some idea.
Demo ABAP code has two purposes:
1. how to determine number of visible lines and how to calculte page number; (the 'calpage' routine has been modify to meet general purpose usage)
2. using field symbol in BDC program, please pay special attention to the difference in Static
ASSIGN and Dynamic ASSIGN.
Now I begin to describe the step to implement my method:
(I use transaction 'ME21', screen 121 for sample, the method using is Call Transation Using..)
Step1: go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop.
Then have a look at steploop itselp, one entry of it will occupy two lines.
(Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)
Now we have : FixedLine = 9
LoopLine = 2(for table control, LoopLine is always equal to 1)
Step2: go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.
Now we have: FirstLine = 0
or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)
Step3: write a subroutine calcalculating number of pages
(here, the name of actual parameter is the same as formal parameter)
global data: FixedLine type i, " number of fixed line on a certain screen
LoopLine type i, " the number of lines occupied by one steploop item
FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new
" scrolling screen is empty, otherwise is 1
Dataline type i, " number of items you will use in BDC, using DESCRIBE to get
pageno type i, " you need to scroll screen how many times.
line type i, " number of lines appears on the screen.
index(2) type N, " the screen index for certain item
begin type i, " from parameter of loop
end type i. " to parameter of loop
*in code sample, the DataTable-linindex stands for the table index number of this line
form calpage using FixedLine type i (see step 1)
LoopLine type i (see step 1)
FirstLine type i (see step 2)
DataLine type i ( this is the item number you will enter in transaction)
changing pageno type i (return the number of page, depends on run-time visible line in table control/ Step Loop)
changing line type i.(visible lines one the screen)
data: midd type i,
vline type i, "visible lines
if DataLine eq 0.
Message eXXX.
endif.
vline = ( sy-srows - FixedLine ) div LoopLine.
*for table control, you should compare vline with maximum line of
*table control, then take the small one that is min(vline, maximum)
*here only illustrate step loop
if FirstLine eq 0.
pageno = DataLine div vline.
if pageno eq 0.
pageno = pageno + 1.
endif.
elseif FirstLine eq 1.
pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.
midd = ( DataLine - 1 ) mod ( vline - 1).
if midd = 0 and DataLine gt 1.
pageno = pageno - 1.
endif.
endif.
line = vline.
endform.
Step4 write a subroutine to calculate the line index for each item.
form calindex using Line type i (visible lines on the screen)
FirstLine type i(see step 2)
LineIndex type i(item index)
changing Index type n. (index on the screen)
if FirstLine = 0.
index = LineIndex mod Line.
if index = '00'.
index = Line.
endif.
elseif FirstLine = 1.
index = LineIndex mod ( Line - 1 ).
if ( index between 1 and 0 ) and LineIndex gt 1.
index = index + Line - 1.
endif.
if Line = 2.
index = index + Line - 1.
endif.
endif.
endform.
Step5 write a subroutine to calculate the loop range.
form calrange using Line type i ( visible lines on the screen)
DataLine type i
FirstLine type i
loopindex like sy-index
changing begin type i
end type i.
If FirstLine = 0.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loopindex gt 1.
begin = Line * ( loopindex - 1 ) + 1.
end = Line * loopindex.
if end gt DataLine.
end = DataLine.
endif.
endif.
elseif FirstLine = 1.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loop index gt 1.
begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.
end = ( Line - 1 ) * ( loopindex - 1 ) + Line.
if end gt DataLine.
end = DataLine.
endif.
endif.
endif.
endform.
Step6 using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index
form creat_bdc.
field-symbols: <material>, <quan>, <indicator>.
data: name1(14) value 'EKPO-EMATN(XX)',
name2(14) value 'EKPO-MENGE(XX)',
name3(15) value 'RM06E-SELKZ(XX)'.
assign: name1 to <material>,
name2 to <quan>,
name3 to <indicator>.
do pageno times.
if sy-index gt 1
*insert scroll page ok_code"
endif.
perform calrange using Line DataLine FirstLine sy-index
changing begin end.
loop at DataTable from begin to end.
perform calindex using Line FirstLine DataTable-LineIndex changing Index.
name1+11(2) = Index.
name2+11(2) = Index.
name3+12(2) = Index.
perform bdcfield using <material> DataTable-matnr.
perform bdcfield using <quan> DataTable-menge.
perform bdcfield using <indicator> DataTable-indicator.
endloop.
enddo.
Sample code
Following is a sample code of handling table control in BDC.
REPORT Y730_BDC5 .
*HANDLING TABLE CONTROL IN BDC
DATA : BEGIN OF IT_DUMMY OCCURS 0,
DUMMY(100) TYPE C,
END OF IT_DUMMY.
DATA : BEGIN OF IT_XK01 OCCURS 0,
LIFNR(10) TYPE C,
BUKRS(4) TYPE C,
EKORG(4) TYPE C,
KTOKK(4) TYPE C,
NAME1(30) TYPE C,
SORTL(10) TYPE C,
LAND1(3) TYPE C,
SPRAS(2) TYPE C,
AKONT(6) TYPE C,
FDGRV(2) TYPE C,
WAERS(3) TYPE C,
END OF IT_XK01,
BEGIN OF IT_BANK OCCURS 0,
BANKS(3) TYPE C,
BANKL(10) TYPE C,
BANKN(10) TYPE C,
KOINH(30) TYPE C,
LIFNR(10) TYPE C,
END OF IT_BANK.
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = 'C:\VENDOR.TXT'
FILETYPE = 'ASC'
TABLES
DATA_TAB = IT_DUMMY.
LOOP AT IT_DUMMY.
IF IT_DUMMY-DUMMY+0(2) = '11'.
IT_XK01-LIFNR = IT_DUMMY-DUMMY+2(10).
IT_XK01-BUKRS = IT_DUMMY-DUMMY+12(4).
IT_XK01-EKORG = IT_DUMMY-DUMMY+16(4).
IT_XK01-KTOKK = IT_DUMMY-DUMMY+20(4).
IT_XK01-NAME1 = IT_DUMMY-DUMMY+24(30).
IT_XK01-SORTL = IT_DUMMY-DUMMY+54(10).
IT_XK01-LAND1 = IT_DUMMY-DUMMY+64(3).
IT_XK01-SPRAS = IT_DUMMY-DUMMY+67(2).
IT_XK01-AKONT = IT_DUMMY-DUMMY+69(6).
IT_XK01-FDGRV = IT_DUMMY-DUMMY+75(2).
IT_XK01-WAERS = IT_DUMMY-DUMMY+77(3).
APPEND IT_XK01.
ELSE.
IT_BANK-BANKS = IT_DUMMY-DUMMY+2(3).
IT_BANK-BANKL = IT_DUMMY-DUMMY+5(10).
IT_BANK-BANKN = IT_DUMMY-DUMMY+15(10).
IT_BANK-KOINH = IT_DUMMY-DUMMY+25(30).
IT_BANK-LIFNR = IT_DUMMY-DUMMY+55(10).
APPEND IT_BANK.
ENDIF.
ENDLOOP.
LOOP AT IT_XK01.
REFRESH IT_BDCDATA.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-REF_LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
IT_XK01-LIFNR.
perform bdc_field using 'RF02K-BUKRS'
IT_XK01-BUKRS.
perform bdc_field using 'RF02K-EKORG'
IT_XK01-EKORG.
perform bdc_field using 'RF02K-KTOKK'
IT_XK01-KTOKK.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-TELX1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
IT_XK01-NAME1.
perform bdc_field using 'LFA1-SORTL'
IT_XK01-SORTL.
perform bdc_field using 'LFA1-LAND1'
IT_XK01-LAND1.
perform bdc_field using 'LFA1-SPRAS'
IT_XK01-SPRAS.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-KOINH(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
DATA : FNAM(20) TYPE C,
IDX TYPE C.
MOVE 1 TO IDX.
LOOP AT IT_BANK WHERE LIFNR = IT_XK01-LIFNR.
CONCATENATE 'LFBK-BANKS(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKS.
CONCATENATE 'LFBK-BANKL(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKL.
CONCATENATE 'LFBK-BANKN(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKN.
CONCATENATE 'LFBK-KOINH(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-KOINH.
IDX = IDX + 1.
ENDLOOP.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02K' '0210'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-FDGRV'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFB1-AKONT'
IT_XK01-AKONT.
perform bdc_field using 'LFB1-FDGRV'
IT_XK01-FDGRV.
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR'
'LFB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFM1-WAERS'
IT_XK01-WAERS.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'WYT3-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
CALL TRANSACTION 'XK01' USING IT_BDCDATA
MODE 'A'
UPDATE 'S'
MESSAGES INTO IT_BDCMSGCOLL.
ENDLOOP.
FORM BDC_DYNPRO USING PROG SCR.
CLEAR IT_BDCDATA.
IT_BDCDATA-PROGRAM = PROG.
IT_BDCDATA-DYNPRO = SCR.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
CLEAR IT_BDCDATA.
IT_BDCDATA-FNAM = FNAM.
IT_BDCDATA-FVAL = FVAL.
APPEND IT_BDCDATA.
ENDFORM.
Regards Kaushik Datta -
requirment: to load a file filed with ean no and populate line item of me23n with the respective eans number and their quan and it shuld populate the line items and not save them so user can check a few things and then save it manually while creating the sto (return). iam running a bdc in error mode so that it popultes the sto line item s wtih matnr and quantity and stop at the po screen so it can be saved manually.
but iam unable to populate all the line item. they only populate till number 13 how can i populate further on . i even tried recording a page down.
any ideas?Hi,
The number of displayed items depends on the screen resolution.
In fact a solution consist in filling the field "position" (RM06E-EBELP) at the bottom of the screen for <u>each</u> item.
* Code to position on the right line :
PERFORM FIELD_BDC TABLES WT_BDCDATA USING
'RM06E-EBELP' WT_POSITION .
PERFORM FIELD_BDC TABLES WT_BDCDATA USING
'BDC_OKCODE' '/00' '0'.
Hope it helps,
Ps : ME22 for BDC, not ME22N.
Erwan.
Message was edited by: Erwan LE BRUN -
Hi,
I tried bdc for transaction mfbf.
After entering all values and entering into post with correction the line item exists.
Here using counter in bdc the batches are entered.
say,
(01),
(02),
(15).
But after pressing page down.
The line item changes to (02). and values are get
stored in (02) of first page.
Here i am facing some difficulty.
Is there any possibility to rectify these.
If there please send me...Hello Shiba,
Try to do the recording again, but if you need to insert a new record in the table click the botton to add a new row, it will be always adding the data in the firts row, and the others will scrool down automatacally,
Hope this helps,
Gabriel. P -
hi,please tell me how to handle the line items i.e the header data and item data in bdc?
provide me a clear vision?go with this sample code
REPORT zsowja NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA: bdcdat LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF record OCCURS 0,
data element: ELIFN
lifnr(010),
data element: EKORG
ekorg(004),
data element: BKGRP
ekgrp(003),
data element: EMATNR
ematn(018),
data element: BSTMG
menge(017),
data element: EWERK
werks(004),
END OF record.
DATA : BEGIN OF head_itab OCCURS 0,
data element: ELIFN
lifnr(010),
data element: EKORG
ekorg(004),
data element: BKGRP
ekgrp(003),
END OF head_itab.
DATA : BEGIN OF item_itab OCCURS 0,
data element: ELIFN
lifnr(010),
data element: EMATNR
ematn(018),
data element: BSTMG
menge(017),
data element: EWERK
werks(004),
END OF item_itab.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
filename = 'c:/hello.txt'
filetype = 'ASC'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = record
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT record.
ON CHANGE OF record-lifnr.
head_itab-lifnr = record-lifnr.
head_itab-ekorg = record-ekorg.
head_itab-ekgrp = record-ekgrp.
APPEND head_itab.
CLEAR head_itab.
ENDON.
TO HAVE LINK BETWEEN HEADER AND ITEM TABLE USE LIFNR AS LINKER
item_itab-lifnr = record-lifnr.
item_itab-ematn = record-ematn.
item_itab-menge = record-menge.
item_itab-werks = record-werks.
APPEND item_itab.
CLEAR item_itab.
ENDLOOP.
*TO CHECH THE DATA IN HEADET ITAB AND DETAIL/ITEM ITAB
*loop at head_itab.
*write :/ head_itab.
*endloop.
*skip 2.
*loop at item_itab.
*write:/ item_itab.
*endloop.
SORT head_itab BY lifnr ekorg ekgrp.
SORT item_itab BY lifnr.
DATA linecount TYPE i.
START-OF-SELECTION.
LOOP AT head_itab.
ON CHANGE OF head_itab-lifnr.
REFRESH bdcdat.
CLEAR bdcdat.
PERFORM bdc_dynpro USING 'SAPMM06E' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EKKO-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EKKO-LIFNR'
head_itab-lifnr.
PERFORM bdc_field USING 'EKKO-EKORG'
head_itab-ekorg.
PERFORM bdc_field USING 'EKKO-EKGRP'
head_itab-ekgrp.
linecount = 0.
<b>
LOOP AT item_itab WHERE lifnr = head_itab-lifnr.
linecount = linecount + 1.
IF linecount = 1.</b>
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EKPO-WERKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EKPO-EMATN(01)'
item_itab-ematn.
PERFORM bdc_field USING 'EKPO-MENGE(01)'
item_itab-menge.
PERFORM bdc_field USING 'EKPO-WERKS(01)'
item_itab-werks.
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
ELSE.
PERFORM bdc_field USING 'BDC_CURSOR'
'EKPO-WERKS(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=NP'.
PERFORM bdc_field USING 'EKPO-EMATN(02)'
item_itab-ematn.
PERFORM bdc_field USING 'EKPO-MENGE(02)'
item_itab-menge.
PERFORM bdc_field USING 'EKPO-WERKS(02)'
item_itab-werks.
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
ENDIF.
AT END OF lifnr.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
ENDAT.
ENDLOOP.
ENDON.
CALL TRANSACTION 'ME21' USING bdcdat MODE 'A'.
REFRESH bdcdat.
ENDLOOP.
FORM bdc_dynpro USING value(a) value(b).
bdcdat-program = a.
bdcdat-dynpro = b.
bdcdat-dynbegin = 'X'.
APPEND bdcdat.
CLEAR bdcdat.
ENDFORM.
FORM bdc_field USING value(c) value(d).
bdcdat-fnam = c.
bdcdat-fval = d.
APPEND bdcdat.
CLEAR bdcdat.
ENDFORM. -
Creation of po with mutiple line items using BDC
Hi Gurus,
Can any body hav notes for creating po's using BDC with multiple line items in transaction ME21. I hav created po for single line item but if i tried to create multiple line items, it ll create multiple po's...
thanks in advance
arunSee the Below Logic for me22 and it is also same for me21
report zpochange.
data : i_error like bdcmsgcoll occurs 0 with header line.
data : i_bdcdata like bdcdata occurs 0 with header line.
tables : ekko, ekpo.
data :c1(10) value 'ME22',
c2(1) value ',',c3(10).
data : var1(20). " LIKE EKKO-EBELN.
data : var2 like ekko-ebeln.
data : begin of i_ekko occurs 0,
header(2),
ebeln like ekko-ebeln,
end of i_ekko.
data : begin of i_ekpo occurs 0,
item(2),
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
menge(10), " LIKE EKPO-MENGE,
end of i_ekpo.
data : v like ekpo-ebelp.
data: begin of itab occurs 0,
text(300),
end of itab.
parameters: p_file like ibipparms-path.
*PARAMETERS: PONUMBER LIKE EKPO-EBELN.
at selection-screen on value-request for p_file.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
FIELD_NAME = ' '
importing
file_name = p_file
start-of-selection.
*SELECT EBELN FROM EKKO INTO TABLE I_EKKO WHERE EBELN = PONUMBER.
SELECT EBELN EBELP MENGE FROM EKPO INTO TABLE I_EKPO WHERE EBELN
*= PONUMBER.
perform get_data.
*LOOP AT ITAB.
WRITE :/ ITAB.
ENDLOOP.
loop at itab.
var1 = itab-text+0(1).
if var1 = 'H'.
*I_EKKO-EBELN = ITAB-TEXT.
split itab at c2 into i_ekko-header
i_ekko-ebeln.
SPLIT ITAB AT ',' INTO I_EKKO-EBELN.
" I_EKPO-EBELP
" I_EKPO-MENGE
" var1.
append i_ekko.
else.
split itab at c2 into i_ekpo-item
i_ekpo-ebeln
i_ekpo-ebelp
i_ekpo-menge.
append i_ekpo.
endif.
*var2 = i_ekpo-ebeln.
MOVE VAR1 TO I_EKPO-EBELN.
MOVE VAR1 TO I_EKKO-EBELN.
APPEND: I_EKPO.
*if not var1 is initial.
split var1 at ',' into i_ekpo-ebelp
i_ekpo-menge.
i_ekpo-ebeln = var2.
append i_ekpo.
*endif.
endloop.
loop at i_ekpo.
write :/ i_ekpo.
endloop.
loop at i_ekko.
perform fill_data. " TABLES I_EKPO.
endloop.
LOOP AT I_EKPO.
WRITE :/ I_EKPO.
ENDLOOP.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
*LOOP AT I_ERROR.
WRITE :/ I_ERROR.
ENDLOOP.
form get_data.
call function 'WS_UPLOAD'
exporting
codepage = ' '
filename = p_file
filetype = 'ASC'
headlen = ' '
line_exit = ' '
trunclen = ' '
user_form = ' '
user_prog = ' '
dat_d_format = ' '
IMPORTING
FILELENGTH =
tables
data_tab = itab
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
others = 10
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " GET_DATA
*& Form FILL_DATA
text
-->P_I_EKPO text
form fill_data. " tables i_ekpo .
perform bdcscreen using 'SAPMM06E' '0105'.
perform bdcfield using 'RM06E-BSTNR' i_ekko-ebeln.
perform bdcfield using 'BDC_OKCODE' '/00'.
loop at i_ekpo where ebeln = i_ekko-ebeln.
V = I_EKPO-EBELP.
perform bdcscreen using 'SAPMM06E' 0120.
perform bdcfield using 'BDC_CURSOR' 'RM06E-EBELP'.
perform bdcfield using 'RM06E-EBELP' i_ekpo-ebelp.
perform bdcfield using 'BDC_OKCODE' '/00'.
perform bdcscreen using 'SAPMM06E' 0120.
perform bdcfield using 'BDC_CURSOR' 'EKPO-MENGE(01)'.
perform bdcfield using 'RM06E-EBELP' i_ekpo-ebelp.
perform bdcfield using 'EKPO-MENGE(01)' i_ekpo-menge.
perform bdcfield using 'BDC_OKCODE' '/00'.
*PERFORM BDCSCREEN USING 'SAPMM06E' 0120.
*PERFORM BDCFIELD USING 'BDC_CURSOR' 'RMO6E-EBELP'.
*CLEAR V.
endloop.
perform bdcfield using 'BDC_OKCODE' '=BU'.
call transaction c1 using i_bdcdata mode 'A'
messages into i_error.
refresh i_bdcdata.
endform. " FILL_DATA
*& Form BDCSCREEN
text
-->P_0140 text
-->P_0120 text
form bdcscreen using p_program p_screen.
i_bdcdata-program = p_program.
i_bdcdata-dynpro = p_screen.
i_bdcdata-dynbegin = 'X'.
append i_bdcdata.
clear i_bdcdata.
endform. " BDCSCREEN
*& Form BDCFIELD
text
-->P_0145 text
-->P_I_EKPO_EBELN text
form bdcfield using fnam fval.
i_bdcdata-fnam = fnam.
i_bdcdata-fval = fval.
append i_bdcdata.
clear i_bdcdata.
endform. " BDCFIELD
Reward Points if it is helpful
Thanks
Seshu -
More than 1 line items in bdc using table controls for BOM
Hi....
how do u update more than one line item for BOM using BDC table control.......
is there any specific command for doing that.......
hav tried d following code bt it takes the flatfile i/p FOR 2 LINE ITEMS as 2 different BOM'S.....
would appreciate ur help....plz provide code.............
REPORT zbdc4_cs01
NO STANDARD PAGE HEADING LINE-SIZE 255.
INCLUDE bdcrecx1.
DATA : a TYPE i,
b type i,
c type i.
DATA : BEGIN OF it_rec OCCURS 0,
rec(200) TYPE c,
END OF it_rec.
DATA : BEGIN OF ctab OCCURS 0,
matnr(18),
werks(4),
stlan(1),
END OF ctab.
DATA : BEGIN OF xtab OCCURS 0,
idnrk(18),
menge(13),
postp(1),
END OF xtab.
DATA : BEGIN OF itab OCCURS 0,
matnr(18),
werks(4),
stlan(1),
idnrk(18),
menge(13),
postp(1),
END OF itab.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:/TEST4.TXT'
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_rec.
LOOP AT it_rec.
a = strlen( it_rec-rec ).
if a = 55.
itab-matnr = it_rec-rec+0(18).
itab-werks = it_rec-rec+18(4).
itab-stlan = it_rec-rec+22(1).
itab-idnrk = it_rec-rec+23(18).
itab-menge = it_rec-rec+41(13).
itab-postp = it_rec-rec+54(1).
APPEND itab.
elseif a > 55.
itab-matnr = it_rec-rec+0(18).
itab-werks = it_rec-rec+18(4).
itab-stlan = it_rec-rec+22(1).
itab-idnrk = it_rec-rec+23(18).
itab-menge = it_rec-rec+41(13).
itab-postp = it_rec-rec+54(1).
APPEND itab.
itab-idnrk = it_rec-rec+55(18).
itab-menge = it_rec-rec+73(13).
itab-postp = it_rec-rec+86(1).
APPEND itab.
endif.
ENDLOOP.
PERFORM open_group.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29N-STLAN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RC29N-MATNR'
itab-matnr. "'3000000107'.
PERFORM bdc_field USING 'RC29N-WERKS'
itab-werks. "'UN02'.
PERFORM bdc_field USING 'RC29N-STLAN'
itab-stlan. "'1'.
PERFORM bdc_field USING 'RC29N-STLAL'
PERFORM bdc_field USING 'RC29N-DATUV'
'11.08.2008'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RC29K-BMENG'
'1'.
PERFORM bdc_field USING 'RC29K-STLST'
'1'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29K-EXSTL'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0111'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29K-LABOR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSTP(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RC29P-IDNRK(01)'
itab-idnrk. "'1000000232'.
PERFORM bdc_field USING 'RC29P-MENGE(01)'
itab-menge. "'100'.
PERFORM bdc_field USING 'RC29P-POSTP(01)'
itab-postp. "'L'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR'.
PERFORM bdc_field USING 'RC29P-POSNR'
'0010'.
PERFORM bdc_field USING 'RC29P-IDNRK'
'1000000232'.
PERFORM bdc_field USING 'RC29P-MENGE'
'100'.
PERFORM bdc_field USING 'RC29P-MEINS'
'KG'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POTX1'.
PERFORM bdc_field USING 'RC29P-SANKA'
'X'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCBU'.
PERFORM bdc_transaction USING 'CS01'.
ENDLOOP.
PERFORM close_group.Hi
Check this sample code for the Table Control in BDC:
data: fnam(20) type c.
move 1 to id.
loop at TI_STAGING WHERE VENDOR = IT_STAGING-VENDOR AND DOCDATE = IT_STAGING-DOCDATE.
concatenate 'RM06E-EPSTP(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-itmcategory.
concatenate 'EKPO-KNTTP(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-accassignment.
concatenate 'EKPO-EMATN(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-material.
concatenate 'EKPO-TXZ01(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-shortxt.
quan = ti_staging-poqty.
concatenate 'EKPO-MENGE(0' id ')' into fnam.
perform bdc_field using fnam quan.
concatenate 'RM06E-EEIND(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-deliverydate.
netpr = ti_staging-netpr.
concatenate 'EKPO-NETPR(0' id ')' into fnam.
perform bdc_field using fnam netpr.
concatenate 'EKPO-MATKL(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-mategroup.
concatenate 'EKPO-WERKS(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-plant.
ID = ID + 1.
ENDLOOP.
Regards,
Vishwa. -
Requirement to populate the Profit center field of Vendor line item thru...
Hi,
My requirement is to populate the Profit center field of Vendor line item.
For this, I want to write a substitution where based on the Business Area of Vendor line item, the system should populate the Profit center while saving.
Is it possible thru Validation & Substitutions...
Plz guide me in writing this
Points will be suitable rewarded for replies.
regards
AVMTcode: GGB1
An example shows how to make a G/L account available for line item substitution.
GGB1
Click FA Doc Header
Click Create Substitution icon
Enter the Text
Click Create Step icon
Click the field u want Say - BKPF- BKTXT
Choose the option Say :Constant value
Give description of ur step
Click Prerequisite
Double Click Structure BKPF
Double Click BKPF-AWKEY
Click Constant button
Enter the Text u want to make it appler in the Reference key
Click Substitution and enter the constant value u want
Go to Tcode: GGB4
Click Substituted Fields
Give ur table and field (Here - BKPF- BKTXT)
Do it in a similar way..if u cannot proceed, let me know the exact field values..and i can take screenshots and send u across
Thanks,
Sridevi -
Standard text entry for Service line items using BDC
Hi,
I want to enter standard texts for service line items of RFQ created using BDC, if it is a line item i can pass RFQ_number+line_item number as TDNAME in SAVE_TEXT function module, but for Service line item what value we need to pass in TDNAME.
Is there anyway we can capture the package number in BDC of ME41?
Regards
Bala Krishna.
-
Line item and header records in the same infopackage
Gurus,
I wanted to check how can I make sure that I get all the line item documents in the same package with the header document record in the same infopackage? Is there some setting for that? If I am writing a custom extractore how can I make sure of this in ABAP?
Thanks
AKDear AKBW,
This is not very clear why you want to use same infopackage for line-item as well as header data. Normally there are 2 different datasources for line item and for header data.
Say you are woking with Sales Order Data in ECC.
So Line-item datasource for sales order data - 2LIS_11_VAITM
and Header datasource for sales order data - 2LIS_11_VAHDR.
Now as they are 2 different datasource, so you must need 2 different infopackages.
Now if you have created one custom datasource in ECC, then just check if its extracting line-item level or header level data. Normally when we create any custom datasource, we try to make it line-item level, to have all the itemwise detail. Though its not mandatory.
So if you have 2 different datasources (SAP or Custom), you definitely need 2 different infopackages.
Please let me know, if you still have any more doubt. You can also give me the other detail of the custom datsource you are creating.( type, fields, what it is supposed to extract etc).. -
Urgent pls: Automatic mailing of Reports thru BDC recording
Hi Gurus..
Please guide me for the possibility of creating a Z program which should call the T. Code, supply parameters for execution & sending output by email.I
need to execute 3 processes thru a single a program ..
1. get the distribution list
2. call the respective Tcode
3. running the background job for saving the variant & passing it.
Do I need to do recording thru BDC for each of them?
How can i do so in this manner..kindly guide me..
Pls experts need urgent help in this..
Thanks..
HimayanHi,
If the transaction codes you are referrring are associated to report programs, do as below:
1. Submit required program with addition Exporting list to Memory.
2. Read the list to an internal table
3. Use the data to send as mail attachments.
Check code samples in the below thread should you require the info:
[Sending External mails with attachments|Re: events]
Kind Regards
Eswar -
Matching FI Line Items and Total Records for FM
Dear Friends,
Currently, we are implementing Public Sector Management using Former Budgeting.
Some PR and PO has been created, before the FM budget data transferred from Cost Center Planning using FM9C.
Using FMRP_2FMB4002 report, the u2018Available Amountu2019 still equal to u2018Curr. Budget Amountu2019, even though we can display the detail PR and PO by double-click the column u2018Assignedu2019 and u2018Commts/Act.u2019 in this report.
After executing RFFMRC04, system shows many line items containing Fund Center, Commitment Items, and its Amount.
I need your assistance to resolve these issues, so that the FM Report can be analyzed accordingly.
Thanks for your kind attention.
Regards,
(Vincent)Hi,
This thread has been created some time ago and recieved no response. Can you please close if you feel this issue/query has been resolved in the meantime. If it has not then please provide additional information in relation to your query. By providing updates to your thread it moves you thread to the first page of thread and increases visibility and possiblity for the multiptude of experts in SDN Forums to offer their support.
Therefore please update with more information or close thread.
Thank you for your assistance.
Regards,
Brendan.
(ERP FI/CO SDN/WIKI Moderator)
http://wiki.sdn.sap.com/wiki/display/ERPFI/ERP+Financials
Maybe you are looking for
-
Thousands of strange images on iPhoto what are they?
I tried to down load my pics in iphoto into a file I could put on an external hard drive for back up. Now i have thousands of images some of which are called resources,water color text mat , uk.iprog ect. What are they & how do I make them go away?
-
dear sir/ me dam i am creating new vendor code but saving problem for number range is sowing account already exists
-
Technical Scenario Switch: From Standalone To Extended Classic
Hello, Currently we are preparing the system to change the technical scenario from standalone to extended classic (SRM 4.0) While the Customizing steps are clear, it isn´t so clear how the data that already exist in the system will behave after the s
-
I did a quick search of the forum and did not see an answer for this. I am trying to run serialver on a class, but when I do I get the following error: Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionBindingLi
-
Retrieve Recipient and Requestor Information to create Shopping Cart
Hi Friends, I have a requirement that Based on the User ID I need to populate the Recipient and Requestor Information. Also how to populate the Partner Information based on the UserID, I am developing a WebDynpro Application with minimal fields that