Getting data from table control to the report program.
Hi,
I created a table control using report program and i am trying to enter data in the table control which i want to update in the DB table. How can i get the data entered in table control to the report program, so that i can update the DB table.
Please help me finding out which variable will hold the data entered in table control(dynamically).
hi,
in your table control you give some name to that table control say it_cntrl.
this only serves as the internal table to process the table control data.
like u can write like this.
loop at it_cntrl into wa_cntrl. "wa_cntrl is work area of type it_cntrl table type
......... "do your functining
end loop.
any clarification get in touch
thnks
Similar Messages
-
How to Populate Internal table data to Table Control in a Report Program
Dear All,
How to Populate Internal table data to Table Control in a Report Program? It is a pure report program with out any Module pool coding involved, which is just used to display data. Till now it is being displayed in a report. Now the user wants the data to be displayed in a table control. Could someone tell me how to go about with this.
Thanks in Advance,
Joseph ReddyIf you want to use a table control, you will need to create a screen.
In your report....
start-of-selection.
perform get_data. " Get all your data here
call screen 100. " Now present to the user.
Double click on the "100" in your call screen statement. This will forward navigate you to the screen. If you have not created it yet, it will ask you if you want to create it, say yes. Go into screen painter or layout of the screen. Use the table control wizard to help you along the process. It will write the code for you. Since it is an output only table control, it will be really easy with not a lot of code.
A better way to present the data to the user would be to give it in a ALV grid. If you want to go that way, it is a lot easier. Here is a sample of the ALV function module. You don't even have to create a screen.
report zrich_0004
no standard page heading.
type-pools slis.
data: fieldcat type slis_t_fieldcat_alv.
data: begin of imara occurs 0,
matnr type mara-matnr,
maktx type makt-maktx,
end of imara.
* Selection Screen
selection-screen begin of block b1 with frame title text-001 .
select-options: s_matnr for imara-matnr .
selection-screen end of block b1.
start-of-selection.
perform get_data.
perform write_report.
* Get_Data
form get_data.
select mara~matnr makt~maktx
into corresponding fields of table imara
from mara
inner join makt
on mara~matnr = makt~matnr
where mara~matnr in s_matnr
and makt~spras = sy-langu.
endform.
* WRITE_REPORT
form write_report.
perform build_field_catalog.
* CALL ABAP LIST VIEWER (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = fieldcat
tables
t_outtab = imara.
endform.
* BUILD_FIELD_CATALOG
form build_field_catalog.
data: fc_tmp type slis_t_fieldcat_alv with header line.
clear: fieldcat. refresh: fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material Number'.
fc_tmp-fieldname = 'MATNR'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '18'.
fc_tmp-col_pos = 2.
append fc_tmp to fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material'.
fc_tmp-fieldname = 'MAKTX'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '40'.
fc_tmp-col_pos = 3.
append fc_tmp to fieldcat.
endform.
Regards,
Rich Heilman -
Accessing data from Table control
Hi,
I created a table control using report program and i am trying to enter data in the table control which i want to update in the DB table. How can i get the data entered in table control to the report program, so that i can update the DB table.
Please help me finding out which variable will hold the data entered in table control(dynamically).hi gautham,
1. While designing set the table control as input field.
2. In ur program create an internal table, with the same structure as your table control.
3. Whenever an entry is made in the table control, modify your internal table.
4. While saving use the internal table data to update the custom table.
If internal table name is same in both screen painter(table control) and in the program then the values will automatically come into the internal table in the program with out programming.
Otherwise we have programtically transfer the values.
In the PAI event using move or move-corresponding statement.
Check the program *RSDEMO02*
check the links
http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac9f35c111d1829f0000e829fbfe/content.htm
Yogesh N -
Getting data from table BSEG taking too long ... any solutions.
Hello people I am currently trying to get data from table BSEG for one particular G/L Account Number With restrictions using For All Entries.
The problem is that even with such tight restrictions its causing my report program to run way too slow. I put an option where you dont have to access table bseg. And it runs just fine. (all of this is done during PRD Server).
My question is
1.) How come BSEG seems to make the report slow, even though I put some tight restrictions. <b>Im using For All Entries where Zuonr eq i_tab-zuonr</b>it seems to work fine in DEV and <b>hkont EQ '0020103101'</b>(Customer Deposits).
2.) Is there a way for me to do the same thing as what I mentioned in #1 but only much faster.
Thanks guys and take careHi
It should be better you don't read BSEG table if you haven't the keys BUKRS and BELNR, because the reading could take many times if there are many hits.
If you want to find out the records of G/L Account it's better read the index table BSIS (for open items) and BSAS (for cleared items), here the field HKONT is a key (and ZUONR too). So you can improve the performance:
DATA: T_ITEMS LIKE STANDARD TABLE OF BSIS.
SELECT * FROM BSAS INTO TABLE T_ITEMS
FOR ALL ENTRIES I_ITAB WHERE BUKRS = <BUKRS>
AND HKONT = '0020103101'
AND ZUONR = I_ITAB-ZUONR.
SELECT * FROM BSIS APPENDING TABLE T_ITEMS
FOR ALL ENTRIES I_ITAB WHERE BUKRS = <BUKRS>
AND HKONT = '0020103101'
AND ZUONR = I_ITAB-ZUONR.
Remember every kind of item has an own index tables:
- BSIS/BSAS for G/L Account
- BSIK/BSAK for Vendor
- BSID/BSAD for Customer
These table have the same informations you can find out from BSEG and BKPF.
Max -
Sample pgm for moving data from table control to internal table
Hi Experts,
I am newbi to ABAP. I don't have good material for Table control . Appreciate if you direct me to some good source of knowledge on Table control.
The problem at hand : I am trying to move info/data from table control (in screen painter/ input and output mode ) to ITAB but couldn't . Sample pgm if possible.
<b>Modify ITAB index TC-Current_Line .</b>
The above statement is not inserting new lines to ITAB . Help me!
Thanks for your timehi,
do like this...
<b>PROCESS AFTER INPUT.</b>
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TAB1'
LOOP AT itab_det.
CHAIN.
FIELD itab_det-comp_code.
FIELD itab_det-bill_no.
FIELD itab_det-bill_date.
FIELD itab_det-vend_cust_code.
FIELD itab_det-bill_amt.
MODULE <b>tab1_modify</b> ON CHAIN-REQUEST.
ENDCHAIN.
FIELD itab_det-mark
MODULE tab1_mark ON REQUEST.
ENDLOOP.
<b>MODULE tab1_modify INPUT.</b>
APPEND itab_det.
<b>ENDMODULE. "TAB1_MODIFY INPUT</b> -
Update internal table data from table control
Hi GURUS,
I need help regarding one of my requirement.
I need to display data from the internal table on the screen and when the user selects a record/multiple records from screen and clicks on approve button i need to update one of the field from N to Y in the corresponding Ztable. Once the record is updated from Ztable , that should no longer be visible for the user on the screen.
I am using table control wizard to display data. I am able to update the Ztable, but that record is not refreshing from the user screen. Any suggestions would be approved.
Also please let me know if table control is the best way to do this/ alv grid control??hi
REFRESH CONTROL Control-Name FROM SCREEN '0100' -> use this command to refresh the table control
to know more, read into
https://forums.sdn.sap.com/click.jspa?searchID=2934287&messageID=673474
Re: URGENT HELP REQ IN TABLE CONTROL WIZARD
if helpful, reward
Sathish. R -
Internal table not getting modified from Table Control
Hi Guys,
I am developing a <b>Module Pool </b>Program where I am inserting data directly in table control of the main screen.
In the flow logic of the Table control I have written :
PROCESS BEFORE OUTPUT.
LOOP AT itab WITH CONTROL tc1 CURSOR tc1-current_line.
MODULE read_data.
ENDLOOP.
MODULE status_0100.
PROCESS AFTER INPUT.
LOOP AT itab.
MODULE mod_data.
ENDLOOP.
MODULE user_command_0100.
Module mod_data input.
MODIFY itab INDEX tc1-current_line.
Endmodule.
At modify, when I am debugging it's showing sy-subrc = 4 (Entry not appending in Int Table though it is there in the header line). But, if I use append itab, it's working (Problem is that while inserting 2nd record a copy of first record is also appending which I don't want).
Please let me know what's wrong in Modify statement or what is solution for inserting records of tablecontrol in internal table.
TIA,
NitinHi Nitin,
use the following code wor module.
Module mod_data input.
READ ITAB INDEX TC1-CURRENT_LINE.
IF SY-SUBRC = 0.
MODIFY itab INDEX tc1-current_line.
ELSE.
APPEND ITAB.
ENDIF.
Endmodule. -
Can't not display the table control in the report
Hello frnds,
I m create a module pool pgm using saptechnical 'Demo on using Table Control',
execute a report bush buttons are displayed but
can't Dispaly the table ctrl in the report using screen paiter
any help me, plz.
Thanks in advance.Hi Kumar,
Check thsi Program demo_sel_screen_with_tabstrip.
and also a program on Subscreens in ABAPDOCU
You need to combine both then only this is possible in Report PRograms
Cheerz
Ram -
Reading the data from table control and write log.
Hi all,
In va01 trasaction i have table control 'All item'.
I want to write value of some columns,( Article no, Order, plant ) so on into ecatt Log file after saving the trasction, for all rows which is having article no.
Is there any possibility in eCATT with going to GETGUI function which is static to spacefic field.
Regards,
SreeHi Sreedhar,
There are two types of variable values you find in transactions, one system generated(generally the unique values) and then the static field values..
When you want to go for the static field values you can use GETGUI. You can use the same GETGUI n number of times according to the situation(like in loops etc) and for the system generated messages we can handle them from the message blocks.
MESSAGE.
ENDMESSAGE.
In the message block make a rule for the message that you are expecting like
'E' MSGNR(the message number) and give a variable in the fields MSGV1/MSGV2 where ever you are getting the unique generated value(according to the log) and you can use that variable for LOG purpose..
Confirm me whether you were looking for this or something else.
Best regards,
Harsha -
Query OR Stored Proc to get data from Tables from All Schemas in the d/base
Hello Experts, (I appologize if i am not using the right way to ask questions)
I have a database, and it has around 400 schemas in it. I have designed a query which will fetch the data from three different table's from Schema1.
But it will be a tedious process of entering the 400 schemas names and pulling the information.
I would like to know as to what would be the best possible way to;
1) Look for all the schemas in the database
2) Look for those specific tables in the schema, which has the data in the tables.
3) If the tables are not present, than Ignore that schema and proceed further.
4) Load the data into a table
Any help, would appreciate it.
Thanks!
The query that i am using is as follows;
-- Query to select all the Schemas from the database
select username from all_users
order by username;
-- Sample Query to see if Tables exsist in the schema
SELECT DISTINCT OWNER, OBJECT_NAME
FROM ALL_OBJECTS
WHERE OBJECT_TYPE = 'TABLE'
AND OBJECT_NAME IN ('ENROLLMENT', 'PRDCT', 'L_P_L')
AND OWNER in ('Schema_1', 'Schema_2', Schema_3', Schema_4',Schema_5', Schema_6')
ORDER BY OWNER;
--Query to get the data from the tables in a Schema
select 'Schema_1@DATABASE_NAME' AS SCHEMA,
(SELECT MAX(LOAD_DT) FROM Schema_1.LOAD_STATUS) AS MAX_LOAD,
L_PROD_LINE.PROD_LINE,
COUNT(DISTINCT ENROLLMENT.MEM_NBR) AS MEMBERSHIP
FROM
Schema_1.ENROLLMENT,
Schema_1.PRDCT,
Schema_1.L_P_L
WHERE
ENROLLMENT.PRODUCT_ID = PRDCT.PRODUCT_ID AND
PRODUCT.PROD_LINE_ID = L_P_L.ID
GROUP BY
L_P_L.PROD_LINE;Hi,
999355 wrote:
Hello Experts, (I appologize if i am not using the right way to ask questions)See the froum FAQ {message:id=9360002}
I have a database, and it has around 400 schemas in it. I have designed a query which will fetch the data from three different table's from Schema1.
But it will be a tedious process of entering the 400 schemas names and pulling the information.
I would like to know as to what would be the best possible way to;
1) Look for all the schemas in the database
2) Look for those specific tables in the schema, which has the data in the tables.
3) If the tables are not present, than Ignore that schema and proceed further.
4) Load the data into a table
Any help, would appreciate it.
Thanks!
The query that i am using is as follows;
-- Query to select all the Schemas from the database
select username from all_users
order by username;
-- Sample Query to see if Tables exsist in the schema
SELECT DISTINCT OWNER, OBJECT_NAME
FROM ALL_OBJECTS
WHERE OBJECT_TYPE = 'TABLE'
AND OBJECT_NAME IN ('ENROLLMENT', 'PRDCT', 'L_P_L')
AND OWNER in ('Schema_1', 'Schema_2', Schema_3', Schema_4',Schema_5', Schema_6')
ORDER BY OWNER; Do you want to give a list of possible schemas (like the 6 above), or do you want to consider all schemas, however many and whatever they are called?
You can get the right information for ALL_OBJECTS, but, since you known all the objects of interest are tables, ALL_TABLES will be faster and simpler.
--Query to get the data from the tables in a Schema
select 'Schema_1@DATABASE_NAME' AS SCHEMA,
(SELECT MAX(LOAD_DT) FROM Schema_1.LOAD_STATUS) AS MAX_LOAD,
L_PROD_LINE.PROD_LINE,
COUNT(DISTINCT ENROLLMENT.MEM_NBR) AS MEMBERSHIP
FROM
Schema_1.ENROLLMENT,
Schema_1.PRDCT,
Schema_1.L_P_L
WHERE
ENROLLMENT.PRODUCT_ID = PRDCT.PRODUCT_ID AND
PRODUCT.PROD_LINE_ID = L_P_L.ID
GROUP BY
L_P_L.PROD_LINE;I take it that the tables in question are ENROLLMENT, PRDCT and L_P_L; they won't have different names in different schemas.
You can start this way:
BEGIN
FOR c IN (
SELECT owner
FROM all_tables
WHERE table_name IN ( 'ENROLLMENT'
, 'PRDCT'
, 'L_P_L'
GROUP BY owner
HAVING COUNT (*) = 3
LOOP
... -- Now get the results for tables in the c.owner schema
END LOOP;
END;
/This will find the schemas that have all 3 of those tables.
Inside the loop, write another dynamic query. All that will change is the value of c.owner
Sorry, I'm running out of time now. I hope this helps. -
Get data from view and displaying the table data into Excel pivot table
Hi All,
I have a small reqirement inthat When i get the data from the View that would displayed as Excel Pivot table.
For displaying gerneral data to Excel I have followed Binarcy cachey
Please suggest me in this.
Thanks,
Lohi.
Message was edited by:
Lohitha MTry this:
http://download-west.oracle.com/docs/html/B25947_01/bcservices005.htm#sthref681
Specifically code sample 8-10 for accessing the AM object.
Then use the findView method to get a pointer to the VO. -
How to clear data from Table-Control
Hi all,
I am working on table control. I have some data on the table control.
When I press the 'Cancel' button, I require that the table-control should be cleared.
I tried using REFRESH CONTROL TC01 USING SCREEN 1001. But, the data doesn't get cleared.
Please advise.
Regards,
Saurabh Buksh.hi
good
try this example
REPORT demo_dynpro_tabcont_loop_at.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA: cols LIKE LINE OF flights-cols,
lines TYPE i.
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 CORRESPONDING FIELDS OF 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'.
DESCRIBE TABLE itab LINES lines.
flights-lines = lines.
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.
ENDCASE.
ENDMODULE.
thanks
mrutyun^ -
Hi Guys,
FYI, im having a table control with field Plant and Material. I have defaulted the <b>std search help</b> to field <u>Material</u> at the screen painter. Meaning system will call up the search help for Material once i press F4.
Since the search help for field Material is a collective search help, and there is a <u>Plant</u> field available for Material filtering. Thus i may need to get the Plant's value from of same row of the table control to Populate into the Material's search help.
I have already tried to create a new module under the LOOP...ENDLOOP at PAI's flow logic. And try to use parameter id to set the value for plant, purpose is to populate it to Material's search help when i click F4 on material field. The problem is the new module that i coded under LOOP...ENDLOOP will never trigger when i click F4. Because there is NO event to trigger my module.
Other than the above, i tried to code it under POV. But it doesn't work as well, because there is more than 1 record under table control and i can not determine the during runtime which row of F4 for material being click.
Please comment on this above on how to solve the problem.
Thanks in advance.Hi,
You can call standard collective search help [say for Eg:<b>MAT1</b>] through Process on value-request event and set the paramenter id of Plant field before calling the funtion module <b>'HELP_START'</b>.Then we can get the materials specific to the PLANT in the corresponding row of the TABLE CONTROL.
To get which row of the table control is clicked use <b>Get Cursor Line</b> Statement as i mentioned below.
Flow logic:
PROCESS ON VALUE-REQUEST.
FIELD x_marc-matnr MODULE mat_shelp.
Module definition:
MODULE mat_shelp INPUT.
DATA:v_help_info LIKE help_info,n TYPE i,
it_dyselect LIKE TABLE OF dselc WITH HEADER LINE,
it_dyvaltab LIKE TABLE OF dval WITH HEADER LINE.
REFRESH it_dyselect.
it_dyselect-fldname = 'MANDT'.
it_dyselect-dyfldname = 'SY-MANDT'.
APPEND it_dyselect.
it_dyselect-fldname = 'MATNR'.
it_dyselect-dyfldname = 'X_MARC-MATNR'.
APPEND it_dyselect.
v_help_info-call = 'M'.
v_help_info-object = 'F'.
v_help_info-program = sy-repid. "'ZVIG_MOD_TABLE_CONTROL_1'.
v_help_info-dynpro = sy-dynnr. "'9001'.
v_help_info-tabname = 'MARC'.
v_help_info-fieldname = 'MATNR'.
v_help_info-fieldtype = 'CHAR'.
v_help_info-keyword = 'MATNR'.
v_help_info-fieldlng = 18.
v_help_info-fldvalue = ''.
v_help_info-mcobj = 'MAT1'.
v_help_info-spras = 'E'.
v_help_info-menufunct = 'HC'.
v_help_info-title = 'SAP'.
v_help_info-dynprofld = 'X_MARC-MATNR'. <b>----
> Give ur screen field name</b>
v_help_info-tcode = sy-tcode. "'ZTC1'.
v_help_info-pfkey = 'MEN'.
v_help_info-docuid = 'FE'.
v_help_info-pov = 'N'.
v_help_info-curow = '2'.
v_help_info-cucol = '1'.
v_help_info-dynpprog = sy-repid. " ZVIG_MOD_TABLE_CONTROL_1
v_help_info-stepl = '1'.
v_help_info-selectart = 'A'.
GET CURSOR LINE n.
READ TABLE it_marc INTO x_marc INDEX n.
SET PARAMETER ID 'WRK' FIELD X_MARC-WERKS .
CALL FUNCTION 'HELP_START'
EXPORTING
help_infos = v_help_info
TABLES
dynpselect = it_dyselect
dynpvaluetab = it_dyvaltab .
ENDMODULE. " mat_shelp INPUT -
Data in Table Control vanishes after report execution
Hi,
I have created a report program with a table control on its selection screen (on a subscreen).
The report executes perfectly, but, after the report execution, once the control comes back to the selection screen, the data entered in the table control gets cleared.
Please let me know how can I retain the data entered in the table control even after the report execution.
Regards,
David.Hello,
When control comes back to selection screen. PBO event executes and possibly internal table has got cleared somewhere before that.
Debug you code to find the exact problem line. You can also add watchpoint for internal table with value initial. So code will break in debug mode whenever internal table is cleared.
Hope this helps!
Thanks,
Augustin. -
Values not getting displayed from first page of the report.
Values in the report is getting displayed from second page.
First page in the report only displaying the report title and column names.
Secone page onwards, data and column names are generated.
Can any one please help me, with the cause of the problem.what reporting tool?
Interactive Reporting
Financial Reporting
Maybe you are looking for
-
J2EE server not running. 503 service unavailable
Hi , J2EE Server is not starting. Rest all are running in mmc console.The contents of the file std_server0.out is as below. stdout/stderr redirect node name : server0 pid : 584 system name : J2E system nr. : 00 started at : Tue Feb 15 10:12:46 2005 C
-
Internal HD = 230GB External HD 1 = 1TB (WD Home Edition) (USB, Fire Wire, eSATA) External HD 2 = 1TB (WD Essential Edition) (USB) Unused External Drives 150GB x 2 (USB or Fire Wire) 60GB (USB or Fire Wire) Right now the WD HDs are a mirror RAID thro
-
Using work-flow for payment release
Dear Experts I have a problem when using work-flow for payment release: I am using ws00400012 as standard work-flow for payment release ,after posting invoice documents via FB60 BSEG is crated but BKPFID dose not exist in container . when I test this
-
How to Change POs before to be sent to the supplier
Hi gurus, My client needs in some cases make some changes manually in the PO (before the PO is sent to the supplier). All PO comes from SC initially, where is the WF. However, there are some functionalities that only the PO has, for instance, schedul
-
Where do I send my ipod to get fix when the screen is cracked?
where do i send my ipod to get fis when the screen cracked?