BDC table page down

I searched forum but did not get clear answer so posting.
I am working on a BDC. Screen has Table. How can I find out how many  rows there will be during BDC and when I need to do page down.
Thanks,
AP

Hi,
The system field SY-LOOPC Contains the total number of rows visible in the TC and SY-STEPL contains the row number of current row.
Then use P+ to page down p- for page up as the values of sy-ucomm
Hope this will serve your purpose.
Cheers
Ramchander Rao.K
Edited by: Ramchander Krishnamraju on Aug 13, 2009 6:41 AM

Similar Messages

  • Bdc MB02 page down after 7items

    I am doing the mb02 change
    I have 15 items for the  material document number1 and 5 items for material document nmber 2 etc and 13 items for material document 3, I have recorded the page down in shdb.
    In mbo2 only 7 items are there per page.
    Now i am looping at the finaltable.
    Now how to tell to the system that material doc1 is having 15 items , ie how to handle page down after 7th item for material doc1.
    For material doc 2 only 5items so we need to bypass page down , please tell how to handle this in this loop and endloop of bdc.
    Loop at itab.
    Pagedown logic please.
    call transaction tcode MB02.
    ENDLOOp.

    Hi,
    No need of page down.
    There is one option in EDIT-> POSITIOn CURSOR menu. It will ask for ITEM number. Whatever item number you have provided that will come in the first line.So reord only first line everytime.
    then you can select and chenage them. this will be easier instead of page down where you need to know when you have to page down.
    Regards,
    Shanmugavel chandrasekaran.

  • BDC(va02) page down condition

    hi all!
    i done bdc for va02.
    In this when i press page down (=p+)only 9 line item will display  and again press page down next  9 line item will be shown .(in my pgm 11 line items showing)
    Is it possible to give a spacific conditio for page down ? how ?
    thanks

    Hi,
    The system field SY-LOOPC Contains the total number of rows visible in the TC and SY-STEPL contains the row number of current row.
    Then use P+ to page down p- for page up as the values of sy-ucomm
    Hope this will serve your purpose.
    Cheers
    Ramchander Rao.K
    Edited by: Ramchander Krishnamraju on Aug 13, 2009 6:41 AM

  • Page down functionality in table control BDC-CJ02 tcode

    Hi Friends,
    I am doing a BDC with Table control for Tcode CJ02.
    When I reach certain number of records, say 13, the page down functionality doesnt work.I tried different ways like using the BDC_OKCODE as "=P" and "=P+".Also, I tried doing a recording by pressing the down key in the table contral, in SHDB, but none of them worked.
    Refered a post in SDN as well, but it doesnt hold any solution.
    Do throw some light on the same to achieve page down functionality for the bdc tcode CJ02.
    Thanks in advance.
    Shri.

    Hi,
    I already posted an answer to that here Re: BDC scroll down with OK_CODE '=P+':
    P+ (=P+ in the BDC) is not a universal function code, but only one which is defined in ABAP lists . So, 99% of time, it doesn't work for all others situations (like yours).
    Scrolling a table control is not so easy to do. When you record a page down on a table control in SHDB, you'll get probably a /00 which corresponds to Enter. When you play the recording, it won't scroll. The issue is that "page down" is processed in 2 parts, it changes the "top line" of the table control, and executes Enter. But it's not possible to record/play the "top line" information.
    The solution is that the program usually implements a function code:
    either "add new line"
    or "position at line"
    Sometimes, the function code is hidden so you must look at inside the program (or search SAP notes, like here: [SAP note 187946 (No positioning on PRT overview in routing)|https://service.sap.com/sap/support/notes/187946 ])
    And sometimes, there's no function code at all, and then you're stuck ! (or use SAP GUI scripting, but it may only work in dialog).
    For CJ02, I can't tell how to scroll through BDC, but anyway, there is a BAPI (don't remember the name, search the forum, it will be easy to find it), so you should always prefer them over BDC.
    Sandra

  • How do I identify OK Code in table control in BDC (scroll up/down)?

    Hi. I have read a lot of very good posts and articles here in the forums about how to work with table controls when writing a BDC program. Unfortunately I haven't found any that address the specific issue that I'm having.
    I'm writing a program to update the line items of a Parked Document using transaction FBV2. I want to be able to insert a row at the end of the previously existing rows regardless of how many there are and I can't seem to figure out the correct OK Codes to scroll up or down, or page up or down within the table control so I can guarantee that I will get to the next available row.
    For example. I have a Parked Document with 13 line items. I would like to insert the new line item as row 14. I know that 10 rows will be displayed at run time on this screen according to my settings in the BDC call and want to scroll down 1 time and then enter the new data on the 4th line on the new set of rows.
    Does anyone have any experience with this, or can someone point me in the right direction where I might find this information?
    Thanks in advance,
    Andy

    Hi
    In my system I can't run that trx, anyway there's any ok-code for the scrolling, you can have only the okcode for the page up/down buttons.
    So you should try to understand how many rows a page can have, so if a page have 10 rows per page and you need to change the row 22, it means you have to simulate to press the page down twice and change the second row of third page.
    If you run your BDC by CALL TRANSACTION u should use the option OPTIONS FROM opt, here you indicate to use the standard size of the dynpro. In this way the size of table control is not screen resolution dependent.
    TABLES CTU_PARAMS.
    CTU_PARAMS-DEFSIZE = 'X'.
    CALL TRANSACTION 'FBV1'  USING ITAB
                                                OPTIONS FROM CTU_PARAMS.
    Max

  • Page down not working for BDC

    Hi all,
    I have written a BDC to call transaction OASV. I have to fill a table control which has initial 10 lines in display. I will have more than 10 items to fill in the table control. But while recording through SHDB i dont get the recording for the page down. However I tried to write the code my self with the OK_CODE as =P++. Still it is not working. It is over writing the lines again when the next set is added. Pls guide me in this.
    Thanks and Regards,
    Anu.

    REPORT zbdc_fi_oasv
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    INCLUDE bdcrecx1.
    DATA : g_filename TYPE  string.
    DATA : BEGIN OF itab OCCURS 0,
           bldat(10) TYPE c,
           budat(10) TYPE c,
           monat(2) TYPE c,
           bukrs(4) TYPE c,
           blart(2) TYPE c,
           ldgrp(4) TYPE c,
           hkont(10) TYPE c,
           shkzg(1) TYPE c,
           dmbtr(13) TYPE c,
           prctr(10) TYPE c,
           END OF itab.
    DATA : BEGIN OF itab_tc OCCURS 0,
           bukrs(4) TYPE c,
           hkont(10) TYPE c,
           shkzg(1) TYPE c,
           dmbtr(13) TYPE c,
           prctr(10) TYPE c,
           END OF itab_tc.
    DATA : counter(2) TYPE n,
           counter1(5) TYPE n,
           ihkont(15) TYPE c,
           ishkzg(15) TYPE c,
           idmbtr(15) TYPE c,
           iprctr(15) TYPE c.
    PARAMETERS: p_fname LIKE rlgrap-filename OBLIGATORY.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_fname.
      g_filename = p_fname.
    START-OF-SELECTION.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = g_filename
          filetype            = 'ASC'
          has_field_separator = 'X'
        TABLES
          data_tab            = itab.
      LOOP AT itab.
        MOVE-CORRESPONDING itab TO itab_tc.
        APPEND itab_tc.
        CLEAR itab.
      ENDLOOP.
      PERFORM open_group.
      SORT itab.
      SORT itab_tc.
      DELETE ADJACENT DUPLICATES FROM itab COMPARING bukrs.
      LOOP AT itab.
        PERFORM bdc_dynpro      USING 'SAPMA03B' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RA01B-LDGRP'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RA01B-BLDAT' itab-bldat.
        " '01.04.2008'.
        PERFORM bdc_field       USING 'RA01B-BUDAT' itab-budat.
        " '01.04.2008'.
        PERFORM bdc_field       USING 'RA01B-MONAT' itab-monat.
                                                                " '1'.
        PERFORM bdc_field       USING 'RA01B-BUKRS' itab-bukrs.
                                                                " '1111'.
        PERFORM bdc_field       USING 'RA01B-BLART' itab-blart.
        " 'aa'.
        PERFORM bdc_field       USING 'RA01B-LDGRP' itab-ldgrp.
                                                                " '0L'.
        PERFORM bdc_dynpro      USING 'SAPMA03B' '0110'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RA01B-PRCTR(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_dynpro      USING 'SAPMA03B' '0110'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        counter = '01'.
        LOOP AT itab_tc WHERE bukrs EQ itab-bukrs.
          CONCATENATE 'RA01B-SHKZG(' counter ')' INTO ishkzg.
          PERFORM bdc_field       USING ishkzg itab_tc-shkzg.
          CONCATENATE 'RA01B-PRCTR(' counter ')' INTO iprctr.
          PERFORM bdc_field       USING iprctr itab_tc-prctr.
          CONCATENATE 'RA01B-HKONT(' counter ')' INTO ihkont.
          PERFORM bdc_field       USING ihkont
                                        itab_tc-hkont.
          CONCATENATE 'RA01B-DMBTR(' counter ')' INTO idmbtr.
          PERFORM bdc_field       USING idmbtr
                                        itab_tc-dmbtr.
          IF counter = '10'.
            PERFORM bdc_dynpro      USING 'SAPMA03B' '0110'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'RA01B-PRCTR(01)'.
            PERFORM bdc_field       USING 'BDC_OKCODE' '=P++'.
            CLEAR : counter.
          ENDIF.
          CLEAR : ishkzg, iprctr, ihkont, idmbtr.
          counter = counter + 1.
        ENDLOOP.
        PERFORM bdc_dynpro      USING 'SAPMA03B' '0110'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RA01B-HKONT(03)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=UPDA'.
        PERFORM bdc_transaction USING 'OASV'.
      ENDLOOP.
      PERFORM close_group.

  • BDC F-03 (page down loading problem)

    Sir,
      I'm trying BDC for tcode ( clear G/L account.). With following code  ..but I'm getting error
      on screen number 0731 while page down loading. Please help me ...
    REPORT  CLEAR_ITEM.
    TABLES :BKPF,RF05A.
    DATA : BEGIN OF RECORD OCCURS 0,
           index(001),
           AGKON(16),
           BUDAT(10),
           MONAT(2),
           BUKRS(4),
           WAERS(3),
           END OF RECORD.
    DATA : BEGIN OF RECORD1 OCCURS 0,
           index(002),
           SEL01 LIKE  RF05A-SEL01,
           END OF RECORD1.
    data dat like sy-datum.
    data ibdc like bdcdata occurs 0 with header line.
    dat = sy-datum - 1.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    *   CODEPAGE                     = ' '
       FILENAME                      = 'C:\'
       FILETYPE                      = 'DAT'
    *   ITEM                          = ' '
    *   FILEMASK_MASK                 = ' '
    *   FILEMASK_TEXT                 = ' '
    *   FILETYPE_NO_CHANGE            = ' '
    *   FILEMASK_ALL                  = ' '
    *   FILETYPE_NO_SHOW              = ' '
    *   LINE_EXIT                     = ' '
    *   USER_FORM                     = ' '
    *   USER_PROG                     = ' '
    *   SILENT                        = 'S'
    * IMPORTING
    *   FILESIZE                      =
    *   CANCEL                        =
    *   ACT_FILENAME                  =
    *   ACT_FILETYPE                  =
      TABLES
        DATA_TAB                      = RECORD.
    * 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.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    *   CODEPAGE                      = ' '
       FILENAME                      = 'C:\'
       FILETYPE                      = 'DAT'
    *   ITEM                          = ' '
    *   FILEMASK_MASK                 = ' '
    *   FILEMASK_TEXT                 = ' '
    *   FILETYPE_NO_CHANGE            = ' '
    *   FILEMASK_ALL                  = ' '
    *   FILETYPE_NO_SHOW              = ' '
    *   LINE_EXIT                     = ' '
    *   USER_FORM                     = ' '
    *   USER_PROG                     = ' '
    *   SILENT                        = 'S'
    * IMPORTING
    *   FILESIZE                      =
    *   CANCEL                        =
    *   ACT_FILENAME                  =
    *   ACT_FILETYPE                  =
      TABLES
        DATA_TAB                      = RECORD1.
    * 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.
    *start-of-selection.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
       CLIENT                    = SY-MANDT
    *   DEST                      = FILLER8
       GROUP                     = 'F-03'
       HOLDDATE                  = DAT
       KEEP                      = 'X'
       USER                      = SY-UNAME.
    *   RECORD                    = FILLER1
    *   PROG                      = SY-CPROG
    * IMPORTING
    *   QID                       =
    * EXCEPTIONS
    *   CLIENT_INVALID            = 1
    *   DESTINATION_INVALID       = 2
    *   GROUP_INVALID             = 3
    *   GROUP_IS_LOCKED           = 4
    *   HOLDDATE_INVALID          = 5
    *   INTERNAL_ERROR            = 6
    *   QUEUE_ERROR               = 7
    *   RUNNING                   = 8
    *   SYSTEM_LOCK_ERROR         = 9
    *   USER_INVALID              = 10
    *   OTHERS                    = 11
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    loop at record.
        perform mapping.
      CALL FUNCTION 'BDC_INSERT'
       EXPORTING
         TCODE                  = 'F-03'
    *     POST_LOCAL             = NOVBLOCAL
    *     PRINTING               = NOPRINT
    *     SIMUBATCH              = ' '
    *     CTUPARAMS              = ' '
        TABLES
          DYNPROTAB              = IBDC.
    *   EXCEPTIONS
    *     INTERNAL_ERROR         = 1
    *     NOT_OPEN               = 2
    *     QUEUE_ERROR            = 3
    *     TCODE_INVALID          = 4
    *     PRINTING_INVALID       = 5
    *     POSTING_INVALID        = 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.
    REFRESH IBDC.
    ENDLOOP.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    * EXCEPTIONS
    *   NOT_OPEN          = 1
    *   QUEUE_ERROR       = 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.
    form mapping.
    perform bdc_dynpro      using 'SAPMF05A' '0131'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-XPOS1(03)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF05A-AGKON'
                                  RECORD-AGKON.
    perform bdc_field       using 'BKPF-BUDAT'
                                  RECORD-BUDAT.
    perform bdc_field       using 'BKPF-MONAT'
                                  RECORD-MONAT.
    perform bdc_field       using 'BKPF-BUKRS'
                                  RECORD-BUKRS.
    perform bdc_field       using 'BKPF-WAERS'
                                  RECORD-WAERS.
    perform bdc_field       using 'RF05A-XPOS1(01)'
    perform bdc_field       using 'RF05A-XPOS1(03)'
                                  'X'.
    perform bdc_dynpro      using 'SAPMF05A' '0731'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-SEL01(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PA'.
    data : A(20) type c,
           IDX(2) TYPE C.
       ADD 1 TO IDX.
    LOOP AT RECORD1 WHERE INDEX = RECORD-index.
    IF IDX > 10 .
    perform bdc_dynpro      using 'SAPMF05A' '0731'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-SEL01(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=P+'.
      IDX = 1.
    ENDIF.
    CONCATENATE 'RF05A-SEL01(' IDX ')' INTO A.
    ibdc-fnam = A .
    IBDC-fval  =  RECORD1-SEL01.
    append ibdc.
    CLEAR IBDC.
    CLEAR A.
    IDX = IDX + 1.
    ENDLOOP.
    perform bdc_dynpro      using 'SAPDF05X' '3100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BS'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-ABPOS'.
    perform bdc_field       using 'RF05A-ABPOS'
                                  '1'.
    perform bdc_dynpro      using 'SAPMF05A' '0700'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWBS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    endform.
    *&      Form  bdc_dynpro
    *       text
    *      -->P_0137   text
    *      -->P_0138   text
    FORM bdc_dynpro using program type string screen type string.
    ibdc-program = program.
    ibdc-dynpro  = screen.
    ibdc-dynbegin = 'X'.
    append ibdc.
    clear ibdc.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
    *       text
    *      -->P_0142   text
    *      -->P_0143   text
    FORM bdc_field  USING  fname type string fvale.
    ibdc-fnam = fname.
    ibdc-fval = fvale.
    append ibdc.
    clear ibdc.
    ENDFORM.                    " bdc_field
    Thanking you..
    Manoj.

    Ramesh ,
    I'll advise you, not to use a bdc-programm for ta's like fb50 - What woud you do, when SAP in future changes the table control to an alv grid control ??
    So i advise you , to use Bapis or the standard interface
    <b>RFBIBL00</b> to post fi-documents.
    Andreas

  • BDC (F-04 ) No Page down

    Hi
    experts ..
    Iam doing a bdc for F-04 (post with clearing header date)
    i got a file in which the data is splited on business area wise,
    and when i enter the details on first screen
    with post key 40 and enter after entering the details here like
    busines area profit cenrter i have to click 
    process open item .
    here i have to select the doc.no and enter acct no and again
    have to process the open item .. where exactly my problem is
    when i process it i will get ascreen in which
    the doc.no are
    from    to
    and i can enter only 16 doc no here but where as there are more
    then 50 doc number for one businees area in file ..there is
    no page down working .
    what to do ?
    regards
    farukh

    HI farukh,
    if it is a table control then one option is that you use the 'INSERT' button to add a line in first place and fill that first line. and again use command 'INSERT' to insert a line at first place.
    you have to record insert button.
    Regards,
    Wasim Ahmed

  • Not able to do page down in table control of screen

    Hello,
    I have created a table control on a screen of my report. This screen gets called from my selection screen. When I do page down or click on down arrow key to view other table entries nothing is happening. The scroll bar is not moving vertically.
    Someone told me that no coding is required to make the table scrollable vertically.
    Can someone please tell me if there is any attribute that needs to be set for this?
    Best Regards,
    Priyanka Gupta.

    Hi,
    Please go through this code.
    dataL line_count type i.         " Global declaration
    In the PAI of the table control screen.
    CASE OK_CODE.
         when 'P--'.
          clear ok_code.
          perform paging using 'P--'.
         when 'P-'.
          clear ok_code.
          perform paging using 'P-'.
         when 'P+'.
          clear ok_code.
          perform paging using 'P+'.
         when 'P++'.
          clear ok_code.
          perform paging using 'P++'.
    form paging using code.  "   NOTE  :  here "TABCTL" is your table control name
      data: i type i,
            j type i.
      case code.
        when 'P--'.
          tabctl-top_line = 1.
        when 'P-'.
          tabctl-top_line = tabctl-top_line - line_count.
          if tabctl-top_line le 0.
             tabctl-top_line = 1.
         endif.
        when 'P+'.
          i = tabctl-top_line + line_count.
          j = tabctl-lines - line_count + 1.
          if j le 0.
             j = 1.
          endif.
          if i le j.
            tabctl-top_line = i.
          else.
            tabctl-top_line = j.
          endif.
        when 'P++'.
          tabctl-top_line = tabctl-lines - line_count + 1.
          if tabctl-top_line le 0.
             tabctl-top_line = 1.
          endif.
      endcase.
    endform.                   
    Hope this will help you.
    Regards,
    Smart Varghese

  • Regarding page down in the table control veritcally

    Hi all,
              I have an issue regarding page down in the Table control in module pool , i.e when i m click the vertical scroll bar and going for page down then , the control is flowing to the next sceen which is not needed , and it shuld just scroll down and up vetically.
    Can anyone help me how to handle the page down event ?
    Thanks & regards,
    satya

    Table Controls: Examples with Scrolling
    The following example processes a table control with LOOP without parallel loop using an internal table. In addition to the scroll bar, the user can also carry out program-controlled scrolling with function codes.
    REPORT demo_dynpro_tabcont_loop.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn,
          fill TYPE i.
          TABLES demo_conn.
    DATA: lines TYPE i,
          limit TYPE i.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
      DESCRIBE TABLE itab LINES fill.
      flights-lines = fill.
    ENDMODULE.
    MODULE fill_table_control OUTPUT.
      READ TABLE itab INTO demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      lines = sy-loopc.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'NEXT_LINE'.
          flights-top_line = flights-top_line + 1.
          limit = fill - lines + 1.
          IF flights-top_line > limit.
            flights-top_line = limit.
          ENDIF.
        WHEN 'PREV_LINE'.
          flights-top_line = flights-top_line - 1.
          IF flights-top_line < 0.
            flights-top_line = 0.
          ENDIF.
        WHEN 'NEXT_PAGE'.
          flights-top_line = flights-top_line + lines.
          limit = fill - lines + 1.
          IF flights-top_line > limit.
            flights-top_line = limit.
          ENDIF.
        WHEN 'PREV_PAGE'.
          flights-top_line = flights-top_line - lines.
          IF flights-top_line < 0.
            flights-top_line = 0.
          ENDIF.
        WHEN 'LAST_PAGE'.
          flights-top_line =  fill - lines + 1.
        WHEN 'FIRST_PAGE'.
          flights-top_line = 0.
      ENDCASE.
    ENDMODULE.
    The layout of screen 100 is:
    A resizable table control called FLIGHTS is defined. The fields of the table control are transferred from the structure DEMO_CONN in the ABAP Dictionary. The first two columns are lead columns. The corresponding fields are output fields. A title bar, column headers, and a selection column are created. The component MARK of type character with length 1 from structure DEMO_CONN is assigned to the selection column. You can select one column and several lines.
    It has the following flow logic:
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      LOOP WITH CONTROL flights.
        MODULE fill_table_control.
    ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE cancel AT EXIT-COMMAND.
      LOOP WITH CONTROL flights.
        MODULE read_table_control.
    ENDLOOP.
      MODULE user_command_0100.
    The system executes a loop at PBO and PAI using the table control FLIGHTS. During the PBO loop, a module is called to fill the table control from table ITAB of the ABAP program. During the PAI loop, a module is called to modify table ITAB.
    Before the PBO loop, in the module STATUS_0100 the current number of lines of the internal table ITAB is placed in component LINES of control structure FLIGHTS. This helps the system to correctly install the scroll bar of the table control.
    During the PBO loop, in the module FILL_TABLE_CONTROL the work area DEMO_CONN is filled with values from the internal table, where the row index corresponds to the current row of the table control.
    During the PAI loop, in the module READ_TABLE_CONTROL the current number of the loop SY-LOOPC in the table control is placed an auxiliary variable. The number is dependent on the size of the screen. The rows of the internal table, whose row index corresponds to the current row of the table control, are overwritten with the contents of the work area DEMO_CONN. User input is transferred from the input fields of the control to the internal table. In particular, the internal table also contains a flag in the column MARK to indicate whether the row of the table control is selected or not.
    After the PAI loop, user input is processed in the module USER_COMMAND. The GUI status SCREEN_100 provides the appropriate function codes. You can scroll line by line or page by page, or Goto the first or last page. You can implement scrolling by setting the component TOP_LINE of control structure FLIGHTS. For page-by-page scrolling the auxiliary variable that is filled in the PAI loop by SY-LOOPC is used as the step size.

  • Page Up and Page down functionality in table control

    Hi,
        I want to add two pushbuttons in the module pool screen which has a table control that fetches data from the transparent table. One pushbutton is for the page up and other is for page down. If my table control <say tab_ctrl1> has 75 records in total with shows 25 at time so with a single page down it should show next 25 rows of the data.
    thanks
    ekta

    Hi,
    Use the function module SCROLLING_IN_TABLE.
    For ok_code pass P- for previous page and P+ for next page.
    Example:
       DATA L_TC_NEW_TOP_LINE     TYPE I.
         CALL FUNCTION 'SCROLLING_IN_TABLE'
              EXPORTING
                   ENTRY_ACT             = Table_Control-TOP_LINE
                   ENTRY_FROM            = 1
                   ENTRY_TO              = Table_Control-LINES
                   LAST_PAGE_FULL        = 'X'
                   LOOPS                 = 25
                   OK_CODE               = 'P+'
                   OVERLAPPING           = 'X'
              IMPORTING
                   ENTRY_NEW             = L_TC_NEW_TOP_LINE
              EXCEPTIONS
    *              NO_ENTRY_OR_PAGE_ACT  = 01
    *              NO_ENTRY_TO           = 02
    *              NO_OK_CODE_OR_PAGE_GO = 03
                   OTHERS                = 0.
       Table_Control-TOP_LINE = L_TC_NEW_TOP_LINE.
    Regards,
    Sesh

  • In BDC Page down command is not working for MB1C T. Code

    Dear Experts,
    I am writing BDC for MB1C, in this to enter serial number for material, when exceeds the limit, the page down command not woking.
    i wrote the below
             IF sn_count = 20.
                PERFORM bdc_dynpro      USING 'SAPLIPW1' '0200'.
                PERFORM bdc_field       USING 'BDC_CURSOR'
                                                     'RIPW0-SERNR(01)'.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                              '=RWS'.
                sn_count = 2.
              ENDIF.
    in my recording i got below
    perform bdc_dynpro      using 'SAPLIPW1' '0200'.
    perform bdc_field       using 'BDC_CURSOR'
                                       'RIPW0-SERNR(07)'.
    perform bdc_field       using 'BDC_OKCODE'
                                       '=RWS'.
    please help me.

    sorry I missed this part with the serial numbers, I thought you were in the item overview.

  • What is ok-code for page down in bdc (reward)

    hiiii
    What is ok-code for page down in bdc...

    HI..
    here is the list..
    P-  : Back
    P-- : Scroll to previous page
    P+ : Scroll to next page
    P++ Scroll to last page
    PL- : Scroll to first line in page
    PL-n :  Scroll back n lines
    PL+ : Scroll to last line in page
    PL+n Scroll forward n lines
    PP- : Scroll back one page
    PP-n Scroll back n pages
    PP+ scroll forward one page
    PP+n : scroll forward n page
    PPn : Scroll to start of page n
    Ps- : Scroll to first column
    PS++ Scroll to last column
    Reward if useful
    Regards
    Prax

  • PROBLEM IN BDC F-04 --NO PAGE DOWN

    HI
    Experts,
    Getting problem in bdc for f-04 , The data is split on basis of
    business area (gsber) , and for one business area there are more
    then 2000 document number, till the screen of doc.no the data is
    coming into fields but i have to put all the doc number for that
    b.area. And only i can enter 16 doc.no as there is no page down i
    have to enter so that it takes another 16 doc.no .
    but i tried it by at new command and then i tried it by on chage of
    but it picks only first doc.no its not piclking all doc.no.
    LOOP AT i_final.
        MOVE i_final TO wa_itab.
        ON CHANGE OF wa_itab-gsber  .
          CLEAR w_count.
          PERFORM bdc_dynpro      USING 'SAPMF05A' '0122'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'RF05A-NEWKO'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'BKPF-BLDAT'
                                         wa_itab-bldat .                       "'27.07.2006'.
          PERFORM bdc_field       USING 'BKPF-BLART'
                                         wa_itab-blart.                        "'SA'.
          PERFORM bdc_field       USING 'BKPF-BUKRS'
                                         wa_itab-bukrs.                         "'NPIL'.
          PERFORM bdc_field       USING 'BKPF-BUDAT'
                                         wa_itab-budat.                         "'27.07.2006'.
          PERFORM bdc_field       USING 'BKPF-WAERS'
                                         wa_itab-waers.                          "'INR'.
          PERFORM bdc_field       USING 'BKPF-XBLNR'
                                         wa_itab-xblnr.                         "'INR'.
          PERFORM bdc_field       USING 'BKPF-BKTXT'
                                        wa_itab-bktxt.                          "'INR'.
          PERFORM bdc_field       USING 'RF05A-XPOS1(04)'
                                         wa_itab-xpos1.
          PERFORM bdc_field       USING 'RF05A-NEWBS'
                                         wa_itab-newbs.         "'50'.
          PERFORM bdc_field       USING 'RF05A-NEWKO'
                                        wa_itab-newko.          "'9991010'.
          PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'BSEG-WRBTR'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=PA'.
          PERFORM bdc_field       USING 'BSEG-WRBTR'
                                        wa_itab-wrbtr.                            "'826532.58'.
          PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'COBL-FIPOS'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTE'.
          PERFORM bdc_field       USING 'COBL-GSBER'
                                         wa_itab-gsber.         "'1101'.
          PERFORM bdc_field       USING 'COBL-PRCTR'
                                         wa_itab-prctr.         "'2000'.
          PERFORM bdc_dynpro      USING 'SAPMF05A' '0710'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'RF05A-XPOS1(03)'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=PA'.
          PERFORM bdc_field       USING 'RF05A-AGKON'
                                         wa_itab-agkon.         "'2810200'.
          PERFORM bdc_field       USING 'RF05A-XPOS1(03)'
                                         'X'.
        ENDON.
        PERFORM bdc_dynpro      USING 'SAPMF05A' '0731'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF05A-SEL01(06)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=PA'.
        w_count = w_count + 1.
        CONCATENATE 'RF05A-SEL01(' w_count ')' INTO w_bdc.
        PERFORM bdc_field       USING   w_bdc
                                        wa_itab-sel01.
        IF w_count >= 16.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          w_count = 0.
        ENDIF.
       ENDON.
       AT END OF gsber.
    *IF W_FLAG = 'X'.
          PERFORM bdc_dynpro      USING 'SAPDF05X' '3100'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BU'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'RF05A-ABPOS'.
          PERFORM bdc_field       USING 'RF05A-ABPOS'
                                        '1'.
          PERFORM bdc_transaction USING 'F-04'.
       ENDAT. "At end of
    *ENDIF.
      ENDLOOP.
      PERFORM close_group.

    Iam doing a bdc for F-04 (post with clearing header date)
    i got a file in which the data is splited on business area wise,
    and when i enter the details on first screen
    with post key 40 and enter after entering the details here like
    busines area profit cenrter i have to click
    process open item .
    here i have to select the doc.no and enter acct no and again
    have to process the open item .. where exactly my problem is
    when i process it i will get ascreen in which
    the doc.no are
    from to
    and i can enter only 16 doc no here but where as there are more
    then 50 doc number for one businees area in file ..there is
    HOPE U GOT MY POINT NOW .
    REGARDS

  • Page down issue in f-28 BDC

    Hi all,
       I am not able to page down in one of the screens in the transaction F-28 while doing BDC.
      Pls find the code that i had used when the items are more than 17,
    Loop
    IF l_cnt = 17.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=P+'.
         PERFORM bdc_dynpro      USING 'SAPDF05X' '4201'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'DF05B-TREST(01)'.
       cnt = 0.
    e ndif.
    Endloop.
    Pls help in this matter.

    Hi Vinod,
      i used the above logic. I enter 4 values in one line ie amount, reason code , reference1 and reference2. The reference1 is unmatched document number.
    Now what happens is all the amounts get added up as 1 line item and no document number is displayed in the next screen. But i need all that to be different line items. I am attaching the code that used.
    Please help me.
    LOOP AT t_820_payadv_tmp WHERE chect EQ st_checks-chect
                                     AND kukey EQ st_checks-kukey
                                     AND esnum EQ st_checks-esnum
                                     AND sgtxt(3) NE 'INV'.
          l_cnt = 1.
          perform bdc_dynpro      using 'SAPDF05X' '4201'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'DF05B-XREF1(01)'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '/00'.
       -Fill amount
            CLEAR : l_fld.
            concatenate :  'DF05B-TREST(' l_cnt ')' INTO l_fld.
            condense : l_fld.
            clear l_amt.
            l_amt = t_820_payadv_tmp-WRBTR.
            condense : l_amt.
            PERFORM bdc_field       USING l_fld l_amt.
       -Fill reason code
            CLEAR : l_fld.
            concatenate :  'DF05B-RSTGR(' l_cnt ')' INTO l_fld.
            condense : l_fld.
            PERFORM bdc_field       USING l_fld
                                          t_820_payadv_tmp-rstgn.
       -Fill reference numbers
            CLEAR : l_fld.
            concatenate :  'DF05B-XREF1(' l_cnt ')' INTO l_fld.
            condense : l_fld.
            PERFORM bdc_field       USING l_fld
                                          t_820_payadv_tmp-xref1.
            CLEAR : l_fld.
            concatenate :  'DF05B-XREF2(' l_cnt ')' INTO l_fld.
            condense : l_fld.
            PERFORM bdc_field       USING l_fld
                                          t_820_payadv_tmp-xref2.
    Endloop.
    perform bdc_dynpro      using 'SAPDF05X' '4201'.
    perform bdc_field       using 'BDC_CURSOR'
                                        'DF05B-XREF1(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                        '=PA'.

Maybe you are looking for