Table control in dialog prog
how to pass data from first screen to table control in second screen.
in the pbo
loop at itab into wa_itab with control TC1 cursor TC1-current_line.
endloop.
in pai
loop at itab.
endloop.
Similar Messages
-
Write the syntax for declaring table control in dialog programming?
1) Write the syntax for declaring table control in dialog programming?
2) Write the syntax to call a selection screen in a modal dialog box?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 -
Strange issue with table control in dialog programming! Please help!
Hello everyone:
I have a table control on screen painter and I have atleast 10 rows on display when user calls the screen. If I have 15 columns then ofcourse user has to scroll down to see extra rows. I have line selection set to "single" for table control so that user can select only one row at a time. This works fine when user does not have to scroll to see extra rows. It is tough for me to explain i.e., if the table control displays 10 rows when the screen opens up then they can only select single row at a time (rows 1 -10). For example user selected row 7 and now they scroll down to see extra rows (for example 13) then it lets them select row 13 also even though I set line selection to "single" in the properties for table control! They should be able to select only one row at a time. Is this some limitation with table control in SAP? Please give me any information you have.
Thanks.
MithunHi,
As you suspected, this is a limitation in the table control. You need to take care of the single-selection functionality yourself except for the rows that are actually being displayed. See [Note 588284|https://service.sap.com/sap/support/notes/588284] for the official SAP explanation.
Regards,
Jamie -
How to move the selected rows from a table control in dialog programming
hiiiiiiii Every1
I have to update some fields for a slected row in table control on click of a button and save it in database.
Regards
Sachin Dhingrasee below example, I have added INSERT option after DELETE option, you can use same table or you can use differnt table by populating into that table and insert into the db table. If you want to use same internal table then use below code
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
insert into table from itab.
ENDLOOP.
REPORT demo_dynpro_tabcont_loop_at.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA cols LIKE LINE OF flights-cols.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn.
TABLES demo_conn.
SELECT * FROM spfli INTO TABLE itab.
LOOP AT flights-cols INTO cols WHERE index GT 2.
cols-screen-input = '0'.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE read_table_control INPUT.
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 'TOGGLE'.
LOOP AT flights-cols INTO cols WHERE index GT 2.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
WHEN 'SORT_UP'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'SORT_DOWN'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'DELETE'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
DELETE itab.
ENDLOOP.
ENDIF.
WHEN 'INSERT'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
itab1 = itab.
modify itab1.
ENDLOOP.
ENDIF.
if not itab1 is initial.
INSERT dbtab FROM TABLE itab1.
endif.
ENDCASE.
ENDMODULE. -
Table control in dialog programming
why we are using loops in pbo and pai events?
Hi
First have to know the concept of Table control
The main purpose of table control is to display multiple records in a table like format.
so when to wants to display the multiple records, the internal table from which the table control has to be populated has to be kept in loop both in PAI and PBO.
see the doc
Check the below link:
http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F
http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm
http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
You can also check the transaction ABAPDOCU which gives you lot of sample programs.
Also you can see the below examples...
Go to se38 and give demodynpro and press F4.
YOu will get a list of demo module pool programs.
One more T-Code is ABAPDOCU.
YOu can find more examples there.
See the prgrams:
DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
http://www.geocities.com/ZSAPcHAT
http://www.allsaplinks.com/files/using_table_in_screen.pdf
reward points if useful
regards
Anji -
Question on line selection in table control in dialog programming....
Hello,
I have a internal table displayed on a screen using Table control wizard. Now, when user selects a particular line and double clicks it, I want to write a query based on the line user selected. How can this be achieved ?
Regards,
Rajesh.Assign a function code to F2 in your status and do the coding:
PROCESS PAI.
LOOP AT ITAB.
MODULE GET_CURSOR.
ENDLOOP.
MODULE USER_COMMAND.
MODULE GET_CURSOR.
GET CURSOR FIELD ws_field LINE ws_line.
ENDMODULE.
MODULE USER_COMMAND.
CASE OK_CODE.
WHEN 'PICK'.
WS_LINE = <TABLE CONTROL>-TOP_LINE + WS_LINE - 1.
READ TABLE ITAB INDEX WS_LINE.
---> Show details
ENDMODULE. -
How to save the selected records from Table control in dialog programming
Hiiiiiiii Every1
Actually the problem is like this:-
I have to select some records from table control and then want to save the selected records in DB table.
Example
I have some rows having inforamtion bout employees...
Now what i want is that when i click on 'SAVE' button then these selected rows should be moved into DB table.
Sachin Dhingrasee below example, I have added INSERT option after DELETE option.
REPORT demo_dynpro_tabcont_loop_at.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA cols LIKE LINE OF flights-cols.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn.
TABLES demo_conn.
SELECT * FROM spfli INTO TABLE itab.
LOOP AT flights-cols INTO cols WHERE index GT 2.
cols-screen-input = '0'.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE read_table_control INPUT.
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 'TOGGLE'.
LOOP AT flights-cols INTO cols WHERE index GT 2.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
WHEN 'SORT_UP'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'SORT_DOWN'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'DELETE'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
DELETE itab.
ENDLOOP.
ENDIF.
WHEN 'INSERT'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
itab1 = itab.
modify itab1.
ENDLOOP.
ENDIF.
if not itab1 is initial.
INSERT dbtab FROM TABLE itab1.
endif.
ENDCASE.
ENDMODULE. -
Select option in dialog, in a table control
Hi Friends,
My need is creating dynamic select options in a table control in dialog screen. How can I do my desire?
Thanks.Hi,
You can make use of
FREE_SELECTIONS_INIT
and
FREE_SELECTIONS_DIALOG
Please see the documentation
a®s -
Hide The Table in Table-Control Dialogue Programming
Hi all,
How to hide the TABLE itself (not the columns only but the whole table completely) in table-control in dialog-programming.can any one please help me.....
Regards,
BiswajitHi,
use the screen table.
delclare as a "table" for the group properties of that table element.
LOOP AT SCREEN.
if screen-goupt1 = "table"
if the pushbutton = 'HIDE'
screen-required = 0.
screen-invsible = 0.
screen-input = 0.
MODIFY SCREEN.
ELSEIF the pushbutton = 'SHOW'
screen-required = 0.
screen-invsible = 1.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
endif.
ENDLOOP.
it solves your problme.
Thanks -
How to handle double click in a table control?
Hi,
Can any one let me how to handle double click event in a table control in dialog programming?
here i need to navigate to another screen when user double click on the table contols (emp number column).
thanks in advance,
PrasadBabu.to define double click in your table controlwhich is similar to 'PICK' function. Enable F2 in PF-status for this
Table Control Question
Check the above thread which was posted recently on SDN, please award points if found helpful -
How to referesh the table control?
Hi all,
How to refresh the table control in dialog programming with the command REFRESG CONTROL provided already ?
Rgds,
MadhuriCode like
Refresh Control 'TC_name' From Screen 'ur_screen_no'.
Regards,
Alpesh -
Displaying icon in tow in table control
Hi experts, I need help on how to display icons in every row in my table control which will be displayed via SAP GUI not Web.
Did anyone have successfully done this?
Thank you in advance guys..Hi,
Check these links.It can help you.If so,kindly reward points by clicking the star on the left of reply.
Re: Showing a status icon column on a table control
Re: How to show icon(traffic lights) into table control in dialog program?
http://www.sapdesignguild.org/resources/MiniSG-old/from_develop/norm_status_icons.htm#positioning_4 -
File format in pop up dialog box in table control
Hi All,
I am using a popup dialog box on user command click in table control. I have to fix the file format to '.CSV' format only from the selection, how to fix this. The FM is 'KD_GET_FILENAME_ON_F4'. Is there any other FM ?
Regards
GajendraHi,
To implement general checks in SRM,you can use BADI "BBP_DOC_CHECK_BADI".But the messages will not come in form of POP UPS.To display messages in the form of Pop up ,you need to implement both the BADI's BBP_DOC_CHANGE_BADI and BBP_DOC_CHECK_BADI.
For sample code,refer the foll link:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/srm/bbp_doc_check_badi-CheckPurchasingDocument&
BR,
Disha.
DO reward points for useful answers. -
Dynamic header text in table control - Dialog programming
Hi All,
I have a table control on one of my dialog screens. I need to dynamically change the column header texts on this control in my PBO. Does anyone know how to do this? I have found all kinds of ways to modify the other characteristics of the fields at run time in the PBO (active, input/output, invisible, etc.) - but not to change the header text! Any help is appreciated.
thanks,
MattHi Hymavathi,
I appreciate your help! This didn't solve the issue, however,...I have used the method you'd mentioned before (many times) for setting it inside the loop at screen:
%_<screenname>_%_APP_%-TEXT = <text something>.
- but only in ABAP reports. It doesn't seem to recogize it (the table control column header text) within a dialog program. I keep getting a compile error. (saying that the %_<screenname>_%_APP_%-TEXT doesn't exist.
I tried the suggestion that you stated below (from lateesh) - yet it only let me place i/o field in title text area (not the column header text). Am still searching... -
Table Control on a report selection screen -not a dialog transaction screen
Hi
Does anyone know of a way to have table control functionality on a report selection-screen? The program needs to be able to run as a background job (ie cannot be a dialog transaction) and we need to be able to save variants with the selection-screen values.
Any help would be appreciated.
The key point is we want to allow the user to enter a dynamic number of rows of table data on the selection-screen, save a variant containing that data and execute the program with the variant as a background job.
Thanks
Nicole KnightHi Nicole,
The main problem is how to persist the data. If you are not able to create a couple of tables then you could always utilise TVARV instead. On a similar line to my original post you could have the button call a dialog transaction. In here you could do your normal GUI table control. When saving the data simply transpose each column into a separate select-option held on TVARV keyed by the 'variant name' + fieldname. Then retrieve and transpose this back when executing the report.
Other methods could be storing the data in cluster xy (see EXPORT TO DATABASE command).
This seems a bit overkill for what would be a couple of maintenance dialogs.
Cheers,
Pete
PS. The view cluster is just a way of hierarchically performing table maintenance across multiple related tables. It offers a good UI for this purpose (header and item config tables) and is utilised extensively in the IMG.
Maybe you are looking for
-
How to publish a Jsp file as a Portlet
Hello, I am using the Oracle Portal to develop a business system, and I have created a Jsp file with the report builder. I have the Jsp file, I have created the provider.xml and configured the zone.properties on the 9iAS. The problem is that; when I
-
White screen after forced reload (used to fix previous white screen issue)
Last Friday after doing a battery pull to clear a stuck Facebook notification, upon reboot my Curve 8520's screen faded to white. I immediately did another battery pull, but then the same thing happened again. It did not return to normal until I plug
-
User not receiving emails she has been copied in to
Hello, we have a user in our office who receives her own emails in to her inbox but also has emails for another user delivered in to a folder within her Outlook so she can review (she is the secretary for this other user). The issue is that if she is
-
Hello, I am using an XML file that has been exported from an Access 2007 database for the spry table. The data displays in the table just fine. Is there any way to automatically refresh the data in the export when the database gets updated? Thank you
-
Dear Guru, Please guide me where we can define the new Category of Delivery Date in customizing. Regards