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

Table control in dialog programming

Former Member
0 Likes
734

Hi,

I have a requirement in dialog programming as if I enter the value of a field exidv from vekp table in the first screen and click enter, then in the next screen the value of that field should be printed along with the counter as 1.Again if I enter another value for that field in the second screen itself then the value of that field should also be displayed in the same screen along with the old value and the counter should be changed to 2.But the latest entered value should be at the top.In this way the user can enter any number of values in that field and the value of counter should be increasing.

How can I achieve this?Is it possible to achieve this through table control?How to get scroll bar in table control?

6 REPLIES 6
Read only

Former Member
0 Likes
704

hi,

when you set the number of lines for table control, you will get scroll bar automatically.

describe table itab lines n
tab_cntl-lines = n.

when you press enter in the flow logic of the screen it goes through PBO and PAI,So

in pai 

loop at itab.
module modify_itab.
endloop.

module  modify_itab..
counter = counter + 1.
itab-counter = counter.
append itab.
endmodule.

Regards

Sajid

Edited by: shaik sajid on Jul 21, 2009 11:12 AM

Read only

Former Member
0 Likes
704

hi,

you can use the concept of memory-id to get a value which was entered previous screen.

Regards,

Nidhi

Read only

Former Member
0 Likes
704

hi,

when you enter the value in the 1st position if it is going to second position all that is sap standard functionalty no need to very about that first enter the all the values and check in display mode..

and for scrolling check with below link.

.

~linganna

Read only

Former Member
0 Likes
704

hi,

check this code for table control.

DIALOG PROGRAMMING

TABLE CONTROL

IN SE51

PROCESS BEFORE OUTPUT.

  • MODULE STATUS_0100.

LOOP AT ITVBAK WITH CONTROL TABCTRL. ## TABLE CONTROL NAME

ENDLOOP.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100.

LOOP AT ITVBAK.

ENDLOOP.

IN PAI FLOW LOGIC

PROGRAM YMODULE_PR4 .

TABLES : KNA1, VBAK.

DATA : BEGIN OF ITVBAK OCCURS 0,

VBELN LIKE VBAK-VBELN,

ERDAT LIKE VBAK-ERDAT,

ERNAM LIKE VBAK-ERNAM,

NETWR LIKE VBAK-NETWR,

END OF ITVBAK.

CONTROLS : TABCTRL TYPE TABLEVIEW USING SCREEN '0100'.

    1. TO ACTIVATE SCROLL BAR

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

-


MODULE USER_COMMAND_0100 INPUT.

CASE SY-UCOMM.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN SPACE.

SELECT VBELN ERDAT ERNAM NETWR

FROM VBAK

INTO TABLE ITVBAK

WHERE KUNNR = KNA1-KUNNR.

TABCTRL-LINES = SY-DBCNT.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

-


MODULE STATUS_0100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_0100 OUTPUT

regards

Saurabh Goel

Read only

0 Likes
704

Hi Saurabh,

Thank you.

When the user enters the value of exidv field in the first screen and click enter the control has to go to 2nd screen and display the value of exidv in the table control and the counter value should be displayed as 1.

I have used the code given below but the value is not getting displayed in the table control.

Read only

Former Member
0 Likes
704