‎2009 Jul 21 10:09 AM
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?
‎2009 Jul 21 10:12 AM
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
‎2009 Jul 21 10:19 AM
hi,
you can use the concept of memory-id to get a value which was entered previous screen.
Regards,
Nidhi
‎2009 Jul 21 10:25 AM
‎2009 Jul 21 10:52 AM
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'.
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
‎2009 Jul 21 1:46 PM
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.
‎2009 Jul 22 7:57 AM
Check the sample code with screen shot in following link
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm