How to create a record in MARC?
Hello Experts,
I have a requirement to insert a new record in MARC table with only MANDT, MATNR, WERKS!
I know that standard tables should not be updated as such!
Is there any function module or BAPI to do this? If so, could you please brief the details of how to use that?
Thanks and Best Regards,
Suresh
Hi Suresh,
Assumptions: Material and Plants are already maintained.
You can write following code.
data : begin of it_marc occurs 0.
include structure marc.
data : end of it_marc.
data : wa_marc like marc.
wa_marc-mandt = sy-mandt.
wa_marc-matnr = '24'.
wa_marc-werks = '0101'.
append wa_marc to it_marc.
CALL FUNCTION 'ENQUEUE_E_TABLEE'
EXPORTING
mode_rstable = 'E'
tabname = 'MARC'
EXCEPTIONS
foreign_lock = 1
system_failure = 2.
IF sy-subrc eq 0.
MODIFY marc FROM TABLE it_marc.
IF sy-subrc EQ 0.
COMMIT WORK .
ELSE .
ROLLBACK WORK.
ENDIF. " IF sy-subrc EQ 0.
Table lock on table 'MARC' is released .
CALL FUNCTION 'DEQUEUE_E_TABLEE'
EXPORTING
mode_rstable = 'E'
tabname = 'MARC'.
ENDIF. " IF sy-subrc NE 0.
Regards,
Anil Salekar
Similar Messages
-
How to create a record based on the name of a file in the file-system?
Hi,
With a lot of pictures I want to have a database to gather some information about these pictures.
First question is how to generate a record based on a file in the file system?
e.g. the pictures are "c:\fotos\2009\01\disc_001.jpg" to "c:\foto\2009\01\dis_98.jpg" .
now i want to create records with as one of the attributes the name of the picture (not the picture itself). how to create these records (based on the information of the file-ssytem). i.e. the number of records should be the same as the number of pictures.
any suggestions?
any reaction will be appreciated.
LeoLink to Create directory
http://www.adp-gmbh.ch/ora/sql/create_directory.html
You can create a list of files in the directory and read the list files from that directory.
[UTL_FILE Documentation |http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]
[Solution using Java|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]
SS -
How to create a record for table PLAF with order type 'NB'.
How to create a record for table PLAF with order type 'NB'(standard purchase order).
who can tell me the T-code or some usefull information?
Thanks.Hi
This will be updated automatically when generate planned orders thru MRP. (MD02)
regards
Srinivas -
How to create A record on DNS server
How do i create an A record on the DNS server (windows server 2008) that would resolve into two ip addresses: PUB & SUB ip addresses respectivly, to enable EM redundancy in Cisco Unified Communications Manager 6.1.
Right now when the PUB failover to the SUB the EM does not work. the Phone services as well as the global directory does not work. the CUCM is fully integrated to LDAP.
Cisco recomends using an SLB but right now i am trying to use the DNS option. what i need now is how to create the A record on the DNS that would resolve into the two ip address of the PUB and SUB.You can do this but your results won't be quite as expected. I've played around with this and you'll see that the request for when you press the services button will go to server A, then when you click on the EM service your request will go to server B, then the login back to server A even though you started the login session with server B and back and forth, then with the authentication information, etc. Also DNS doesn't know about the state of your servers. If a server is down you'll still have issues if the name resolves to the down IP address. As far as I've seen DNS will always round robin with multiple records for the same name (unless you use an SRV record).
-
How to create Static Record group in Oracle Forms??
Dear All,
I have the following values V1,V2 to be placed in my list item field during DML operations.
I have an example to create the record group based on the table; whereas i have never tried for static value creation.
Could you please guide me how can i acheive this.?
Thanks ....
Regards,
Sunil.GThanks dhivya for your reply.
Actually what happens is; when i use the same methodology as you mentioned, it is asking me to set the Initial value.
Whereas in my applications; user has to manually select any of the values i.e eithe V1 or V2 for the first time.
Moreover i have found the query:-
I have created a static record group RG_VERSIONS i.e creating a new record group with the static values mentioning the "Column names " as "Version_label" which i have given the column values as "V1" and "V2" and then another column name as "Version_value" with the column values as "V1" and "V2".
Then i used the below query in the WHEN-NEW-FORM-INSTANCE trigger:-
PROCEDURE p_when_new_form_instance
IS
l_rg_id recordgroup;
l_item_id item;
BEGIN
--Populating value for Version Type based on static record group
l_rg_id := FIND_GROUP ('RG_VERSION');
IF NOT ID_NULL (l_rg_id)
THEN
l_item_id := FIND_ITEM ('BLOCKNAME.COLUMN_NAME');
POPULATE_LIST (l_item_id, l_rg_id);
END IF;
END p_when_new_form_instance;
Then it was working fine.
Thanks for your time.
Regards,
Sunil.G
Edited by: Sunil G on Jun 27, 2010 6:00 AM -
How to create table records..
hi,
i have table having 6 fields,
first two are key fields.. i need to create table records with repeating
1st field , how can i create plz tell me , because its not accepting in se11, is their any altenative .
thanks and regards,
kalyanCan you be more clear on what your requirement is ?
Lets put it in an example :
CASE 1 : Possible
Key1 Key2 Field1 Field2 Field3 Field4
1 1 XXX xxx xxxx xxx
1 2 XXX xxx xxxx xxx
OR
CASE 2 : Impossible with 2 keys, you will need one more key.
Key1 Key2 Field1 Field2 Field3 Field4
1 1 XXX xxx xxxx xxx
1 1 XXX xxx xxxx xxx
regards,
Advait -
How to create new record with old values
Dear all
i have creation page with 45 fields are there
user will enter all the fields and save it will call to non editable mode
if user will click on change button it will call to editable mode
in that my requirement is user wont change among those ites(45 items)clcik on save again it will call to view mode
in that user will change any one of the value among 45 items and click on save button i need to create one more record in database
if user wont edit any one of the field out of 45 items i dont want to create new record in database
how can we achieve thsi functionality
Regards
SreekanthHi Srikant,
When user may edit the record, the same row may get updated in vo. Thus over writing existing row instead of creating new row.
Approach1..
On the page where user may edit records, instead of presenting records of existing row, present copy of existing row. So
In AM... (Later on you can put vo logic to its proper place, i.e. vo java file)
public void viewPageCallSetup()
Row originalRow=vo.createRow();
Row dummyRowForEdit=vo.createRow();
//COPY THE ORIGINAL ROW TO DUMMY ROW. IF THERE IS DIRECT METHOD TO CREATE COPY OF EXISTING ROW, THAT MAY BE MUCH BETTER.
for(int i=0;i<vo.getAttributeCount()-1; i++)
dummyRowForEdit.setAttribute(i, originalRow.getAttribute(i));
vo.insertRow(dummyRowForEdit);
vo.setNewRowState(Row.STATUS_INITIALIZED);
vo.setCurrentRow(dummyRowForEdit);
call this method in contoller's processRequest..
string oid=pagecontext.getparameter("oid");
if(pageContext.getparameter("Purpose").equals("Edit")) //Means user clickED the edit button so we need to replicate the row
am. viewPageCallSetup(oid); //calling this method in am
else
In PFR...
if(pageContext.getparameter("Purpose").equals("Edit"))
am.xxcostedit(oid); //calling this method in am
in case user selects "Cancel" on edit form,we need to remove the duplicate row. So in AM write a method to remove the duplicate rowd on click of "Cancel" button on edit form.
Rest of the logic is same for "Save" button. Just say commit.
Abdul Wahid -
How to create Child record at the time of master record creation.
Hi,
I have MasterVO and ChildVO. And association between both are 1 to *. I have a requirement like, I need to create row in ChildVO at the time of MasterVO row creation.
I have used entity based association to create view link. This view link created ChildVO accessor in MasterRowImpl as type RowIterator.
Actually my idea is to override create method in MasterVORowImpl and call ChildVO ViewObject and call .createRow() method on it. But I don't have access to ViewObject, instead it gave access to RowIterator.
Could you please provide any pointer to achieve above functionality?
Many thanks in advance.
Jdev version - 11.1.1.7.0
Regards,
Dileep.Hi Tim,
Now it is creating child record at the time of master row creation. But it is working only through BC tester. But when I drag the child VO instance in the jsff page, only master is get created as editable only, child is displayed as read only without populating any default values like child VO surrogate key and other default attributes. But through BC tester it is working fine.
Am I missing anything here while implementing in UI?
Thanks,
Dileep. -
Interactive list musing abap query and how to create infoset records
hi,
Can any one suggest how to create interactive list using ABAP Query .And also infosets and ranked list ..thanks in advance
Regards,
Raghu.Hi,
Check this
Re: How to make output of ABAp query interactive(drill down)..?
some info on the ABAP query
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40bec8da-4cd8-2910-27a9-81f5ce10676c
hope it helps.
Regards! -
How to create a record structure dynamically
Hi,
I would like to create a record structure dynamically in the body of my pl/sql procedure.
I don't want to create the structure in the declaration because my record structure depends on some parameters that the procedure will receive.
Thank you> I would like to create a record structure dynamically in the body of my pl/sql procedure
Terrible idea. Why? Because if the structure is dynamic then you need to write pretty complex code to handle this structure that could be anything. Complex code means buggy code. Inconsistent code. Weird run-time errors. Etc.
Yes, you can create dynamic "structures" - for example, you can create a user defined type that at execution time can decide what properties it has. Similar to a an object in an o-o language that has a RTTI (Run Time Type Information) interface.
But this is complex. And what did I say about complex code above? Not the best of ideas most of the time.
There is however a very easy way to deal with dynamic data via a "dynamic" structure that is in fact a statically defined structure. Arrays aka collections aka associative arrays.
E.g.
create or replace type TStrings as table of varchar2(4000);
Using this I can create a SQL statement (cursor) on any table, with any predicates, and pass the results (dynamic list of columns) to a procedure for processing:
select TStrings(object_id,object_type,object_name) as DYNAMIC_LIST from user_objects order by object_type, object_name
Using this I can create a procedure that accepts a dynamic list of values and process these:
create or replace procedure DynamicProcess( list TStrings ) as ...
So when thinking "dynamic structures" - think it through carefully. There is a difference between an UNKNOWN structure and a DYNAMIC structure.
The former needs a RTTI interface. You have no idea what the structure contains. You need an interface to call in order for it to describe the structure for you. This is complex stuff.
The latter means that you know the structure as it is pre-defined (statically defined). At run-time, it can contain any number of elements - thus making the structure dynamic. This is easy stuff.
I would rather go for the easy stuff than the complex stuff any time of the day - even when on my 3rd cup of coffee... -
How to create multiple records using ADF
Currently working on my first ADF BC and UIX project, and I basically want to create multiple records after a user makes a choice on the screen. I would like to know at what layer should this functionality be implemented?
Would this be more at the Struts/Controller level, where I have a java class to perform the creation as part of a data action? I ask because, I am not sure if this is feasible at the ADF BC level (View objects and Entity Objects) via some sort of customization, and i am new to the different possibilies avail as part of the ADF framework
Regards
Anora
(Jdeveloper 10.1.2.1 build 1913, Oracle DB 10.1.2)I'd put it into the application module. You then can call the method from the controller layer or from an other application module. This way you put it into the business logic, which helps if you ever decide to use a different client approach (like swing).
-
How to create a record of quiz takers details
I am new to Captivate 5 and have created a quiz. How do I record the quiz takers details and have those details sent to me via email on the complection of the quiz so I can record who has taken the test.
Thanks for any help in advance.Link to Create directory
http://www.adp-gmbh.ch/ora/sql/create_directory.html
You can create a list of files in the directory and read the list files from that directory.
[UTL_FILE Documentation |http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]
[Solution using Java|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]
SS -
How to create variable record length target file in SAP BODS
Hi All
I have a requirement to create target file which will have various record layout; meaning different record length (similar to cobol file format), but this is for the target. Please let me know what is the best practice and how to solution this requirment.
Thanks
AshHi Shiva,
Thanks for your feedback. My issue is that I have 10 different detail records (each record type is fixed length).
For each customer account, I have to write to file the header record, the detail records in the exact order, then continue with next account and so on and then write the trailer record. I have given sample layout below. Highlighted text is the record identifier in this exmaple while the underlineds are account numbers. Fields are fixed length right padded with space or 0.
220700000000SA00 Wednesday 2014-12-12 ASA00034 334 000 ---> (this is header)
220700000010SA10 AAb 00000+000000+ Akab xxxx bb 0000000000943 3433 --> (detail rec)
220700000010SA14 AAA 00034354 DDD 000000000+ --> (detail rec)
220700000010SA15 888e a88 00000000+ --> (detail rec)
. . . . . remaining detail records
220700000012SA10 AAb 00000+000000+ Akab xxxx bb 0000000000943 3433 --> (detail rec)
220700000012SA14 AAA 00034354 DDD 000000000+ --> (detail rec)
220700000012SA15 888e a88 00000000+ --> (detail rec)
. . . . . remaining detail records
220700000000SA99 Wednesday 2014-12-12 d334 000 --> (trailer is header) -
SqlLoader: how to create multiple records out of one CSV input line?
A question concerning the SQL-Loader.
I need to load data from a CSV file where one of the CSV values determines how many records should be inserted.
Example of the input data:
KEYWORD;2;REC1_COL1_X,REC1_COL2_X;REC2_COL1_X;REC2_COL2_X
KEYWORD;3;REC1_COL1_Y;REC1_COL2_Y,REC2_COL1_Y;REC2_COL2_Y;REC3_COL1_Y;REC3_COL2_Y
KEYWORD;4;REC1_COL1_Z;REC1_COL2_Z,REC2_COL1_Z;REC2_COL2_Z;REC3_COL1_Z;REC3_COL2_Z,REC4_COL1_Z;REC4_COL2_Z
If the KEYWORD is found, then the next value determines how many value pairs will follow, and therefore how many rows should be created in the affected DB table.
As a result I hope to achieve this:
SELECT Column1, Column2 FROM testTable
REC1_COL1_X,REC1_COL2_X
REC2_COL1_X;REC2_COL2_X
REC1_COL1_Y;REC1_COL2_Y
REC2_COL1_Y;REC2_COL2_Y
REC3_COL1_Y;REC3_COL2_Y
REC1_COL1_Z;REC1_COL2_Z
REC2_COL1_Z;REC2_COL2_Z
REC3_COL1_Z;REC3_COL2_Z
REC4_COL1_Z;REC4_COL2_Z
I learned how to import data using Oracle SQL loader for cases where one input line more or less matches a (new) row in a DB table. But how to handle this?Hello 784948.
Assuming that the delimiter is a comma, and also assuming that the number of pairs is limited to four, you could use the following tested control fileLOAD DATA
APPEND
INTO TABLE testTable
WHEN (1:7) = 'KEYWORD' AND (9) = '1'
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( KeywordColumn FILLER
, PairCountColumn FILLER
, InputColumn1
, InputColumn2
, FillerColumn1 FILLER
, FillerColumn2 FILLER
, FillerColumn3 FILLER
, FillerColumn4 FILLER
, FillerColumn5 FILLER
, FillerColumn6 FILLER
INTO TABLE testTable
WHEN (1:7) = 'KEYWORD' AND (9) = '2'
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( KeywordColumn FILLER POSITION(1)
, PairCountColumn FILLER
, InputColumn1
, InputColumn2
, FillerColumn1 FILLER
, FillerColumn2 FILLER
, FillerColumn3 FILLER
, FillerColumn4 FILLER
, FillerColumn5 FILLER
, FillerColumn6 FILLER
INTO TABLE testTable
WHEN (1:7) = 'KEYWORD' AND (9) = '3'
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( KeywordColumn FILLER POSITION(1)
, PairCountColumn FILLER
, InputColumn1
, InputColumn2
, FillerColumn1 FILLER
, FillerColumn2 FILLER
, FillerColumn3 FILLER
, FillerColumn4 FILLER
, FillerColumn5 FILLER
, FillerColumn6 FILLER
INTO TABLE testTable
WHEN (1:7) = 'KEYWORD' AND (9) = '2'
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( KeywordColumn FILLER POSITION(1)
, PairCountColumn FILLER
, FillerColumn1 FILLER
, FillerColumn2 FILLER
, InputColumn1
, InputColumn2
, FillerColumn3 FILLER
, FillerColumn4 FILLER
, FillerColumn5 FILLER
, FillerColumn6 FILLER
INTO TABLE testTable
WHEN (1:7) = 'KEYWORD' AND (9) = '3'
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( KeywordColumn FILLER POSITION(1)
, PairCountColumn FILLER
, FillerColumn1 FILLER
, FillerColumn2 FILLER
, InputColumn1
, InputColumn2
, FillerColumn3 FILLER
, FillerColumn4 FILLER
, FillerColumn5 FILLER
, FillerColumn6 FILLER
INTO TABLE testTable
WHEN (1:7) = 'KEYWORD' AND (9) = '4'
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( KeywordColumn FILLER POSITION(1)
, PairCountColumn FILLER
, FillerColumn1 FILLER
, FillerColumn2 FILLER
, InputColumn1
, InputColumn2
, FillerColumn3 FILLER
, FillerColumn4 FILLER
, FillerColumn5 FILLER
, FillerColumn6 FILLER
INTO TABLE testTable
WHEN (1:7) = 'KEYWORD' AND (9) = '3'
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( KeywordColumn FILLER POSITION(1)
, PairCountColumn FILLER
, FillerColumn1 FILLER
, FillerColumn2 FILLER
, FillerColumn3 FILLER
, FillerColumn4 FILLER
, InputColumn1
, InputColumn2
, FillerColumn5 FILLER
, FillerColumn6 FILLER
INTO TABLE testTable
WHEN (1:7) = 'KEYWORD' AND (9) = '4'
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( KeywordColumn FILLER POSITION(1)
, PairCountColumn FILLER
, FillerColumn1 FILLER
, FillerColumn2 FILLER
, FillerColumn3 FILLER
, FillerColumn4 FILLER
, InputColumn1
, InputColumn2
, FillerColumn5 FILLER
, FillerColumn6 FILLER
INTO TABLE testTable
WHEN (1:7) = 'KEYWORD' AND (9) = '4'
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( KeywordColumn FILLER POSITION(1)
, PairCountColumn FILLER
, FillerColumn1 FILLER
, FillerColumn2 FILLER
, FillerColumn3 FILLER
, FillerColumn4 FILLER
, FillerColumn5 FILLER
, FillerColumn6 FILLER
, InputColumn1
, InputColumn2
)Luke
Please mark the answer as helpful or answered if it is so. If not, provide additional details.
Always try to provide create table and insert table statements to help the forum members help you better.
Edited by: Luke Mackey on Aug 5, 2010 1:23 PM (always better to test before posting) -
How to Create a record if vo.executequery does not return any rows
I would like to update a single record on adf form. However if the record does not exist would like to create a row and save it in the table.
The user does not want to add a "create" button on the screen. Hence would need to add the create code if vo.execute does not return any rows...
How to add this and where to add?you can have a TF router for for exists and does not exist and based on that execute transient VO and other VO.
Add a method call activity like below to create a row in transient VO
public Row createRow()
ViewObjectImpl tVO = (ViewObjectImpl)getTVO();
tVO.executeEmptyRowSet();
Row newRow = tVO.createRow();
tVO.setCurrentRow(newRow);
tVO.insertRow(newRow);
return newRow;
}
Maybe you are looking for
-
I am getting error=39 when downloading tv shows and cannot fix this. can someone help me with this?
-
Last update now causing a script to run endlessly, how do I fit the problem?
The WIN XP machine I'm running is chugging along trying to finish loading the last FireFox update. It is slowing the browser down. I have tried to restart but the same thing happens.
-
IOS5 missing slideshow transitions?
After upgrading my iPhone4 to iOS5, it would appear some of my Photo Slideshow Transitions are missing. In particular when I airplay a picture slideshow to an upgraded ATV2, it is stuck on Ken Burns transition which isn't even an option in my transit
-
Problems with iPhoto and Photo Booth
I can't open or use iPhoto. When I click on the icon on the dock, a pop-up comes up and says I "cannot create new library" because I "do not have enough access privileges". Then when I click Photo Booth a pop-up says Photo Booth cannot save any photo
-
Ldmd problem - libpiclsnmp.so.1
Hello everyone, after installation of SUNWldm 1.1 I've got problem to start ldmd due to missing libpiclsnmp.so.1 Is that something missing from the SUNWldm? How can I fix it? Thanks, Philip # svcs -vx svc:/ldoms/ldmd:default (Logical Domains Manager)