Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Scrolling in table control

Former Member
0 Likes
1,525

Hi,

I have a table control where user can input values in a particular field.

When I change a particular value, then vertically scroll down to the next

set of values, and again scroll back, the changed value disappears and the old

value is again there.

I want the changed value to be visible permanently irrespective of scrolling.

Please help.

Thanks,

Abhishek

5 REPLIES 5
Read only

Former Member
0 Likes
765

Hi abhishek,

When u scroll down it triggers the PAI of the screen and then the PBO...in which the values are lost.

plz do loop at table control to transfer values from program to screen and vice versa in both pbo and pai.

Regards,

Auro

Read only

Former Member
0 Likes
765

Handle the scrolling using this sample code:

MODULE user_command_XXXX INPUT. (XXXX is screen no.)

  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
*&-----------------------------------------------------*
*       Form to do scrolling for screen XXXX
*------------------------------------------------------*
*      -->CODE   OKCODE value (P--, P-, P+, P++ )
*------------------------------------------------------*

FORM paging USING code.
  DATA: i TYPE i,
        j TYPE i.

  CASE code.

    WHEN 'P--'. <table control name>-top_line = 1.

    WHEN 'P-'.
      <table control name>-top_line =
              <table control name>-top_line - line_count.
      IF <table control name>-top_line LE 0.
        <table control name>-top_line = 1.
      ENDIF.

    WHEN 'P+'.
      i = <table control name>-top_line + line_count.
      j = <table control name>-lines - line_count + 1.
      IF j LE 0. j = 1. ENDIF.
      IF i LE j.
        <table control name>-top_line = i.
      ELSE.
        <table control name>-top_line = j.
      ENDIF.

    WHEN 'P++'.
      <table control name>-top_line =
             <table control name>-lines - line_count + 1.
      IF <table control name>-top_line LE 0.
        <table control name>-top_line = 1.
      ENDIF.

  ENDCASE.
ENDFORM.                               " PAGING

Read only

Former Member
0 Likes
765

Refer

Read only

former_member632991
Active Contributor
0 Likes
765

Hi,

This is because when u scroll the TC , PAI and then PBO events trigger, so in PBO and PAI transfer valuse from TC to internal table and then from internal table to Tc

PROCESS BEFORE OUTPUT.

LOOP WITH CONTROL TC_SER.

  • CURSOR TC_SER-CURRENT_LINE.

****for dispalying data into TC**

<b> MODULE DATA_TO_TC.</b>

ENDLOOP.

PROCESS AFTER INPUT.

LOOP WITH CONTROL TC_SER.

<b> MODULE DATA_FROM_TC.</b>

ENDLOOP.

MODULE DATA_TO_TC OUTPUT.

READ TABLE ITAB_TC INDEX TC_SER-CURRENT_LINE.

IF SY-SUBRC = 0.

EKPO-EBELN = ITAB_TC-EBELN .

EKPO-MATNR = ITAB_TC-MATNR .

EKPO-EBELP = ITAB_TC-EBELP .

EKPO-MENGE = ITAB_TC-MENGE .

SEL = ITAB_TC-SEL.

RET_QTY = ITAB_TC-RET_QTY.

ENDIF.

CLEAR ITAB_TC.

ENDMODULE. " DATA_TO_TC OUTPUT

MODULE DATA_FROM_TC INPUT.

ITAB_TC-EBELN = EKPO-EBELN.

ITAB_TC-MATNR = EKPO-MATNR.

ITAB_TC-EBELP = EKPO-EBELP.

ITAB_TC-SEL = SEL.

ITAB_TC-RET_QTY = RET_QTY.

ITAB_TC-MENGE = EKPO-MENGE.

MODIFY ITAB_TC INDEX TC_SER-CURRENT_LINE TRANSPORTING EBELN MATNR EBELP SEL RET_QTY MENGE.

IF SY-SUBRC <> 0.

APPEND ITAB_TC.

CLEAR ITAB_TC.

ENDIF.

ENDMODULE. " DATA_FROM_TC INPUT

Hope it helps.

Regards,

Sonika

Read only

Former Member
0 Likes
765

Check this:

module scroll_1002 output.

tctrl_cont_items-lines = 100.

tctrl_cont_items-v_scroll = 'X'.

endmodule. " scroll_1002 OUTPUT

Use the above Code hope it will work

REgards,

Vasanth