Hi All, Pls send me the recording for va01 by handling table control

Hi All, Pls send me the recording for va01 by handling table control with 3 or more materials. Pls send me a flat file and code ASAP.
Thanks&regards.
Bharat

Here is a example of similar kind ..plz go through this doc..it will be help hul 4 u
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.
Reward if helpful

Similar Messages

  • Pls send me the link for online DMS study material

    Regards
    surya

    Hi Surya
    Here is the link where you can refer the SAP DMS online help
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/c1/1c31a243c711d1893e0000e8323c4f/frameset.htm
    with regards
    Mangesh

  • How to handle table control in lsmw recording method

    hi expert please tell me the procedure for how to handle table control in lsmw recording method
    Locked for same reason as how to upload data for me01 using LSMW BDC METHOD
    Edited by: Matt on May 9, 2011 8:52 AM

    Sri,
    just search in SDN search box by giving table control in lsmw you will get hell lot of threads for same.
    Amit.

  • TS3694 hi. friends i want details about itunes download for 4s version 5.0.1... where i download itunes pls send me the link frinds

    hi. friends i want details about itunes download for 4s version 5.0.1... where i download itunes pls send me the link frinds

    You can download iTunes for your computer from here : www.apple.com/itunes/download
    If you want to update your iPhone to iOS 5.1.1 (you can only update to that version as that is only version that is 'signed' by Apple), then if you are on iOS 5+ already on your phone then you can update directly on the iPhone via Settings > General > Software Update.
    If you are on iOS 4 (or you can do it this way if you are on iOS 5) then you will need to update via your computer's iTunes (you will need the latest version of iTunes installed on your computer).
    Updating to iOS 5+ : http://support.apple.com/kb/HT4972

  • I want to learn SD , Could you pls send me the Reference Book names.

    Hi All,
    I want to learn SD , Could you pls send me the Reference Book names.
    and i heard about materials like Billing , Pricing , Shipping - Which material should i study first to understand baisc flow.
    Thanks in Advance.
    Regards,
    Nithi.

    Hi ,
    Instaed of a book i will refer you the help files of SAP .
    You can get there files at http://help.sap.com/
    An for SD the link is http://help.sap.com/saphelp_47x200/helpdata/en/92/df293581dc1f79e10000009b38f889/frameset.htm
    These files will help you a lot .
    even today also SD gurus take help from these files only.
    Regards

  • Hi pls send me the ppts and documenation to understand MM

    Hi
    i am an abaper i want to know about mm
    pls send me the ppts and documenation to understand MM

    Hi,
    MM Cycle:
    Purchase Requisition-> STaff in an orgn places Pur requisition for want of some goods/products - ME51
    Request for Quotation(RFQ)-> The Purchase dept in the orgn calls/requests for the quotation for the products against which PR was raised. - ME41
    Vendor Evaluation->After receving the RFQ's, after comparison a Vendor is finalised based on the terms and conditions.
    Purchase Order(PO)-> Pur order was issued to that vendor asking him to supply the goods/products -ME21N
    Goods Receipt Note(GRN)->Vendor supplies the material/Products to the orgn-
    MB01
    Goods Issue (GI) -> People receives their respective itesm for which they have placed the Requisitions
    Invoice Verification-> ALong with the Material Vendor submits a Invoice for which the Company Pays the amount - .MIRO
    Data to FI -> data will be posted to FI as per the vendor invoices
    you better go through all these links u will get all the info what ever u need
    for mm
    http://www.sapgenie.com/abap/tables_mm.htm
    http://www.sap-img.com/sap-download/sap-tables.zip
    http://www.allsaplinks.com/material_management.html
    http://www.training-classes.com/course_hierarchy/courses/2614_SAP_R_3_MM_Invoice_Verification_-_Rel_4_x.php
    http://www.sapfriends.com/sapstuff.html
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSMAT/PSMAT.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CAARCMM/CAARCMM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MYSAP/SR_MM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LOMDMM/LOMDMM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMMM/BCBMTWFMMM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MMIVMVAL/MMIVMVAL.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MMWMLVS/MMWMLVS.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MMISVE/MMISVE.pdf
    <b>Reward Points for helpful answers</b>,
    Satish

  • Hi , PLS Send me the ecc 6.0 intalation steps

    Hi , PLS Send me the ecc 6.0 intalation steps with screen shots.
          pls send me any one as soon as possible.
      my id is  vksaini at gmail. com
    any kind of help is highly appricated.

    Vikas - I assume you want installation steps for the preview installation?
    The installation steps are delivered with the downloaded installation files. Check the documentation directory.

  • Send back the report for revision in BPF

    Hi all,
    I have a scenario to create BPF
    1.I have one report and user 1 make changes to that report and submit to BPC
    2.i have a manager who have two options either to send back the report for revision or to approve it.
    How can i proceed wit the second step?
    Thanks in advance
    Regards,
    Anila
    Edited by: Anila Mohan on Apr 6, 2009 1:02 PM
    Edited by: Anila Mohan on Apr 6, 2009 1:05 PM

    Hi Anila,
    You define work status according to scenario and use BPC-Excel: E-submit- Cahnge work status Settings to modify your data work status.
    Try this option it will work.
    Regards
    Naveen.KV

  • Can you pls send me the link to down load JDeveloper version 10.1.2

    Dear All,
    can you pls send me the link to down load JDeveloper version 10.1.2
    Regards,
    Prasanth.

    Hi,
    [http://www.oracle.com/technology/software/products/jdev/archives.html|http://www.oracle.com/technology/software/products/jdev/archives.html]
    Pedja

  • The PDFs I send to the customers for approval look too bright and clean! Help!!

    I working for a printing company that prints on Un coated White wove. The PDFs I send to the customers for approval look too bright and clean compaired to what is going to end up on press. How can I create a PDF the better represents the more dull look of un coated stock that they will end up with. Most of them are probably using Reader to view my pdfs.

    Hi Mike ,
    If you could request the customers to view PDF' on Acrobat and compare the outputs .
    Request the customer to change the default program viewer to Acrobat and see the results.
    You may also want to check the resolution on the both ends. i.e yours and the customer' end.
    Does all the customers get the same output ?
    Regards
    Sukrit Dhingra

  • After doing the recording for transaction fpcj, the values are not being se

    after doing the recording for transaction fpcj, the values are not being sent to the g/l.

    HI,
      When you are recording.. you might be creating the values... ensure that they are updated into the GL before u write program. I doubt you might have missed the save ..
    Thanks
    Mahesh

  • Pls give me the solution for this requirement

    Hi experts ,
    pls give me the solution for this requirement
    what we have to do when basis guys are tranported my object to the production without completting . how can we rectiify this .
    thanks in advance

    Hi
    After Transporting a request or released a request you cant do any thing in that so now you have to create a new Transport request for your report continue with that. After completion transport it . It will makes no difference it will just over write already existing report
    Reward alll helpfull answers
    Regards
    Pavan

  • Kindly send me the link for compaq c702tu audio driver

    Dear sir, please send me the procedure for installation of audio driver in compaq 702tu.

    Hi:
    Here is the link to the support and driver page for your notebook:
    http://h10025.www1.hp.com/ewfrf/wc/product?product=3540058&cc=us&dlc=en&lc=en&os=228&query=c702tu&sw...=
    If you need the XP audio driver, please read this downgrade guide below:
    http://h30434.www3.hp.com/t5/Notebook-Operating-systems-and/General-XP-Downgrade-Guide-for-HP-Laptop...
    The instructions to install the audio drivers can be found under the section labeled Moderate Models.
    Paul

  • When recording voiceovers, I click the stop recording button at the end, but I can't figure out how to get rid of the "click" sound before I send off the recording!

    When recording voiceovers, I click the stop recording button at the end, but I can't figure out how to get rid of the "click" sound before I send off the recording!

    njordan wrote:
    I can't figure out how to get rid of the "click" sound before I send off the recording!
    drag the BottomRight edge of the region to the left, past the unwanted sound

  • Plz, could anybody send me the driver for VF0010 webcam for xp 64 bit?

    Plz, could anybody send me the driver for VF000 webcam ? iam using xp 64 bit
    my email is [email protected]
    thanks in advance

    yeah exactly
    3000 N100-0768DKU
    XP Home 5.01.2600 SP2
    Ubuntu 8.04(hardy)

Maybe you are looking for