How is table control data handled in Session Method?
Hi Friends,
Can any1 plz tell me how is table control data handled in Session Method.
In Call tran we do it by count. But how in Session Method?
Thank you.
Regards,
Varun.
Hi,
u can do it by both methods. u can check out this program. u need to comment the performs of table control fields and write ur own perform statements.And u have to declare the table control fields as separate internal tables.
report zcustomer_change_bict
no standard page heading line-size 255.
include bdcrecx1.
data: begin of it_record occurs 0,
kunnr like rf02d-kunnr,
d0360 like rf02d-d0360,
anred(30) type c,
name1(35) type c,
namev(35) type c,
telf1(35) type c,
abtnr(10) type c,
end of it_record.
data: begin of it_knvk1 occurs 0,
anred like knvk-anred,
end of it_knvk1.
data: begin of it_knvk2 occurs 0,
name1 like knvk-name1,
end of it_knvk2.
data: begin of it_knvk3 occurs 0,
namev like knvk-namev,
end of it_knvk3.
data: begin of it_knvk4 occurs 0,
telf1 like knvk-telf1,
end of it_knvk4.
data: begin of it_knvk5 occurs 0,
abtnr like knvk-abtnr,
end of it_knvk5.
data : fld(20) type c,
cnt(2) type n.
start-of-selection.
call function 'GUI_UPLOAD'
exporting
filename = 'C:\CUSTCH.TXT'
filetype = 'ASC'
has_field_separator = 'X'
tables
data_tab = it_record
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
perform open_group.
loop at it_record.
refresh bdcdata.
refresh: it_knvk1,it_knvk2,it_knvk3,it_knvk4,it_knvk5.
split it_record-anred at ',' into table it_knvk1.
split it_record-name1 at ',' into table it_knvk2.
split it_record-namev at ',' into table it_knvk3.
split it_record-telf1 at ',' into table it_knvk4.
split it_record-abtnr at ',' into table it_knvk5.
screen 101
perform bdc_dynpro using 'SAPMF02D' '0101'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-D0360'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02D-KUNNR'
it_record-kunnr.
perform bdc_field using 'RF02D-D0360'
it_record-d0360.
screen 360
perform bdc_dynpro using 'SAPMF02D' '0360'.
perform bdc_field using 'BDC_CURSOR'
'KNVK-ABTNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
*perform bdc_field using 'KNVK-ANRED(01)'
record-ANRED_01_003.
*perform bdc_field using 'KNVK-NAMEV(01)'
record-NAMEV_01_004.
*perform bdc_field using 'KNVK-NAME1(01)'
record-NAME1_01_005.
*perform bdc_field using 'KNVK-TELF1(01)'
record-TELF1_01_006.
*perform bdc_field using 'KNVK-ABTNR(01)'
record-ABTNR_01_007.
move 1 to cnt.
loop at it_knvk1 .
concatenate 'knvk-anred( ' cnt ' ) ' into fld.
perform bdc_field using fld it_knvk1-anred.
cnt = cnt + 1.
endloop.
move 1 to cnt.
loop at it_knvk2 .
concatenate 'knvk-name1( ' cnt ' ) ' into fld.
perform bdc_field using fld it_knvk2-name1.
cnt = cnt + 1.
endloop.
move 1 to cnt.
loop at it_knvk3 .
concatenate 'knvk-namev( ' cnt ' ) ' into fld.
perform bdc_field using fld it_knvk3-namev.
cnt = cnt + 1.
endloop.
move 1 to cnt.
loop at it_knvk4 .
concatenate 'knvk-telf1( ' cnt ' ) ' into fld.
perform bdc_field using fld it_knvk4-telf1.
cnt = cnt + 1.
endloop.
move 1 to cnt.
loop at it_knvk5 .
concatenate 'knvk-abtnr( ' cnt ' ) ' into fld.
perform bdc_field using fld it_knvk5-abtnr.
cnt = cnt + 1.
endloop.
screen 360
perform bdc_dynpro using 'SAPMF02D' '0360'.
perform bdc_field using 'BDC_CURSOR'
'KNVK-NAMEV(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_transaction using 'XD02'.
endloop.
perform close_group.
Similar Messages
-
How to modify changes of table control data in PAI
I have a table control where the columns are brought by dict fields.I am able to bring data into table control through an itab.
Now what i want is whenever user edits data in table control and clicks on save button the corresponding changes should be made in database.
For this according to my understanding we need to (in PAI) modify the changes in itab from the table control and then in SY-UCOMM of SAVE button we need to update in database table using itab.
For this , I am not able to write code for modifying the changes in itab from table control. Here is my code below.Please tell me how to do this.
PROCESS BEFORE OUTPUT.
MODULE FILL_DATA.
LOOP AT ITAB INTO ZEMPLOYEE_MASTER WITH CONTROL EMPTABLE CURSOR
EMPTABLE-CURRENT_LINE.
ENDLOOP.
MODULE STATUS_0001.
PROCESS AFTER INPUT.
LOOP AT ITAB.
MODULE MODIFY_ITAB.
ENDLOOP.
MODULE USER_COMMAND_0001.
REPORT ZDATA_FORM1.
TABLES: ZEMPLOYEE_MASTER.
CONTROLS EMPTABLE TYPE TABLEVIEW USING SCREEN 0001.
data: begin of itab occurs 0,
emp_no like zemployee_master-emp_no,
name like zemployee_master-name,
city like zemployee_master-city,
end of itab,
rowno TYPE I VALUE 1.
*& Module STATUS_0001 OUTPUT
* text
MODULE STATUS_0001 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0001 OUTPUT
*& Module USER_COMMAND_0001 INPUT
* text
MODULE USER_COMMAND_0001 INPUT.
MESSAGE 'Inside INPUT' TYPE 'I'.
CASE SY-UCOMM.
WHEN 'SAVE'.
UPDATE zemployee_master.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0001 INPUT
*& Module fill_data OUTPUT
* text
MODULE fill_data OUTPUT.
select emp_no name city from zemployee_master into TABLE itab ORDER BY emp_no.
Describe table itab lines EMPTABLE-LINES.
ENDMODULE. " fill_data OUTPUT
*& Module modify_itab INPUT
* text
MODULE modify_itab INPUT.
* MODIFY itab from zemployee_master index
* MESSAGE 'Inside modify_itab' TYPE 'I'.
ENDMODULE. " modify_itab INPUTHi
In the following module of your code
MODULE modify_itab INPUT.
MODIFY itab from zemployee_master index tc-current_line " Where TC is the name of the Table control on the Screen
ENDMODULE.
Table control data gets refreshed on *enter*
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/2165e990-0201-0010-5cbb-b5c2ad436140
Cheerz
Ramchander Rao.K -
How to fetch the Table Control data to Customer Table(Z-Table) ?
How to fetch the Table Control data to Customer Table(Z-Table) ?
Hi Krishna,
Check this sample programs
http://www.planetsap.com/online_pgm_main_page.htm
http://sap.niraj.tripod.com/id29.html
http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_basic.htm
Have a look at below links. It will help you.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm
Thanks,
Reward If helpful. -
Downloading table control data in excel sheet
Hi experts,
I have written a module pool pgm which fetches the data from a table and filled in a table control. Now my requirement is to download this (table control data) in an excel sheet like we download the ALV report data in an excel sheet.
Can the same downloading option be provided in module pool pgm also?
Pls tell me how it is possible to download the table control data in an excel sheet in module pool?
Regards,
ShanthiHi Shanthi,
As you can display data in Table Control means data is available in Internal Table
Give Download Button
case ok_code.
when 'DOWN'.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = path1.
CALL FUNCTION 'GUI_DOWNLOAD' " Go through FM Documentatin for more Info
EXPORTING
filename = path1
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = ist_final
fieldnames = ist_fc_download " You can provide the Column Heading
EXCEPTIONS
OTHERS = 22.
endcase.
Cheerz
Ram
Edited by: Rob Burbank on Mar 20, 2010 5:04 PM -
How to overcome view changes in bdc session method using recording ?
how to overcome view changes in bdc session method using recording ?
ex-for mm01 in recording if i selected views basic data1 and basic data2.
i seheduleded for background for after 3 days .
if any body changes views by selecting other views also.
how to overcome this with out programming ?
is there any settings ?Hi,
I am attaching few threads.Hope these will help you.
If there are any error records in session, all those error records will get poulated in log .SM35 and after the session is completed , u can see error records which can be corrected and reprocessed again
We have the structures BDCLD and BDCLM, which will capture the log details inthe session. Firstly, sesssion should be processed. After that log will be created. Then caputure the information into an internal table using BDCLM and BDCLD.
and refer the link.
error correction in bdc session
regards
Madhu -
How to add new field to table control data not displayed
hi
I have added some nwe fields to already existing table control added three new fields...
though the recoreds are inserted in teh table properly with the three new fields user id data and time fields
but on display only the data is not shown in these three columns though the data is coming in internal table...but not to the screen output
pls suggest where the problme may be
nishantFirst try the small button Configuration on top right of the table control, as displayed when you run the program. Hit 'Administrator' and see if the fields are checked as invisible. Uncheck them, activate and save.
If the fields are not in that list at all, then check if the table control is initialized for the screen you use. For example
CONTROLS: tc_ent_lines TYPE TABLEVIEW USING SCREEN '0100'.
but you copied your screen and use the same table control in the new screen 0200. Then all you have to do is
REFRESH CONTROL 'TC_ENT_LINES' FROM SCREEN '0200'.
before you show the screen. -
Table control data update with LED status progress
Hi Friends,
I've a requirement for my project....
But i am not clear of how to implement that.
The main.vi will extract the data from an Excel sheet using all excel.llb and show the data in table control.
At the back end i'll be keep on reading data from the worksheet 1 of the excel sheet.
so my intention is something like this
whenever it reads the 1st row of data the LED should blink at the first row and it proceed down as per the for loop
And should continue up to the end.
If anybody have worked out with the Table control and Excel sheet VI's please help.
Your help would be appreciated.
Will attach the VI on request.
Cheers,
Suneel.VHi Mike,
Thanks for your prompt response.
Attached are the VI's.
The main VI is Excel_Tablecontrol.vi and the sub vi is excel_read.vi
In the main VI select any excel sheet from your PC and it will extract the first sheet data in it.
But in my real project i will be reading line by line.
Could you please make me clear how should i put an indicator whcih would go line by line.
Cheers,
Suneel.V
Attachments:
Excel_TableControl.vi 11 KB
Excel_Read_Write_V1.0.vi 48 KB -
Module Pool - Table Control - Data not getting displayed in Control
Hi,
I have a table contol in my module pool program. In my processing I am filling an internal table & then in my PBO I am linking the internal table to table control. The issue is that even though the internal table is getting filled correctly (found through debugging), the data is not getting populated in table control. Nothing is populated on screen. I am writing part of code below
Declaration:
Types: begin of ty_control,
SELECTED TYPE C,
TEXT TYPE DPR_CAUSE_T-TEXT,
end of ty_control.
CONTROLS : TBL_CONT TYPE TABLEVIEW USING SCREEN '9001'.
DATA: lt_table_cont type TABLE OF ty_control with header line.
Fields in TBL_CONT:
TBL_CONT-SELECTED
TBL_CONT-TEXT
PBO Flow Logic:
MODULE STATUS_9001.
MODULE fill_data.
LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.
ENDLOOP.
PAI Flow Logic:
Loop at lt_table_cont.
MODULE UPDATE_DATA.
endloop.
MODULE USER_COMMAND_9001.
PLZ let me know what might be the problem. I have been trying to figure out but cant.
Thanks.Hi Sonali,
When ever you need to do anything with the table control, i mean if u want to display data in table control or you want to validate the data entered in table control Should be done within Loop and Endloop.(PBO or PAI's which ever is appropriate)
Here the data is not bieng displayed in ur table control because you have not used the MODULE fill_data between
LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.
ENDLOOP.
so do it like this
LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.
MODULE fill_data
ENDLOOP.
this will solve your problem.
Regards,
Syed -
Adobe Forms - Table control data Saved in Database table through Web Dynpro
Hello Friends,
I Am facing a Problem in Adobe Forms through Web Dynpro.
i Want to Make Interactive online Adobe Forms - In Table Control user enter the multiple entry in the table control and after that Click on SAVE button , entry will saved in Database table.
Please guide me.
Thanks in advance.
Gaurav.Hi Gaurabh,
For interactive form you have to check the property DisplayType = native and PdfSource should be a Context Attribute of type 'Xstring'.
For data retrieval, create a NODE and have all the required attributes within that node of AOBE form.
Fetch the data in WDDOINIT.
Also check, that the offline senario for this form is working.
Hope it helps you. -
How to reset the data when the session lost?
When I use response.sendRedirect("http://localhost:82/main.jsp")
the session lost, because the URL before redirect is using SSL,
"https://localhost:81/index.jsp", they use the different port,
so the session lost, what should i do to prevent this? And how
to reset the data?Create a HashMap and store it as an attribute of the servlet context. In the first servlet assign the user a key and store all session data in the HashMap under that key (use a vector, collection or user defined class).
In the response.sendRedirect call add the key to the url:
response.sendRedirect(url + "?key=" + userKey);
In the second servlet get the key (request.getParameter("key")), retrieve the session data from the HashMap in the servletcontext and store in an httpsession.
Remember to delete the entry from the HashMap so it doesn't become overly large. -
How Make Table Control full screen ?
Hi all, how can I make table control full screen?
Hello,
In the menu painter for the screen containing the table control....drag the boundaries of the table to fit the visible boundary marked..if we are calling table control using a sub screen area ..then the subscreen area in the main screen needs to be enlarged as per requirements...
Pls check and revert
Regards
Byju -
Table control data to databse table
Hi Experts,
I have created Table control on screen . After entering no of rows of data manually in Table control and after clicking on save button, entered data should be get saved into the corresponding table.
Please help me on this issue.
Thanks & Regards,
Nagaraju C.program znmodpl2.
tables : zntable.
data : it_table type table of zntable with header line.
controls : tabcntrl type tableview using screen 100.
data : ok_code type sy-ucomm.
*& Module STATUS_0100 OUTPUT
text
module status_0100 output.
set pf-status '0100'.
set titlebar '100'.
move-corresponding it_table to zntable.
endmodule. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
module user_command_0100 input.
case ok_code.
when 'INS'.
it_table-carrier = zntable-carrier .
it_table-personnelno = zntable-personnelno.
it_table-flightname = zntable-flightname.
it_table-flightdate = zntable-flightdate.
it_table-f_name = zntable-f_name.
it_table-l_name = zntable-l_name.
it_table-rol_emp = zntable-rol_emp.
it_table-telephone = zntable-telephone.
it_table-city_dept = zntable-city_dept.
it_table-city_arrv = zntable-city_arrv.
append it_table.
insert into zntable values it_table.
message 'SUCCESSFUL INSERTION OF DATA' type 'S' .
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
The Flow Logic will be :
process before output.
loop at it_table with control tabcntrl.
module status_0100.
endloop.
process after input.
loop at it_table .
module user_command_0100.
endloop.
thank & regards,
Nilay Sarkar. -
How Scroll Table control in BDC (TCode = SR11)
Hi Gurus,
I'm trying to insert lines in a table control via batch.
Unfortunately I must be able to insert more lines than the table control can show (4 lines at the same time).
I am not able to get the good OkCode trough SHDB.
I tried to add a line via OkCode 'P++' but it didnt worked.
See below a sample of my code.
IF NOT P_L_DATA-SA01 IS INITIAL.
CLEAR L_C_INDEX.
L_C_INDEX = L_INDEX.
CONCATENATE 'ADRCITYCCS-SPARTE(0' L_C_INDEX ')' INTO L_FIELD.
L_VALUE = '01'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
CONCATENATE 'ADRCITYCCS-BUKRS(0' L_C_INDEX ')' INTO L_FIELD.
L_VALUE = P_L_DATA-SA01.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
L_INDEX = L_INDEX + 1.
ENDIF.
IF NOT P_L_DATA-SA04 IS INITIAL.
CLEAR L_C_INDEX.
L_C_INDEX = L_INDEX.
CONCATENATE 'ADRCITYCCS-SPARTE(0' L_C_INDEX ')' INTO L_FIELD.
L_VALUE = '04'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
CONCATENATE 'ADRCITYCCS-BUKRS(0' L_C_INDEX ')' INTO L_FIELD.
L_VALUE = P_L_DATA-SA04.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
L_INDEX = L_INDEX + 1.
ENDIF.
IF NOT P_L_DATA-SA05 IS INITIAL.
CLEAR L_C_INDEX.
L_C_INDEX = L_INDEX.
CONCATENATE 'ADRCITYCCS-SPARTE(0' L_C_INDEX ')' INTO L_FIELD.
L_VALUE = '05'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
CONCATENATE 'ADRCITYCCS-BUKRS(0' L_C_INDEX ')' INTO L_FIELD.
L_VALUE = P_L_DATA-SA05.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
L_INDEX = L_INDEX + 1.
ENDIF.
IF NOT P_L_DATA-SA06 IS INITIAL.
CLEAR L_C_INDEX.
L_C_INDEX = L_INDEX.
CONCATENATE 'ADRCITYCCS-SPARTE(0' L_C_INDEX ')' INTO L_FIELD.
L_VALUE = '06'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
CONCATENATE 'ADRCITYCCS-BUKRS(0' L_C_INDEX ')' INTO L_FIELD.
L_VALUE = P_L_DATA-SA06.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
L_INDEX = L_INDEX + 1.
ENDIF.
L_FIELD = 'BDC_OKCODE'.
L_VALUE = '/00'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
IF L_INDEX = 5.
L_PROG = 'SAPLSZRC'.
L_DYN = '0200'.
PERFORM BDC_DYNPRO USING L_PROG L_DYN.
L_FIELD = 'BDC_CURSOR'.
L_VALUE = 'ADRCITYCCS-BUKRS(04)'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
L_FIELD = 'BDC_OKCODE'.
L_VALUE = 'P++'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
ENDIF.
L_PROG = 'SAPLSZRC'.
L_DYN = '0200'.
PERFORM BDC_DYNPRO USING L_PROG L_DYN.
L_FIELD = 'BDC_CURSOR'.
L_VALUE = 'ADRCITYCCS-BUKRS(02)'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
the 5th line
IF NOT P_L_DATA-SA07 IS INITIAL.
CLEAR L_C_INDEX.
L_C_INDEX = L_INDEX.
CONCATENATE 'ADRCITYCCS-SPARTE(' '02' ')' INTO L_FIELD.
L_VALUE = '07'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
CONCATENATE 'ADRCITYCCS-BUKRS(' '02' ')' INTO L_FIELD.
L_VALUE = P_L_DATA-SA07.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
L_INDEX = L_INDEX + 1.
ENDIF.
L_FIELD = 'BDC_OKCODE'.
L_VALUE = '/00'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
L_PROG = 'SAPLSZRC'.
L_DYN = '0200'.
PERFORM BDC_DYNPRO USING L_PROG L_DYN.
L_FIELD = 'BDC_OKCODE'.
L_VALUE = 'SAVE'.
PERFORM BDC_FIELD USING L_FIELD L_VALUE.
Any idea will be welcomed.
Please try to be clear and precide as I always wen trought several posts wich just not match.
ThanksHi Niyaz,
Sorry but there is no button to add lines to this table control during the bdc recording.
The only way to enter more lines than the default number is to scroll the table control.
Unfortunatly this scroll action is not recorded (no OkCode) during recording.
Any idea gurus ???
Regards -
Hi Experts,
My table control having 3 materils as below .
MATNR MTART WERKS
222 AA 1000
333 BB 1108
444 CC 1200
Client requirement is to display material-333 in red font color, is it possible in table control?.
Thanks in advance
maheHi,
in PBO
" Go to Screen Painter attributes and set BRIGHT attribute but I am not sure this would give you BLUE color
module status_100.
loop at itab with control tc.
endloop
in Program
module status_100.
loop at screen.
if screen-name = 'ITAB-MATNR'.
SCREEN-COLOR = 1. " In Screen Table Control you only get Red Color not any other to the best of my knowledge
MODIFY SCREEN.
ENDIF.
endloop
endmodule
Cheerz -
How to rectify the errors occured during session method
how to rectify the errors occured during session method
HI
When the execution of session is completed: we can check the errors via the log.
Rectification of errors depends on the kind of errors. It is not specific that we have to approach the same way to handle all kinds of errors.
Errors can be due to data format, inconsistency due to the configuration, unavailability of master data...
Kind Regards
Eswar
Maybe you are looking for
-
HT1338 how do i get mac app store
the app store aint in my apple botton inthe top left coner
-
IPhone not open all webpages !
I am connect to web be WI-FI in me macbook airport .Some web pages are without problems , but are much pages, which is not possible open. And between them apple.com also for example.........and many other..... Where is problem ?
-
Run-time error "SYSTEM_NO_TASK_STORAGE"
Hi gurus, I always encounter this runtime error especially when running such transaction: "SYSTEM_NO_TASK_STORAGE" wherein it is Unable to fulfil request for xxxxx bytes of storage space. (I check it in tcode ST22) My current system is AIX 5.3 and Or
-
Updated Bidpong ADSLBroadband to WiFi using Thomson TG7827 Modem
I installed the modem on desktop with no problems. but i cannot connect to WiFi on the Iphone. message is "cannot join" i rang Bigpond (six times) the last one with an Iphone expert who asked for my password. Which password is it, the Apple, The Bigp
-
Since the last OSX update my Time Machine has been unable to back up. It takes a long time to prepare backup then just gives up the ghost. The only info I get on the matter is this "Time Machine Error: Unable to complete backup. An error occurred whi