How to update field of ReadOnly Child Using Relationship Name
HI Guys,
The scenario is as follows:-
<b>Parent</b> (Has Read Read/ Write BDoc Specified)- But Does not has the Segment Field that is to be modified
<b>Relationship Name</b> Is specified b/w Parent and Child
<b>Child</b> (Has only Read BDoc Specified)- Has the segment field that is to be modified.
<b>BQuery</b> - Exists for the parent BDoc
Is it possible to update the field in child BDoc by any means..?????
Directly or Indrectly?
Please help with Syntax.
Thank You in advance
Well Guys I got the solution to it.
Yes we can update the child fields. And we need not have a write BDoc specified in this case.
The Syntax is of just one line.--
<i><ParentBOName><RelationShipName>.<field name> </i>= <b>value</b>
Similar Messages
-
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 update software on multiple iPhones using same iTunes account?
How to update software on multiple iPhones using same iTunes account?
SeanB15 wrote:
Here are more details on my situation which should help clarify things...
I purchased three iPhone 4 models back when they first came out (for my family) that all share the same iTunes account for access to apps and music, but each phone/user still has his/her custom contact list, email accts, and select lists of apps and music from the one iTunes acct library. The problem is (as I understand it) that I can only update the software on one of the three iPhones – the primary phone I used to setup the iTunes acct without wiping out the separate contact lists, etc. As it stands today... the first (primary) iPhone associated with the iTune acct has been updated with the latest software version 5.1.1 and sync'd up with all the apps, music, etc from the one iTune acct, while the other two iPhones are still running on the original software version 4.0.2 and are experiencing problems now. I was advised by AT&T back in January that it would be necessary to setup separate iTunes accts for the second and third iPhones in order to receive system updates and still be able to manage separate contact lists, etc. If I go this route, I assume we will lose all the apps on phones #2 and #3 that we have been "sharing"... correct? Since this AT&T advice was prior to iCloud coming out, would iCloud be a better solution or at least part of the solution? I really don't yet understand how iCloud works. Hopefully, one of you can help me??
we have 2 iphone 4's synced to the same itunes account for apps and music since the day we bought them, but each has a different icloud acct. they have both been updated on the same itunes account with every update that has come out since we bought them in december of 2010. nothing on either phone has ever been lost or duplicated. having said all that, maybe i'm missing something here, but we have had no problems. we do have itunes setup to sync manually. i do believe i'm a piker compared to lawrence finch, but i'm just telling you what happens in my house. maybe check with apple? is there a store near you? -
How to update field in table FAGLFLEXA/FAGLFLEXT
Hi Gurus,
we are stay in ECC 5.00. The new g/l have activated but we have not assigned the relevant scenario to the ledger (Refer note no 990612)
now we have assinged following field:
FIN_CCA: RCNTR (Cost center), SCNTR (Sender cost center)
FIN_CONS: RASSC (Trading partner), RMVCT (Transaction Type)
FIN_GSBER: RBUSA (Business area), SBUSA (Trading partner's business area)
FIN_PCA: PRCTR (Profit Center), PPRCTR (Partner Profit Ctr)
FIN_SEGM: SEGMENT (Segment), PSEGMENT (Partner segment)
FIN_UKV: RFAREA (Functional Area), SFAREA (Partner Functional Area)
our problem is the data was posted before that does not update fields in table FAGLFLEXA/FAGLFLEXT,How to update field in table FAGLFLEXA/FAGLFLEXT?
Thanks,Hello Jenjira,
Since this was a question asked few years back, I think you can share your experience with activation of a Scenario subsequent to Go-Live of new GL functionality (We are contemplating activation of one more scenario for Functional Area updation in new GL. 4 update scenarios were activated at time of New GL Implementation 4 years ago).
Please share following:
1. Impact of this subsequent activation on Open documents in the live system.
2. How you addressed the issues arising on Point 1.
3. Any support that you got from SAP Support Team on issues thereof.
Any inputs will be of great help. -
How do I generate the pdf file using the name of a field. How can I help
how do I generate the pdf file using the name of a field. How can I help
Hi,
here's a sample.
LiveCycle Blog: Formulare in bestimmte Verzeichnisse speichern und nach Inhalt aus Formularfeld benennen //Save forms to… -
How to update fields in the target table in correspondance with the source file values
Environment: win7, SQL server 2008 R2
Application: Microsoft Management SQL Studio 2008 R2, Business Intelligence 2008 - SSIS
SSIS competency level: Novice
Problem: I have been trying to update some of the fields in the destination table,student table, in reference to data set in the staging table and ssn table. I was able to insert/load new data to the destination using look up transformation
while the driver is ssn (data mapping) but i couldn't know how to update some of the fields in the student table while keeping the orignal pn_id of both tables(ssn and student tables), because pn_id already exists in the SSN table and student table. There
are other records also associated with the pn_id so I am not allowed to update the pn_id in the destination tables. For example,
SSN Table (pn_id,ssn)
('000616850',288258466)
('002160790',176268917)
Staging Table (ssn, id, pn_id, name, subject, academic year, comments)
(288258466, 1001, '770616858',Sally Johnson, English,A, 2005,'great student')
(176268917, 1002, '192160792',Will Smith, Math,38000,C, 2014,'no comments')
(444718562, 1003, '260518681',Mike Lira, Math,38000,B, 2013,'no comments')
Student Table (destination table)(id,pn_id,subject,academic year, grade, comments):
(1001, '000616850', ' ',' ', ,'')
(1002, '002160790', ' ',' ', ,'')
Expected Results:
My goal is to have student table updated as the following:
Student Table
(1001, '000616850', 'English','A' ,2005 ,'great student')
(1002, '002160790', 'Math ',' C',2014 ,'no comments')
please adviseWhy can't you use simple UPDATE command in EXECUTE SQL Task as below,
DROP TABLE SSN
DROP TABLE STAGING
DROP TABLE STUDENT
CREATE TABLE SSN(pn_id VARCHAR(100),ssn BIGINT)
INSERT INTO SSN VALUES('000616850',288258466)
INSERT INTO SSN VALUES('002160790',176268917)
CREATE TABLE Staging (ssn BIGINT, id INT, pn_id BIGINT, name VARCHAR(100), subject VARCHAR(100),grade VARCHAR(10), [academic year] INT, comments VARCHAR(100))
INSERT INTO Staging VALUES(288258466, 1001, '770616858','Sally Johnson', 'English','A', 2005,'great student')
INSERT INTO Staging VALUES(176268917, 1002, '192160792','Will Smith', 'Math','C', 2014,'no comments')
INSERT INTO Staging VALUES(444718562, 1003, '260518681','Mike Lira', 'Math','B', 2013,'no comments')
CREATE TABLE Student(id INT,pn_id BIGINT,subject VARCHAR(100), [academic year] INT, grade VARCHAR(10), comments VARCHAR(100) )
INSERT INTO Student VALUES(1001, '000616850', NULL,NULL,NULL ,NULL)
INSERT INTO Student VALUES(1002, '002160790', NULL,NULL,NULL ,NULL)
UPDATE Student SET Subject = C.Subject, [academic year]=C.[academic year], grade=C.grade,comments=C.comments
FROM SSN A INNER JOIN Student B
ON A.pn_id=B.pn_id INNER JOIN Staging C
ON A.ssn = C.ssn
SELECT * FROM Student
Regards, RSingh -
How to update old records of LIPS used user exit MV50AFZ1
To All Experts,
I have used User Exit MV50AFZ1 and in this user exit i updated the fields
USEREXIT_MOVE_FIELD_TO_LIPS.
LIPS-ETENR = VBEP-ETENR.
Its working fine for new VL0N1 t-code, but what about old recods of LIPS table ?
How to update old records ? Pl. guide me.
YusufHi Yusuf,
See SAP Note 415716 - User exits in delivery processing, it explain how these userexits work and cautions that you must have.
Regards
Eduardo -
HT201209 how do i know if my child used their itunes gift cards
How do I know if my child actually USED their itunes gift cards or if they just scratched off the strip and put it aside ?
Thank you again for all of your help!! I really appreciate it!
I think I am following -- I was able to upload to my iPhoto and all photos and videos are there that is a plus! I tried to create an Event in my iPhoto and put all of my photos in that event but for some reason, now my iTunes it not recognizing that Event in my iPhoto. It is not allowing me to import just that event at the moment but I may be doing something wrong. At least all of my pics and vids are in iPhoto so that is a plus and I know they are at least saved somewhere. Just for some reason, my iTunes it not locating the event that I created with only those photos.
Thank you for letting me know about my contacts! How do I know if I have the contacts app?
Also, I had no clue that my iCloud could be backed up via cellular data! However, is this a new feature with the most updated iOS?? Unforutnatly I am like 2 iOS updates behind because I don't have enough storage on my phone. I still get the notification that my phone needs to be plugged in and connected to wifi in order to back up to the cloud :-(
How can I sync using USB? Right now when i click on the info tab for my iPhone in my iTunes this is the answer that I get -- I am a little unclear as to what it means.
Sync Contacts:
Your contacts are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone
Sync Calendars:
Your calendars are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone -
How to update fields in multiple tables ?
Dear all,
What is the fastest way to update fields in multiple tables... from a single change table...as below is my code to update the fields but it is taking long time to update as i need to keep log file if any one update fails....
CREATE OR REPLACE
package body DO_DC_NAME_UPDATE_OTHER_TAB
as
type rowidArray is table of rowid index by binary_integer;
type custRec is record
n_cust_ref_no dbms_sql.number_table,
v_name dbms_sql.varchar2_table,
v_name_chg dbms_sql.varchar2_table,
rowid rowidArray,
changed dbms_sql.varchar2_table
procedure VALIDATE_CUST_NAME( p_n_cust_ref_no in number,p_v_name_chg in out NOCOPY varchar2, p_changed in out NOCOPY varchar2 )
is
begin
FOR cr_cust IN (SELECT --a.n_cust_ref_no,a.v_name,UPD_V_NAME, a.n_weight,a.V_LASTUPD_INFTIM
from GNMT_CUSTOMER_MASTER_CHG where n_cust_ref_no=p_n_cust_ref_no)
loop
-- v_name
if nvl(trim(cr_cust.v_name),0) != nvl(p_v_name_chg,0)
then
p_v_name_chg := p_v_name_chg;
--p_v_name := p_v_name;
p_changed := 'Y';
end if;
end loop;
end;
procedure DO_NAME_UPDATE_OTHER_TAB
is
l_record custRec;
l_array_size number default 20000;
l_done boolean;
l_cnt number default 1;
cursor c is select a.n_cust_ref_no, a.v_name,a.v_name_chg, a.rowid, 'N'
from GNMT_CUSTOMER_MASTER_CHG a--,GNMT_CUSTOMER_MASTER b
where a.v_name <> trim(a.v_name_chg); --and a.n_cust_ref_no in (1434775,1561181,1601870);
begin
open c;
loop
dbms_application_info.set_client_info
( 'processing ' || l_cnt || ' thru ' || (l_cnt+l_array_size-1) );
fetch c bulk collect into l_record.n_cust_ref_no, l_record.v_name,l_record.v_name_chg,l_record.rowid, l_record.changed
LIMIT l_array_size;
l_done := c%notfound;
--dbms_output.put_line ('message10');
for i in 1 .. l_record.n_cust_ref_no.count
loop
VALIDATE_CUST_NAME(l_record.n_cust_ref_no(i),l_record.v_name_chg(i),l_record.changed(i) );
end loop;
--dbms_output.put_line (l_record.n_cust_ref_no(i)||','||l_record.V_OCCUP_CODE(i)||','||l_record.CHANGED(i));
/*forall i in 1 .. l_record.n_cust_ref_no.count
update GNMT_CUSTOMER_MASTER q
set q.v_name = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.v_name) = l_record.v_name(i)
and l_record.changed(i) = 'Y';*/
-- update v_name in all the related tables
forall i in 1 .. l_record.n_cust_ref_no.count
update ADE_CUSTOMER_MASTER q
set q.v_NAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.v_name) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update GNMT_POLICY_DETAIL q
set q.v_NAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.v_name) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update GNMT_QUOTATION_DETAIL q
set q.v_NAME =l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.v_name) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update NBDT_BENEFICIARY q
set q.V_NAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.V_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update PSDT_NOMINATION_TRANSACTION q
set q.V_NAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.V_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update PSMT_POLICY_BENEFICIARY q
set q.V_NAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.V_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_NAME is not null;
commit;
forall i in 1 .. l_record.n_cust_ref_no.count
update PSMT_POLICY_TRUSTEE q
set q.V_NAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.V_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update PSMT_QUOTATION_BENEFICIARY q
set q.V_NAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.V_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update PSMT_QUOTATION_TRUSTEE q
set q.V_NAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.V_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_NAME is not null;
commit;
forall i in 1 .. l_record.n_cust_ref_no.count
update GNDT_BLACKLIST_DETAIL q
set q.v_FNAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.v_FNAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_FNAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update INDT_LIAM_DETAIL q
set q.v_FNAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.v_FNAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.v_FNAME is not null;
commit;
forall i in 1 .. l_record.n_cust_ref_no.count
update GNMT_POLICY q
set q.V_PAYER_NAME = l_record.v_name_chg(i)
where q.N_PAYER_REF_NO = l_record.n_cust_ref_no(i)
and trim(q.V_PAYER_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.V_PAYER_NAME is not null;
commit;
forall i in 1 .. l_record.n_cust_ref_no.count
update GNMT_QUOTATION q
set q.V_PAYER_NAME = l_record.v_name_chg(i)
where q.N_PAYER_REF_NO = l_record.n_cust_ref_no(i)
and trim(q.V_PAYER_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.V_PAYER_NAME is not null;
commit;
forall i in 1 .. l_record.n_cust_ref_no.count
update GNMT_QUOTATION q
set q.V_PROPOSER_NAME = l_record.v_name_chg(i)
where q.N_PROPOSER_REF_NO = l_record.n_cust_ref_no(i)
and trim(q.V_PROPOSER_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.V_PROPOSER_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update GNMT_POLICY q
set q.V_PROPOSER_NAME = l_record.v_name_chg(i)
where q.N_PROPOSER_REF_NO = l_record.n_cust_ref_no(i)
and trim(q.V_PROPOSER_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.V_PROPOSER_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update CLMT_CLAIM_MASTER q
set q.V_CLIENT_NAME = l_record.v_name_chg(i)
where q.N_CLIENT_REF_NO = l_record.n_cust_ref_no(i)
and trim(q.V_CLIENT_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.V_CLIENT_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update CLMT_CLAIM_MASTER q
set q.V_INTIMATOR_NAME = l_record.v_name_chg(i)
where q.N_CLIENT_REF_NO = l_record.n_cust_ref_no(i)
and trim(q.V_INTIMATOR_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.V_INTIMATOR_NAME is not null;
forall i in 1 .. l_record.n_cust_ref_no.count
update PYMT_VOU_MASTER q
set q.V_PAYEE_NAME = l_record.v_name_chg(i)
where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
and trim(q.V_PAYEE_NAME) = l_record.v_name(i)
and l_record.changed(i) = 'Y'
and q.V_PAYEE_NAME is not null;
/*forall i in 1 .. l_record.n_cust_ref_no.count
INSERT INTO GNMT_CUSTOMER_MASTER_LOG
(N_CUST_REF_NO, V_TITLE_CODE, V_NAME, D_BIRTH_DATE, V_SEX, V_RELIGION_CODE, V_NATION_CODE, V_OCCUP_CODE, V_ALIVE, V_SMOKER,
N_NO_STICKS, D_DEATH_DATE, V_BUMI_NON_BUMI, V_AGE_ADMITTED, V_SHORT_NAME, V_FIRST_NAME, V_LAST_NAME, V_EMAIL, V_DESIGNATION,
N_HEIGHT,N_WEIGHT,V_TITLE_CODE_CHG, V_NAME_CHG, D_BIRTH_DATE_CHG, V_SEX_CHG,V_RELIGION_CODE_CHG,V_NATION_CODE_CHG, V_OCCUP_CODE_CHG, V_ALIVE_CHG,
V_SMOKER_CHG, N_NO_STICKS_CHG, D_DEATH_DATE_CHG,V_BUMI_NON_BUMI_CHG, V_AGE_ADMITTED_CHG, V_SHORT_NAME_Chg, V_FIRST_NAME_Chg,
V_LAST_NAME_Chg, V_EMAIL_Chg, V_DESIGNATION_Chg,N_HEIGHT_Chg,N_WEIGHT_Chg, V_UPD_STATUS_DC,-- V_LASTUPD_PROG, V_LASTUPD_INFTIM,
V_LASTUPD_USER_DC, V_LASTUPD_PROG_DC,V_LASTUPD_INFTIM_DC
SELECT N_CUST_REF_NO, V_TITLE_CODE, V_NAME, D_BIRTH_DATE, V_SEX, V_RELIGION_CODE, V_NATION_CODE, V_OCCUP_CODE, V_ALIVE, V_SMOKER,
N_NO_STICKS, D_DEATH_DATE, V_BUMI_NON_BUMI, V_AGE_ADMITTED, V_SHORT_NAME, V_FIRST_NAME, V_LAST_NAME, V_EMAIL, V_DESIGNATION,
N_HEIGHT,N_WEIGHT,V_TITLE_CODE_CHG, V_NAME_CHG, d_birth_date_chg, V_SEX_CHG, V_RELIGION_CODE_CHG,V_NATION_CODE_CHG, V_OCCUP_CODE_CHG, V_ALIVE_CHG,
V_SMOKER_CHG, N_NO_STICKS_CHG, D_DEATH_DATE_CHG, V_BUMI_NON_BUMI_CHG, V_AGE_ADMITTED_CHG, V_SHORT_NAME_Chg, V_FIRST_NAME_Chg,
V_LAST_NAME_Chg, V_EMAIL_Chg, V_DESIGNATION_Chg,N_HEIGHT_Chg,N_WEIGHT_Chg--, V_LASTUPD_USER, V_LASTUPD_PROG, V_LASTUPD_INFTIM
,'PROCESSED'
,user,--P_USER,
'DC_PAKAGE',
sysdate--P_DATE
FROM GNMT_CUSTOMER_MASTER_CHG where n_cust_ref_no =l_record.n_cust_ref_no(i)
--and n_cust_ref_no not in (select n_cust_ref_no from GNMT_CUSTOMER_MASTER_LOG);*/
exit when (l_done);
l_cnt := l_cnt + l_array_size;
end loop;
commit;
end;
end;
thank YouDear SeánMacGC thanks for reply,
But "a.changed" is not a field in GNMT_CUSTOMER_MASTER_CHG. what i am doing in this procedure is i am collecting bulck data and validating field by field from GNMT_CUSTOMER_MASTER_CHG with GNMT_CUSTOMER_MASTER table as their structure is same.. if v_name is not same as v_name_chg then i am setting changed flag to "Y" changed is "changed dbms_sql.varchar2_table" and updating GNMT_CUSTOMER_MASTER in bluck where changed flag ='Y'...
type custRec is record
n_cust_ref_no dbms_sql.number_table,
v_name dbms_sql.varchar2_table,
v_name_chg dbms_sql.varchar2_table,
rowid rowidArray,
*changed dbms_sql.varchar2_table*
i cannot use simple SQL as i need to validate field for each records with GNMT_CUSTOMER_MASTER_CHG and insert into log file as well.....
to run this procedure:
execute DO_DC_NAME_UPDATE_OTHER_TAB.DO_NAME_UPDATE_OTHER_TAB;
Thanks... -
Very Urgent: how to define field symbols in class using se24 Points assured
hi all
I am new to abap oo programming. I am using se24 to build a class
where some methods have code which involves working with field sybmols but i am not able to figure out way for how to define field symbols in the attributes section.
I tried defining like : fld_sym type ref to dbtab-fld
but in the method implementation if i try to use it like assign fld to <fld_sym> there it says fld_sym is not defined as a field symbol.
So can anyone please guide me how to define field symbols in se24.
Also what should be the general steps while creating a class using se24.
Points assured
thanksHi
Global classes are like Global fun modules in which the Methods and code is already written and is mainly used for Reusability purpose.
Goto SE24 tcode and see the std global classes like
CL_ABAP_CHAR_UTILITIES
see the links
chk out the links below:
General Tutorial for OOPS
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
Have a look at these links for OO ABAP.
http://www.sapgenie.com/abap/OO/
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
http://www.allsaplinks.com/
http://www.sapgenie.com/abap/controls/index.htm
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
SDN Series:
https://www.sdn.sap.com/irj/sdn/developerareas/abap?rid=/webcontent/uuid/35eaef9c-0b01-0010-dd8b-e3b0f9ed7ccb [original link is broken]
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
Basic concepts of OOPS
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
http://www.henrikfrank.dk/abapuk.html
http://www.erpgenie.com/abap/OO/
Reward oints if useful,
Aleem. -
How to update Location numbers of customers using BAPI_CUSTOMERCRM_CHANGE
Hi everyone,
I would like to ask how to update location numbers 1 and 2 and check digit using this bapi,
BAPI_CUSTOMERCRM_CHANGE and what are the significance of the following parameters.
CALL FUNCTION 'BAPI_CUSTOMERCRM_CHANGE'
EXPORTING
I_UPLOAD_ID =
I_DESTIN =
I_SFA_REL =
I_KEYWORD_IN =
I_CUSTOMER =
I_ADDRESS =
I_ADRCHANGE =
I_SALESORG =
I_TAXDATA =
I_BANKCHANGE =
I_TRANS_MODE =
I_ORIGIN =
I_CUSTCHANGE =
I_SALESCHANGE =
IMPORTING
E_STATUS =
TABLES
TI_STDTEL =
TI_STDFAX =
TI_STDTTX =
TI_STDTLX =
TI_STDMAIL =
TI_BANK =
TI_LOADING_POINTS =
TI_ROLES =
TI_BANKCHANGE =
TI_ROLECHANGE =
TI_EXTENSION =
TI_SFA_KEYS =
Thanks for helping!
Regards
Jay Ags
Moderator Message: Welcome to SCN. But please search for SAP Documentation and/or sample codes.
Edited by: kishan P on Apr 6, 2011 12:09 PMI was facing the exact same issue and just figured out the solution: the issuing storage location is only accepted if the supplying plant is passed at the same time (in the header structure). That solved the issue for me!
-
How to UPDATE MASTER DATA RECORD PA0377 using FM HR_INFOTYPE_OPERATION
How to UPDATE MASTER DATA RECORD IN INFOTYPE 0377 DIRECTLY using function module HR_INFOTYPE_OPERATION ? When i use operation = 'MOD' im getting an ERROR as NO DATA STORED FOR 0377 IN SELECTION PERIOD.
Can anyone please help me how to use HR_INFOTYPE_OPERATION to UPDATE MASTER DATA RECORD.
Thanks,
Karthi.Hi,
please check this code
it is very useful
infotypes: 0105.
parameters: p_pernr type p0105-pernr,
p_subty type p0105-subty,
p_begda type p0105-begda,
p_endda type p0105-endda,
p_opera type pspar-actio,
p_usrid type p0105-usrid,
p_commt as checkbox. "Useful only when NO_COMMIT is 'X'
data: w_return type bapireturn1, "Error handling data
w_key type bapipakey, "If record has been created or changed the created/ changed
"record's key (PSKEY) will be populated
v_message type string. "For printing returned messages
call function 'BAPI_EMPLOYEE_ENQUEUE'
exporting
number = p_pernr
importing
return = w_return.
if w_return is initial. "Employee is not locked
p0105-pernr = p_pernr.
p0105-subty =
p0105-usrty = p_subty.
p0105-begda = p_begda.
p0105-endda = p_endda.
p0105-usrid = p_usrid.
*Calls Internally HR_MAINTAIN_MASTERDATA
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0105'
number = p_pernr
subtype = p_subty
validityend = p_endda
validitybegin = p_begda
record = p0105
operation = p_opera
dialog_mode = '0'
nocommit = 'X'
importing
return = w_return
key = w_key.
endif.
if w_return is not initial.
message id w_return-id type w_return-type number w_return-number
with w_return-message_v1 w_return-message_v2 w_return-message_v3
w_return-message_v4 into v_message.
case w_return-type.
when 'A' or 'E'.
format color col_negative. write:/ v_message.
when others.
format color col_heading. write:/ v_message.
endcase.
call function 'BAPI_EMPLOYEE_DEQUEUE'
exporting
number = p_pernr.
else.
format color col_positive. write:/ 'Record Updated Successfully.'.
if w_key is not initial.
write:/ 'Key contains',
/ 'Personnel Number:', w_key-employeeno,
/ 'Subtype (absence type):', w_key-subtype,
/ 'Start date of Absence:', w_key-validbegin,
/ 'End date of Absence:', w_key-validend.
endif.
commit work.
endif.
Thanks and regards
durga.K -
How to update bulk no of records using Batch Update
i am trying to insert and update records into multiple tables using Statement addBatch() and executeBatch() method. But some times it is not executing properly. some tables records are inserting and some tables it is not inserting. But I want all the records need to excute and commit or if any error is there then all records need to rollback.
This is the code i am using.
public String addBatchQueryWithDB(StringBuffer quries, Connection conNew,Statement stmtNew) throws Exception {
String success="0";
try {
conNew.setAutoCommit(false);
String[] splitquery=quries.toString().trim().replace("||","##").split("\\|");
for(int i=0;i<splitquery.length;i++) {
//System.out.println("query.."+i+".."+splitquery.trim().replace("##","||"));
stmtNew.addBatch(splitquery[i].trim().replace("##","||"));
int[] updCnt = stmtNew.executeBatch();
for(int k=0;k<updCnt.length;k++){
int test=updCnt[k];
if(test>=0){
success=String.valueOf(Integer.parseInt(success)+1);
// System.out.println(".updCnt..."+updCnt[k]);
System.out.println("success...length.."+success);
if(updCnt.length==Integer.parseInt(success)){
success="1";
//conNew.commit();
} catch (BatchUpdateException be) {
//handle batch update exception
int[] counts = be.getUpdateCounts();
for (int i=0; i<counts.length; i++) {
System.out.println("DB::addBatchQuery:Statement["+i+"] :"+counts[i]);
success="0";
conNew.rollback();
throw new Exception(be.getMessage());
} catch (SQLException ee) {
success="0";
System.out.println("DB::addBatchQuery:SQLExc:"+ee);
conNew.rollback();
throw new Exception(ee.getMessage());
} catch (Exception ee) {
success="0";
System.out.println("DB::addBatchQuery:Exc:"+ee);
conNew.rollback();
throw new Exception(ee.getMessage());
}finally {
// determine operation result
if(success!=null && success.equalsIgnoreCase("1")){
System.out.println("commiting......");
conNew.commit();
}else{
System.out.println("rolling back......");
success="0";
conNew.rollback();
conNew.setAutoCommit(true);
return success;
}Koteshwar wrote:
Thank you for ur reply,
I am using single connection only, but different schemas. Then I am passing a Stringbuffer to a method, and First iam setting con.setAutoCommit(false); and then in that method i am splitting my queries in stringbuffer and adding it to stmt.addBatch(). After that I am executing the batch.after executing the batch i am commiting the connectionIf I am reading that right then you should stop using Batch.
The intent of Batch is that you have one statement and you are going to be using it over and over again with different data. -
How to find the list of un used table names in a schema?
Hi,
I have a doubt in Oracle. The doubt is that If we are using any tables in Function Or Proc.... Then...We can list all those used table names from USER_DEPENDENCIES system table. Right...
But, If the table is used with Execute Immediate Statement, then, those table names are not coming out with USER_DEPENDENCIES system table. Because they are identified at run time and not compile time.
It is fine. And I agree.. But, If I want to list out those tables also...then...How to do? Any idea?
I think ‘USER_SOURCE’ system table may not be the right one. If there is any other system table avails for this purpose...then..it would be very grateful to extract right...
So I am wanting that exact system table.
Please let me know about this, if you have any idea or check with your friends if they have any idea.
Regards,
Subramanian GHi Guys,
Thanks for all your answers.
Yes....You are all right. We can list out the used tables upto certain extent. Anyhow, I have done some R&D to derive the SQL's which is given below:
SELECT TABLE_NAME FROM USER_TABLES
MINUS
SELECT DISTINCT UPPER(REFERENCED_NAME)
FROM user_dependencies
where
referenced_type='TABLE' and UPPER(NAME) in
select distinct UPPER(object_name) from user_objects where UPPER(object_type) in
'MATERIALIZED VIEW',
'PACKAGE',
'PACKAGE BODY',
'PROCEDURE',
'TRIGGER',
'VIEW',
'FUNCTION'
UNION
SELECT UT.TABLE_NAME FROM
SELECT TABLE_NAME FROM USER_TABLES
MINUS
SELECT DISTINCT UPPER(REFERENCED_NAME)
FROM user_dependencies
where
referenced_type='TABLE' and UPPER(NAME) in
select distinct UPPER(object_name) from user_objects where UPPER(object_type) in
'MATERIALIZED VIEW',
'PACKAGE',
'PACKAGE BODY',
'PROCEDURE',
'TRIGGER',
'VIEW',
'FUNCTION'
AND REFERENCED_OWNER=(SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual)
) UT,
( SELECT * FROM USER_SOURCE
WHERE NAME IN
( SELECT DISTINCT NAME FROM USER_SOURCE
WHERE TYPE NOT IN ('TYPE')
AND
UPPER(TEXT) LIKE '%EXECUTE IMMEDIATE%'
) US
WHERE
UPPER(US.TEXT) LIKE '%'||UPPER(UT.TABLE_NAME)||'%'
AND
(UPPER(US.TEXT) NOT LIKE '%--%')
The above SQL Query can list out unused tables by checking the Dynamic SQL Statement also upto some level only.
Once we extracted the list of unused tables, having a manual check would be also greater to verify as it is should not impact the business applications.
Regards,
Subramanian G -
How to update old POs when changing a supplier name?
Hi,
Can anyone advise on how to update supplier details on old POs when we update a supplier name?
Thanks.Hi,
You dont want to do any updation in Old PO even its in Approved and Closed status.
System will automatically update the name in All PO when you update the supplier name in Suppliers form.
Thank you
Regards
M.R.Sivasooriyan
Maybe you are looking for
-
Hi, Im calling a method in my BSP application which gives me PDF output. CALL METHOD ref->****** EXPORTING lv_vbeln = lv_vbeln IMPORTING l_header = l_header wa_head_right = message = l_vbeln_text = with_hold
-
Accounting document generated even if foreign data incomplete
Hi, I did the customizing for foreign trade data and I created an incompletion procedure (VI29) for some data like Commodity code, Country of destination, statistic value. I have to create a billing document (export from Italy to France) and my expec
-
I'm running iPhoto 4.0.3 on a Powerbook G4 with Mac OS 10.3.9. I recently had to reinstall the operating system, and when I did, I lost both my Adjust buttons and the ability to reduce red eye in iPhoto. What happened? Did the updates the gave me the
-
I'm not sure if this is an error or a desired change on Apple's part but when I go to the iPod app of my iPhone I can no longer keep the forever loop option if I change the song. I usually listen to a song on repeat until I am tired of it, change the
-
Safari crashes during startup - crash log enclosed
Safari will not launch. I get the dialog box "The application Safari has unexplectedly quit' before the application starts up. The full crash log is listed below. I am using Safari 1.0.3. Yes I know I need to upgrade the OS and the apps. Date/Time: 2