Based on input file i need to update default values to some columns of database table using bulk copy process
Hi Team,
Am using BULK INSERT Format file option to load data into table from .txt file here am facing an issue i.e ibased on input file i need to insert default values to some columns of table so we can not declare it on table level, Can we give default values in
format file ? if we can give how it is ? or Any alternate possibilities to this scenario instead of BULK INSERT ?
Thanks,
Sudhakar
Thanks for your response, here i don't have any rights to change table structure the table is created by different team, my work is to load data from file to table. Is there any chance to supply default values by*XML* format file instead of *.fmt* file
please let me know the possibility.
Again, no. If you want to supply default values that are not present in DEFAULT constraints in the table definition, you will need to write your own code. There are plentyfull of options, and I have mentioned some already.
Here are some more:
* Table-valued parameters, see here for examples:
http://www.sommarskog.se/arrays-in-sql-2008.html
* Use BULK INSERT to load data to a staging table, and then apply the default values when you copy from staging to target.
Erland Sommarskog, SQL Server MVP, [email protected]
Similar Messages
-
Hi All,
Am using OPENROWSET to load the file data into table, here the problem is i need to map same input value to two different columns of table, As format file doesn't allow the duplicate numbers am unable to insert same value to two columns, please help me to
find a solution for this.
i can use only OPENROWSET because i need to insert some default values also which come based on file. only the problem is how to map same input value to two different columns of table. please give me the suggestions.
Thanks,
SudhakarFrom what you say:
INSERT tbl(col1, col2)
SELECT col1, col1
FROM OPENROWSET(....)
But I guess it is more difficult. You need to give more details. What sort of data source do you have? What does your query look like? The target table?
Erland Sommarskog, SQL Server MVP, [email protected]
Hi Erland,
Thanks for your response
my source file is text file with | symbol separate for ex:
1002|eTab |V101|eTablet|V100|Logic|LT-7|Laptops|SCM
Database table have columns like
column1,column2,column3...etc, now i need to insert same value from input file into two columns for ex:
the eTab value from text file has to be insert into column2 and column3 of
table
we cannot change format file like below one
for the above situation how can we insert eTab into column2 and column3
Thanks,
Sudhakar. -
<blockquote>Locked by Moderator as a duplicate/re-post.
Please continue the discussion in this thread: [tiki-view_forum_thread.php?comments_parentId=702631&forumId=1]
Thanks - c</blockquote>
== Issue
==
I have a problem with my bookmarks, cookies, history or settings
== Description
==
How can I get the default value of a particular preference in FireFox?.
I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.
I see some that there are values for preferences in firefox.cs but I am not certain that these are being used as the default values for preferences. prefs.js in user's profile only has the updated values and not the default values.
Any help towards acheiving this programtically is greatly appreciated.
If the default values are stored in a file, kindly let me know the format in which it is stored for me to parse it programatically.
== User Agent
==
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)Dear Friend,
Here when you have the callableSattement as ?=proc(?), the first ? is an output parameter. So you should register it as out parameter using registeroutparameter.
Then you can get the value from the outparameter using callablestatement.getXXX().
Try that way.
For free tral versions of JDBC Drivers go to www.Atinav.com -
How to update field values in a database table using module pool prg?
hi
how to update field values in a database table using module pool prg?
we created a customized table, and we put 2 push buttons in screen painter update and display.
but update is not working?
data is enter into screen fields and to internal table, but it is not updated in database table.
thanks in adv
vidyaHI,
we already used the update statement. but its not working.
plz check this.
*& Module Pool ZCUST_CALL_REC
PROGRAM ZCUST_CALL_REC.
TABLES: ZCUST_CALL_REC,ZREMARKS.
data: v_kun_low like ZCUST_CALL_REC-kunnr ,
v_kun_high like ZCUST_CALL_REC-kunnr,
v_bud_low like ZCUST_CALL_REC-budat,
v_bud_high like ZCUST_CALL_REC-budat.
ranges r_kunnr for ZCUST_CALL_REC-kunnr .
ranges r_budat for zcust_call_rec-budat.
DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
*data:begin of itab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of itab.
*data:begin of Jtab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of Jtab.
CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
*start-of-selection.
*& Module USER_COMMAND_9000 INPUT
text
MODULE USER_COMMAND_9000 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'ENQUIRY'.
perform multiple_selection.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9001'.
WHEN 'UPDATE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
perform update on commit.
WHEN 'DELETE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module STATUS_9000 OUTPUT
text
MODULE STATUS_9000 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9001 INPUT
text
MODULE USER_COMMAND_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
endcase.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9001 OUTPUT
text
MODULE STATUS_9001 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module USER_COMMAND_9002 INPUT
text
module USER_COMMAND_9002 input.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'UPDATE'.
perform move_data.
UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
ENDIF.
WHEN 'DELETE'.
perform move_data.
DELETE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
ENDIF.
endcase.
endmodule. " USER_COMMAND_9002 INPUT
*& Module STATUS_9002 OUTPUT
text
module STATUS_9002 output.
SET PF-STATUS 'ZCUSTOMER1'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_9002 OUTPUT
*& Module update_table OUTPUT
text
module update_table output.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
endmodule. " update_table OUTPUT
***Selection Data
FORM SELECT_DATA.
SELECT mandt kunnr budat code remarks FROM zcust_call_rec INTO
table itab
WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
ENDFORM.
****append vendor code
FORM APPEND_CUSTOMER_CODE.
clear r_kunnr.
clear itab.
clear r_budat.
refresh r_kunnr.
refresh itab.
refresh r_kunnr.
IF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_high
IMPORTING
OUTPUT = r_kunnr-high.
r_kunnr-option = 'BT'.
r_kunnr-sign = 'I'.
append r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
CALL SCREEN '9000'.
ENDIF.
PERFORM V_BUDAT.
ENDIF.
ENDFORM.
FORM V_BUDAT.
IF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'BT'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-HIGH = v_bud_HIGH.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
CALL SCREEN '9000'.
r_budat-low = ''.
r_budat-option = ''.
r_budat-sign = ''.
ENDIF.
ENDIF.
ENDFORM.
*& Form update
text
--> p1 text
<-- p2 text
form update .
commit work.
endform. " update
*& Form move_data
text
--> p1 text
<-- p2 text
form move_data .
clear itab.
refresh itab.
move-corresponding zcust_call_rec to itab.
MOVE ZCUST_CALL_REC-MANDT TO ITAB-MANDT.
MOVE ZCUST_CALL_REC-KUNNR TO ITAB-KUNNR.
MOVE ZCUST_CALL_REC-BUDAT TO ITAB-BUDAT.
MOVE ZCUST_CALL_REC-CODE TO ITAB-CODE.
MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
APPEND ITAB.
delete itab where kunnr is initial.
endform. " move_data
thanks in adv
vidya -
How to Upload a PDF file into BLOB column in a table using Forms 9i
Can anyone tell me how to upload a PDF file from client system using File dialog window and store its content in BLOB column in a table. The file to be uploaded will be in client side.
Hi,
please, search a bit on the forum before do a question:
Just searching by "upload blob pdf" ...
How to batch upload PDF files into database BLOB
Regards,
Jose. -
How to Upload a PDF file into BLOB column in a table using Forms 6i
Can anyone tell me how to upload a PDF file from client and store its content in BLOB column in a table. The file will be genered using reports and win be stored in db.The file to be uploaded will be in client side.
Thank´s.If you are using version 9 or 10 use webutil.... Look in webutil.pll.
Use either one these two fuctions...
FUNCTION Client_To_DB( clientFile in VARCHAR2,
tableName in VARCHAR2,
columnName in VARCHAR2,
whereClause in VARCHAR2,
asynchronous in BOOLEAN default FALSE,
callbackTrigger in VARCHAR2 default NULL) return BOOLEAN;
FUNCTION Client_To_DB_With_Progress
( clientFile in VARCHAR2,
tableName in VARCHAR2,
columnName in VARCHAR2,
whereClause in VARCHAR2,
progressTitle in VARCHAR2,
progressSubTitle in VARCHAR2,
asynchronous in BOOLEAN default FALSE,
callbackTrigger in VARCHAR2 default NULL) return BOOLEAN; -
Need to set default values for the fields plant and location in ME21N
Hi All,
i need to set default values for the fields plant and location in ME21N tcode.
In accout assignment if we give 'A' then we need to create asset by clicking the Asset tab,there you have the fields plant and location.
How to resolve this?
Thanks in Advancehi .
i needed to set default strorage location and plant in personal setting in me21n.
i solve it with this way.
go to program SAPLMEPERS in se38.
create new function in output with the sample name :MODULE ZTEST_001 OUTPUT.
in this module write:
if MEPOITEM_PROP-WERKS is INITIAL and MEPOITEM_PROP-LGORT is INITIAL.
MEPOITEM_PROP-WERKS = '1000'.
MEPOITEM_PROP-LGORT = '0032'.
endif.
this is the solution.
best regards.
maryam -
Alter program execution structure based on input file
I have a program that takes some parameters from an input file then runs a visual acquisition, using IMAQ, controlling some other hardware at the same time. The parameters control the duration of various steps in this process.
There is a stacked sequence structure to control reading in the input file, initialisation of the hardware and then a while loop on the final frame to do the actual acquisition.
The user of the program would now like the capability of having multiple sets of acquisition within the same run, possibly with different duration parameters. This would mean various iterations of the final while loop, based upon the parameters in the input file. There might be 5 acquisition sets on one occasion, 3 on another etc., within one run of the program.
The VI structure already seems a little baroque and I don't want to make it even more complicated.
I would welcome any advice as to the best way to proceed, as I'm very much a LabView novice.
Solved!
Go to Solution.Dear Verdurin
With reference to Cory K's earlier post the most practical and efficient method to achieve acquistion would indeed be to use a Standard State Machine VI sequence structure. This structure executes set code (your own code) and determines which state to transition to. I agree with Cory K's 3 states within the sequence. Using the iterations loop you can define how many iterations of each acquistion you require. In LV, click File > New > From Template > Frameworks > Design Patterns > Standard State Machine. This automatically creates the VI for you to use where you can create the 3 states required.
Within the 3 states input your code into the relevant states to achieve acquistion. Use timing to achieve different duration parameters within the case structure. After you have read from the input file, select the next state as initialisation, then after that is complete, select the next state as acquistion. Repeat this loop as many time as you need for each acquistion.
I hope this clarifys your question. If you have any problems please do not hesitate to contact me and thanks for using the NI forums.
Kind regards
David
Applications Engineer
National Instruments UK
Many thanks for using the NI forums and I look forward to your reply.
Kind regards
David
Applications Engineer
National Instruments UK -
Need to update sequence value in two table
Hi guys
Please help me in the below query
I will need to insert a row in two different table
table1
col1 col2
table2
column1 column2
the col1 in table1 will be assigned a sequence.nextval
i need to assign the same value in table2 column 1.
can i do it in a single insert statementi would do like this. INSERT ALL is the way to go...
SQL> create sequence my_seq;
Sequence created.
SQL> create or replace function my_seq_fn return number
2 as
3 lNum number;
4 begin
5 select my_seq.nextval into lNum from dual;
6 return lNum;
7 end;
8 /
Function created.
SQL> create table t1(a number, b number);
Table created.
SQL> create table t2(c number, d number);
Table created.
SQL> insert all
2 into t1(a,b) values(seq, val1)
3 into t2(c,d) values(seq, val2)
4 select my_seq_fn() as seq, level+5 as val1, level+10 as val2
5 from dual
6 connect by level <=10;
20 rows created.
SQL> /
20 rows created.
SQL> select * from t1;
A B
1 6
2 7
3 8
4 9
5 10
6 11
7 12
8 13
9 14
10 15
11 6
A B
12 7
13 8
14 9
15 10
16 11
17 12
18 13
19 14
20 15
20 rows selected.
SQL> select * from t2;
C D
1 11
2 12
3 13
4 14
5 15
6 16
7 17
8 18
9 19
10 20
11 11
C D
12 12
13 13
14 14
15 15
16 16
17 17
18 18
19 19
20 20
20 rows selected.
SQL> select my_seq.currval from dual;
CURRVAL
20 Thanks,
Karthick -
Hi,
I am trying to use class CL_ALV_CHANGED_DATA_PROTOCOL to update a database table from an ALV grid.
I have used program BCALV_EDIT_04 as an example.
I am able to successfully processed inserted or deleted lines using the attributes
MT_DELETED_ROWS
MT_INSERTED_ROWS
but I also want to process modified lines.
I was just wondering whether anyone out there has some example code for this.
I can see that there are the following attributes available
MT_MOD_CELLS
MP_MOD_ROWS.
I would ideally like to use MP_MOD_ROWS rather than MT_MOD_CELLS but it is not clear to me what type MP_MOD_ROWS is.
If anyone has any example code for this sort of thing, please let me know.
Thanks,
Rubyhi Ruby,
Yes we can use that *data reference variable *.
It is a variable( something comparable to a pointer ) that points to a int table( table with changed contents )
which ll be created at run-time based on the data type ot the internal table that we pass to the parameter it_outtab of method set_table_for_first_display ...
assign er_data_changed->mp_mod_rows->* to a field-symbol and use it...
Check the below code for example -> method refresh_changed_data
screen flow logic.
PROCESS BEFORE OUTPUT.
MODULE pbo.
PROCESS AFTER INPUT.
MODULE pai.
main program.
* CLASS lcl_event_responder DEFINITION *
CLASS lcl_event_responder DEFINITION.
PUBLIC SECTION.
DATA : ls_changed_cell TYPE lvc_s_modi,
lv_language TYPE spras..
METHODS refresh_changed_data FOR EVENT data_changed
OF cl_gui_alv_grid
IMPORTING er_data_changed
e_ucomm.
ENDCLASS. "event_responder DEFINITION
TYPES tt_makt TYPE STANDARD TABLE OF makt.
DATA: go_handler TYPE REF TO lcl_event_responder,
go_grid TYPE REF TO cl_gui_alv_grid,
gt_fieldcat TYPE lvc_t_fcat,
gv_language TYPE spras VALUE 'E',
gt_outtab TYPE tt_makt,
gs_tableline TYPE LINE OF tt_makt.
FIELD-SYMBOLS : <changed_rows> TYPE tt_makt.
CALL SCREEN 100.
* MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'BASIC'.
PERFORM create_and_init_alv CHANGING gt_outtab[]
gt_fieldcat.
ENDMODULE. "pbo OUTPUT
* MODULE PAI INPUT *
MODULE pai INPUT.
LEAVE PROGRAM.
ENDMODULE. "pai INPUT
FORM create_and_init_alv CHANGING pt_outtab LIKE gt_outtab[]
pt_fieldcat TYPE lvc_t_fcat.
CHECK go_grid IS NOT BOUND.
CREATE OBJECT go_grid
EXPORTING
i_parent = cl_gui_container=>default_screen.
PERFORM build_display_table.
PERFORM build_fieldcat CHANGING pt_fieldcat.
go_grid->set_table_for_first_display( CHANGING it_fieldcatalog = pt_fieldcat
it_outtab = pt_outtab ).
go_grid->set_ready_for_input( 1 ).
* raises the 'data_changed' event when we select another cell/any action after changing the data
go_grid->register_edit_event( EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_enter ).
CREATE OBJECT go_handler.
SET HANDLER go_handler->refresh_changed_data FOR go_grid.
ENDFORM. "CREATE_AND_INIT_ALV
FORM build_display_table.
FREE gt_outtab.
SELECT * FROM makt UP TO 20 ROWS INTO TABLE gt_outtab WHERE spras EQ gv_language.
ENDFORM. "build_display_table
FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'MAKT'
CHANGING
ct_fieldcat = pt_fieldcat.
LOOP AT pt_fieldcat INTO ls_fcat.
ls_fcat-edit = abap_true.
MODIFY pt_fieldcat FROM ls_fcat.
ENDLOOP.
ENDFORM. "build_fieldcat
* CLASS event_responder IMPLEMENTATION *
CLASS lcl_event_responder IMPLEMENTATION.
METHOD refresh_changed_data.
ASSIGN er_data_changed->mp_mod_rows->* TO <changed_rows>.
LOOP AT <changed_rows> INTO gs_tableline.
BREAK-POINT.
ENDLOOP.
ENDMETHOD. "click
ENDCLASS. "event_responder IMPLEMENTATION
Cheers,
Jose. -
SQL Loader needs to load default value instead of null
I am loading data from the flat file into the table. The table primary key consists of 5 fields. One of these fields might be empty in the text file, so on the load I need to substitute it with some default value like "***", for instance. Is there any way to make some conditions in the control file?
You can either make use of the suggession given by Warren Tollentino or alter table by adding default constraint for the column.
-
Add entries to database tables using update function module
Hi All,
I have a small requirement, in which I need to update Z-tables usimg update function module in update task. In the calling program, I have gathered the data in a field symbol value of type any. I need to pass the same to that function module to update the data which is in the field symbol.
Please guide me how to achieve this technically.
Thanks in advance,
Pradipta .Hi,
I believe you already have evrything with you.....Start Coding the same and come back with any Coding issue.
I believe you will not be able to pass the Field Symbol in FM Interface.....You need to pass the Variable which Field Symbol is referring.... -
Can we update The extended VBPA database table using BAPI
Hi,
We have a table VBPA appended with two fields start date and end date. Our scenario is to when modifying the sales order using the bapi BAPI_SALESORDER_CHANGE we need to update the two fields star_date and end_date of VBPA table for the corresponding Ship to or Sold to partner for the Given Sales Order.
Thanks,
Venkat.Hi,
YES You can, You should be updating this to fields using a BAPI - "BAPI_SALESORDER_CHANGE" and use table user this BAPI "EXTENSIONIN" to update this fields. Refer to BAPI documentation for more reference. Please check below code which was done for VBAK (2 date fields).
Regards,
Tim
DATA:
ZBAPISDH1 TYPE BAPISDH1,
ZBAPISDH1X TYPE BAPISDH1X,
ZEXTENSIONIN TYPE TABLE OF BAPIPAREX WITH HEADER LINE,
BAPE_VBAK TYPE BAPE_VBAK,
BAPE_VBAKX TYPE BAPE_VBAKX.
ZBAPISDH1X-UPDATEFLAG = 'U'.
BAPE_VBAK-VBELN = P_VBELN.
BAPE_VBAK-ZZSD_FROM = P_START.
BAPE_VBAK-ZZSD_TO = P_END.
BAPE_VBAKX-VBELN = P_VBELN.
BAPE_VBAKX-ZZSD_FROM = CO_X.
BAPE_VBAKX-ZZSD_TO = CO_X.
ZEXTENSIONIN-STRUCTURE = 'BAPE_VBAK'.
ZEXTENSIONIN-VALUEPART1 = BAPE_VBAK.
APPEND ZEXTENSIONIN.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'. -
Update button code to reflect data into database table?
Hi Everyone,
I have search page and Update page. On clicking on update image of any row in Search page i am able to navigate to Update page with the parameters.
Now after updating the values i need to click on Apply button then the data should be stored to table(database).
What code should i write in Apply button?
Do i need to initialize row? If yes what code and where should i write?
thanks.Hi Kumar ,
Row initialization not required , you have get the exact row in update page and in ProcessFromRequest of your controller class
you can call the method which is defined in AM to Commit the updated values .
Code :
In PFR
if(pageContext.getParameter("Upate") != null)
am.invokeMethod("UpdatePacelineLayout");
In AmImpl
public void UpdatePacelineLayout()
getTransaction().commit();
throw new OAException("Record Updated Successfully", OAException.INFORMATION);
--Keerthi -
How to update the database table using webdynpro??
Hi,
Can anybody helm me in updating database table....by entering the values on the output screen of webdynpro component??should i use any commit statement in function module ,which i used to update.hi martina....
consider you are having two input fields bound to attr1 and attr2.
now after pressing the save button:
just read teh two attributes to field1, field2 using code wizard. then
<db name>-<fieldname1> = <field1>.
<db name>-<fieldname2> = <field2>.
insert <dbname>.
---regards,
alex b justin
Maybe you are looking for
-
Error in SRM: a user with enough authorisation level is miss
Hello, We are on SRM 5.0 and our users get the following error in SRM when creating a shopping cart: No user assigned to object a user with enough authorisation level is missing. Anybody any idea ? Thanks as ever
-
How can you reset your iphone when its disable with sync to a new computer
Someone help mhe !r
-
Sleep mode crashed - Will not launch in regular or safe mode (Yosemite)
I put Yosemite to sleep last night, and woke up to a frozen screen the next day. I hard rebooted the computer and the loading bar freezes at about 50%. I have tried multiple reboots and from time to time, the computer will make it to the desktop and
-
Noise problem with moving bitmaps
I'm having trouble with the most recent Flash player (9,0,45,0). When displaying moving bitmaps, the player sometimes shows horizontal noise lines across the image. This doesn't happen on all platforms, but it does happen on my customers', so I've go
-
2.2 Update Failed - Error 13
Went to update my iPhone this morning. I first updated iTunes and then went to update the iPhone. However about halfway through the process, I received error 13. I now have a brick. I've followed the Apple advice, but I still have a brick. Any help a