Save data to database?
Hi All,
In one requirement i have save button. in two requirements it has to trigger. 1. adding new record, 2. modyfing existing. how to do this? any help?
Thanks,
venkat.
HI,
Use modify statement. If the record exists with the same key it will update the record, else it will inser the new record.
Regards,
MAdhu
Similar Messages
-
Hi everybody,
I am new at Acrobat and experiencing some difficulties at the start.
My aim is to generate a PDF file with some fields, which can be filled in by visitors of a website. When the visitor has finished filling in, he should press a button in the PDF file to send it to a specific email-address. The receiver should be able to add little information and save data in a specific (MySQL) database.
My main problems are:
1. The visitor must not see the button for sending the information to the MySQL database.
2. How to send the information to the database (and select the fitting datafields)?
I'm looking forward to reading your replies.
Thanks in advance for your help!
Regards,
KBYou will need someone who knows how to script such things. It can probably be done with PHP or something similar.
-
How to save data to access database in dreamweaver
Hello,
I want to save data from webpage to MS access database. I am
using dreamweaver MX 2004 developing tool. For server side
scripting I am using asp page but I am not geting any result. And I
am calling this asp page using HTML codes (using "action").
Please anybody suggest me proper way for this.Thanks for the reply....I'will try your suggestion
........But still I will appriciate if you can check my codes......
I am using following codes for webpages,
<form name="form1" action="add_to_database.asp"
method="post">
<div align="center">
<table width="80%" border="0">
<td><b>FEEDBACK FORM</b></td>
<tr> <td>Name :</td>
<td><input type="text" name="uname"></td>
</tr>
<tr>
<td>Email :</td>
<td> <input type="text" name="email"></td>
</tr>
<tr>
<td>Comments :</td>
<td><textarea
name="comments"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Submit details"
name="submit" onClick="validate()" ></td>
</tr>
</table>
</div>
</form>
and using the action and post method I am calling following
asp page
<body>
<%
Dim uname, email, comments
Dim Conn
Dim Rs
Dim sql
uname = Request.Form("uname")
email = Request.Form("email")
comments =Request.Form("comments")
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=" & Server.MapPath("users.accdb")
sql= "INSERT into adduser(uName, Email, Comments) values(' "
& uname & "', '" & email & "', '" & comments
Conn.execute sql
Rs.Open sql, Conn
Rs.AddNew
Rs.Fields("Name") = Request.Form("name")
Rs.Fields("Email")=Request.Form("email")
Rs.Fields("Comments") = Request.Form("comments")
Rs.Update
Rs.Close
Set Rs = Nothing
Set Conn = Nothing
%>
</body>
Thanks, -
Save Data From Grid to Database
Hello All,
I want to create a form to save data from a grid to the database just like the SAP Forecast Form .
My requirements are as follows :-
I have created a Table in which there are three fields ItemCode,Date,Qty
But while entering user will first select the Date ranges (from - To) and based on that date range
no. of columns will be created as it will be dynamic and then user will enter the corresponding quantity for that item and date
just like the Sales Forecast (SAP) Form .
Form will be like :-
From Date - 10/10/11 ToDate - 13/10/11
Row Levels Fields :-
ItemCode 10/10/11 11/10/11 12/10/11 13/10/11
A0001 100 150 200 300
While updating system will put the data in database table as :-
ItemCode Date Quantity
A0001 10/10/11 100
A0001 11/10/11 150
A0001 12/10/11 200
A0001 13/10/11 300
This is what i want to do .
Please suggest how to proceed with this using a Matrix or a grid.
Thanks & Regards,
Amit
Edited by: AmitSharma_061985 on Oct 19, 2011 7:08 AMHi,
If you are doing it with oops concept then here are the steps for that.
1) Declare DATA : er_data_changed TYPE REF TO cl_alv_changed_data_protocol,
data_changed TYPE REF TO cl_alv_changed_data_protocol.
--For getting the row no of of the row which is edited by user
DATA : ls_mod_cell TYPE table of lvc_s_modi with header line,
lv_value TYPE lvc_value .
in your program
2) Define a class
CLASS notification DEFINITION.
PUBLIC SECTION.
CLASS-METHODS : handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
ENDCLASS. "NOTIFICATION DEFINITION
3) For that class write the implementation
CLASS notification IMPLEMENTATION.
METHOD handle_data_changed.
PERFORM handle_data_changed USING er_data_changed.
ENDMETHOD. "handle_data_changed
ENDCLASS. "NOTIFICATION IMPLEMENTATION
4) In the PERFORM handle_data_changed you code like this
FORM handle_data_changed USING er_data_changed type ref TO
cl_alv_changed_data_protocol.
SORT er_data_changed->mt_mod_cells BY row_id .
LOOP AT er_data_changed->mt_mod_cells
INTO ls_mod_cell .
append ls_mod_cell.
ENDLOOP.
*LS_MOD_CELL will have all the rows which were edited
and all the updated data corresponding to those rows*
You can now use the the data which is in LS_MOD_CELL
to update into your DB Table.
LOOP at ls_mod_cell.
READ TABLE itab3 INTO t_output INDEX ls_mod_cell-row_id.
ENDLOOP.
ENDFORM. " handle_data_changed
Regards,
Syed -
Save /ADD Grid Control Columns Data in database
Hello All,
Can any one suggest me how we add or save or update the grid control columns fields data into databases.
My problem is I have 2 tabs in user defined screen Main and issue tabs . when we click the issue tabs then items data in main tab matrix is filled in issue tab grid for this i create user defind table and register it with my user defined object .and
fill somoe of this table fields using reocord set . Now I want to add these grid data in database .
how we achieve this .Please guide meArvind,
You may want to review the documentation on the Grid Object in the SDK Help documentation as this may help with your question.
Eddy -
How to save data from form into database
i nid to save data from form into the new table, @abc.
got any idea ?
smtg like oObj = BaseAddOn.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes) this but it is a new object or user data source.
Thankshi
i have created UDO i have also done registration i want to bind item master completely to matrix and then in one column i will set check box to check unchecked and then i want to save it to database
i have one user defined form and 4 matrix and 4 child tables
for each matrix i have given 1 form and i have to transfer the data from temp form to main form matrix having large data in matrix on temp form to main form matrix
to load data on matrix i have used for loop that i want to avoid so how i can bind large data to matrix without for loop
regards
amey -
How save & retrive data from database using flex, coldfusion, sql server
hi , i am very new in flex, i am trying to insert data in
database using flex2, coldfusion, sql server. any one can help me
please. or give me any example.Hi try to goto the following sites, you will get some
direction to think
http://weblogs.macromedia.com/pent/archives/2006/11/example_of_flex.cfm
http://pdxphp.org/node/258
Good Luck -
How to save data in ztable after editing in alv report
how to save data in ztable after editing in alv report?
Hi,
Please find the attachment below.This may be usefull to you.
[http://wiki.sdn.sap.com/wiki/display/Snippets/ALV-Editingandsavingtheeditedvaluesin+Database%28OOPS%29]
Regards,
Ramakrishna Yella. -
Save Data in ALV Report .
Hello,
Given below is my code
*& Report ZALV_TEST_SA *
REPORT ZALV_TEST_SA NO STANDARD PAGE HEADING.
*----------------------TYPE POOL OF ALV--------------------------------*
TYPE-POOLS: SLIS.
*----------------------DATABASE TABLES---------------------------------*
TABLES: ZFLIGHTM_SA, ZFLIGHT_AVAIL_SA.
*-------------DATA DECLARATION-----------------------------------------*
DATA: BEGIN OF ITAB OCCURS 0,
ZFLIGHT_ID TYPE ZFLIGHT_ID,
ZCITY_FROM TYPE ZCITY_FROM,
ZCITY_TO TYPE ZCITY_TO,
ZDEP_DATE TYPE DATS,
ZTIME TYPE TIMS,
ZPRICE TYPE ZPRICE,
ZNUM_OF_PSNGRS(3) TYPE N,
ZAVAIL_SEATS(3) TYPE N,
END OF ITAB.
DATA: BEGIN OF ITABM OCCURS 0,
MANDT TYPE MANDT,
ZFLIGHT_ID TYPE ZFLIGHT_ID,
ZCITY_FROM TYPE ZCITY_FROM,
ZCITY_TO TYPE ZCITY_TO,
ZTIME TYPE TIMS,
ZPRICE TYPE ZPRICE,
END OF ITABM.
DATA: BEGIN OF ITAB_AVAIL OCCURS 0,
MANDT TYPE MANDT,
ZFLIGHT_ID TYPE ZFLIGHT_ID,
ZDEP_DATE TYPE DATS,
ZNUM_OF_PSNGRS(3) TYPE N,
ZAVAIL_SEATS(3) TYPE N,
END OF ITAB_AVAIL.
DATA: WA_ITAB LIKE LINE OF ITAB,
WA_ITABM LIKE LINE OF ITABM,
WA_ITAB_AVAIL LIKE LINE OF ITAB_AVAIL.
DATA: L_REPID LIKE SY-REPID,
L_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV,
L_EVENTS TYPE SLIS_T_EVENT.
DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
*----------------SELECTION SCREEN SELECT-OPTIONS-----------------------*
SELECT-OPTIONS S_CITY FOR ZFLIGHTM_SA-ZCITY_FROM NO INTERVALS.
SELECT-OPTIONS D_CITY FOR ZFLIGHTM_SA-ZCITY_TO NO INTERVALS.
SELECT-OPTIONS D_DATE FOR ZFLIGHT_AVAIL_SA-ZDEP_DATE NO INTERVALS.
*----------------------SELECTION OF DATA-------------------------------*
PERFORM SELECT_DATA.
*----------------SETTING DATA IN TABLE FOR FIELD CATALOG---------------*
PERFORM CALL_FIELDCAT_MERGE.
*----------CALLING FUNCTION FOR DISPLAYING REPORT----------------------*
PERFORM DISPLAY_TABLE.
*----------------------AT SELECTION SCREEN EVENT-----------------------*
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'STORE'.
PERFORM SAVE_DATA.
WHEN 'PREVIOUS'.
LEAVE TO SCREEN 0.
WHEN OTHERS.
ENDCASE.
*------------------------------FORMS-----------------------------------*
*& Form SELECT_DATA
* text
* --> p1 text
* <-- p2 text
FORM SELECT_DATA .
SELECT A~ZFLIGHT_ID ZCITY_FROM
ZCITY_TO ZDEP_DATE
ZTIME ZPRICE
ZNUM_OF_PSNGRS ZAVAIL_SEATS
FROM ZFLIGHTM_SA AS A INNER JOIN ZFLIGHT_AVAIL_SA AS B
ON A~ZFLIGHT_ID = B~ZFLIGHT_ID
INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE A~ZCITY_FROM IN S_CITY
AND A~ZCITY_TO IN D_CITY
AND B~ZDEP_DATE IN D_DATE.
L_REPID = SY-REPID.
ENDFORM. " SELECT_DATA
*& Form CALL_FIELDCAT_MERGE
* text
* --> p1 text
* <-- p2 text
FORM CALL_FIELDCAT_MERGE .
* CLEAR WA_FIELDCAT.
* WA_FIELDCAT-TABNAME = ITAB.
* WA_FIELDCAT-FIELDNAME = 'ZFLIGHT_ID'.
* WA_FIELDCAT-KEY = 'X'. "sets key field
* APPEND WA_FIELDCAT TO L_FIELDCAT.
* WA_FIELDCAT-TABNAME = ITAB.
* WA_FIELDCAT-FIELDNAME = 'ZPRICE'.
* WA_FIELDCAT-KEY = 'X'. "sets key field
* APPEND WA_FIELDCAT TO L_FIELDCAT.
* WA_FIELDCAT-TABNAME = ITAB.
* WA_FIELDCAT-FIELDNAME = 'ZAVAIL_SEATS'.
* WA_FIELDCAT-KEY = 'X'. "sets key field
* APPEND WA_FIELDCAT TO L_FIELDCAT.
*--------------CALLING FUNCTION FOR FIELD CATALOG----------------------*
CLEAR L_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = L_REPID
I_INTERNAL_TABNAME = 'ITAB'
* I_STRUCTURE_NAME = 'WA_ITAB'
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = 'ZALV_TEST_SA'
I_BYPASSING_BUFFER = 'X'
* I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = L_FIELDCAT
* EXCEPTIONS
* INCONSISTENT_INTERFACE = 1
* PROGRAM_ERROR = 2
* OTHERS = 3
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*--------------EDITING FIELDS IN FIELD CATALOG ------------------------*
LOOP AT L_FIELDCAT INTO WA_FIELDCAT.
CASE WA_FIELDCAT-FIELDNAME.
WHEN 'ZFLIGHT_ID'.
WA_FIELDCAT-COL_POS = '1'.
* WA_FIELDCAT-text_fieldname = 'Flight ID'.
WA_FIELDCAT-KEY = '3'.
WA_FIELDCAT-JUST = 'L'.
WA_FIELDCAT-NO_ZERO = 'X'.
WA_FIELDCAT-EMPHASIZE = 'X'.
WA_FIELDCAT-SELTEXT_L = 'Flight ID'. "40 char long field name
WA_FIELDCAT-SELTEXT_M = 'Flight ID'. "20 char long field name
WA_FIELDCAT-SELTEXT_S = 'Flight ID'. "10 char long field name
WHEN 'ZCITY_FROM' .
WA_FIELDCAT-NO_OUT = 'X'.
WHEN 'ZCITY_TO' .
WA_FIELDCAT-NO_OUT = 'X'.
WHEN 'ZDEP_DATE' .
WA_FIELDCAT-NO_OUT = 'X'.
WHEN 'ZTIME' .
WA_FIELDCAT-NO_OUT = 'X'.
WHEN 'ZPRICE' .
WA_FIELDCAT-COL_POS = '2'.
* WA_FIELDCAT-text_fieldname = 'Flight ID'.
WA_FIELDCAT-KEY = '4'.
WA_FIELDCAT-JUST = 'L'.
WA_FIELDCAT-NO_ZERO = 'X'.
* WA_FIELDCAT-EMPHASIze = 'X'.
WA_FIELDCAT-SELTEXT_L = 'Price'. "40 char long field name
WA_FIELDCAT-SELTEXT_M = 'Price'. "20 char long field name
WA_FIELDCAT-SELTEXT_S = 'Price'. "10 char long field name
WA_FIELDCAT-EDIT = 'X'.
WHEN 'ZNUM_OF_PSNGRS' .
WA_FIELDCAT-NO_OUT = 'X'.
WHEN 'ZAVAIL_SEATS' .
WA_FIELDCAT-COL_POS = '3'.
* WA_FIELDCAT-text_fieldname = 'Flight ID'.
WA_FIELDCAT-KEY = '4'.
WA_FIELDCAT-JUST = 'L'.
WA_FIELDCAT-NO_ZERO = 'X'.
* WA_FIELDCAT-EMPHASIze = 'X'.
WA_FIELDCAT-SELTEXT_L = 'Available Seats'.
"40 char long field
WA_FIELDCAT-SELTEXT_M = 'Available Seats'.
"20 char long field
WA_FIELDCAT-SELTEXT_S = 'Seats'. "10 char long field name
WA_FIELDCAT-EDIT = 'X'.
WHEN OTHERS.
WA_FIELDCAT-NO_OUT = 'X'.
ENDCASE.
MODIFY L_FIELDCAT FROM WA_FIELDCAT.
ENDLOOP.
ENDFORM. " CALL_FIELDCAT_MERGE
*& Form USER_COMMAND_ALV_SA
* text
* --> p1 text
* <-- p2 text
FORM USER_COMMAND_ALV_SA USING I_UCOMM LIKE SY-UCOMM
IS_SELFIELD TYPE SLIS_SELFIELD.
*****form frm_usercommand using r_ucomm like sy-ucomm
*****rs_selfield type slis_selfield.
****CASE I_UCOMM.
CASE sy-ucomm.
WHEN 'STORE'.
PERFORM SAVE_DATA ON COMMIT.
WHEN 'PREVIOUS'.
LEAVE TO SCREEN 0.
WHEN OTHERS.
ENDCASE.
ENDFORM. "USER_COMMAND_ALV_SA
*& Form DISPLAY_TABLE
* text
* --> p1 text
* <-- p2 text
FORM DISPLAY_TABLE .
* L_FIELDCAT-input = 'X'.
* L_FIELDCAT-edit = 'X'.
* L_LAYOUT-Edit = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = L_REPID " report id
I_CALLBACK_PF_STATUS_SET = 'ZALV_TEST_SA' " to set pf-status
I_CALLBACK_USER_COMMAND = 'USER_COMMAND_ALV_SA' " to handle
" user command
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME = ''
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT = L_LAYOUT
IT_FIELDCAT = L_FIELDCAT " for field catalog
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
IT_EVENTS = L_EVENTS "internal table with
" user events
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB "internal table with
" records
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
********* IF SY-SUBRC <> 0.
********** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
********** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
********* ENDIF.
ENDFORM. " DISPLAY_TABLE
*-------------------------SET PF-STATUS--------------------------------*
*& Form ZALV_TEST_SA
* text
* --> p1 text
* <-- p2 text
FORM ZALV_TEST_SA USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ZALV_TEST_SA' .
ENDFORM. "ZALV_TEST_SA
*& Form SAVE_DATA
* text
* --> p1 text
* <-- p2 text
FORM SAVE_DATA.
LOOP AT ITAB INTO WA_ITAB.
****HIDE:WA_ITAB-ZFLIGHT_ID, WA_ITAB-ZCITY_FROM,
****WA_ITAB-ZCITY_TO, WA_ITAB-ZTIME,
****WA_ITAB-ZDEP_DATE, WA_ITAB-ZNUM_OF_PSNGRS,
****WA_ITAB-ZAVAIL_SEATS.
CLEAR: WA_ITABM,WA_ITAB_AVAIL.
WA_ITABM-ZFLIGHT_ID = WA_ITAB-ZFLIGHT_ID.
WA_ITABM-ZCITY_FROM = WA_ITAB-ZCITY_FROM.
WA_ITABM-ZCITY_TO = WA_ITAB-ZCITY_TO.
WA_ITABM-ZTIME = WA_ITAB-ZTIME.
WA_ITABM-ZPRICE = WA_ITAB-ZPRICE.
WA_ITAB_AVAIL-ZDEP_DATE = WA_ITAB-ZDEP_DATE.
WA_ITAB_AVAIL-ZNUM_OF_PSNGRS = WA_ITAB-ZNUM_OF_PSNGRS.
WA_ITAB_AVAIL-ZAVAIL_SEATS = WA_ITAB-ZAVAIL_SEATS.
APPEND WA_ITABM TO ITABM.
APPEND WA_ITAB_AVAIL TO ITAB_AVAIL.
ENDLOOP.
MODIFY ZFLIGHTM_SA FROM TABLE ITABM.
MODIFY ZFLIGHT_AVAIL_SA FROM TABLE ITAB_AVAIL.
COMMIT WORK.
ENDFORM. " SAVE_DATA
I want to edit a field--the price and save the changes. I have assigned a button STORE for this. But my data is not getting saved.
I searched the forum and wrote the code accordingly. I even referred the stored programs. Still I am not getting the output. Please help.
Regards,
Smruthi.
Edited by: Smruthi Acharya on Feb 10, 2009 3:31 PM
Edited by: Julius Bussche on Feb 10, 2009 12:16 PM
Please use code tagsHi,
You must have taken some function code for that STORE button (say you have taken it as MODIFY )
Use this code, it will modify the code in internal table from alv.
I have tried it, n its working:-
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = v_rep_id " report id
i_callback_pf_status_set = 'PF' " for PF-STATUS
i_callback_user_command = 'USER_COMMAND' " for User-Command
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = wa_layout " for layout
it_fieldcat = it_field " field catalog
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = it_sort " sort info
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* i_save = 'A'
* is_variant = wa_variant " variant name
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final " internal table
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& Form USER_COMMAND
* SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
* AND EXECUTE THE APPROPIATE CODE
* -->LV_OKCODE used to capture the function code
* of the user-defined push-buttons
* -->L_SELFIELD text
FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
* assign the function code to variable v_okcode
lv_okcode = sy-ucomm.
* handle the code execution based on the function code encountered
CASE lv_okcode.
* when the function code is MODIFY (STORE button) then save data
WHEN 'MODIFY'.
* to reflect the data changed into internal table
DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
" at this point your data in internal table is changed
* refresh the ALV Grid output from internal table
l_selfield-refresh = c_check.
ENDFORM. "USER_COMMAND
Hope this helps you.
Regards,
Tarun -
Issue to load data from database to XML file. error: ODI-40768
Hi,
While I am trying to load data from database to XML following error is appearing.
ODI-1228: Task TEST_XML_DATA (Integration) fails on the target XML connection MyLOCALXSD.
Caused By: java.sql.SQLException: ODI-40768: Could not save the file <default>:C:\DATA_FILE\www.xml because a class java.io.IOException occurred and said: The filename, directory name, or volume label syntax is incorrect
at com.sunopsis.jdbc.driver.xml.SnpsXmlFile.writeToFile(SnpsXmlFile.java:751)
at com.sunopsis.jdbc.driver.xml.SnpsXmlConnection.internalExecute(SnpsXmlConnection.java:769)
at com.sunopsis.jdbc.driver.xml.SnpsXmlPreparedStatement.execute(SnpsXmlPreparedStatement.java:46)
at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:166)
at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)
at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)
at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:540)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:263)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:822)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:83)
at java.lang.Thread.run(Thread.java:662)
jdbc url: jdbc:snps:xml?d=C:\test_xsd.xsd&s=TESTSQL&re=employeesX&ro=true
physical schema: TESTSQL
Knowledge modules are:
LKM: LKM SQL to SQL
IKM: IKM XML Control Append
CKM: CKM SQL
Parameters set are:
CREATE_XML_FILE: true
XML_PATH:<default>:C:\DATA_FILE\www.xml
I have tried to change the directory path but error is still there.
Could some one please help me to resolve the issue?
Regards,
user1672911Hi,
The trouble in "<default>:" - if you set XML_PATH as C:\DATA_FILE\www.xml instead <default>:C:\DATA_FILE\www.xml- it will work correctly.
Greetings,
Eugene -
How to save data after clicking checkbox stored in databasetable
TYPE-pools: slis.
tables:mkpf,mseg,mard.
TYPES: BEGIN OF tp_data,
mblnr LIKE mseg-mblnr,
matnr LIKE mseg-matnr,
werks LIKE mard-werks,
lgort LIKE mard-lgort,
lgpbe LIKE mard-lgpbe,
charg LIKE mseg-charg,
bwart LIKE mseg-bwart,
budat LIKE mkpf-budat,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
kostl LIKE mseg-kostl,
aufnr LIKE mseg-aufnr,
rsnum LIKE mseg-rsnum,
checkbox TYPE c,
__mark,
END OF tp_data,
tp_tbl_data TYPE STANDARD TABLE OF tp_data.
Constants
Data objects (variable declarations and definitions)
Report data to be shown.
DATA: it_data TYPE STANDARD TABLE OF tp_data.
Heading of the report.
DATA: t_heading TYPE slis_t_listheader.
========================== Selection Screen ==========================
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
smatnr FOR mseg-matnr MODIF ID m2,
swerks FOR mard-werks MODIF ID m3,
slgort FOR mard-lgort MODIF ID m4,
slgpbe FOR mard-lgpbe MODIF ID m5,
scharg FOR mseg-charg MODIF ID m6,
sbwart FOR mseg-bwart MODIF ID m7,
skostl FOR mseg-kostl MODIF ID m8,
saufnr FOR mseg-aufnr MODIF ID m9,
srsnum FOR mseg-rsnum MODIF ID m10.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
pse RADIOBUTTON GROUP radi,
bps RADIOBUTTON GROUP radi.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETER:layout TYPE i.
SELECTION-SCREEN END OF BLOCK b3.
=========================== Event Blocks =============================
AT selection-SCREEN.
start-OF-selection.
PERFORM get_data USING it_data.
END-OF-selection.
PERFORM build_alv USING it_data t_heading.
=========================== Subroutines ==============================
*& Form get_data
Gets the information to be shown in the report.
FORM get_data USING t_data TYPE tp_tbl_data.
SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
msegmenge msegmeins msegkostl msegaufnr mseg~rsnum
INTO CORRESPONDING FIELDS OF TABLE t_data
FROM mseg
JOIN mard ON mardmatnr EQ msegmatnr
JOIN mkpf ON msegmblnr EQ mkpfmblnr
WHERE mseg~matnr IN smatnr.
ENDFORM. " get_data
*& Form build_alv
Builds and display the ALV Grid.
FORM build_alv USING t_data TYPE tp_tbl_data
t_heading TYPE slis_t_listheader.
ALV required data objects.
DATA: w_title TYPE lvc_title,
w_comm TYPE slis_formname,
w_status TYPE slis_formname,
x_layout TYPE slis_layout_alv,
t_event TYPE slis_t_event,
t_fieldcat TYPE slis_t_fieldcat_alv,
t_sort TYPE slis_t_sortinfo_alv.
REFRESH t_fieldcat.
REFRESH t_event.
REFRESH t_sort.
CLEAR x_layout.
CLEAR w_title.
Field Catalog
PERFORM set_fieldcat2 USING:
1 'MBLNR' 'MBLNR' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
2 'MATNR' 'MATNR' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
3 'WERKS' 'WERKS' 'MARD' space space space space space space space space space space space space t_fieldcat,
4 'LGORT' 'LGORT' 'MARD' space space space space space space space space space space space space t_fieldcat ,
5 'LGPBE' 'LGPBE' 'MARD' space space space space space space space space space space space space t_fieldcat ,
6 'CHARG' 'CHARG' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
7 'BWART' 'BWART' 'MSEG' space space space space space space space space space space space space t_fieldcat,
8 'BUDAT' 'BUDAT' 'MKPF' space space space space space space space space space space space space t_fieldcat,
9 'MENGE' 'MENGE' 'MSEG' space space space space space space space space space space space space t_fieldcat,
10 'MEINS' 'MEINS' 'MSEG' space space space space space space space space space space space space t_fieldcat,
11 'KOSTL' 'KOSTL' 'MSEG' space space space space space space space space space space space space t_fieldcat,
12 'AUFNR' 'AUFNR' 'MSEG' space space space space space space space space space space space space t_fieldcat,
13 'RSNUM' 'RSNUM' 'MSEG' space space space space space space space space space space space space t_fieldcat,
14 '__MARK' 'XFELD' space space space 'Select' 'Select this row' 'Sel' 'Select this row' space space space 'X' 'X' space t_fieldcat.
Layout
x_layout-zebra = 'X'.
Top of page heading
PERFORM set_top_page_heading USING t_heading t_event.
Events
PERFORM set_events USING t_event.
GUI Status
w_status = ''.
User commands
w_comm = 'USER_COMMAND'.
Order
Example
PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
PERFORM set_order USING 'LIFNR' 'IT_DATA' 'X' space 'X' t_sort.
PERFORM set_order USING 'EBELN' 'IT_DATA' 'X' space 'X' t_sort.
PERFORM set_order USING 'EBELP' 'IT_DATA' 'X' space space t_sort.
Displays the ALV grid
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = t_fieldcat
is_layout = x_layout
it_sort = t_sort
i_callback_pf_status_set = w_status
i_callback_user_command = w_comm
i_save = 'X'
it_events = t_event
i_grid_title = w_title
TABLES
t_outtab = t_data
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " build_alv.
*& Form set_top_page_heading
Creates the report headings.
FORM set_top_page_heading USING t_heading TYPE slis_t_listheader
t_events TYPE slis_t_event.
DATA: x_heading TYPE slis_listheader,
x_event TYPE LINE OF slis_t_event.
Report title
CLEAR t_heading[].
CLEAR x_heading.
x_heading-typ = 'H'.
x_heading-info = 'Reporte Prueba'(001).
APPEND x_heading TO t_heading.
Program name
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'Program: '.
x_heading-info = sy-repid.
APPEND x_heading TO t_heading.
User who is running the report
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'User: '.
x_heading-info = sy-uname.
APPEND x_heading TO t_heading.
Date of execution
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'Date: '.
WRITE sy-datum TO x_heading-info.
APPEND x_heading TO t_heading.
Time of execution
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'Time: '.
WRITE sy-uzeit TO x_heading-info.
APPEND x_heading TO t_heading.
Top of page event
x_event-name = slis_ev_top_of_page.
x_event-FORM = 'TOP_OF_PAGE'.
APPEND x_event TO t_events.
ENDFORM.
*& Form set_events
Sets the events for ALV.
The TOP_OF_PAGE event is alredy being registered in
the set_top_page_heading subroutine.
FORM set_events USING t_events TYPE slis_t_event.
DATA: x_event TYPE LINE OF slis_t_event.
Example
clear x_event.
x_event-name = .
x_event-form = .
append x_event to t_event.
ENDFORM.
*& Form set_order
Adds an entry to the order table.
FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
t_sort TYPE slis_t_sortinfo_alv.
DATA: x_sort TYPE slis_sortinfo_alv.
CLEAR x_sort.
x_sort-fieldname = p_fieldname.
x_sort-tabname = p_tabname.
x_sort-UP = p_up.
x_sort-down = p_down.
x_sort-subtot = p_subtot.
APPEND x_sort TO t_sort.
ENDFORM. "set_order
*& Form set_fieldcat2
Adds an entry to the field catalog.
FORM set_fieldcat2 USING p_colpos p_fieldname p_ref_fieldname p_ref_tabname
p_outputlen p_noout
p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
p_hotspot p_showasicon p_checkbox p_edit
p_dosum
t_fieldcat TYPE slis_t_fieldcat_alv.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
General settings
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-col_pos = p_colpos.
wa_fieldcat-no_out = p_noout.
wa_fieldcat-HOTSPOT = p_hotspot.
wa_fieldcat-CHECKBOX = p_checkbox.
wa_fieldcat-ICON = p_showasicon.
wa_fieldcat-do_sum = p_dosum.
Set reference fieldname, tablenam and rollname.
If p_ref_tabname is not given, the ref_fieldname given is a data element.
If p_ref_tabname is given, the ref_fieldname given is a field of a table. In case ref_fieldname is not given, it is copied from the fieldname.
IF p_ref_tabname IS INITIAL.
wa_fieldcat-rollname = p_ref_fieldname.
ELSE.
wa_fieldcat-ref_tabname = p_ref_tabname.
IF p_ref_fieldname EQ space.
wa_fieldcat-ref_fieldname = wa_fieldcat-fieldname.
ELSE.
wa_fieldcat-ref_fieldname = p_ref_fieldname.
ENDIF.
ENDIF.
Set output length.
IF NOT p_outputlen IS INITIAL.
wa_fieldcat-outputlen = p_outputlen.
ENDIF.
Set text headers.
IF NOT p_seltext_m IS INITIAL.
wa_fieldcat-seltext_m = p_seltext_m.
ENDIF.
IF NOT p_seltext_l IS INITIAL.
wa_fieldcat-seltext_l = p_seltext_l.
ENDIF.
IF NOT p_seltext_s IS INITIAL.
wa_fieldcat-seltext_s = p_seltext_s.
ENDIF.
IF NOT p_reptext_ddic IS INITIAL.
wa_fieldcat-reptext_ddic = p_reptext_ddic.
ENDIF.
IF NOT p_ddictxt IS INITIAL.
wa_fieldcat-ddictxt = p_ddictxt.
ENDIF.
Set as editable or not.
IF p_edit IS NOT INITIAL.
wa_fieldcat-INPUT = 'X'.
wa_fieldcat-EDIT = 'X'.
ENDIF.
APPEND wa_fieldcat TO t_fieldcat.
ENDFORM. "set_fieldcat2
=========================== Subroutines called by ALV ================
*& Form top_of_page
Called on top_of_page ALV event.
Prints the heading.
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'XXXXX'
it_list_commentary = t_heading.
ENDFORM. " alv_top_of_page
*& Form user_command
Called on user_command ALV event.
Executes custom commands.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Example Code
Executes a command considering the sy-ucomm.
CASE r_ucomm.
WHEN '&IC1'.
Set your "double click action" response here.
Example code: Create and display a status message.
DATA: w_msg TYPE string,
w_row(4) TYPE n.
w_row = rs_selfield-tabindex.
CONCATENATE 'You have clicked row' w_row
'field' rs_s lfield-fieldname
'with value' rs_selfield-value
INTO w_msg SEPARATED BY space.
MESSAGE w_msg TYPE 'S'.
ENDCASE.
End of example code.
ENDFORM. "user_command
this is mycode,mblnr, matnr and checkbox both field had created in database table
then save data after clicking checkbox data stored in database table,and next clickin checkboxes are no change. this my requirment.
plz send me code .Try this
In user_command form...
LOOP AT IT_DATA.
IF CHECKBOX __MARK EQ 'X'.
write logic wht u want....
ENDIF.
ENDLOOP. -
Saving data in database by using MM17
I have customised fields in MARA table. I want to save the data in database by using Mass transaction MM17. Can any one can give the solution.
Please do not post the same question more than once. Please read the Terms of Engagement. I have deleted your duplicate posts.
-
Saving Data in Database.
I want to save game data into database...how can i do that??
for that which dabase I've to use...and also which scripting language??It's not a case of no one knowing. It's more likely a case of posting at a time when no one is around to try to help.
Search Google using search terms like "AS2 MySQL PHP tutorial". Also. check out the tutorial found at...
http://www.gotoandlearn.com/play.php?id=20 -
Re: using create_text and read_text should save text in database table
Hi,
what are the parameters i need to pass for create_text and read_text in dialog programming, i have a 4 i/o fields where in each i need to enter 30 email ids , after entering email ids i need to save to the database, what is the logic
fields: SNO---serial number
mail1------> need to enter less than r more than 30 email address
mail2----> need to enter less than r more than 30 email address
mail3-----> need to enter less than or more than 30 email address
when i click create insert into database and from database it should b displayed on the table control. How to do using create_text ( using text objects function modules)If you are updating a custom Z Table, then look at redesigning it:
Fields:
<b>Client</b>
<b>SNO</b>
<b>MAIL ID ( 1, 2, 3)</b> etc
<b>COUNTER</b> (001 to 999)
These fields make up the key.
Email Address
This way you can store many email addresses.
It is not a good idea to store data in a free form text field. -
How to populate Adobe LiveCycle Designer generated PDF Forms with data from Database in Windows app
Hi
I have a PDF template designed in Adobe LiveCycle Designer. This template has form fields which needs to be filled with data programmatically. I am using windows application in C#.Net 2005 in which I want to retrieve data from database and merge this data into PDF form in respective fields.
How this can be achieved?
I searched a lot & I found that we can process the XDP file generated from PDF to acheive this. I created the XDP file out of the PDF template created in designer. But I don't know how to merge data from database into that XDP file in respective fields and again convert this XDP file back to PDF programmatically. Can anybody help me ? This is urgent.
Thanks in advance.
SambhajiPlease ignore the above code.<br />The following one is correct one.<br />using System;<br />using System.Data;<br />using System.Configuration;<br />using System.Web;<br />using System.Web.Security;<br />using System.Web.UI;<br />using System.Web.UI.WebControls;<br />using System.Web.UI.WebControls.WebParts;<br />using System.Web.UI.HtmlControls;<br />using System.Text;<br />public partial class _Default : System.Web.UI.Page <br />{<br /> protected void Page_Load(object sender, EventArgs e)<br /> {<br /> Response.ContentType = "application/vnd.adobe.xdp+xml";<br /> StringBuilder responseString = new StringBuilder();<br /> responseString.Append("<?xml version='1.0' encoding='UTF-8'?>");<br /> responseString.Append("<?xfa generator='AdobeLiveCycleDesigner_V8.0' APIVersion='2.5.6290.0'?>");<br /> responseString.Append("<xdp:xdp xmlns:xdp='http://ns.adobe.com/xdp/'>");<br /> responseString.Append("<xfa:datasets xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/'>");<br /> responseString.Append("<xfa:data>");<br /><br /> responseString.Append("<form1>");<br /> responseString.Append("<TextField1>Homer</TextField1>");<br /> responseString.Append("<TextField2>Simpson</TextField2>");<br /> responseString.Append("<field name ='DropDownList1'>");<br /> responseString.Append("<items save='1'>");<br /> responseString.Append("<text>1</text>");<br /> responseString.Append("<text>2</text>");<br /> responseString.Append("<text>3</text>");<br /> responseString.Append("</items>");<br /> responseString.Append("</field>");<br /><br /> responseString.Append("</form1>");<br /><br /> responseString.Append("</xfa:data>");<br /> responseString.Append("</xfa:datasets>");<br /> responseString.Append("<pdf href='C:\\Test.pdf' xmlns='http://ns.adobe.com/xdp/pdf/' />");<br /> responseString.Append("</xdp:xdp>");<br /><br /> Response.Write(responseString);<br /> Response.Flush();<br /> Response.End();<br /> }<br />}
Maybe you are looking for
-
I can't open Google Browser window
I use Mac os 10.6.8 and today my computer was really slow so I decided to shut down all open programs including Google Chrome. However, after I restarted the computer, the Google Chrome browser wouldn't open. This has happened to me before several ti
-
Yosemite - Samsung 840 Pro Significant Slowdown
I have upgraded my MacbookPro 15" Early 2011 with a Samsung SSD 840 Pro 512GB. It was performing extremely smooth and well using OS 10.9 (Mavericks). Last week, I have upgraded the OS X to Yosemite and now I'm experiencing frequent significant slow d
-
Why do I have a double set of icons on top right after install?
After downloading and installing beta 4 i get double icons on top. I removed them by customizing but now when I open new tabs I dont have any way to close them as in no little x.
-
Can I update my iPhone using an iPad?
Am just wondering if the iPad is capable of being able to update my iPhone or do I need to use a computer?
-
Urxvt ignores highlightColor in some applications since 9.09
As the subject says, since version 9.09 urxvt's highlighting behavior changed and its highlightColor setting is ignored in some applications, like vim or ncmpcpp, to name a few. Instead of using the specified color, background and foreground colors a