Skip to Content
avatar image
Former Member

batch input: how to scroll in table control , returncode ?

hi friends,

i have a question regarding batch input if the dynpro has a scrollable table control in it:

how can i fill this table with the corresponding values and how can i then scroll down if the number of lines displayed in the dynpro is not sufficient ?

any ideas ? please advise, <REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Feb 29, 2008 6:00 PM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 29, 2008 at 10:58 AM

    See the following ex

    FORM UPLOAD_DATA .

    DATA: L_PGD LIKE SY-TABIX,

    L_PGD1 LIKE SY-TABIX,

    L_FLG TYPE C.

    LOOP AT I_TAB1.

    REFRESH I_BDCDATA.

    CLEAR: I_BDCDATA, G_FL, L_SUBRC.

    SET PARAMETER ID 'BUK' FIELD I_TAB1-BUKRS.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    '/00'.

    PERFORM BDC_FIELD USING 'RM08M-VORGANG'

    '1'.

    PERFORM BDC_FIELD USING 'BDC_CURSOR'

    'INVFO-BLDAT'.

    PERFORM BDC_FIELD USING 'INVFO-BLDAT'

    I_TAB1-BLDAT.

    PERFORM BDC_FIELD USING 'INVFO-XBLNR'

    I_TAB1-XBLNR.

    PERFORM BDC_FIELD USING 'INVFO-WRBTR'

    I_TAB1-AMOUNT.

    PERFORM BDC_FIELD USING 'INVFO-WAERS'

    I_TAB1-CURR.

    PERFORM BDC_FIELD USING 'INVFO-BUPLA'

    'BTDS'.

    PERFORM BDC_FIELD USING 'INVFO-SECCO'

    'BTDS'.

    PERFORM BDC_FIELD USING 'INVFO-XMWST'

    'X'.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    '=DUMMY'.

    PERFORM BDC_FIELD USING 'INVFO-MWSKZ'

    'Z0'.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    '/00'.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    '=HEADER_FI'.

    PERFORM BDC_FIELD USING 'RM08M-ITEM_LIST_VERSION'

    '7_6310'.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    '/00'.

    PERFORM BDC_FIELD USING 'RM08M-VORGANG'

    '1'.

    PERFORM BDC_FIELD USING 'INVFO-BKTXT'

    I_TAB1-BKTXT.

    PERFORM BDC_FIELD USING 'INVFO-GSBER'

    I_TAB-BUSAREA.

    PERFORM BDC_FIELD USING 'INVFO-LIFRE'

    I_TAB1-LIFNR.

    PERFORM BDC_FIELD USING 'BDC_CURSOR'

    'RM08M-XWARE_BNK'.

    PERFORM BDC_FIELD USING 'RM08M-EBELN'

    I_TAB1-EBELN.

    PERFORM BDC_FIELD USING 'RM08M-XWARE_BNK'

    '2'.

    PERFORM BDC_FIELD USING 'RM08M-ITEM_LIST_VERSION'

    '7_6310'.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    'HEADER_FI'.

    CLEAR: CNT, L_PGD, L_FLG.

    ****Handling Table control

    LOOP AT I_TAB2 WHERE EBELN = I_TAB1-EBELN.

    L_PGD = L_PGD + 1.

    CNT = CNT + 1.

    REPLACE C WITH CNT INTO QTY.

    REPLACE C WITH CNT INTO AMT.

    REPLACE C WITH CNT INTO TAX.

    PERFORM BDC_FIELD USING 'BDC_CURSOR'

    • 'DRSEG-MENGE(01)'.

    AMT.

    PERFORM BDC_FIELD USING QTY

    I_TAB2-DMBTR.

    PERFORM BDC_FIELD USING AMT

    I_TAB2-MENGE.

    PERFORM BDC_FIELD USING TAX

    'Z0'.

    QTY = 'DRSEG-WRBTR(&1)'.

    AMT = 'DRSEG-MENGE(&1)'.

    TAX = 'DRSEG-MWSKZ(&1)'.

    **Check the no.of lines that can be entered in screen at a time.

    ***If it is filled then scroll

    IF L_PGD = 6.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    '/00'.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    '=P+'.

    CLEAR L_PGD.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    'HEADER_FI'.

    CLEAR CNT.

    ENDIF.

    ENDLOOP.

    CLEAR : L_FLG, L_PGD.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    '/00'.

    PERFORM BDC_DYNPRO USING 'SAPLMR1M' '6000'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    '=PARK'.

    CALL TRANSACTION 'MIR7' USING I_BDCDATA

    MODE G_MODE

    UPDATE 'S'

    MESSAGES INTO I_MESSTAB.

    ENDLOOP.

    ENDFORM. " UPLOAD_DATA

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 29, 2008 at 10:54 AM

    filling table controls in batch input is a pain in the a...

    you would usually try it like this:

    loop each line of source data

    ...fill first row of control

    ...process a function code for "new lines" or similar

    endloop

    this way you are always filling the first line and need not worry about how many lines there are on the dynpro.

    Cheers

    Thomas

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 29, 2008 at 10:57 AM

    while recording use page down, and use the same okcode(P+) if u want to scroll down

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 29, 2008 at 10:57 AM

    Hi Clemens,

    There is no OK_Code attached to scroll down/up.

    You should hanle the pageup/page down or new page OK_CODE to scroll down.

    But make sure the screen display is fixed for all the users. because screen display may vary from user to user.

    **----Parameter for runtime of CALL TRANSACTION.

    DATA: st_opt LIKE ctu_params.

    st_opt-dismode = c_mode. " Processing mode for CALL TRANSACTION

    st_opt-updmode = ''. " Update mode for CALL TRANSACTION

    st_opt-defsize = ''. " Default screen size for CALL TRANS

    st_opt-nobiend = ''.

    *----Call transaction

    CALL TRANSACTION c_tcode USING it_bdcdata

    OPTIONS FROM st_opt

    MESSAGES INTO it_bdcmsgcoll.

    Add comment
    10|10000 characters needed characters exceeded