How to control the tab control using event structure?

Hi,
I am using tab control and event structure in the program.
When i run the application event is not happening for the active page.
When user switches from active page to the other page then event is taking place for all pages
So, how to get the event trigger for the active page when the application is started
For more clarification i am attaching the code "Test Control Tab using Event Structure.vi"
Attachments:
Test Control Tab using Event Structure.vi ‏52 KB

You have a basic misunderstanding of dataflow. Maybe you should start with some tutorials or study some of the examples that ship with LabVIEW.
The event structure belongs inside the while loop, and not vice versa. RIght now, the event structure only runs exactly once and never again.
If the stop is pressed first, the VI will stop. Game over.
If the tab control is changed (from any state to any other state!), the inner loop will spin forever as fast as the CPU allows, either executing one or the other case. It just reads the tab terminal to decide which case to execute. Changing tab never triggers any events. The VI is trapped inside the event until stop is pressed to stop the VI.
you were closer to a reasonable program in the other thread:
http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=287905
Have you tried execution highlighting? Maybe things would become more clear of you do.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Using Key down to control the Tab Control on the front panel

    Greetings everyone,
    Like the question ask how do i control the Tab control's tabs using the key down of the event structure...I dont want to use any of the fuctions keys..i have seem a lot of other sample like the one that i have attached it can only alternate between page 1 and page 2 what if i have a lot of pages and i want to use key down function to switch across the pages.
    Attachments:
    Tab_switch.vi ‏28 KB

    Try something like the attached modification.Message Edited by altenbach on 03-13-2005 04:04 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Tab_switchDOWN.vi ‏32 KB

  • How to determine the execution order of event structure

    Hi everyone,
    I have an event structure were it contains four events. All the four events has separate buttons to execute. Here, three events will generate numeric output, remaining one event (Finder) should find the order of those three events. For example, Three events namely A, B and C. I execute the events in the order of B, C and A. The finder event should find the order of previously executed events(B, C and A). 
    Thanks in advance.
    Solved!
    Go to Solution.

    Hello Vij@y,
    I could not look in to your VI because I dont have LabVIEW 2013 (I have 2010) but i tried to understand the situation you are explaining.
    Please find attached image of front panel I made for your reference.
    Here I generated two events sequently, no 3 first followed by no 1 and the same is displayed in sequence array. now you can use the build array function to actually add each event to this array as explained by many people in this forum.
    regarding the timeout event, either you can display the sequencer array in that event or you can display it in finder event and then you can reset the sequencer in finder event (I used reset button click event to reset sequencer back to zero value)
    regarding getting zero when you press finder/reset button before triggring any other event:- Is it not correct to have empty array when you have not trigger any event?
    I hope I put it well and may help you to find solution. 
    With Regards
    Miraz
    Kudos is better option to thank somebody on this forum
    Attachments:
    Sequence.png ‏70 KB

  • How to change the name of the tab control window?

    Dear all,
    Is there any way to change the name of the tab control page programatically?
    Thanks,
    Ritesh

    Hi Ritesh,
    yes it´s possible, see this link.
    Mike

  • Feedback from the Tab Control

    I have 3 tabs, and each one runs a sequence, in a case associated with the tab control. When I start my program, the sequence found in the active tab (case) runs. I have put 3 Stop buttons (one per tab) to stop each of cases (actually to stop a loop there). After stopping a sequence on a tab, I can press on another tab and change this way the running sequence.
    Now, I'd like to stop any running sequence in a tab's case by just pressing on another tab and this way starting the sequence associated with that tab. This would eliminate the Stop buttons. But how to do it, because just the selection of another tab with the operating tool neither triggers an event nor launches the case associated with that tab?
    I use LabView 6.1 under Win2K. TIA.

    In each of the loops that you monitor the stop buttons, inspect the local value of the tab control and compare it for changed value or the value of your specific case. In either case the logic is the same as your stop button. While( !StopButton AND !TabChanged)
    Stu
    Stu McFarlane
    Viewpoint Systems, Inc.

  • Can you print all the tab control's contents and include the tabs?

    We are trying to generate a report that includes the contents of a tab control (graphs, text).  Using the Append Control Image to Report.vi, we are only able to print out the active tab and the tab is cut off of the image. How can we generate reports that include all the tab pages and their contents and include the labeling tabs?
    Thanks in advance.
    Jim

    I do have a workaround for makinging the prints but it looks like some sort of cropped screensave that cuts off the tabs.  In my sample I was printing out 3 of the tab controls and you can see there are three by the cut off tabs.  Is there a setting to allow for more of the graph and its surroundings to be "captured"?
    Attachments:
    Document.pdf ‏53 KB
    Document (2).pdf ‏51 KB
    Document (3) (2).pdf ‏58 KB

  • How do i set tab control page size programmatically?

    Hi,
    I have a tab control in my program and each page has different amounts of controls on it. I would like to know how I can make the tab control pages resize automatically, only to fit the controls on the page and not have extra space underneath that other pages require.

    romulus wrote in message news:<[email protected]>...
    > Hi,
    >
    > I have a tab control in my program and each page has different amounts
    > of controls on it. I would like to know how I can make the tab control
    > pages resize automatically, only to fit the controls on the page and
    > not have extra space underneath that other pages require.
    You can use the tab control property 'PaneDimension' to
    programatically change the size of the tab control. To
    programatically find the areas occupied by the controls on each page:
    Use the 'Pages' property of the tab control to get a reference to the
    desired page; wire that to a property node and select the
    'ControlsOnPage[]' property; iterate through all the control
    refere
    nces, getting the position and bounds of each control, using
    'Max & Min' and shift registers to find the extent occupied by the
    controls.
    Paul Cardinale

  • How to pass the input control

    Hi, how to pass the input control from  1 report to another report please reply me ...

    HI Stefen,
    That feature is not yet provided .
    But you can achieve if you ahve that kind of requirement using the reportfilter summary options.
    please check if it can help you
    User input control for more than one tab in webI

  • Why does Waveform Chart Initalized by Property nodes behave erratically when hidden such as by the Tab Control?

    I am using wave form Chart on a tab control. The problem is that the chart works fine when it is showing. I can stop the data and reset the chart history successfully. The Fun begins when I go to say Page 2 of Tab control ( The wave form Chart is on Page 1). If I now try to initilize my chart with offset, multiplier, min and max rage values - The chart assumes values on the X scale which are arbitrary. I can see this when I go back to Page 1.!!
    But If Page 1 were showing and I did the same Operation The chart behaves as I expect it too.
    Can this behaviour be explained? How do I resolve this Problem? Also I have Observed that from time to time the Sca
    ling on X Axis may also change when the Chart is Hidden by the tab control. I have not been able to identify the reason for this, It is totally random.
    Good Luck!
    Mache
    Attachments:
    Time_Tab.vi ‏50 KB

    I did a similar workaround ...
    Everytime I Toggle the Run Button, I am making sure the active Tab is the one with Waveform Chart. This way the waveform Initializes fine. Then I try to Switch the active tab back to its One Previous Value, programatically - So that the user may have somewhat seamless interaction.
    There is one hitch however - The waveform Chart needs some time to initialize and my data stream is also coming at every second. So if I switch Immediately to some other tab, Sometimes I am successful, Sometimes I am not. Again this depends om System Speed and such. If I update the Tab Control at the next iteration, it is very irritating visually. So I left the Tab control at the waveform chart after reset. If the User wants they can switch it Bac
    k.
    Of Course the best thing to do is don't Reset. Referred the problem to NI Apps. They said it will be fixed in the next version.
    Well! Got to make enough money without resetting so that we can buy the new Version, which will reset!! Ciao! And Thanks for your answer.
    Regards,
    Mache
    Good Luck!
    Mache

  • How to run the two events at the same time by using event structure

    In my project, I have to run two stepper motor which can run both forward and reverse direction by changing the control in front panel so I am using event structure. In front panel I gave two separate controls for both stepper motor such as forward,reverse and stop. I would like to do motor1 will rotate alone, motor2 will rotate alone and both motor will rotate at the same time when user click the control in front panel. My doubt is how to run a motor2 while motor1 is running at the same time please tell me the suggestion for this problem
    Attachments:
    motor.png ‏192 KB

    How do you control your motors?
    Most motion control systems do supply two modes:
    a) position based motion: The motion axis has a positioning system (most often some kind of encoder system) which enables the motion control to know where the axis is currently located. Passing the target location to the controller will result in the axis to move to that location. This is, for most applications, the recommended approach. It does require some sort of motion controller device.
    b) direction based motion: This essentially tells the periphery device for the motor to move at a certain speed into a certain direction. As it does not stop at a dedicated location, it induces great risks for many applications if there are no kill- and/or end-switches. Depending on the setup, this can be either done with motion controllers or pure by software control (e.g. "controlling" the voltage level for the motor).
    If you go for a), there is not much preventing parallelism as you request.
    Option b) depends on the setup. If you have a control loop in the software itself, you have to move to an architecture like the producer/consumer. Please note that this does not incorporate any security measures for the external devices.
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Data Origin Types not filled in the tab "Control Data" of BP interface

    Hello experts,
    I have loaded the clients from ECC6.0 to CRM 4.0.
    Before I have loaded the clients I have maintained the data origin type for the BP in spro -> cross application components -> SAP Business Partner -> Business partner -> Basic settings -> Data Origin -> Maintain Data Origin Type.
    After I have done the load initial of clients, the field  "Data Origin" is empty in  the tab "Control Data" in BP interface. If I do F4 in the field appear the configuration that I did in spro appear.
    For this field will appear filled I'll need to do more configurations in spro?
    Best regards,
    Mary

    Hi Mary,
    The middleware does not fill this field in BP master data. You can maintain data origin type in SPRO, however the mBdoc does not use this customizing in order to fill this field.
    Please try to use the BADI CRM_DATAEXCHG_BADI in order to fill this field during master data download.
    It hope it helps.
    Regards,
    Gabriel Santana

  • When I resize the font for the Page Labels on the tab control in LabVIEW 7, the Increment/Decrement size gets messed up. Is there a solution to this problem or is this a bug?

    I have noticed in LabVIEW 7.0 and 7.1 that when the text in the page labels display is enlarged, that the arrows enlarge but the top arrow enlarges more then the small arrow but then when you decrease the text size, the arrows stay remain large. This is not a problem in 6.1 because the arrows aren't available. Is there a work around for this bug or do I have to use small text for these page label arrows to look right?

    I must admit that I've never used the page labels display and it does look like a bug. You can fix it however. Select the tab control and choose Advanced>Customize. In the control editor, select the page label control and do the same thing. You should be in the control editor for the numeric control and then you can go to edit mode and enlarge the decrement arrow to make it the same size as the increment.

  • Can I Control the Pulse offset using the Counter Out?

    Hello Everyone.
    I am trying to generate the Pulse as below;
    I have seen and understood an example to generate a pulse waveform "GenDigPulseTrain_Continuous".
    However, I can not control the offset of the pulse train.
    Although the function gives me "initial delay(The amount of time in seconds to wait before generating the first pulse)",
    I can not shift "t_dead" cycle.
    /*01.Frequency Control*/
     // The units to use to define pulse frequency.
      m_pTaskWrite->COChannels.CreatePulseChannelFrequ​ency(vecstrings[0]/*LPCTSTR counter*/,
       "PWM_C0_CH_HIGH"/*LPCTSTR nameToAssignChannel*/,
       DAQmxCOPulseFrequencyUnitsHertz,
       DAQmxCOPulseIdleStateHigh,
       dDeadTime, 
       m_nFncFrequency/*frequency*/,
       prDuty.second/*dutyCycle*/);
      // The units to use to define pulse frequency.
       m_pTaskWrite->COChannels.CreatePulseChannelFreque​ncy(vecstrings[1]/*LPCTSTR counter*/,
        "PWM_C0_CH_LOW"/*LPCTSTR nameToAssignChannel*/,
        DAQmxCOPulseFrequencyUnitsHertz,
        DAQmxCOPulseIdleStateLow,
        dDeadTime/**2 + (prDuty.second *dCycleTime)*/, 
        m_nFncFrequency/*frequency*/,
        prDuty.second/*dutyCycle*/);
    Please let me know how I solve this problem.
    Thank you

    Dear Zl,
    Counting pulses is much easier with the FP-QUAD-510 or FP-CTR-500, but can be done with the FP-AI-110.  You can't directly count the pulses with a FP-AI-110, but you can do it in software. Bring in the data by doing a normal read. Then, using shift registers, if the previous voltage is less than .8V (low) and the current voltage is more than 2.5 (high), increase the pulse count. I have attached a program that shows what to do with the data once you bring it in. I took the data from an array outside the while loop, but your data will be brought in one point at a time inside the while loop. One thing to take note of, since Fieldpoint brings in data at 1 kS/s, this will only work with pulses slower than 500 Hz. The farther the duty cycle is away from 50% duty cycle, the slower the signal must be in order to catch the pulses correctly. Please let me know if you have any questions. Have a great day!
    Sincerely,
    Marni
    PS- Please only post question once.
    Attachments:
    pulsecount.vi ‏22 KB

  • How to refresh the table control on some action

    Hi All,
         In a web Dynpro application, I am filling data to the Table control through Supply function. When  I do some action (like save new record )  i want to refresh the table control means add the newly added record.
       How to refresh the Table control.
    Thanks
    Hemalatha

    hi hema........
        if you are using a select query inside the supply function...
        then...
        you can just use node->invalidate(). method..
        it just invalidates the node that is bound to the table.
       so the supply function will be called again, which again uses the select query to fetch the values.. so that your table gets refreshed.
    ---regards,
       alex b justin

  • How to clear the table control content

    Hi All,
    I am doing BDC for cost estimate change. In this the transaction KKPB contains table control. So when ever i process with particular cost estimate, i need to fill the table control with the values. Here when i am doing the BDC for change, i need to clear all the contents of the table control then i need to fill with new entries.
    So my problems is how to clear the table control entriee?? please help me in this??
    Many Thanks,
    Raghu.

    Hi this might help u.
    Check the below link.
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    THis is example to upload the Bank details of the Vendor which has the TC.
    REPORT zprataptable2
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    DATA : BEGIN OF itab OCCURS 0,
            i1 TYPE i,
            lifnr LIKE   rf02k-lifnr,
            bukrs LIKE   rf02k-bukrs,
            ekorg LIKE   rf02k-ekorg,
            ktokk LIKE   rf02k-ktokk,
            anred LIKE lfa1-anred,
            name1 LIKE lfa1-name1,
            sortl LIKE lfa1-sortl,
            land1 LIKE lfa1-land1,
            akont LIKE lfb1-akont,
            fdgrv LIKE lfb1-fdgrv,
             waers LIKE lfm1-waers,
            END OF itab.
    DATA : BEGIN OF jtab OCCURS 0,
            j1 TYPE i,
            banks LIKE lfbk-banks,
            bankl LIKE lfbk-bankl,
            bankn LIKE lfbk-bankn,
             END OF jtab.
    DATA : cnt(4) TYPE n.
    DATA : fdt(20) TYPE c.
    DATA : c TYPE i.
    INCLUDE bdcrecx1.
    START-OF-SELECTION.
      CALL FUNCTION 'WS_UPLOAD'
        EXPORTING
          filename = 'C:\first1.txt'
          filetype = 'DAT'
        TABLES
          data_tab = itab.
      CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         filename                      = 'C:\second.txt'
         filetype                      = 'DAT'
        TABLES
          data_tab                      = jtab.
      LOOP AT itab.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF02K-KTOKK'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RF02K-LIFNR'
                                      itab-lifnr.
        PERFORM bdc_field       USING 'RF02K-BUKRS'
                                      itab-bukrs.
        PERFORM bdc_field       USING 'RF02K-EKORG'
                                       itab-ekorg.
        PERFORM bdc_field       USING 'RF02K-KTOKK'
                                       itab-ktokk.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0110'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFA1-LAND1'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'LFA1-ANRED'
                                      itab-anred.
        PERFORM bdc_field       USING 'LFA1-NAME1'
                                      itab-name1.
        PERFORM bdc_field       USING 'LFA1-SORTL'
                                      itab-sortl.
        PERFORM bdc_field       USING 'LFA1-LAND1'
                                      itab-land1.
        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-BANKN(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        cnt = 0.
        LOOP AT jtab WHERE j1 = itab-i1.
          cnt = cnt + 1.
          CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
          PERFORM bdc_field  USING fdt jtab-banks.
          CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
          PERFORM bdc_field USING fdt jtab-bankl.
          CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
          PERFORM bdc_field   USING fdt jtab-bankn.
          IF cnt = 5.
            cnt = 0.
            PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'LFBK-BANKS(01)'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=P+'.
            PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'LFBK-BANKN(02)'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=ENTR'.
          ENDIF.
        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'
                                      itab-akont.
        PERFORM bdc_field       USING 'LFB1-FDGRV'
                                      itab-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'
                                      itab-waers.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0320'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF02K-LIFNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM bdc_dynpro      USING 'SAPLSPO1' '0300'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=YES'.
        PERFORM bdc_transaction USING 'XK01'.
      ENDLOOP.
      PERFORM close_group.
    Header file:
    1     63190      0001     0001     0001     mr     bal188     b     in     31000     a1     inr
    2     63191      0001     0001     0001     mr     bal189     b     in     31000     a1     inr
    TC file:
    1     in     sb     11000
    1     in     sb     12000
    1     in     sb     13000
    1     in     sb     14000
    1     in     sb     15000
    1     in     sb     16000
    1     in     sb     17000
    1     in     sb     18000
    1     in     sb     19000
    1     in     sb     20000
    1     in     sb     21000
    1     in     sb     22000
    2     in     sb     21000
    2     in     sb     22000
    REPORT zmm_pr_upload_mat
           NO STANDARD PAGE HEADING
           LINE-SIZE 255.
    Standard Include for Selection Screen
    INCLUDE bdcrecx1.
    Internal Table for Upload Data
    DATA: BEGIN OF i_pr OCCURS 0,
    Header Screen
            sno(3),               " SNo
            bsart(004),           " PR Type
            epstp(001),           " Item Category
            knttp(001),           " Account Assignment
            eeind(010),           " Delivery Date
           lpein(001),          " Category of Del Date
            werks(004),           " Plant
            lgort(004),           " Storage Location
            ekgrp(003),           " Purchasing Group
            matkl(009),           " Material Group
            bednr(010),           " Tracking No
            afnam(012),            " Requisitioner
    Item Details
            matnr(018),           " Material No
            menge(017),           " Quantity
           badat(010),
           frgdt(010),
            preis(014),           " Valuation Price
           waers(005),           " Currency
           peinh(005),
           wepos(001),
           repos(001),
            sakto(010),           " GL Account
            kostl(010),           " Cost Center
           bnfpo(005),
          END OF i_pr.
    Internal Table for header Data
    DATA: BEGIN OF it_header OCCURS 0,
            sno(3),               " SNo
            bsart(004),           " PR Type
            epstp(001),           " Item Category
            knttp(001),           " Account Assignment
            eeind(010),           " Delivery Date
            werks(004),           " Plant
            lgort(004),           " Storage Location
            ekgrp(003),           " Purchasing Group
            matkl(009),           " Material Group
            bednr(010),           " Tracking No
            afnam(012),            " Requisitioner
          END OF it_header.
    Internal Table for Item Data
    DATA: BEGIN OF it_item OCCURS 0,
            sno(3),               " SNo
            matnr(018),           " Material No
            menge(017),           " Quantity
            preis(014),           " Valuation Price
            sakto(010),           " GL Account
            kostl(010),           " Cost Center
          END OF it_item.
    Data Variables & Constants
    CONSTANTS : c_x             VALUE 'X'.  " Flag
    DATA : v_l(2),                          " Counter
           v_rowno(5),                      " Row No
           v_2(2),                          " Counter
           v_rows LIKE sy-srows,            " Rows in TC
           v_field(45).                     " String
    Parameters
    PARAMETERS: p_file LIKE ibipparms-path.  " Filename
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Start of Selection
    START-OF-SELECTION.
    Open the BDC Session
      PERFORM open_group.
    Upload the File into internal Table
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = i_pr
        EXCEPTIONS
          conversion_error        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          OTHERS                  = 7.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      SORT i_pr BY sno.
      LOOP AT i_pr.
        MOVE-CORRESPONDING i_pr TO it_item.
        APPEND it_item.
        CLEAR it_item.
        AT END OF sno.
          READ TABLE i_pr INDEX sy-tabix.
          MOVE-CORRESPONDING i_pr TO it_header.
          APPEND it_header.
          CLEAR it_header.
        ENDAT.
      ENDLOOP.
      SORT it_header BY sno.
      SORT it_item BY sno.
      v_rows = sy-srows - 6.
    Upload the Data from Internal Table
      LOOP AT it_header.
    Header Data
        PERFORM bdc_dynpro      USING 'SAPMM06B' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'EBAN-BEDNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'EBAN-BSART'
                                      it_header-bsart.
        PERFORM bdc_field       USING 'RM06B-EPSTP'
                                      it_header-epstp.
        PERFORM bdc_field       USING 'EBAN-KNTTP'
                                      it_header-knttp.
        PERFORM bdc_field       USING 'RM06B-EEIND'
                                      it_header-eeind.
       PERFORM bdc_field       USING 'RM06B-LPEIN'
                                     it_header-lpein.
        PERFORM bdc_field       USING 'EBAN-WERKS'
                                      it_header-werks.
        PERFORM bdc_field       USING 'EBAN-LGORT'
                                      it_header-lgort.
        PERFORM bdc_field       USING 'EBAN-EKGRP'
                                      it_header-ekgrp.
        PERFORM bdc_field       USING 'EBAN-MATKL'
                                      it_header-matkl.
        PERFORM bdc_field       USING 'EBAN-BEDNR'
                                      it_header-bednr.
        PERFORM bdc_field       USING 'EBAN-AFNAM'
                                      it_header-afnam.
    Item Details
        v_l = 0.
    To add no. of rows
        v_2 = 0 .
    As the screen is showing 13 rows defaulted to 130
        v_rowno = 130 .
        LOOP AT it_item WHERE sno = it_header-sno.
          v_l = v_l + 1.
          IF v_l = 14 .
            IF v_2 = 12 .
              v_2 = 12 .
              v_l = 2 .
    From second time onwards it is displaying 12 rows only
              v_rowno = v_rowno + 120 .
              PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
              PERFORM bdc_field       USING 'BDC_CURSOR'
                                            'RM06B-BNFPO'.
              PERFORM bdc_field       USING 'RM06B-BNFPO'
                                            v_rowno.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                            '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                '/00'.
            ELSE.
    V_2 initialized to 12 for second screen purpose
              v_2 = 12 .
              v_l = 2 .
              PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
              PERFORM bdc_field       USING 'BDC_CURSOR'
                                            'RM06B-BNFPO'.
              PERFORM bdc_field       USING 'RM06B-BNFPO'
                                            v_rowno .
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                            '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                '/00'.
            ENDIF.
          ENDIF.
          PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          CLEAR v_field.
          CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
          PERFORM bdc_field   USING v_field it_item-matnr.
          CLEAR v_field.
          CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
          PERFORM bdc_field   USING v_field it_item-menge.
          PERFORM bdc_dynpro      USING 'SAPMM06B' '0102'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'EBAN-PREIS'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'EBAN-PREIS'
                                      it_item-preis.
          PERFORM bdc_dynpro      USING 'SAPMM06B' '0505'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'EBKN-SAKTO'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTE'.
          PERFORM bdc_field       USING 'EBKN-SAKTO'
                                      it_item-sakto.
    Cost Center
          PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'COBL-KOSTL'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTE'.
          PERFORM bdc_field       USING 'COBL-KOSTL'
                                        it_item-kostl.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTE'.
        ENDLOOP.
        PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RM06B-BNFPO'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BU'.
    Call The Transaction
        PERFORM bdc_transaction USING 'ME51'.
      ENDLOOP.
    Close the BDC Session
      PERFORM close_group.
    with regards,
    Hema Sundara.

Maybe you are looking for

  • Business Simulations to demonstrate benefits of ERP? MIT's Beer Game +

    Do you know of some good, relatively inexpensive business simulations to demonstrate the benefits of end-to-end Enterprise Resource Planning (ERP)? I'm looking for something like: 1) MIT's Beer game  - http://web.mit.edu/jsterman/www/SDG/beergame.htm

  • Manual Check Deposit

    I have done with all settings of Bank Accounting; Created House Bank Created Check Deposit Account Crated Account Symbols and assigned GL accounts Created Keys and defined Posting Rules Created and Assigned Business Transactions Defined Variant for M

  • HOW CAN I PUT THE AMOUNT WITH THE SIGN OF DOLLAR?

    HI! HOW CAN I PUT THE AMOUNT WITH THE SIGN OF DOLLAR? BECAUSE WHEN I WRITE THE DATA THE AMOUNT OVERWRITE THE SIGN. THANKS PEOPLE

  • ADF SelectOneChoice List Question

    I posted the following message in the Toplink forum and they have suggested I try over here: Toplink Essentials List Question ================== I am new to Toplink Essentials. I am using Toplink Essentials inside of JDeveloper 11g, against Oracle Ex

  • Adding and Removing Components to/from a jPanel

    Hello, I am searching for a way to have a jButton create a remove and create some jComboBoxes, jLabels, and jButtons. I don't know how I could do this. I have some screenshots from NetBeans IDE to help illustrate my problem. I want the Add Shift butt