Data of table control not saved in variant of report
Hi ppl,
I have created a report program with some selection parameters.
Also, I have included a table control on the selection screen (using subscreen).
The report works perfectly.
But, when I press the SAVE button on the selection screen to save the data on the selection screen into a variant, the variant only stores the values of the parameters and select-options present on the screen. It is not capturing the data in the table control.
Please let me know if I need to do some additional coding for this.
Thanks,
David.
Hi David,
I too struggled a lot to find the solution ....atlast got it....It possible by exporting and importing the table control values to Database Index.
1. AT SELECTION SCREEN OUTPUT event triggers when you SAVE and GET the variant.
2. So write the logic in AT SELECTION-SCREEN OUTPUT event.
CONSTANTS: c_vari TYPE char30 VALUE
'(SAPLSVAR)RSVAR-VARIANT'.
FIELD-SYMBOLS: <lfs_vari> TYPE ANY.
ASSIGN: (c_vari) TO <lfs_vari>.
IF sy-subrc = 0.
IF <lfs_vari> IS NOT INITIAL.
IF ok_code = 'SPOS'.
EXPORT gt_chars[] TO DATABASE vari(tc) ID <lfs_vari>.
ELSEIF ok_code = space.
IMPORT gt_chars[] FROM DATABASE vari(tc) ID <lfs_vari>.
ENDIF.
ENDIF.
ENDIF.
In the above logic if OK_CODE is 'SPOS', that is for saving the variant with the name <lfs_vari>.
Similarly if the OK_CODE is other than, 'GET'....that is for retrieving the variant. But in case of getting the variant OK_CODE is not filled with 'GET', but variant will be filled. We should take variant filling as base and do as done above.
It worked for me.....
Similar Messages
-
Data in table control not seen for the Standard Transaction Iview
Hi
I am creating one Standard Transaction Iview for CATS .
While doing print preview in IE 6 , I am not able to see data in Table control(Data Entry Area ).
Can you please provide me the solution for how I can see the data in Table Control
Regards
RuturajHi David,
I too struggled a lot to find the solution ....atlast got it....It possible by exporting and importing the table control values to Database Index.
1. AT SELECTION SCREEN OUTPUT event triggers when you SAVE and GET the variant.
2. So write the logic in AT SELECTION-SCREEN OUTPUT event.
CONSTANTS: c_vari TYPE char30 VALUE
'(SAPLSVAR)RSVAR-VARIANT'.
FIELD-SYMBOLS: <lfs_vari> TYPE ANY.
ASSIGN: (c_vari) TO <lfs_vari>.
IF sy-subrc = 0.
IF <lfs_vari> IS NOT INITIAL.
IF ok_code = 'SPOS'.
EXPORT gt_chars[] TO DATABASE vari(tc) ID <lfs_vari>.
ELSEIF ok_code = space.
IMPORT gt_chars[] FROM DATABASE vari(tc) ID <lfs_vari>.
ENDIF.
ENDIF.
ENDIF.
In the above logic if OK_CODE is 'SPOS', that is for saving the variant with the name <lfs_vari>.
Similarly if the OK_CODE is other than, 'GET'....that is for retrieving the variant. But in case of getting the variant OK_CODE is not filled with 'GET', but variant will be filled. We should take variant filling as base and do as done above.
It worked for me..... -
How to delete data in table control
Hi,
I am doing module pool programming. After the user enters the data in table control after saving the data. if the user wants to remove the line item the line item shd be removed from the screen and data base.
Please Give me vaulable Suggestions
RegardsHi,
Screen 8002 (with table control) --> select records --> press delete button --> delete selected records
Now you wan to delete those records selected by the user at runtime when DELETE button is clicked.
Take another internal table and work area same as the initial internal table and work area used in screen 8002 which is to be used to delete the selected data.
Take the names of the input/output fields as work_area-field_name and select column in table control as work_area-flag.
Also take a flag field of size 1 datatype character as the last field in the internal table and work area while declaration.
You must have passed a code in PBO of the screen for reading internal table into the table control.
So it reads the internal table into the table control whenever you perform any action on use command.
All you need to do is to write a code to modify the internal table form the table control while performing any user action.
Remember to change the LINE SEL option in attributes of table control as MULTIPLE.
At screen logic,
PROCESS BEFORE OUTPUT.
MODULE status_8002. "for pf-status
LOOP WITH CONTROL po_tab. "po_tab is table control
MODULE pass_data. "to pass data into table control from internal table
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_8002. "for user command(back and exit)
LOOP WITH CONTROL po_tab.
MODULE modify_data. "to modify data from table control into table control
ENDLOOP.
MODULE delete. "to delete the selected records
In PBO,
*& Module STATUS_8002 OUTPUT
MODULE status_8002 OUTPUT.
SET pf-status 'ZAB_PFSTA'. " pf-status
DATA : line_count TYPE i.
DESCIRBE TABLE it_ekpo
LINES line_count.
po_tab-lines = line_count + 10.
" to make table control scrollable
ENDMODULE. " STATUS_8002 OUTPUT
*& Module PASS_DATA OUTPUT
MODULE pass_data OUTPUT.
READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE. " PASS_DATA OUTPUT
"it_ekpo is internal table and wa_ekpo is the work area
In PAI,
*& Module MODIFY_DATA INPUT
MODULE MODIFY_DATA INPUT.
MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
"modify records from table control into the internal table
ENDMODULE. " MODIFY_DATA INPUT
*& Module DELETE INPUT
MODULE DELETE INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'DELETE'. "when delete button is clicked
SORT IT_EKPO BY FLAG DESCENDING. "sort by flag(selection column value)
CLEAR WA_EKPO1.
CLEAR WA_EKPO.
REFRESH IT_EKPO1.
LOOP AT IT_EKPO INTO WA_EKPO WHERE FLAG = 'X'.
DATA : J TYPE I.
CLEAR J.
J = SY-TABIX. "assign index value if a record is selected
MOVE-CORRESPONDING WA_EKPO TO WA_EKPO1. "append selected records to another
"work area and append to another internal table to delete
APPEND WA_EKPO1 TO IT_EKPO1.
DELETE IT_EKPO. "delete the selected records from initial internal table
" to reflect the changes on the table control
ENDLOOP.
IF J = 0.
MESSAGE I006. "if no record selected
ELSE. "if some records are selected
DELETE ZEKPO FROM TABLE IT_EKPO1. "delete from database table
COMMIT WORK.
IF SY-SUBRC = 0.
MESSAGE S007. "success message (records deleted)
ENDIF.
ENDIF.
ENDCASE.
ENDMODULE. " DELETE INPUT
Now at PAI, you have delete records and these changes are reflected back to the internal table.
Now when PBO is executed it will again read the initial internal table and will not show the deleted records.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
How to populate data in table control .
hi all,
i put matnr no. in screen no. 103
validation is done at that screen only.
now when i want to modify dat record
when i put matnr no. at screen 103
so how i will get all data of dat number to table control screen.Hi Darshan,
Here is a detailed description of how to update data in table controll.
Updating data in table control
The ABAP language provides two mechanisms for loading the table control with data from the internal table and then storing the altered rows of the table control back to the internal table.
Method 1: Read the internal table into the Table Control in the screenu2019s flow logic. Used when the names of the Table Control fields are based on fields of the internal table.
Method 2: Read the internal table into the Table Control in the module pool code. Used when the names of the Table Control fields are based on fields of the database table.
Method 1 (table control fields = itab fields)
In the flow logic we can read an internal table using the LOOP statement. Define the reference to the relevant able control by specifying WITH CONTROL <ctrl>
Determine which table entry is to be read by specifying CURSOR <ctrl>-CURRENT_LINE.
After the read operation the field contents are placed in the header line of the internal table. If the fields in the table control have the same name as the internal they will be filled automatically. Otherwise we need to write a module to transfer the internal table fields to the screen fields.
We must reflect any changes the user makes to the fields of the table control in the internal table otherwise they will not appear when the screen is redisplayed after PBO processing, (eg, after the user presses Enter or scrolls) However, this processing should be performed only if changes have actually been made to the screen fields of the table control (hence the use of the ON REQUEST)
PROCESS BEFORE OUTPUT.
LOOP AT ITAB_REG WITH CONTROL TCREG
CURSOR TCREG-CURRENT_LINE.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT ITAB_REG.
MODULE MODIFY_ITAB_REG.
ENDLOOP.
MODULE MODIFY_ITAB_REG INPUT.
MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
ENDMODULE.
Method 2 (table control fields = dict. fields)
If using a LOOP statement without an internal table in the flow logic, we must read the data in a PBO module which is called each time the loop is processed.
Since, in this case, the system cannot determine the number of internal table entries itself, we must use the EXIT FROM STEP-LOOP statement to ensure that no blank lines are displayed in the table control if there are no more corresponding entries in the internal table.
PROCESS BEFORE OUTPUT.
LOOP WITH CONTROL TCREG.
MODULE READ_ITAB_REG.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL TCREG.
CHAIN.
FIELD: ITAB_REG-REG,
ITAB_REG-DESC.
MODULE MODIFY_ITAB_REG
ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE READ_ITAB_REG OUTPUT.
READ TABLE ITAB_REG INDEX TCREG-CURRENT_LINE.
IF SY-SUBRC EQ 0.
MOVE-CORRESPONDING ITAB_REREG TO TCREG.
ELSE.
EXIT FROM STEP-LOOP.
ENDIF.
ENDMODULE.
MODULE MODIFY_ITAB_REG INPUT.
MOVE-CORRESPONDING TCREG TO ITAB_REG.
MODIFY ITAB_REG INDEX
TCREG-CURRENT_LINE.
ENDMODULE.
Updating the internal table
Method 1
PROCESS AFTER INPUT.
LOOP AT ITAB_REG.
CHAIN.
FIELD: ITAB_REG-REG,
ITAB_REG-DESC.
MODULE MODIFY_ITAB_REG ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE MODIFY_ITAB_REG INPUT.
ITAB_REG-MARK = u2018Xu2019.
MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
ENDMODULE.
Method 2
PROCESS AFTER INPUT.
LOOP WITH CONTROL TCREG.
CHAIN.
FIELD: TCREG-REG,
TCREG-DESC.
MODULE MODIFY_ITAB_REG ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE MODIFY_ITAB_REG INPUT.
MOVE-CORRESPONDING TCREG TO ITAB_REG.
ITAB_REG-MARK = u2018Xu2019.
MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
ENDMODULE.
Updating the database
MODULE USER_COMMAND_100.
CASE OK_CODE.
WHEN u2018SAVEu2019.
LOOP AT ITAB-REG.
CHECK ITAB_REG-MARK = u2018Xu2019.
MOVE-CORRESPONDING ITAB_REG TO TCREG.
UPDATE TCREG.
ENDLOOP.
WHEN u2026
u2026
ENDCASE.
ENDMODULE.
Hope this will solve your problem.
Regards,
Pavan.
Edited by: PAVAN CHANDRASEKHAR GANTI on Aug 3, 2009 12:48 PM -
How to modify data in table control
hi
i have created table control where i have displayed data into table control
logic used
screen 200
PROCESS BEFORE OUTPUT.
MODULE SELECT_RECORD.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TBC_200'
MODULE TBC_200_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TBC_200_CHANGE_COL_ATTR.
LOOP AT IT_MARA
INTO WA_MARA
WITH CONTROL TBC_200
CURSOR TBC_200-CURRENT_LINE.
MODULE TBC_200_GET_LINES.
*&SPWIZARD: MODULE TBC_200_CHANGE_FIELD_ATTR
ENDLOOP.
MODULE STATUS_0200.
PROCESS AFTER INPUT.
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TBC_200'
LOOP AT IT_MARA.
CHAIN.
FIELD WA_MARA-MATNR.
FIELD WA_MARA-ERSDA.
FIELD WA_MARA-ERNAM.
MODULE TBC_200_MODIFY ON CHAIN-REQUEST.
ENDCHAIN.
FIELD WA_MARA-MARK
MODULE TBC_200_MARK ON REQUEST.
ENDLOOP.
MODULE TBC_200_USER_COMMAND.
*&SPWIZARD: MODULE TBC_200_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TBC_200_CHANGE_COL_ATTR.
module -
MODULE SELECT_RECORD.
MODULE SELECT_RECORD OUTPUT.
SELECT MATNR ERSDA ERNAM
FROM MARA
INTO CORRESPONDING FIELDS OF TABLE it_mara.
ENDMODULE. " SELECT_RECORD OUTPUT
and
another thing
i have made field MARA-ERSDA. and FIELD WA_MARA-ERNAM editable by
input possible using layout
so
now those 2 fields contents are editable
i want to know how to edit and save the data
some body guide.
and i want to put the lock so that i can update
can tell how to implement lock.
Thanks
Edited by: viju bangalore on Jan 27, 2011 10:40 AMHi Viju,
In PAI do something like this
LOOP AT itab.
MODULE mod_table_control.
ENDLOOP.
MODULE user_command_0100.
at module mod_table_control put this
MODULE mod_table_control INPUT.
MODIFY itab FROM demo_conn INDEX flights-current_line.
if sy-subrc ne 0.
insert itab.
endif.
ENDMODULE.
for saving you can create at custom gui status with a save button, and at MODULE user_command_0100 save the data. -
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 -
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> -
Urgent!!!!! Inserting data in table control of infotype.
Hi Experts,
I want to insert data in custom infotype.I am using FM HR_INFOTYPE_OPERATION for this purpose.But custom infotype contains a table control.
Table control of infotype has 20 rows containing fields name01 , addr01 upto name20 , addr20.
How do i insert data in table control fields of infotype if i want to use FM HR_INFOTYPE_OPERATION .
Pls suggest if there is another way to do it.
Thanks.Thanks for your reply.
I am Calling FM HR_INFOTYPE_OPERATION in a loop of a table.
Table contains multiple employee numbers-PERNR.There can be all different PERNR or some records of same PERNR.
Suppose if there are four records in the table.First two records are of the same PERNR.Then how would name01 or name02 will be assigned.
Now, third record is of new PERNR .Again it should be name01.
So the question is how everytime in a loop i will assign nameNN for different PERNR.
nameNN and addrNN was an example. I am sending my code here.
Loop at it_data.
gs_9000-PERNR = it_data-pernr..
gs_9000-currentamount03 = it_data-curramt.
gs_9000-mtdamount03 = it_data-mtd.
gs_9000-qtdamount03 = it_data-qtd.
gs_9000-ytdamount03 = it_data-ytd.
gs_9000-roll12amount03 = it_data-roll.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = gs_9000-pernr
IMPORTING
RETURN = RETURNE.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '9000'
NUMBER = gs_9000-PERNR
VALIDITYBEGIN = '20080801'
RECORD = gs_9000
OPERATION = 'INS'
TCLAS = 'A'
DIALOG_MODE = '0'
IMPORTING
RETURN = RETURN
KEY = KEY.
IF RETURN IS NOT INITIAL.
WRITE :/ 'Error Occurred'.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = gs_9000-PERNR
endloop.
So in above code...
gs_9000-currentamount03 = it_data-curramt.
gs_9000-mtdamount03 = it_data-mtd.
gs_9000-qtdamount03 = it_data-qtd.
gs_9000-ytdamount03 = it_data-ytd.
gs_9000-roll12amount03 = it_data-roll.
these are table control fields , so how i wud i assign for
gs_9000-currentamount04 = it_data-curramt.
gs_9000-mtdamount04 = it_data-mtd.
gs_9000-qtdamount04 = it_data-qtd.
gs_9000-ytdamount04 = it_data-ytd.
gs_9000-roll12amount04 = it_data-roll.
in loop of a table.
Thanks -
How to transfer data in table control in bdc
hi
how to transfer data in table control in bdc . I need the theory regarding this
byeHi,
just check in the forum , there is many threads available to ur questions.
Table control in BDC
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
You can even refer to these related threads
bdc table control
Re: table control in bdc
table control in BDC
Reward if helpful.
Thanks
Naveen khan -
How to clear data in Table Control.
hi! all
How to clear the data in table control.
i have a Table control which displays column A data from the previous screen and allows to enter column B and column C and i have a button CLEAR, when i click CLEAR button the Data displaying in table control has to be cleared. how to do it.
Regards,
NagulanHi,
Loop over the internal table of table control & clear data from table control.
loop at tctab.
clear tctab.
modify tctab.
endloop.
Best regards,
Prashant -
How to show data through table control
Hi Experts,
I have created an table control through wizard using table EKKO.
I have to populate one internal table( type ekko ), and then show it in output through table control.
Please advise, how to do that and in where i have to write the codes.
I will reward points for every suggestion
Thanks in advance.
regardshi saubrab,
This is kiran kumar.G.I am sending some sample code to populate data into table control check it once.
i will give input in 100 screen. and display table control in 200 screen.check it once once ..ok....
SE38 :(CODE)
*& Module pool YMODULEPOOL_TABLECONTROL1 *
*& DEVELOPER : KIRAN KUMAR.G *
*& PURPOSE : TABLE CONTROL DEMO *
*& CREATION DT : 17/12/2007 *
*& T.CODE : YMODTABLECONTROL1 *
*& REQUEST : ERPK900035 *
PROGRAM ymodulepool_tablecontrol1.
Tables
TABLES: yvbap, "Sales Document: Item Data
vbak. "Sales Document: Header Data
Controls
CONTROLS: my_table TYPE TABLEVIEW USING SCREEN 200.
Global Variables
DATA: gv_lines TYPE i,
gv_lines1 type i,
gv_temp type i,
gv_flag(20) TYPE c VALUE 'DISP',
gv_mode1 TYPE c,
gv_mode TYPE c VALUE 'C'. " C: Change, D :Display
Internal Table
DATA: BEGIN OF gt_item OCCURS 0,
vbeln LIKE vbap-vbeln, "Sales Document Number
posnr LIKE vbap-posnr, "Sales Document Item
matnr LIKE vbap-matnr, "Material Number
matkl LIKE vbap-matkl, "Material Group
arktx LIKE vbap-arktx, "Short Text for Sales Order Item
cflag, "Deletion Indicator
END OF gt_item.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'ZTABLECONTROL' OF PROGRAM 'YMODULEPOOL_TABLECONTROL'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'DISP'.
SELECT single vbeln
erdat
angdt
bnddt
FROM vbak
INTO (vbak-vbeln,vbak-erdat,
vbak-angdt,vbak-bnddt)
WHERE vbeln = vbak-vbeln.
IF sy-subrc EQ 0.
*Fetch the table control data and place them in Internal Table
SELECT vbeln
posnr
matnr
matkl
arktx
FROM yvbap
INTO TABLE gt_item
WHERE vbeln = vbak-vbeln.
IF sy-subrc EQ 0.
*NO OF line in the Internal Table
DESCRIBE TABLE gt_item LINES gv_lines.
my_table-lines = gv_lines + 20.
ENDIF.
ENDIF.
*Call Screen 200.
SET SCREEN 200.
WHEN 'EXIT' OR 'BACK' OR 'CANCEL'.
*Exit from the Program
CALL TRANSACTION 'SESSION_MANAGER'.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
module STATUS_0200 output.
SET PF-STATUS 'ZTABLECONTROL1'.
endmodule. " STATUS_0200 OUTPU
*& Module copy_data OUTPUT
text
module copy_data output.
*Fetch the current line data from the Table control
read table gt_item index my_table-current_line.
if sy-subrc eq 0.
*Populating data into screen fields
gt_item-vbeln = gt_item-vbeln.
gt_item-posnr = gt_item-posnr.
gt_item-matnr = gt_item-matnr.
gt_item-matkl = gt_item-matkl.
gt_item-arktx = gt_item-arktx.
endif.
SE51:CODE (SCREEN 100)
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
SE51 :CODE (SCREEN 200)
PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
loop at gt_item with control my_table cursor my_table-current_line.
module copy_data.
endloop.
PROCESS AFTER INPUT.
loop at gt_item.
MODULE USER_COMMAND_0200.
endloop.
HAVE A NICE DAY..
Award points if helpful,kiran kumar.G -
How to insert data into table control
hi experts,,
i have inserted data into data base table through table control .
now i want to insert data into table control through database table.
how to delete data from table control for selected rowHi
go through this link.
http://www.****************/Tutorials/ABAP/TableControl/Demo.htm -
Table Control not displaying selected data
I have 2 screens, screen 100 is the selection screen where i select the data to be displayed and 300 is my table control. When I select a single airline in screen 100, it displays all the airlines in my table control in screen 300, how can i fix?
Table control if built via the screen painter wizard uses the contents of internal table declared in the main program and defined in the wizard to display. Check how you are filling this table, perhaps your filling it incorrectly.
-
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 -
How to write bdc programme to load the data in table control
Hi
i have to write a bdc programme and the data to be filled in table control fileds can any one help me with the code how i have to write it is for cs02 tcode
thanks and regards
naveenHi Naveen,
See the sample code
PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29N-DATUV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=KALL'.
PERFORM bdc_field USING 'RC29N-MATNR'
w_matnr.
PERFORM bdc_field USING 'RC29N-WERKS'
w_werks.
PERFORM bdc_field USING 'RC29N-STLAN'
'1'.
PERFORM bdc_field USING 'RC29N-DATUV'
'01/01/2004'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '2110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCPU'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29K-BMENG'.
PERFORM bdc_field USING 'RC29K-BMENG'
w_testuph.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0150'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-MENGE(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCBU'.
PERFORM bdc_field USING 'RC29P-MENGE(01)'
w_testuph.
"For raw material.
IF NOT w_raw_mat_fg IS INITIAL.
PERFORM bdc_field USING 'RC29P-MENGE(02)'
w_testuph.
ENDIF.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POTX1'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POTX1'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0150'.
CALL TRANSACTION 'CS02' USING bdcdata MODE w_display_mode UPDATE 'S'
MESSAGES INTO t_message_tab.
Prabhudas
Maybe you are looking for
-
Oracle Management Server could not be started while installing 12c
Hello All, I'm trying to installing the Oracle 12cR2 on OEL6 32 bit over Oracle Virtual Box. The installation went smooth but at 79% of the installation, it throws me error as the OMS server is down and it could not be started. I tried to started the
-
Hi everyone, hope you can help. My iphone was stood on and broken and i hadnt backed it up to itunes, i have had it repaired, it looks brand new but it has no audio at all, i have very important voice recordings that i need off the phone i can see t
-
Hi Guys, I need to generate following reports on daily basis from Production client. But its taking lot of time becoz of huge data to retirve. I request you to help me out in which table and fields can i get the data faster, so that time can be saved
-
OBIEE write back error MSG: OPR4ONWY:U9IM8TAC:OI2DL65P
Hello there, I've been trying to use OBIEE write back function. I've created XML template to insert and update value in OBIEE dashboard and then to the DB. I've look into several research paper, yet I still have the problem. Your help is greatly appr
-
Collective Order good moviement 101 - 261 ( sub - order )
Dear gurus, i inserted in the HALB component the special procurement (52) and the Type procurement = E I created a production order for the Material Fert and the system create a collective order . Order 0001 for the FERT material and the order 0002 f