Hotspot in table control
Hello All....
i hav created a screen with table control .what i m doing is when i select a row n press execute ,it process the row n show the output in the desired feild i want ,but now what i want it as soon as i select a row it should execute , may be it can be done by hotspot but how to do it in table control for the entire row .
Hi Nikita.,
You have to use AT-CURSOR SELECTION EVENT to achieve this ..place the following code in PAI of ur flowlogic .
FIELD ZERNUM_TSHT_HD-EMPID MODULE CALL_REPORT AT CURSOR-SELECTION .
In program add the following code .
*& Module CALL_REPORT INPUT
text
MODULE CALL_REPORT INPUT.
DATA V LIKE ZERNUM_TSHT_HD-EMPID .
GET CURSOR FIELD ZERNUM_TSHT_HD-EMPID VALUE V.
SUBMIT ZERUM_EMP_TIMS VIA SELECTION-SCREEN WITH PA_EMPID = V AND RETURN.
ZERNUM_TSHT_HD-EMPID = V .
ENDMODULE. " CALL_REPORT INPUT
Also set Function Code "CS" to "F2" function key .When u set like this Double Click will automatically set to that function code.Hope it helps, any queries revert back .
Thanks&Regards.,
S.Sivakumar
Similar Messages
-
Hi!
I want to develop hotspot in Table control. It means when i make ONE click on the field i want to go to PAI.
I've set properties:
1. "Responds double click" in field properties.
2. In dialog status F2 have PICK code.
But now only double click works (Hi,
HOTSOPT is available with reports only. But the default function key for double click is F2. So you may handle the double click and process logic according to that in user command.
Regards,
Renjith Michael. -
Hand mouse icon in Table Controle
Hi Guys,
Is it possible to change the mouse icon into a hand in a table controle when it pass over a field?
This field must call other transaction filling the Parameter ID with your content.
Att.Hi
I don't think, you should use an ALV grid setting a cell available for hotspot
Max -
Reg:How to delete the column in table control also from database table.
Hi Experts,
Once again thank u all for giving the responses.
one more doubt is how to delete the columns of table control and also the record shold delete from ztable.
With Regards,
Saroja.P.Hi,
If you want to delete the rows in the table control and simultaneously delete it from the database table, then you can implement a 'DELETE' functionality specific to your table control. Have a MARK field (you will find that in the screen attributes of the table control -> give a name for the MARK field, you will find an additional MARK column at the beginning of your table control). You can check whatever rows you want to delete from the table control, call the delete module.
"This portion of code inside the LOOP...ENDLOOP.
IF sy-ucomm eq 'F_DELETE'.
gt_itab2-check = mark. " Store the MARK field status into your internal table's correspoding field 'check'
MODIFY gt_itab INDEX tabcontrol-current_line.
ENDIF.
iF sy-ucomm eq 'DELETE1'.
DELETE gt_itab WHERE check eq 'X'. "Your internal table does not have rows that you want to delete
ENDIF.
Now you can modify your database table using the MODIFY statement.
MODIFY ZDB FROM TABLE gt_itab. -
How to delete the row in table control with respect to one field in module pool programming?
Hi,
Can I know the way to delete the row in table control with respect to one field in module pool programming
Regards
Darshan MSHI,
I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
I have written this code,
module USER_COMMAND_9000 input.
DATA OK_CODE TYPE SY-UCOMM.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'DELETE'.
LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
APPEND LS_SOURCE TO LT_RESTORE.
DELETE TABLE LT_SOURCE FROM LS_SOURCE.
SOURCE-LINES = SOURCE-LINES - 1.
ENDLOOP.
But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
So I thought of doing with respect to the field. -
HAI FRIENDS,
I HAVE DISPLAYED THE VALUES IN THE TABLE CONTROL
I HAVE DEFINED 'CHECK' FOR SELECTING THE FIELDS OF TABLE CONTROL
THE ISSUE STARTS HERE
WHEN I CHECK TOP FIELDS OF TABLE CONTROL
THEN SCROLLED VERTICALLY, THE TABLE CONTROL TO SELECT I.E CHECK THE
BOTTOM FIELDS OF TABLE CONTROL.
THE TOP FIELDS WATEVER CHECK WHERE CHECKS DISPAPEARS FOR TOP FIELDS .
BY THIS I UNABLE TO SELECT THE FIELDS OF TABLE.
PLZ HELP ME URGENTLY NEEDED.
MY MONDAY I NEEDEDYou use an internal table for values in table control..
One of the fields( very first field) in that itab is used for check - uncheck..
u have make it 'X' when u click any row...
I think this might be the problem in ur case.. when u scroll PAI starts... in that PAI check the value of check box for that particular field...
Regards
Prax -
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 -
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 -
Validação de campos em um Table Control
Boa tarde.
Gostaria de pedir um auxilio .
Tenho uma duvida, na seguinte situação. Estou construindo um programa de Module Pool
Neste programa vai ter um tabstrip, para atualizar duas tabelas Z
Na primeira u201CABAu201D, serão inseridos os registros da tabela pai e na segunda u201CABAu201D, os registros da tabela
Filho a relação será de 1 para N.
Na tabela filho os campos chaves serão um identificador próprio , mais o registro chave da tabela pai.
Na segunda a aba para inserir os registros da tabela filho, terei que usar um table Control.
O meu problema é que ao inserir os registros na tabela filho, terei que de forma automática preencher o campo que corresponde a chave da tabela pai. Ou seja o usuário na primeira u201Cabau201D digamos digite o código da tabela pai como 10 ao inserir na table Control um registro o campo correspondente a chave da tabela pai devera ser preenchido com o valor 10 e não permitir ao usuário efetuar qualquer manutenção neste campo.
Como eu faço isso???
Alguém tem algum exemplo????
Obrigado a todosOlá, bom dia!
Este é um dessenvolvimento bem específico, talvez por isso ninguem lhe respondeu ainda. Voce já deu uma olhada na seção de Wiki, buscando algum código de exemplo?
Vai alguns links que encontrei:
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1499ec90-0201-0010-769f-860989655f7e?QuickLink=index&overridelayout=true
http://wiki.sdn.sap.com/wiki/display/sandbox/ModulePoolProgramming
O primeiro link traz um exemplo de como torna um campo ineditavel via codigo. Espero que possa ajudar.
Abraços,
Rodrigo Paisante -
Capture field name in table control on double click
Hi,
How can I capture the field name of internal table passed to table control on double click?
I have set function code as 'PICK' and applied 'Respond to double click' and used GET CURSOR statement. Here I can get the values like row number (line number), field value also. But I would like to capture on which field the cursor is (or on which column the cursor is)?
Thanks in advance.
Regards
Ramesh.Got it.
We can capture it by using the statement GET CURSOR only.
GET CURSOR field <field xx> .
Here the <field xx> is the field name where we have said double click. -
How to activate the Vertival Scroll Bar to Table control
Hi All,
I Have created a Module pool table control(Wizard) with Input control,where user can enter the values in the screen.
In my screen 15 lines are visible,once i enter all 15 rows,vertical scroll bar is active,but rest of all lines are in deactivate mode.
My requirement is:Once i enter all the visible lines,the remaining lines should be in activ mode(In put control).
I appreciate your response.
Best Regards,
SeshadriDATA : BEGIN OF IT_MARA OCCURS 1,
MATNR LIKE MARA-MATNR,
ERSDA LIKE MARA-ERSDA,
ERNAM LIKE MARA-ERNAM,
MTART LIKE MARA-MTART,
MBRSH LIKE MARA-MBRSH,
V_FLAG TYPE C,
END OF IT_MARA.
DATA : WA_MARA LIKE it_MARA .
CONTROLS TABLE TYPE TABLEVIEW USING SCREEN 100.
MODULE POPULATE_100 INPUT.
CASE SY-UCOMM.
WHEN 'DISP'.
SELECT MATNR
ERSDA
ERNAM
MTART
MBRSH FROM MARA INTO WA_MARA .
APPEND WA_MARA TO IT_MARA.
ENDSELECT.
DESCRIBE TABLE IT_MARA LINES V_TEXT.
TABLE-LINES = V_TEXT.
CLEAR IT_MARA.
Regards..
Balaji ( assign if this helps u ..) -
Problem while saveing in Table Control.
Hi
I am geting error while saving data in table control.
This table contol is pop up window at end of screen .
user enter qty & uom in TC..
Error i am getting is...
Field symbol has not been assigned.
Error analysis
The system tried to access an anasigned field symbol (data segment
number 32772).
The field symbol is no longer assigned, because a Unicode program
previously tried to set the field symbol using an ASSIGN statement with
an offset/length declaration. The memory addressed in this offset/length
declaration, however, no longer lay within the valid range.
Information on where terminated
The termination occurred in the ABAP program "SAPLOMCV" in
"CONVERSION_EXIT_MATN1_INPUT".
i Have coded like this..
MODULE USER_COMMAND_0112 INPUT.
CASE OKCODE.
WHEN 'BACK' or 'CANCEL'.
SET SCREEN 0.
This iti is contain data which diplay in TC
when 'DISPLAY'.
LOOP AT ITI.
read table iti with key ingr_code = iti-ingr_code
ingr_desc = iti-ingr_desc.
wka1-ingr_code = iti-ingr_code.
wka1-ingr_desc = iti-ingr_desc.
wka1-conc = iti-conc.
wka1-quantity = iti-quantity.
wka1-uom = iti-uom.
append wka1 to itf.
ENDLOOP.
WHEN 'SAV'.
loop at itf where check = 'x' .
update zacg_ns
set ingr_code = itf-ingr_code
col_name = itf-ingr_desc
conc = itf-conc
quantity = itf-quantity
UOM = itf-UOM
ru = itf-ru
where ingr_code = itf-ingr_code
and col_name = itf-ingr_desc.
zacg_ns-ingr_code = itf-ingr_code.
zacg_ns-col_name = itf-ingr_desc.
zacg_ns-conc = itf-conc.
zacg_ns-quantity = itf-quantity.
zacg_ns-UOM = itf-UOM.
update zacg_ns.
endloop.
leave program.
ENDCASE.
ENDMODULE. " USER_COMMAND_0112 INPUT
MODULE read_table_control INPUT
MODULE read_table_control INPUT.
MODIFY itf INDEX tc-current_line.
ENDMODULE. "read_table_control INPUT
*& Include ZACG_NS_2 *
*& Module STATUS_0111 OUTPUT
text
MODULE STATUS_0111 OUTPUT.
SET PF-STATUS 'ZNEWSHADE'.
SET TITLEBAR 'ZNS'.
ENDMODULE. " STATUS_0111 OUTPUT
*& Module STATUS_0112 OUTPUT
text
MODULE STATUS_0112 OUTPUT.
SET PF-STATUS 'ZTC'.
SET TITLEBAR 'xxx'.
DESCRIBE TABLE itf LINES lines.
tc-lines = lines.
ENDMODULE. " STATUS_0112 OUTPUt
PROCESS BEFORE OUTPUT.
MODULE STATUS_0112.
LOOP at itf WITH CONTROL TC CURSOR tc-current_line.
MODULE TC_PBO .
ENDLOOP.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
LOOP at itf .
module read_table_control.
ENDLOOP.
MODULE USER_COMMAND_0112.
Can any one help me..Hi,
Did you enter that filed later after creating the table control?
You check in the element list whether for that element u have an entry or not..
Regards,
Nishant -
Module pool - table control - update ztable
hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
pd: sorry for my bad english
this is my code:
TOP:
PROGRAM z_pp_lote_etiquetas MESSAGE-ID zz.
TABLES:zc2p_lote_etique,
zc2p_lider_modul.
DATA: ok_code LIKE sy-ucomm.
DATA save_ok LIKE sy-ucomm.
* internal table
DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
**************Workarea
DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
DATA: sel.
DATA: MARK.
DATA: init.
DATA: col TYPE scxtab_column.
DATA: lines TYPE i.
* Variable Declaration
DATA : flg, "Flag to set the change mode
ln TYPE i. "No. of records
* Table Control Declartion.
CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
**PROCESS BEFORE OUTPUT INCLUDE **
*& Include Z_PP_LOTE_ETIQUETAS_O01
*& Module set_status OUTPUT
* Setting the GUI status
MODULE status_0100 OUTPUT.
SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
SET TITLEBAR 'Z_PP_LOT_ETIQ'.
ENDMODULE. " set_status OUTPUT screen 100
* MODULE status_0101 OUTPUT
* Setting the GUI status
MODULE status_0101 OUTPUT.
SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
SET TITLEBAR 'Z_PP_LOT_ETIQ'.
* Data retreving
if init is INITIAL.
select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
zc2p_lider_crtl-lines = ln + 10.
init = 'X'.
endif.
ENDMODULE. "status_0101 OUTPUT
module change_sdyn_conn output.
* you can change the content of current table control line via
* sdyn_conn
READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
endmodule. " FILL_TABLE_CONTROL OUTPUT
MODULE set_screen_fields OUTPUT.
LOOP AT SCREEN.
IF flg IS INITIAL.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
*ENDIF.
* Modifying the screen after making changes
MODIFY SCREEN.
ENDLOOP.
ENDMODULE. " set_screen_fields OUTPUT
PROCESS AFTER INPUT INCLUDE.
* MODULE USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'LIDM'.
CALL SCREEN 101.
WHEN 'CANC'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. "USER_COMMAND_0100 INPUT
* MODULE USER_COMMAND_0101 INPUT
MODULE user_command_0101 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'SORT'.
DATA: fldname(100),help(100).
READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
SPLIT col-screen-name AT '-' INTO help fldname.
SORT it_zc2p_lider_modul BY (fldname).
WHEN 'CHANGE'.
* Setting the flag to make the table control in editable mode[excluding
* primary key].
flg = 'Y'.
WHEN 'BACK'.
CALL SCREEN 100.
LEAVE SCREEN.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'SAVE'.
MODIFY zc2p_lider_modul FROM it_zc2p_lider_modul.
COMMIT WORK.
ENDCASE.
ENDMODULE. "USER_COMMAND_0101 INPUT
* MODULE read_table_control INPUT
MODULE read_table_control INPUT.
* Check input values
IF mark = 'X' AND save_ok = 'DELETE'.
DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
ENDIF.
ENDMODULE. " READ_TABLE_CONTROL INPUT
Screen Flow Logic 100
PROCESS BEFORE OUTPUT.
MODULE status_0100.
PROCESS AFTER INPUT.
MODULE user_command_0100.
Screen Flow Logic 101.
PROCESS BEFORE OUTPUT.
MODULE status_0101.
LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
zc2p_lider_crtl.
* Dynamic screen modifications
MODULE set_screen_fields.
MODULE change_sdyn_conn.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_0101.
LOOP AT it_zc2p_lider_modul.
MODULE read_table_control.
ENDLOOP.
i hope somebody can help for what i missing here thanks>
Sanjeev Kumar wrote:
> Hello Edgar,
>
> Problem seems to be there in the flow logic of 101
>
>
> PROCESS BEFORE OUTPUT.
> MODULE status_0101.
> LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
> zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
> * Dynamic screen modifications
> MODULE set_screen_fields.
> MODULE change_sdyn_conn.
> ENDLOOP.
> *
> PROCESS AFTER INPUT.
> MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.
>
> LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
> MODULE read_table_control.
> ENDLOOP.
>
>
>
> With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
>
> Try these changes and I hope it will work.
>
> Thanks
> Sanjeev
i do the firts advice but the second one i get syntax error :
my code :
PROCESS AFTER INPUT.
LOOP at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
MODULE read_table_control.
ENDLOOP.
MODULE user_command_0101.
error :
In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP
AT". -
Hi,
Currently using SAP 4.7 SAPKB62011
The need was to develop a program, which based on a selection-criteria displays a table(editable) and some changes will be done in the table and data should get saved.
The best approach I assumed was to
a) Create a report, define the selection screen parameters
b) Do validation in at selection-screen
c) If all validations are proper, select values to be shown in table control
d) call screen 9000
Everything is working perfectly, except for adding new lines in table control.
When I execute select query in AT SELECTION-SCREEN event before calling the screen 9000, then I am not able to add values to table control.
But if I put the select query in the PBO of screen 9000, I am able to add new values. Only those values which are already present in table control can be changed. I am not able to add any new entries.
In my opinion, there should not be a select query in PBO, because that query would hit the database in all possible events.
Any particular reason, why.
<b>AT SELECTION-SCREEN code</b>
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'ONLI'.
lv_pernr = p_pernr.
lv_lifnr = p_lifnr.
* SELECT *
* FROM zpersoninfo
* INTO TABLE lt_zpersoninfo
* WHERE personno = lv_pernr.
* IF sy-subrc <> 0.
* ENDIF.
* APPEND INITIAL LINE TO LT_ZPERSONINFO.
CALL SCREEN 9000.
ENDCASE.
<b>Dynpro code</b>
PROCESS BEFORE OUTPUT.
MODULE pbo_9000.
LOOP AT lt_zpersoninfo INTO zpersoninfo WITH CONTROL tablecontrol CURSOR
tablecontrol-current_line.
MODULE pbo_tc_9000.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP.
MODULE pai_tc_9000.
ENDLOOP.
MODULE pai_9000.
<b>PBO_9000</b>
MODULE pbo_9000 OUTPUT.
SET PF-STATUS lv_pfstatus.
pa0315-pernr = lv_pernr.
SELECT *
FROM zpersoninfo
INTO TABLE lt_zpersoninfo
WHERE personno = lv_pernr.
IF sy-subrc <> 0.
ENDIF.
APPEND INITIAL LINE TO LT_ZPERSONINFO.
ENDMODULE. " PBO_9000 OUTPUT
<b>PBO 9000 - Table Control Code</b>
MODULE pbo_tc_9000 OUTPUT.
LOOP AT SCREEN.
IF lv_pfstatus = 'DISPLAY'.
CASE screen-name.
WHEN 'ZPERSONINFO-SERVICENO'.
screen-input = '1'.
screen-active = '1'.
WHEN 'ZPERSONINFO-MANDATORY'.
screen-input = '1'.
screen-active = '1'.
ENDCASE.
ELSEIF lv_pfstatus = 'CHANGE'.
CASE screen-name.
WHEN 'ZPERSONINFO-SERVICENO'.
screen-input = '0'.
WHEN 'ZPERSONINFO-MANDATORY'.
screen-input = '0'.
ENDCASE.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDMODULE.
Let me know if I have skipped some information, which you may find it useful to find the solution.
Regards,
Subramanian V.That is because I didn't upate the 'LINES' field in tablecontrol. How silly !!
Regards,
Subramanian V. -
Table Control[Accept Input Only] - "ENTER" Key
Hi Folks,
I'm reviving this unanswered thread in relation to table control: when the user press enter, all the values entered disappear.
[url]Re: Table control (Enter key)[url]
I have a table control that accepts "ONLY" input, meaning to say, there will be no pre-loading of data in the PBO, so it will loop through the table control itself instead of looping from an internal table.
Issue: Whenever I press "ENTER" in any column/row of my table control, ALL the values I entered disappear.
PBO:
PROCESS BEFORE OUTPUT.
MODULE CLEAR_OKCODE.
MODULE LOAD_TABLECTRL.
LOOP WITH CONTROL TC_DATA.
MODULE READ_DATA.
ENDLOOP.
module READ_DATA output.
READ TABLE T_DATA INTO WA_DATA INDEX TC_DATA-current_line.
data : line_count type i.
"to increase the number of lines in table control dynamically
describe TABLE t_data lines line_count.
TC_DATA-lines = line_count + 10.
endmodule.
PAI:
PROCESS AFTER INPUT.
LOOP WITH CONTROL TC_DATA.
MODULE MODIFY_DATA.
ENDLOOP.
module MODIFY_DATA input.
WHEN 'CREATE'.
"subroutines are here, etc.
WHEN 'DELETE'.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
endmodule.
In my ABAP Debug, the value of SY-UCOMM is BLANK whenever I press Enter.
Thanks.Hi
Your code seems to be rght only the MODIFY statament is useless:
module READ_DATA output.
READ TABLE T_ID_CHECK INTO WA_ID_CHECK INDEX TC_ID-current_line.
IF SY-SUBRC EQ 0.
ZQID_CHECK-WERKS = WA_ID_CHECK-WERKS.
ZQID_CHECK-MATNR = WA_ID_CHECK-MATNR.
ZQID_CHECK-LICHA = WA_ID_CHECK-LICHA.
ZQID_CHECK-LIFNR = WA_ID_CHECK-LIFNR.
ELSE.
CLEAR ZQID_CHECK.
ENDIF.
endmodule.
Now before LOOP of PBO try to set the lines of table control to be display, I've created this report on my system and it works fine:
.CONTROLS T_CTRL TYPE TABLEVIEW USING SCREEN 100.
DATA: BEGIN OF ITAB OCCURS 0,
WERKS LIKE MARC-WERKS,
MATNR LIKE MARC-MATNR,
LIFNR LIKE LFA1-LIFNR,
END OF ITAB.
DATA: WA LIKE ITAB.
START-OF-SELECTION.
DO 4 TIMES.
ITAB-WERKS = '5010'.
ITAB-MATNR = '1234567890'.
ITAB-LIFNR = '0000000001'.
APPEND ITAB.
ENDDO.
CALL SCREEN 100.
PROCESS BEFORE OUTPUT.
MODULE SET_T_CTRL.
LOOP WITH CONTROL T_CTRL.
MODULE READ_DATA.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL T_CTRL.
MODULE MODIFY_DATA.
ENDLOOP.
MODULE SET_T_CTRL OUTPUT.
DESCRIBE TABLE ITAB LINES T_CTRL-LINES.
ENDMODULE. " SET_T_CTRL OUTPUT
MODULE READ_DATA OUTPUT.
READ TABLE ITAB INDEX T_CTRL-CURRENT_LINE.
IF SY-SUBRC = 0.
MOVE-CORRESPONDING ITAB TO WA.
ELSE.
CLEAR WA.
ENDIF.
ENDMODULE. " READ_DATA OUTPUT
MODULE MODIFY_DATA INPUT.
MODIFY ITAB FROM WA INDEX T_CTRL-CURRENT_LINE.
IF SY-SUBRC NE 0.
CHECK NOT WA IS INITIAL.
APPEND WA TO ITAB.
ENDIF.
ENDMODULE. " MODIFY_DATA INPUT
Maybe you are looking for
-
Exit button not working when entering wrong date
how do I get the message not to appear by day Invalid (Frm-50004) in forms
-
Currently I have a Nokia 5530 XM and I had 2 questions 1. When will the Nokia 5530 get an update? ( I live in the US) 2. Will the 5530 get an update to Symbian S^3?
-
How to keep track of the users who are all currently logged in
Hi All, I have basic knowledge of Session and Servlets. I am wondering how to keep track of the users who are all currently logged in. There should be some way of achieving it. I thought of it and come up with having an Application variable that hold
-
Hi all I am trying to enhance the extractor 0HRPOSITION_ATTR by adding the head of org unit flag (ie Chief). In tx PPOSE it shows up as field OMLEADER in a structure. So I added OMLEADER to an append structure in RSA6 I am now trying to write some AB
-
DHCP Relay using Brocade Switches
Hi I have a large project with 3 UCM cluster with unity cluster and UCCX The network is a Brocade switch environement, The Core is using OSPF and distribution is Layer 2. I have configured the Cluster with a dedicated DHCP and TFTP service. DHCP rela