Prob in BDC
Hi Friends,
I am doing bdc call transaction method.Releasing delivery block from sales order at header level n item level.
I am getting all sales order which r having block order.The output is constructed like when i select 1 sales order n click on release that sales order should release...
Each sales order is having 1 to 3 item so the output is displaying 3 times each sales order with different item. means 3 coloums ...
But what the problem is each sales order is having more then 1 item so when i am selecting each sales order it is releasing the whole document....
suppose 3000000234 is having item 10,20,30 i want to release onlt sales order 3000000234 with item 10.but is realising whole document..
now how to solve the problem plzzz any one help me..
Hi
Use the BAPI. Instead of BDC.
data:
it_atg_delcreate LIKE vbap OCCURS 1 WITH HEADER LINE,
order_item TYPE TABLE OF bapisditm WITH HEADER LINE,
order_itemx TYPE TABLE OF bapisditmx WITH HEADER LINE,
returnmsg
LIKE bapiret2 OCCURS 1 WITH HEADER LINE,
schdulelines
LIKE bapischdl OCCURS 1 WITH HEADER LINE,
schedulelinex LIKE bapischdlx OCCURS 1 WITH HEADER LINE,
atg_orderheader LIKE bapisdh1x,
atg_orderheader-updateflag = 'U'.
LOOP AT it_atg_delcreate.
order_item-itm_number = it_atg_delcreate-posnr.
APPEND order_item.
CLEAR:order_item.
order_itemx-itm_number = it_atg_delcreate-posnr.
order_itemx-updateflag = 'U'.
APPEND order_itemx.
CLEAR:order_itemx.
schdulelines-req_dlv_bl = space.
schdulelines-itm_number = it_atg_delcreate-posnr.
schdulelines-sched_line = '0001'.
APPEND schdulelines.
schedulelinex-req_dlv_bl = 'X'.
schedulelinex-itm_number = it_atg_delcreate-posnr.
schedulelinex-updateflag = 'U'.
schedulelinex-sched_line = '0001'.
APPEND schedulelinex.
CLEAR: schedulelinex, schdulelines.
AT END OF vbeln.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = it_atg_delcreate-vbeln
order_header_inx = atg_orderheader
TABLES
return = returnmsg
order_item_in = order_item
order_item_inx = order_itemx
schedule_lines = schdulelines
schedule_linesx = schedulelinex.
IF sy-subrc = 0.
Clearing the values
REFRESH : order_item,
order_itemx,
schdulelines,
schedulelinex.
CLEAR : order_item,
order_itemx,
schdulelines,
schedulelinex.
ENDIF.
ENDAT.
ENDLOOP.
Commit the database
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
The above is exactly suits u r requirement.
If it is helpful rewards ponits.
Regards
Pratap.M
Similar Messages
-
Hmmm..Date is updation probs in BDC transaction
Hi all, very gud morning
I have written a BDC program to a dialog UI screen,
So in dialog screen there is a date field, which wud be entered and updated.
So if v update the date, using screen its been updated into the database corectly.
ex: if i enter 30.05.2007, its updated as the same.
But if i have saved the data in a .txt file and if i update the database using BDC, its been updating as 30.05.2020 into the database instead of taking it as 30.05.2007
So do u knw watz the problem n solution for this?
Regards,
SouravHi Sowrabh,
You can facing this problem because SAP date field accepts only 8 characters
and when you are giving the value of 10 chracters, it is truncating the last 2 characters.
You can try the following code:
Data: i_dat(10),
o_dat type d.
*You can replace i_dat with ur date fld
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = i_dat
IMPORTING
output = o_dat.
Use the variable o_dat in ur upload.
Regards -
hi everybody,
how r u all. i have a prob with bdc line items. all the fields r getting displayed in only one field. tell me clearly how to handle bdc line items.
Regards,
sindhu.Hi,
check this code for line items
FORM POPULATE_BDC.
DATA:L_COUNTER TYPE N,
L_STRING TYPE STRING.
LOOP AT IT_CUSTOMER.
AT NEW KUNNR.
CLEAR L_COUNTER.
L_INDEX = SY-TABIX.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
perform bdc_dynpro using 'SAPMV10A' '0100'.
perform bdc_field using 'MV10A-KUNNR'
IT_CUSTOMER-KUNNR.
perform bdc_field using 'MV10A-VKORG'
IT_CUSTOMER-VKORG.
perform bdc_field using 'MV10A-VTWEG'
IT_CUSTOMER-VTWEG.
perform bdc_field using 'BDC_OKCODE'
'/00'.
ENDAT.
L_COUNTER = L_COUNTER + 1.
CLEAR L_STRING.
perform bdc_dynpro using 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-MATNR(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-MATNR.
CONCATENATE 'MV10A-KDMAT(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-KDMAT.
CONCATENATE 'MV10A-MEGRU(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-MEGRU.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*-- For Page down in Call Transaction Mode
IF L_COUNTER = 14.
CLEAR L_COUNTER.
PERFORM BDC_DYNPRO USING 'SAPMV45A' '4001'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P+'.
ENDIF.
perform bdc_dynpro using 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-SELKZ(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-SELKZ.
perform bdc_field using 'BDC_OKCODE'
'=SELE'.
perform bdc_dynpro using 'SAPMV10A' '0300'.
perform bdc_field using 'MV10A-KDMAT'
IT_CUSTOMER-KDMAT.
perform bdc_field using 'MV10A-LPRIO'
IT_CUSTOMER-LPRIO.
perform bdc_field using 'MV10A-ANTLF'
IT_CUSTOMER-ANTLF.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/EBACK'.
at end of kunnr.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
CALL TRANSACTION 'VD51' USING IT_BDC MODE 'A' UPDATE 'S'
MESSAGES INTO IT_MESSAGES.
CLEAR IT_BDC.
REFRESH IT_BDC.
ENDAT.
IF NOT IT_MESSAGES[] IS INITIAL.
PERFORM FORMAT_MESSAGE.
ENDIF.
ENDLOOP.
ENDFORM. " POPULATE_BDC
regards,
keerthi -
i am wroking in the program in which two BDC are run . i give the pushbutton in programe named "move to next" .when i execute the programe and put the obligatory field .
after that i press enter button then next screen appear i continuousely press the enter button the values are appear cont. . and a next screen is appear . now my prob. is that i want that when BDC posted it terminated futher pressing enter it can not take any value . and when i press pushbutton then next screen is appear.Hi Pankaj,
If you are creating a program using SHDB recording, there is option available "Continue after commit" in SHDB... Tick this checkbox before recording and then create your recording. Transfer recording to code after that.
Regards,
Mohaiyuddin -
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 -
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. -
hi,
i am facing a problem at the time of bdc recording in MC88 , when i capturing the inactive version button it generates ok_code "/00" but when it put down in z report it does not work. if any one knows about dis prob. den tell me.
Thanks & Regards.
Kshitiz Goyal.Do a recording with a material which is throwing u the UOM screen .
IF ur flat file is not having Uom pick the values for the materials from MARA/ MARM table into a variable and submit it to the screen of UOM.
See a recording will be done considering the fact that all the possible scenarios are handled . So If the screen is popping up with a UOM screen then it has to be handled .
You have to capture this in ur BDC recording .
Cause even it throws the UOM screen for one material u need to handle that .
There is one more screen for UOM jsut do a select and pass the UOM for the material in the code
if u r not intending to maintain the same in ur flat file.
Regards,
vijay -
BDC help req for MM02??
hi
I made a BDC pgm for MM02,to update the Purchasing Group filed for a matnr,based on Plant.
But i am facing an prob that,when in a Matnr views,my curcur is coming to Purchsaing View ,it update the EKGRP filed,but when it directly comes to MRP 1,its given an error,that MARC-EKGRP not exits.
Moreover I had done only recording for Purchaing View,not for MRP 1 view,but not able to understand why its going there in MRP 1 view,some time for some materials.
Can any one tell me,how to rectify this prob?
Regds.Hi,
This problem occurs because,
Different materials have different types,
so this view will not be same for all,
so if you have done recording for 4th tab ,than for next material at 4th tab some other thing will be there,
to rectify this problem,
do the recording for basic data 1 (it will be present for very material ) and then goto the required tab,
i hope it fits to your requirement,
Regards,
Talwinder -
Hi guru's,
after i have done bdc rec, i have imported the code to my program. but i have a small problem.
1. i have selected some views for my trn mm03(during bdc rec). while executing the Final program, the view at the last is not being selected until i scroll it until that view. (but in bdc rec i hav selected them) . hope u understood.
my code snippet:
PERFORM open_group.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-MATNR'
WA_FINAL-MATNR.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'
c_x.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(02)'
c_x.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(12)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(12)'
c_x.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(13)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(13)'
c_x.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
plant.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'MM03'.
PERFORM close_group.
So, in the above code, i want the views to be selected directly without me pressing enter. so which fiels should i change in the above code for the dynamic selection of the views in trn 'mm03'.
2. i have to skip the first two screens, like entering the materialno & selecting the views. As i have already selected them durin bdc rec.
How to code for skipping these two screens.
can anyone solve my two probs.
ask me for any clarity in my doubts.
please help me
regards,
chaitanya
Edited by: chaitanya on Mar 13, 2008 11:02 AMhi
for ur first query :
i am giving u sample code for view selection on second screen
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(17)'.
perform bdc_field using 'BDC_OKCODE'
'P+'.perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(03)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
record-KZSEL_04_005.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
record-KZSEL_05_006.
perform bdc_field using 'MSICHTAUSW-KZSEL(06)'
'X'.
record-KZSEL_06_007.
perform bdc_field using 'MSICHTAUSW-KZSEL(07)'
'X'.
record-KZSEL_01_004.
*perform bdc_field using 'MSICHTAUSW-KZSEL(08)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(09)'
'X'.
record-KZSEL_09_008.
perform bdc_field using 'MSICHTAUSW-KZSEL(10)'
'X'.
record-KZSEL_01_004.
*perform bdc_field using 'MSICHTAUSW-KZSEL(11)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(12)'
'X'.
record-KZSEL_12_009.
perform bdc_field using 'MSICHTAUSW-KZSEL(13)'
'X'.
record-KZSEL_13_010.
perform bdc_field using 'MSICHTAUSW-KZSEL(14)'
'X'.
record-KZSEL_14_011.
perform bdc_field using 'MSICHTAUSW-KZSEL(15)'
'X'.
record-KZSEL_15_012.
perform bdc_field using 'MSICHTAUSW-KZSEL(16)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(17)'
'X'.
record-KZSEL_17_013.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
record-KZSEL_13_014.
perform bdc_field using 'MSICHTAUSW-KZSEL(06)'
'X'.
record-KZSEL_14_015.
perform bdc_field using 'MSICHTAUSW-KZSEL(07)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(08)'
'X'.
record-KZSEL_16_016.
perform bdc_field using 'MSICHTAUSW-KZSEL(09)'
'X'.
record-KZSEL_01_004.
here important is use P+ code to page down for select last views, and after that it may possible
that value 'MSICHTAUSW-KZSEL(07)' may be greater then 15 so change this by counting position . like
for 16 -
> 01
17 -
> 02
2. For ur second problem .
as u asking to eleminate 1and 2 screen , it is not possible bcoz
as u enter t.code first screen will come .
and without selecting VIEW u can not go further in t.code.
what u can do is make the entries in fields of these screen default then u will not requied to give them in flat file .
reward if helpful. -
I got the charger flex or pin changed and now the apps dance on the screen, photos open and zoom in, then out, the other apps open and close. I have already restored the device with Itunes and prob is still there. What can be the problem? Any suggestion will be welcome. Thank you
THANKS for your prompt reply Bluetooth is off in my laptop and IPhone.. and in fact the reset is the only thing that can make it back to normal. But for a lil while. I wonder if it is the touch, or the home botton... both things are very expensive to replace, so I wouldn't like to spend $$ and continue having the prob.....
-
Error while running a BDC for the Transaction F-02
Hi,
I'm getting an error <b><i>"Parking not possible during Batch Input"</i></b> while running a BDC for the transaction F-02.
When i click on the error message it displays the message [b<i>]"In Customizing, you can control whether an error message is issued."</b></i>
How to solve this issue?.
Waiting for ur replies.........
Regards
N.SenthilHi,
When you are doing the recording in SHDB, and in the same screen where the TCODE to be recorded is given, there are options that you can choose called "Recording Parameters"...Select the checkbox which says "Not a Batch Input Session", this will set the sy-binpt variable to " "(in a recording by default it is "X")...and you will not get this error...
Also make sure while writing the BDC program to make use of the "bdc options" parameter which has this property to switch of sy-binpt...
Refer below theard for sample bdc code for f-02.
https://forums.sdn.sap.com/click.jspa?searchID=5126766&messageID=1538409
Regards -
Unable to update the serial number through bdc in Sales Order
Hi experts,
I written the inboud FM for to update the 3rd party items serial number to the sales orders through BDC Call transaction Method.
Here i am facing a problem when i have the 19 item Quan ,it is updating correct through idoc , when ever there is moe than 19 and at that if any serial number repeated for that if i am changing at that time it is loosing the control of the BDC and giving the control to the salesorder screen.
how can i handle that control again has to come to BDC prgrm......
Thnks,
Regards,
BharaniHi,
Can you please let me know the segment in ORDERS05 Idoc to process the Payment card information and if the standard Function Module can handle the creation of a Sales Order with data for Payment Card.
We have a requirement to map the Tokenized Number of the Credit Card send from a store front end to ECC mapping via SAP-PI.
Thanks in Advance, -
MULTIPLE ITEM PROBLEM IN VL31N BDC
hI FRIENDS ,
I AM POSTING A BDC OF TRANSACTION VL31N ,ie FOR SCHEDULE AGREEMENT INBOUND DELIVERY.I CREATE A FUNCTIONAL MODULE OF THE SAME AND CALL IT FROM AN ASP PAGE,IN THAT THERE IS PO NUMBER 5500000986 WHICH HAS TWO ITEMES 62 AND 95 RESPECTIVLY OF SAME MATARIAL NUMBER R010230123041002 AND DIE NUMBER 2304P,NOW THE PROBLEM IS THIS BDC IS WORKING WHEN THERE IS ONLY ONE ITEM BUT GIVES AN ERROR "CANT CREAT INBOUND DELIVERY FOR PO NO ...' WNEN IT HAS MULTIPLE ITEM.WHAT SHOULD I DO ? I ALSO USED LOOP BUT IT ALSO DOSENT WORK AS IT WILL ADD ALL OPEN QTY OF PO 986 AND UPDATE AGAINST ITEM NO 95.
CODE IS AS FOLLOWS:.........
FUNCTION y_synie_bdcinbdly.
""Local interface:
*" IMPORTING
*" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'
*" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'N'
*" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'
*" VALUE(GROUP) LIKE APQI-GROUPID OPTIONAL
*" VALUE(USER) LIKE APQI-USERID OPTIONAL
*" VALUE(KEEP) LIKE APQI-QERASE OPTIONAL
*" VALUE(HOLDDATE) LIKE APQI-STARTDATE OPTIONAL
*" VALUE(NODATA) LIKE APQI-PUTACTIVE DEFAULT '/'
*" VALUE(EXTNID) LIKE MAKT-MAKTG
*" VALUE(VENDORNO) LIKE LFA1-LIFNR
*" VALUE(PONUMBER) LIKE EKKO-EBELN
*" VALUE(ITEMNUMBER) LIKE LIPS-VGPOS
*" VALUE(MATERIAL) LIKE MAKT-MAKTG
*" VALUE(DLYQTY) LIKE LIPS-LFIMG
*" VALUE(BTCHNO) LIKE LIPS-CHARG
*" VALUE(POSLR) LIKE EKES-EBELP OPTIONAL
*" EXPORTING
*" VALUE(SUBRC) LIKE SYST-SUBRC
*" VALUE(INDELYNO) LIKE SY-MSGV2
*" VALUE(MSG1) LIKE SY-MSGV1
*" VALUE(MSG2) LIKE SY-MSGV2
*" VALUE(MSG3) LIKE SY-MSGV3
*" VALUE(MSG4) LIKE SY-MSGV4
*" TABLES
*" MESSTAB STRUCTURE BDCMSGCOLL
*" ERRTAB STRUCTURE YSYNERRMSGS
*" INDLYTAB STRUCTURE YSYN_QTYTAB
Updated by ANAND SYNISE 19.1.2007
DATA: BEGIN OF bdctab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdctab.
DATA: datenow(10) TYPE c,
fldvar(30) TYPE c,
fldno TYPE i,
flditoc(6) TYPE c,
qty(13) TYPE c.
DATA maxposnr LIKE lips-posnr.
DATA testposnr TYPE posnr.
DATA itemnoint TYPE i.
CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO datenow.
CLEAR bdctab.
REFRESH bdctab.
PERFORM open_group USING group user keep holddate ctu.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '4007'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'RV50A-VERUR_LA'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '/00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-LIFNR'.
bdctab-fval = vendorno.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LV50C-BSTNR'.
bdctab-fval = ponumber.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-VERUR_LA'.
bdctab-fval = extnid.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=MKAL_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIKP-BLDAT'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=POPO_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-POSNR(01)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '0111'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'RV50A-PO_MATNR'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = 'WEIT'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-PO_MATNR'.
bdctab-fval = material.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=POLO_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-POSNR(01)'.
APPEND bdctab.
*ADDED BY ANAND ON 22-01-2007
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = ITEMNUMBER . "ITEMNUMBER = LIPS-VGPOS
APPEND bdctab.
************ENDED***********************
ADDED BY MILIND 19.01.2007
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = poslr .
APPEND bdctab.
* ENDED * *
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LIPS_SELKZ(01)'.
bdctab-fval = ''.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '/00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-CHARG(01)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
QTY = INDLYTAB-DLYQTY.
qty = dlyqty.
bdctab-fnam = 'LIPSD-G_LFIMG(01)'.
bdctab-fval = QTY.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIPS-CHARG(01)'.
* BDCTAB-FVAL = INDLYTAB-BTCHNO.
bdctab-fval = btchno.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=SICH_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-MATNR(02)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CALL TRANSACTION 'VL31N' USING bdctab MODE 'N' MESSAGES INTO messtab.
subrc = sy-subrc.
PERFORM close_group USING ctu.
CLEAR bdctab.
REFRESH bdctab.
IF sy-subrc EQ 0.
indelyno = sy-msgv2.
ENDIF.
LOOP AT messtab.
MOVE: messtab-msgid TO errtab-msgid,
messtab-msgnr TO errtab-msgnr,
messtab-msgv1 TO errtab-msg1,
messtab-msgv2 TO errtab-msg2,
messtab-msgv3 TO errtab-msg3,
messtab-msgv4 TO errtab-msg4.
APPEND ERRtab.
ENDLOOP.
LOOP AT errtab.
SELECT SINGLE text FROM t100
INTO errtab-errmsg
WHERE msgnr EQ errtab-msgnr AND arbgb EQ errtab-msgid
AND sprsl EQ sy-langu.
MODIFY errtab.
ENDLOOP.
ENDFUNCTION.Hi,
Check this code:
REPORT Z_CUSTOMER_UPLOAD .
D A T A D E C L A R A T I O N S *
DATA:BEGIN OF IT_CUSTOMER OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_CUSTOMER.
DATA:BEGIN OF IT_success OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_success.
DATA:BEGIN OF IT_error OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_error.
DATA: L_INDEX TYPE SY-TABIX.
DATA:IT_BDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
ERROR MESSAGE TABLE
DATA:IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : C_S TYPE C VALUE 'S',
C_E TYPE C VALUE 'E'.
*DATA: IT_SUCCESS LIKE IT_CUSTOMER OCCURS 0,
IT_ERROR LIKE IT_CUSTOMER OCCURS 0.
DATA : V_RECTOT TYPE I,
V_RECERR TYPE I,
V_RECSUC TYPE I.
S E L E C T I O N - S C R E E N *
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : P_FILE LIKE RLGRAP-FILENAME .
SELECTION-SCREEN : END OF BLOCK B1.
A T S E L E C T I O N - S C R E E N *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
to get F4 help for p_file
PERFORM F4_FILENAME USING P_FILE.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Uploading data from flat file into it_tab
PERFORM BDC_UPLOAD USING P_FILE.
PERFORM PROCESS_DATA.
PERFORM POPULATE_BDC.
E N D O F S E L E C T I O N *
*END-OF-SELECTION.
PERFORM DISPLAY_REPORT.
*& Form F4_FILENAME
text
-->P_P_FILE text
FORM F4_FILENAME USING P_P_FILE.
DATA:L_FILE TYPE IBIPPARMS-PATH.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = L_FILE .
P_P_FILE = L_FILE.
ENDFORM. " F4_FILENAME
*& Form BDC_UPLOAD
text
-->P_P_FILE text
FORM BDC_UPLOAD USING P_P_FILE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_P_FILE
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 8
I_END_ROW = 1000
TABLES
INTERN = IT_DATA
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
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. " BDC_UPLOAD
*& Form PROCESS_DATA
text
--> p1 text
<-- p2 text
FORM PROCESS_DATA.
SORT IT_DATA BY ROW COL.
LOOP AT IT_DATA.
CASE IT_DATA-COL.
WHEN 1.
IT_CUSTOMER-KUNNR = IT_DATA-VALUE.
WHEN 2.
IT_CUSTOMER-VKORG = IT_DATA-VALUE.
WHEN 3.
IT_CUSTOMER-VTWEG = IT_DATA-VALUE.
WHEN 4.
IT_CUSTOMER-MATNR = IT_DATA-VALUE.
WHEN 5.
IT_CUSTOMER-KDMAT = IT_DATA-VALUE.
WHEN 6.
IT_CUSTOMER-MEGRU = IT_DATA-VALUE.
WHEN 7.
IT_CUSTOMER-LPRIO = IT_DATA-VALUE.
WHEN 8.
IT_CUSTOMER-ANTLF = IT_DATA-VALUE.
APPEND IT_CUSTOMER.
ENDCASE.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*& Form POPULATE_BDC
text
--> p1 text
<-- p2 text
FORM POPULATE_BDC.
DATA:L_COUNTER TYPE N,
L_STRING TYPE STRING.
LOOP AT IT_CUSTOMER.
AT NEW KUNNR.
CLEAR L_COUNTER.
L_INDEX = SY-TABIX.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
perform bdc_dynpro using 'SAPMV10A' '0100'.
perform bdc_field using 'MV10A-KUNNR'
IT_CUSTOMER-KUNNR.
perform bdc_field using 'MV10A-VKORG'
IT_CUSTOMER-VKORG.
perform bdc_field using 'MV10A-VTWEG'
IT_CUSTOMER-VTWEG.
perform bdc_field using 'BDC_OKCODE'
'/00'.
ENDAT.
L_COUNTER = L_COUNTER + 1.
CLEAR L_STRING.
perform bdc_dynpro using 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-MATNR(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-MATNR.
CONCATENATE 'MV10A-KDMAT(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-KDMAT.
CONCATENATE 'MV10A-MEGRU(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-MEGRU.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*-- For Page down in Call Transaction Mode
IF L_COUNTER = 14.
CLEAR L_COUNTER.
PERFORM BDC_DYNPRO USING 'SAPMV45A' '4001'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P+'.
ENDIF.
perform bdc_dynpro using 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-SELKZ(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-SELKZ.
perform bdc_field using 'BDC_OKCODE'
'=SELE'.
perform bdc_dynpro using 'SAPMV10A' '0300'.
perform bdc_field using 'MV10A-KDMAT'
IT_CUSTOMER-KDMAT.
perform bdc_field using 'MV10A-LPRIO'
IT_CUSTOMER-LPRIO.
perform bdc_field using 'MV10A-ANTLF'
IT_CUSTOMER-ANTLF.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/EBACK'.
at end of kunnr.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
CALL TRANSACTION 'VD51' USING IT_BDC MODE 'A' UPDATE 'S'
MESSAGES INTO IT_MESSAGES.
CLEAR IT_BDC.
REFRESH IT_BDC.
ENDAT.
IF NOT IT_MESSAGES[] IS INITIAL.
PERFORM FORMAT_MESSAGE.
ENDIF.
ENDLOOP.
ENDFORM. " POPULATE_BDC
*& Form bdc_dynpro
text
-->P_0273 text
-->P_0274 text
FORM bdc_dynpro USING VALUE(P_0273)
VALUE(P_0274).
IT_BDC-PROGRAM = P_0273.
IT_BDC-DYNPRO = P_0274.
IT_BDC-DYNBEGIN = 'X'.
APPEND IT_BDC.
CLEAR IT_BDC.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
-->P_0278 text
-->P_RECORD_KUNNR_001 text
FORM bdc_field USING VALUE(P_0278)
VALUE(P_0279).
IT_BDC-FNAM = P_0278.
IT_BDC-FVAL = P_0279.
APPEND IT_BDC.
CLEAR IT_BDC.
ENDFORM. " bdc_field
*& Form FORMAT_MESSAGE
text
--> p1 text
<-- p2 text
FORM FORMAT_MESSAGE.
DATA: L_MSG(100).
LOOP AT IT_MESSAGES.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = IT_MESSAGES-MSGID
LANG = SY-LANGU
NO = IT_MESSAGES-MSGNR
V1 = IT_MESSAGES-MSGV1
V2 = IT_MESSAGES-MSGV2
V3 = IT_MESSAGES-MSGV3
V4 = IT_MESSAGES-MSGV4
IMPORTING
MSG = L_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write:/ l_msg.
ENDLOOP.
ENDFORM. " FORMAT_MESSAGE
reward if helpful,
keerthi -
Creation of PGI using BDC for tc VL02N is not happening..
Hi All,
i need to do Post Goods Issue (PGI) thro' BDC and after that i need to update the flag in Ztable.
its giving Success message and updating the database also.
but its not issuing the PGI.and further i want to create billing doc.So its compulsory to me to post PGI.
if i look into the BDCMSGCOLL structure its giving "NO BATCH INPUT DATA FOR SCREEN"? why this is happening?
please let me know immediately....
REFRESH: tt_bdcmsgcoll .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_created-document_numb
IMPORTING
output = wa_created-document_numb.
REFRESH tt_bdcdata.
PERFORM bdc_dynpro USING text-001 text-002.
PERFORM bdc_field USING text-008
text-014.
PERFORM bdc_field USING text-009
text-011.
PERFORM bdc_field USING text-014
wa_created-document_numb.
PERFORM bdc_dynpro USING text-001 text-003.
PERFORM bdc_field USING text-009
text-036.
PERFORM bdc_field USING text-025
sy-datum.
PERFORM bdc_field USING text-008
text-035.
PERFORM bdc_field USING text-037
sy-datum.
PERFORM bdc_field USING text-038
text-029.
PERFORM bdc_field USING text-016
c_x.
CALL TRANSACTION c_t_del USING tt_bdcdata
MODE c_m
UPDATE c_u
MESSAGES INTO tt_bdcmsgcoll .
SORT tt_bdcmsgcoll BY msgtyp.
READ TABLE tt_bdcmsgcoll INTO wa_bdcmsgcoll WITH KEY msgtyp = c_e.
IF sy-subrc EQ 0.
LOOP AT tt_bdcmsgcoll INTO wa_bdcmsgcoll WHERE msgtyp = c_e.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = wa_bdcmsgcoll-msgid
lang = text-010
no = wa_bdcmsgcoll-msgnr
v1 = wa_bdcmsgcoll-msgv1
v2 = wa_bdcmsgcoll-msgv2
v3 = wa_bdcmsgcoll-msgv3
v4 = wa_bdcmsgcoll-msgv4
IMPORTING
msg = v_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
WRITE :/ v_msg.
ENDLOOP.
ELSE.
MOVE : c_x TO wa_worklist-pgi_flag.
READ TABLE tt_epit INTO wa_epit WITH KEY epi_id = wa_worklist-epi_id epi_sr = wa_worklist-epi_sr.
IF sy-subrc EQ 0.
MODIFY tt_epit FROM wa_worklist TRANSPORTING pgi_flag WHERE epi_id = wa_worklist-epi_id AND epi_sr = wa_worklist-epi_sr.
ELSE.
APPEND wa_worklist TO tt_epit.
ENDIF.
wa_epit-pgi_flag = c_x.
MODIFY tt_epit FROM wa_epit TRANSPORTING pgi_flag WHERE epi_id = wa_worklist-epi_id AND del_no = wa_created-document_numb .
UPDATE zsd_dt_epit SET pgi_flag = 'X' WHERE epi_id = wa_worklist-epi_id AND del_no = wa_created-document_numb .
IF sy-subrc EQ 0.
ENDIF.
ENDIF.HI,
Please refer this
To perform Post goods issue
PERFORM OPEN_GROUP.
PERFORM BDC_DYNPRO USING 'SAPMV50A' '4004'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LIKP-VBELN'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=WABU_T'.
PERFORM BDC_FIELD USING 'LIKP-VBELN' DELIVERY.
'84000064'.
PERFORM BDC_TRANSACTION USING 'VL02N'.
PERFORM CLOSE_GROUP.
CLEAR : DELIVERY,
T_BSITEM,
T_BSICTL.
ENDIF.
ENDFORM. " DELIVERY -
Problem in creation of BDC for transaction phap_create
Hello Friends,
I am trying to create BDC for PHAP_CREATE.
When you run a transaction a pop up window appears to select the template id.
And in BDC it is selected by cursor position. So once selected, the value of template id cannot be changed.
I want this as a parameter.So that each time I run a BDC I will be able to create different types of Appraisal documents i.e with different template ids.
How to go about it???
Regards,
BhushanHi,
For selecting the id, while doing recording,
record with
CTRL + F ( Where u can give ur id) and proceed further.
Maybe you are looking for
-
How can i see, on which page my client commented in a shared PDF file via CC?
Hello, i want to use the share function of CC to share a multipage PDF document with my client. Everytime he comments this PDF, the comments are not shown on the single pages, they are shown in a summary for the whole file. It is really hard to find
-
Driver development for custom PCI card
Hi friends, I've a PCI card developed in-house. How to prepare a driver for the same in LabVIEW? Can I develop drivers in VISA? I don't have a manufacture id. Is there any other method to develop a driver for PCI card? Once developed, can I use them
-
How secure is the default web services?
Just curious how secure the default web services configuration is. Would mod_security need to be installed? The server would only host 2 sites but I am concerned about basic security.
-
Installing Enterprise Linux Release 5 x86 (32 bit) for Oracle eBusiness
Hi: Where do I get installation instruction to install Oracle eBusiness Suite on Linux? Please help Ali
-
Elements 8 on iMac running 10.6.8
I'm running OS 10.6.8 on an iMac. I have Elements 8 loaded and running. Now when I went to open the program, I got a message suggesting that the program was incompatible with my system and that I might need to update or reinstall the program. So I tr