Updating custom table through table control in module pool
Hi
I am entering a data in the module pool screen in a table control . The functionality is that whatever i enter in a row gets updated in a custom table in the database with the same values . My problem is that when i enter some values and press the save button on the module pool screen , the data gets updated on the table but gets invisible from the module pool screen . The user wants the data to be displayed even after it has been saved ..if anyone can help on this ...
thanks
hi,
Check whether u have activated the report and screen.
Similar Messages
-
How to put scrol bar in table viw control in module pool programming
how to put scrool bar in table-view control in module pool programming
Hi Rani,
You need not insert Scrollbar in the table control, it appears automcatically once the amount of data vertical or horizontal limit of table control.
Regards,
Sathish
Note : Reward useful Answers -
How to delete a column from the table control in module pool?
Hi,
can any one please tell How to delete a column from the table control in module pool?
thanks in advance
warm regards
HareeshKumar Nhi hareesh,
I think it is better to hide it.
How to hide: You can check this link
Dynamic Hide column in table control -
Table control of Module Pool Program
Hi,
I need a help in the table control of Module pool.
Here I am using 40 columns in the table control. Out of 40, 30 columns are numeric type.
Now the client need only 5 columns total in the last row. I made it as per requirement.
But it is giving 5 columns total and the remaining 25 columns are filled zero value of total row.
Now the client doesnt want to display the zero for these 25 columns in the Total row.
Its very urgent. Please help on this.
Reward points will be providing for useful answers.
Advance Thanks 4 all.
Regards,
KBS REDDYHi,
In your PBO, inside LOOP ENDLOOP, have a module for screen modifications and for the last row that has totals, you set screen-invisible = 1 inside LOOP AT SCREEN. ENDLOOP.
For example,
If your screen has following PBO Logic,
MODULE ...
MODULE ...
LOOP ...
****New module here for screen modification if does not ****exist already.
MODULE modify_screen.
ENDLOOP.
and then in MODULE modify_screen.
MODULE modify_screen.
****Basically check MATNR EQ 'TOTAL' or some thing like ****that
IF <your condition for totals line>.
LOOP AT SCREEN.
****Note instead of screen-name, you can assign a screen ****group to all columns w/o totals and then use
****SCREEN-GROUP1 EQ <your grp> logic
IF screen-name EQ <your column name w/o totals>.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
On another note, since you are already disabling this fields in the last row, you have all the screen modification logic already I guess, so just add SCREEN-INVISIBLE = 1 for all fields w/o totals..
Hope this helps..
Sri
Message was edited by: Srikanth Pinnamaneni -
How to find the current line in the table control in module pool ?
How to find the current line in the table control in module pool ?
This is an urgent requirement? please do help me.refer to 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<b> flights-current_line.</b>
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. -
How to save Custom control records module pool program ?
Hi guru ,
1. How to save Custom control records module pool program ?
I wrote multiple lines of record in custom control
Who to save that records ?
thanking you.
Regards,
Subash.Hi Subasha,
Please check the format below since it is based on a working code
**************data declarations
TYPES: BEGIN OF TY_EDITOR,
EDIT(254) TYPE C,
END OF TY_EDITOR.
data: int_line type table of tline with header line.
data: gw_thead like thead.
data: int_table type standard table of ty_editor.
You should create a text for uniquely identifying the text you are saving each time so that it doesn't get overwritten
For this a key combination must be decidedd to uniquely identify the test..here it is loc_nam
****************fill header..from SO10( t-code )
GW_THEAD-TDNAME = loc_nam. " unique key for the text
GW_THEAD-TDID = 'ST'. " Text ID
GW_THEAD-TDSPRAS = SY-LANGU.
GW_THEAD-TDOBJECT = 'ZXXX'. "name of the text object created
*Read Container and get data to int_table
CALL METHOD EDITOR ->GET_TEXT_AS_R3TABLE
IMPORTING
TABLE = int_table
EXCEPTIONS
ERROR_DP = 1
ERROR_CNTL_CALL_METHOD = 2
ERROR_DP_CREATE = 3
POTENTIAL_DATA_LOSS = 4
others = 5.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop data from int_table and save to int_line-tdline appending it.
*save the text
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
HEADER = GW_THEAD
TABLES
LINES = InT_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
IF SY-SUBRC 0.
ENDIF.
The code shown above is ok and working fine for save also,hope that the above sample with helps you solve the problem
Please check and revert,
Reward if helpful
Regards
Byju -
How to insert tabstrip control in module pool screen painter
Hi all!
plz tell e how to use tabstrip control in module pool screen painter.Also plz give me an example program using tabstrip control.To insert tabstrip just open layout of screen and press on the tabstrip button there .
Use this souce code further to activate it .
CONTROLS tabstrip TYPE TABSTRIP.
DATA: okcode TYPE sy-ucomm,
dynnr TYPE sy-dynnr,
flag type flag,
active like tabstrip-activetab .
call SCREEN 100.
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
data: lv_okcode type syucomm.
lv_okcode = okcode.
clear okcode.
case lv_okcode.
WHEN 'TAB1'.
dynnr = '0110'.
WHEN 'TAB2'.
dynnr = '0120'.
WHEN 'TAB3'.
dynnr = '0130'.
WHEN 'TAB4'.
dynnr = '0140'.
WHEN 'TAB5'.
"check authorization, if authorization fails
flag = 'X'. "set the global flag
active = 'TAB1'. "store active tab in global variable
dynnr = '0110'. "set the screen number
WHEN 'BACK' or 'EXIT'.
leave program.
ENDCASE.
IF lv_okcode(3) = 'TAB'.
tabstrip-activetab = lv_okcode.
ENDIF.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN'.
SET TITLEBAR 'xxx'.
IF tabstrip-activetab IS INITIAL OR
dynnr IS INITIAL.
tabstrip-activetab = 'TAB1'.
dynnr = '0110'.
ENDIF.
"set the activetab explicilty here
if flag eq 'X'. "from authorization failure
tabstrip-activetab = active. "'TAB1'
clear flag.
endif.
ENDMODULE. " STATUS_0100 OUTPUT -
How to create subscreens in tabstrip control using module pool
hai experts,
can u plz give me step by step procedure to create subscreens in tabstrip control using module pool,hi,
You can check this program
<b> DEMO_DYNPRO_TABSTRIP_LOCAL </b>
This will help you in understanding the concept and how to create subscreens.
Regards
Nishant -
Update database table through table control
Dear friends
i have to update entered data in table control to data base table please suggest some modification in my coding for the same
following is my coding
report zrb_ins_data.
data wa_tmp_rebset type zrb_hed.
data wa_tmp_rebset1 type zrebate_items.
types:begin of st_hdr,
bukrs type zrb_hed-bukrs,
sch_typ type zrb_hed-sch_typ,
sch_desc type zrb_hed-sch_desc,
sch_no type zrb_hed-sch_no,
vtweg type zrb_hed-vtweg,
vkorg type zrb_hed-vkorg,
vkbur type zrb_hed-vkbur,
vkgrp type zrb_hed-vkgrp,
spart type zrb_hed-spart,
regio type zrb_hed-regio,
ort02 type zrb_hed-ort02,
ort01 type zrb_hed-ort01,
kunnr type zrb_hed-kunnr,
konzs type zrb_hed-konzs,
matkl type zrb_hed-matkl,
matnr type zrb_hed-matnr,
lifsk type zrb_hed-lifsk,
shtyp type zrb_hed-shtyp,
from_date type zrb_hed-from_date,
to_date type zrb_hed-to_date,
hkont type zrb_hed-hkont,
aufnr type zrb_hed-aufnr,
end of st_hdr.
types : begin of st_itm,
item_id type zrebate_items-sch_no,
sch_no type zrebate_items-sch_no,
from_dat type zrebate_items-from_dat,
to_dat type zrebate_items-to_dat,
type type zrebate_items-type,
qty_per_rate type zrebate_items-qty_per_rate,
key1 type zrebate_items-key1,
curr_com type zrebate_items-curr_com,
key2 type zrebate_items-key2,
qty_per_rate1 type zrebate_items-qty_per_rate1,
curr_com1 type zrebate_items-curr_com1,
end of st_itm.
data:it_hdr type table of st_hdr with header line,
wa_hdr type st_hdr,
it_itm type table of st_itm with header line,
wa_itm type st_itm.
controls ztbl type tableview using screen 1000.
*CALL SCREEN 1000.
*& Module STATUS_1000 OUTPUT
text
module status_1000 output.
set pf-status 'SYMBOL'.
set titlebar 'xxx'.
endmodule. " STATUS_1000 OUTPUT
*& Module USER_COMMAND_1000 INPUT
text
*module USER_COMMAND_1000 input.
*& Module get_data OUTPUT
text
*& Module user_command_1000 INPUT
text
module user_command_1000 input.
case sy-ucomm.
when 'EXEC'.
perform get_data.
endcase.
endmodule
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form get_data .
move-corresponding wa_hdr to wa_tmp_rebset.
modify zrb_hed from wa_tmp_rebset.
move-corresponding wa_itm to wa_tmp_rebset1.
wa_tmp_rebset1-item_id = 'TS1234'.
wa_tmp_rebset1-sch_no = wa_hdr-sch_no.
wa_tmp_rebset1-from_dat = wa_itm-from_dat.
wa_tmp_rebset1-to_dat = wa_itm-to_dat.
append wa_itm to it_itm.
modify zrebate_items from wa_tmp_rebset1.
endform.hi,
Refer to this link...you'll get the idea..
how to update dbtab from table control?
Re: How to update a DB from a table control.
Edited by: avinash kodarapu on Dec 27, 2008 12:36 PM -
BADI or User exit for FB50 to update custom field in table COEP
Hi all,
i have added one custom field in table COEP through include CI_COBL .
when i do posting through sales order(VA02) or purchase order(ME22n) that custom fields in COEP get updated with controlling document
and through BADI AC_DOCUMENT i m updating that custom field in COEP.
but when i do manual posting through FB50 controlling document is generated in COEP but i m not able to update that custom field
because in this case BADI AC_DOCUMENT is not get triggered.
is there any BADI or User exit or enhancement spot for FB50 through which i can update that custom field in table COEPHi Sandy,
Thanks for u r reply,
RFAVIS01 is not getting triggered through FB50
and F180A001 ( EXIT_SAPLF048_001) is getting triggered but it doesnt contain COEP field in its parameter
import - F180A_DOC_HEAD_TAB
F180A_DOC_ITEM_TAB
changing - RELATION_TAB -
Updating custom field in table EKKO within user exit when PO is saved
I am trying to update a custom field in table EKKO when a PO is saved. I am using FM EXIT_SAPMM06E_013, within enhancement MM06E005. Since EKKO is not a table that can be updated with this user exit, I am using a technic that I read about on SDN where I assign a field symbol to the calling program variable and then am able to access data within EKKO table. But when I pass this data back into the field symbol, for some reason this field is not getting saved when the PO is saved. In debug mode, it looks like this field is getting updated, but when I look in the table after the PO is saved, it is not there. My code sample is below. What I am doing wrong?
data:
CHAR(50) VALUE '(SAPLMEPO)EKKO-ZHDRCSTCENTER',
g_zhdrcstcenter like ekko-zhdrcstcenter,
FIELD-SYMBOLS <F1> type any.
if i_ekko-ekorg = '5401'.
ASSIGN (char) to <F1>.
g_zhdrcstcenter = <F1>.
move '0000113322' to g_zhdrcstcenter.
<F1> = g_zhdrcstcenter.
endif.
Thanks!
Sarah Smyth.Firstly, have you investigated using EXIT_SAPMM06E_008 to set any custom fields you have added in the EKKO_CI / CI_EKKODB structure?.. that might work more easily.
In terms of doing an assign back into a calling program's memory, it can work but it's probably worth setting a break point in your code then stepping through watching the values in EKKO - sometimes you can find subsequent code that re-writes an earlier copy of values back into the structure, thereby preventing you doing your change... SAP does warn this method is for "internal use". Also check in your debugger that it's SAPLMEPO and not SAPMM06E you need. -
Getting Error when createing Table control in Module Pool.
Hi expert ,
i am creating a module pool program . i want to crate line item value for that i have created table control on screen 200 .
but when i am activation to that giving error below mention.
The field "ZFBDCHALLAN-EBELN" is not assigned to a loop. "LOOP ...ENDLOOP" must appear in "PBO" and "PAI".
thanks
chandraIts mandatory to have loop endloop in both events
PBO and PAI
loop your internal table similarly.
Please check it should be below format
PROCESS BEFORE OUTPUT.
* Set PF Status for screen 100.
MODULE status_0200.
* This module will initialize the field
MODULE init_0100.
LOOP AT t_custmat_asg INTO w_custmat_asg
WITH CONTROL tc_1
CURSOR tc_1-current_line.
* It will count the record in internal table
MODULE set_linecount.
* Screen Modifications
MODULE status_check.
ENDLOOP.
PROCESS AFTER INPUT.
* Module AT EXIT-COMMAND
MODULE exit_0200 AT EXIT-COMMAND.
LOOP AT t_custmat_asg .
CHAIN.
FIELD :
w_custmat_asg-check,
w_custmat_asg-kunnr,
w_custmat_asg-name1,
w_custmat_asg-asgtyp,
w_custmat_asg-productcls,
w_custmat_asg-sctegry,
w_custmat_asg-ctegry,
w_custmat_asg-parent,
w_custmat_asg-frmdate,
w_custmat_asg-todate,
w_custmat_asg-frecster,
w_custmat_asg-salesrep,
w_custmat_asg-flag,
w_custmat_asg-username,
w_custmat_asg-udate.
* Validation For Forecaster.
MODULE validate_forecaster.
* Validation For Salesrep.
MODULE valiate_salesrep.
* Validation for Customer
module validate_customer.
* Validate null value
module validate_null_vals.
* Validation For Data Changed On The Screen
MODULE data_changed_0200 ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
Regards
Satish Boguda -
Table Control in Module Pool Programming
In my Module Pool program I have created a Table Control on my screen. In my Table one column is the Checkbox. When I make changes in any of the Checkbox and scroll the Table or scroll with mouse,the data is lost.I am updating the database table and for that I have created a 'SAVE' button.But to make the changes I have to Scroll the Table on the screen and the changed data is lost.
Please guide me or if possible then tell me the Flow Logic of Module Pool with Table Control??
Thanks for the Help....PROCESS BEFORE OUTPUT.
MODULE INITIALIZE.
*&spwizard: pbo flow logic for tablecontrol 'TBLALLOC_CYC'
module TBLALLOC_CYC_change_tc_attr.
*&spwizard: module TBLALLOC_CYC_change_col_attr.
loop at GT_NEW_ALLOC
into GT_NEW_ALLOC_WA
with control TBLALLOC_CYC
cursor TBLALLOC_CYC-current_line.
module TBLALLOC_CYC_get_lines.
*&spwizard: module TBLALLOC_CYC_change_field_attr
endloop.
MODULE STATUS_9003.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9003.
*MODULE USER_COMMAND_9003.
*&spwizard: pai flow logic for tablecontrol 'TBLALLOC_CYC'
loop at GT_NEW_ALLOC.
chain.
field GT_NEW_ALLOC_WA-/BIC/ZALLOCCYC.
field GT_NEW_ALLOC_WA-/BIC/UFACT_FLG.
field GT_NEW_ALLOC_WA-CHANGEDBY.
field GT_NEW_ALLOC_WA-CH_ON.
field GT_NEW_ALLOC_WA-/BIC/ECHAT.
module TBLALLOC_CYC_modify on chain-request.
endchain.
endloop.
module TBLALLOC_CYC_user_command.
*&spwizard: module TBLALLOC_CYC_change_tc_attr.
*&spwizard: module TBLALLOC_CYC_change_col_attr.
module TBLALLOC_CYC_user_command.
MODULE USER_COMMAND_9003.
MODULE INITIALIZE OUTPUT.
At the time of initialization of the screen data is to be displayed
by calling Function Module ZUFACTS_FETCH_ALLOC_CYC.
CALL FUNCTION 'ZUFACTS_FETCH_ALLOC_CYC'
TABLES
T_ALLOC = GT_NEW_ALLOC
Pass the value displayed in Internal Table GT_OLD_ALLOC.
GT_OLD_ALLOC[] = GT_NEW_ALLOC[].
MOVE GT_OLD_ALLOC TO GT_OLD_ALLOC.
*****Initialize the ok_code.
CLEAR OK_CODE .
ENDMODULE. " INITIALIZE OUTPUT
MODULE USER_COMMAND_9003 INPUT.
CASE : OK_CODE.
WHEN 'SAVE'.
CALL FUNCTION 'ZUFACTS_UPDATE_ALLOC_CYC'
TABLES
T_OLD_ALLOC = GT_OLD_ALLOC
T_NEW_ALLOC = GT_NEW_ALLOC
EXCEPTIONS
NO_FIELD_UPDATED = 1
UNSUCCESSFUL_UPDATION = 2
OTHERS = 3
IF SY-SUBRC = 1.
MESSAGE I005 .
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC = 2.
MESSAGE E006.
ENDIF.
WHEN 'CANCEL' OR 'BACK' OR '%EX' OR 'RW'.
LEAVE TO SCREEN 0.
ENDCASE.
CLEAR OK_CODE.
ENDMODULE. " USER_COMMAND_9003 INPUT -
To give colours for a certain row in table control in module pool
Hi,
In module pool,,,,,When I am displaying the Table Control......Suppose in some rows personnel no. is there and for the person who has exited from the company should be highlighted with red colour.
Please some code..
thanks..Hi Jayasree,
I think I had a similar requirement to have a one column on a particular row
available for input where all other rows for that column were not. It took
me a while to figure this out but it was quite simple. I expect it will
work for colour changes too.
In Process Before Output
LOOP AT INTERNAL TABLE INTO WA WITH CONTROL TC
Call Module
END LOOP
In the module program the condition on which the colour change / input
status etc has to be changed using
IF condition = true
LOOP AT SCREEN
IF SCREEN-NAME = column name
Make your colour / input status change
MODIFY SCREEN
ENDIF
ENDLOOP
ENDIF
I hope this helps you.
Please search the forum before adding a new thread. -
To delete multiple entries in table control in module pool
Hi,
Please help me out to know , <b>how to delete multiple entries from table control</b> when multiple lines in table control are selected.
Regards,
Irfan Hussainhai,
you can do it inthis way.
in the PAI event.
loop at <table control name>
module del_itab.
endloop.
in the nodule,write the folowing code.
if <tablecontrol>-fieldname = 'X'.
delete <tablecontrol-itab>
endif.
cheers
Maybe you are looking for
-
Query to see which system events are being traced?
I had an Oracle consultant working on our database recently. He left with some system level tracing running at level 16 (support) and the trace files are filling the disk. Is there a query I can do to determine which events are being traced so that I
-
Report 3.0 -- Problem !!!! (Very Urgent)
I have a report on Report 3.0 using Group above style, my SQL QUERY is SELECT Bank_CD,MFGR_TRAN_CD, ACC_NO, BALANCE FROM BANK_MSTR I have used grouping on Bank_CD ** MFGR_TRAN_CD --> Manufacturer or Transporter Code I created 2 PlaceHolders field 1)
-
What do i need to uninstall and reinstall photoshop cs5 extended windows 7 32-bit?
what do i need to uninstall and reinstall photoshop cs5 extended windows 7 32-bit?
-
Error Message " Where is the file '370.MTS'? "
Hello Experts.I am trying to open a PE version 9 project file with my newly installed PE version 12. I have a new laptop with windows 8. I think I correctly transfered the project file from my old computer that ran windows 7 (and has the PE 9 on it.)
-
How do i update to the latest ios7 without sim card
I tried to update me old iphone 4 that doesn't have any sim. I am using this phone as a security camera and was wondering how can I achieve the update without sim card. Any help is appreciated. PS I tried the one in google (ios7 beta) but in the late