Updating EAN11 field in mara table through BAPI_MATERIAL_SAVEDATA
Hi,
I want to update EAN11 field in mara table through BAPI_MATERIAL_SAVEDATA could anybody please guide me how to achieve.
it would be great if is there any sample code for the same.
Thanks
Please give the following fields in the lwa_uom structure as well
lwa_uom -ALT_UNIT
lwa_uom -NUMERATOR
lwa_uom -DENOMINATR
DATA: lwa_uom TYPE BAPI_MARM,
lwa_uomx TYPE BAPI_MARMX.
DATA: lt_uomx TYPE STANDARD TABLE OF BAPI_MARM,
lt_uomx TYPE STANDARD TABLE OF BAPI_MARMX.
lwa_uom-ean_upc = '123456' " enter the value here
lwa_uom-ean_cat = 'abcd'.
append lwa_uom to lt_uom.
lwa_uomx-ean_upc = 'X'.
lwa_uomx-ean_cat = 'X'.
append lwa_uomx to lt_uomx.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
unitsofmeasure = lt_uom
unitsofmeasurex = lt_uomx.
Edited by: Rahul Babukuttan on Dec 21, 2011 4:23 PM
Similar Messages
-
To Update Custom field in mch1 table through MIGO Tcode
Dear champs,
I have added one custom field in mch1 table ( date ).
Now , In MIGO Tcode when i am doing posting, MCH1 table is also updated.
I want to know how to update my custom field in mch1 table at the time of posting.
Please tell me where to write logic to update mch1 table.
Regards,
Satyen TrivediHi Satyen,
what data has to be update in MCH1 table new field, for this did you added any screen or you want to implement your own custom logic.
1) if you implemented the screen , then you have to write logic there itself.
2) If you want to update through custom logic , then you takeup with the Enhancements or BADI.
Regards,
Krishna -
Updating values in mara table through bapi
Hi friends,
I am very new to ABAP , just now i have started my carrier in SAP-ABAP.
I have to update these three fields MSTAE, EXTWG, MTPOS_MARA in MARA table through bapi. I need to give these values from selection screen followed by Material no.
I already found some program in the forum but that programs are very lenthy , i am not able to understand.
Can anyone help me by giving some idea or sample program so that i can learn how to do this thing.
Thankx in advance...Hi Ritesh,
Use BAPI_MATERIAL_SAVEDATA to update the entries MSTAE, EXTWG and MTPOS_MARA by passing the following fields:
DATA: ls_headdata TYPE bapimathead,
ls_clientdata TYPE bapi_mara,
ls_clientdatax TYPE bapi_marax,
ls_return TYPE bapiret2.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = ls_material-matnr
IMPORTING
output = ls_headdata-material
EXCEPTIONS
length_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR: ls_headdata-material.
ENDIF.
ls_clientdata-extmatlgrp = ls_material-extwg.
ls_clientdata-pur_status = ls_material-mstae.
ls_clientdata-item_cat = ls_material-mtpos_mara.
ls_clientdatax-extmatlgrp = 'X'.
ls_clientdatax-pur_status = 'X'.
ls_clientdatax-item_cat = 'X'.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = ls_headdata
clientdata = ls_clientdata
clientdatax = ls_clientdatax
IMPORTING
return = ls_return.
IF ls_return-type = 'E' OR ls_return-type = 'A'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
Thanks & Regards,
Prasanna -
Update Yes/No field in access table through oracle procedure
Hi,
How to update Yes/No field in access table through oracle procedure. all other fields like AutoNumber, Text I can update it. Yes/No field how to update? Please, any one can help me?
Thanks and Regards,
Sudha.Sudha Teki wrote:
select "fldPost" from tblPHd@ODBCLNKNot quite sure what you mean, but the way you select the column would indicate a case sensitive column name
Look at this example
SQL> create table t
2 ("this" varchar2(10))
3 /
Table created.
SQL> insert into t values ('hello')
2 /
1 row created.
SQL> select *
2 from t
3 /
this
hello
SQL> select this
2 from t
3 /
select this
ERROR at line 1:
ORA-00904: "THIS": invalid identifier
SQL> select "this"
2 from t
3 /
this
helloIs your column name also case sensitive? -
Ideal way to update a field in a table
Hi All,
We need to update a field in a table which have some 8 million records.
The value of the field needs to be updated in all the above mentioned records.
Now, we have an input file with all the primary key fields and the field to be updated.
Can any one suggest the ideal way to update the field.
1. Updating the database for each record.
Loop at itab.
Update .
Endloop.
2. Updating the database with a set of 100 records.
We are planning to schedule the job in the background.
Thanks for your help.
Regards,
KrishnaHi,
be very carefull with the update, ´cause you can damage 8 million records !!
You better use instruction Update for this:
update mytable set field = value where conditions.
Try to use all key fields in the conditions and never use something like
update mytable set: field1 = value1
field2 = value2
field3 = value3 where conditions.
The loop in your case 1 is not absolutely necessary, ´cause you update a whole bunch of records at once with the conditions in Update.
Test the changes in the development system before you do it in production -
Bapi or function module to update rstgr field in bseg table
what is the bapi or function module used to update the fields in bseg table particularly "rstgr" field?
Hi,
Use Bapi
BAPI_ACC_DOCUMENT_POST
Regards,
Prashant -
I need to update an Oracle 8i database. I need to update 2 fields in 1 table with about 2,000 rows of data.
Right now the date is stored in an Excell file in columns A and B.
I need Something like:
Update Table1
set field1 with value from A:1,
set field2 with value from B:1
repeated with A:2,B:2 and so onI believe you could use sql loader to get your excel file in but here is a way I cheat to do it.
I save the excel file as a comma deliminated file (I think it is .csv)
then I open it up and copy and paste it into the following. (the part that says paste flat file here)
this is assuming 8i supports model clause I'm unsure on that point.
create or replace view view_xl_file_to_table as
select * from
with t as (select
--- copy paste your flat file here
' Bob,Jones,12345,Employee
Fred,Thebes,32,Manager
John,Smith,12,Employee
Karl,Cane,432,Employee
George,Johnson,54,Manager
' flat_text_file from dual
select flat_text_file text_file_turned_into_row,
substr(flat_text_file, 1, instr(flat_text_file,',',1,1)-1) col1, -- get text up to the first comma
substr(flat_text_file, instr(flat_text_file,',',1,1)+1, instr(flat_text_file,',',1,2) - instr(flat_text_file,',',1,1)-1 ) col2, --2nd comma
substr(flat_text_file, instr(flat_text_file,',',1,2)+1, instr(flat_text_file,',',1,3) - instr(flat_text_file,',',1,2)-1 ) col3, --3rd
substr(flat_text_file, instr(flat_text_file,',',1,3)+1, instr(flat_text_file,',',1,4) - instr(flat_text_file,',',1,3)-1 ) col4,
substr(flat_text_file, instr(flat_text_file,',',1,4)+1, instr(flat_text_file,',',1,5) - instr(flat_text_file,',',1,4)-1 ) col5,
substr(flat_text_file, instr(flat_text_file,',',1,5)+1, instr(flat_text_file,',',1,6) - instr(flat_text_file,',',1,5)-1 ) col6,
substr(flat_text_file, instr(flat_text_file,',',1,6)+1, instr(flat_text_file,',',1,7) - instr(flat_text_file,',',1,6)-1 ) col7
from t
-- first turn the carriage return into seperate rows
model return updated rows
dimension by (0 d)
measures (flat_text_file, 0 position_of_return ) -- the position of return is where the next carriage return is
rules iterate(1000) until position_of_return[iteration_number+1] = 0
position_of_return[iteration_number + 1] = instr(flat_text_file[0],chr(10),1,iteration_number + 1), -- find the next carriage return
-- get the text between the previous carriage return and the next and make it a row
flat_text_file[iteration_number + 1] = replace(substr( flat_text_file[0],
position_of_return[iteration_number],
position_of_return[iteration_number + 1] - position_of_return[iteration_number]
),chr(10))||','
)now I have a view and I could anything I want with it and I just drop it when I'm done.
Edited by: pollywog on Apr 19, 2010 7:57 AM -
FM / BAPI to update STEUC field in marc Table basing on material and plant
Hi,
I need to to update STEUC field in marc Table basing on material and plant. please suggest FM / BAPI.
Thanks.
raviraj.Hi
Try this BAPI function module:
" BAPI_MATERIAL_MAINTAINDATA_RT "
Data: LS_HEADDATA TYPE BAPIE1MATHEAD,
LS_RETURN TYPE BAPIRETURN1,
LT_PLANT TYPE TABLE OF BAPIE1MARCRT, LS_PLANT TYPE BAPIE1MARCRT,
LS_PLANTX TYPE BAPIE1MARCRTX, LT_PLANTX TYPE TABLE OF BAPIE1MARCRTX.
CALL FUNCTION 'BAPI_MATERIAL_MAINTAINDATA_RT'
EXPORTING
HEADDATA = LS_HEADDATA
IMPORTING
RETURN = LS_RETURN
TABLES
PLANTDATA = LT_PLANT
PLANTDATAX = LT_PLANTX.
Check the PLANTDATA in the above fm in which pass your ''STEUC'' to BAPIE1MARCRT-CTRL_CODE......
Hope this works..... -
Update XARCH field in BSIS table
Hello Experts,
Need to update XARCH field in BSIS table . I know using update in program is not recommended .
Please advice if there is a function or BAPI to do this. We are using ECC 6.0
Thanks,
Murtuza.Hi
Check This BAPI
BAPI_ACC_GL_POSTING_POST
Ranga -
Hi experts,
i want to update a field in BSEG table (field name is BUPLA).
Using UPDATE statement i am going to update the bseg table.
I know only update statement.
This my immediate requirement.
please give me suggesstion.Hi,
If you want to update the existing table record or field.. it is always advisable to use MODIFY statement instead of UPDATE.
syntax:
fetch the BSEG data to internal table IT_BSEG and do you modificaltions.
Loop at it_bseg.
it_bseg- XYZ = 'ABC'.
it_bseg-UVW = '123'.
modify it_bseg transporting XYZ UVW .
endloop.
MODIFY BSEG FROM TABLE IT_BSEG (here it_bseg is the internal table)
COMMITWORK.
Modify always check in the database whether the record exists or not if it is there it will modify the existing one.. otherwise create a new record.... in Update statement.. there is always a chance of creating a new record.. instead of updating the existing one... -
I am new to adf. I am trying to update a field in the table which is parent in adf tree
I had created a adf tree table
My Scenario:
=> If i selected the Parent row and after clicking the Post Button
=> A Field in the Parent table should get updated
which is the best approach to acheive it and how can i acheive it?I am getting this error while i try to post the Document
Error 500--Internal Server Error
java.lang.NullPointerException
at comm.rits.glm.view.backing.AGLM1010.cb5_actionListener(AGLM1010.java:259)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:788)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:306)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:186)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Edited by: asadrina on Sep 7, 2011 2:42 AM -
hi,
i am trying to update a field in a table.
i need to eliminate the first character in the following field. how would i do that? isn't there a TRIM function?
srdial (field name)
12001202307
12001207581
12001570282
12001570281
after running the function the following should appear..
srdial (field name)
2001202307
2001207581
2001570282
2001570281
how would i do this?
thanks,
markLTRIM? Search for it in the Oracle documentation at available at http://tahiti.oracle.com/
-- CJ -
How to update the field ZLSPR of table BSEG
HI Friends,
Can anyone tell me how to update the field ZLSPR of table BSEG? I've a 700 line abap program and I should include some logic in this program to make an entry into BSEG-ZLSPR. Is there any FM/BAPI available? Is BDC a healthy approach?. My team lead do not want me to use UPDATE statement....please help.
Thanks in advans,
Varsha.Hi,
Hi ,
You will need to group that radiobuttons so that SAP knows they are linked together. To do this using the grahical layout editor simply select all the radiobuttons and then right click on them, Now choose define group. Once you have done this you should not need any of the "clear" or "='X'" statements SAP should control it all for you.
hope this helps
Reward if found helpfull...
Venkoji Babu. -
Get Error while update the User defined row table through DSK Code
Hi experts,
I have got an error while updating the user row defined table.
Error is - "Invalid row"
I have created one master table "@CBF_FARM " and Child table "@CBF_FAR1"
First i inserted 5 record in the child table so in my my child table there are 5 Line id (1,2,3,4,5 one for each row).
after that i delete 2 rows (3rd & 4th row) from child table now in my child table there are 3 rows( Line id 1, 2, 5). Please See attachment.
Now i am updating the last record of child table through Code (Line id is 5) from other form, then i got error invalid row.
Following Code used for updating the user defined child table.
SAPbobsCOM.GeneralService oGeneralService1 = null;
SAPbobsCOM.GeneralData oGeneralData1 = null;
SAPbobsCOM.GeneralDataParams oGeneralParams1 = null;
SAPbobsCOM.CompanyService sCmp1 = null;
SAPbobsCOM.GeneralData oChild1 = null;
SAPbobsCOM.GeneralDataCollection oChildren1 = null;
sCmp1 = clsAddOn.LDNA_Company.GetCompanyService();
oGeneralService1 = sCmp1.GetGeneralService("CBF_FARM");
// Get UDO record
oGeneralParams1 = ((SAPbobsCOM.GeneralDataParams)(oGeneralService1.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)));
oGeneralParams1.SetProperty("Code", oForm.Items.Item("edtFarmCd").Specific.Value);
oGeneralData1 = oGeneralService1.GetByParams(oGeneralParams1);
// Add lines on UDO Child Table
oChildren1 = oGeneralData1.Child("CBF_FAR1");
// Create data for rows in the child table
SAPbouiCOM.Item oItem = oForm.Items.Item("cmbShed");
oCombo = oItem.Specific;
string ShedCode = oCombo.Selected.Value;
ldna_Rec = clsAddOn.LDNA_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
string strQuery1 = "select LineId from [@CBF_FAR1] where U_ShedCd = " + ShedCode;
ldna_Rec.DoQuery(strQuery1);
oChild1 = oChildren1.Item(ldna_Rec.Fields.Item("LineId").Value - 1);
oChild1.SetProperty("U_Status", "Ready For Schedule");
//Update the UDO Record
oGeneralService1.Update(oGeneralData1);
Please Help me it is an urgent requirement,
-Regards
Vikashi.
Error is - "Invalid row"
Now i am updating the last record of child table through Code (Line id is 5) from other form, then i got error invalid row.
As per my knowledge
What i understood is you have 5 lines and you are going to be update 5th line
am i correct..
while u are updating the line in child table
you have to consider like this..
line number u have to update like
1 0
2 1
3 2
4 3
5 4
which means in child table treat
line 1 as 0
line 2 as 1
line 5 as 4
If you want to update the line 5 u have to mention 4 th line -
BADI MB_MIGO_BADI not updating custom field in MSEG Table
Dear Experts,
I am working on screen exit In MIGO transaction for transfer Posting.
I checked that BADI MB_MIGO_BADI having facility for screen exit and method line_modify having facility to change GOITEM Structure for the changed line item.
Now, to make this functionality work I have enhanced include structure CI_COBL which is available in both mseg table and goitem structure, now I have this customized fields on my custome tab through the enhancement and also to update this value 2 custom fields created in goitem structure and MSEG table through include structure CI_COBL.
Here my question is at the time of transfer posing creation in MIGO when I am passing the value in custom fields through screen and assigning it to custom fields of structure GOITEM through LINE_MODIFY method, it is giving me below worning message
BADI: Field GOITEM-ZZIDNLF is not ready for input. (Change is not taken over)
Now I have debuged the code, also checkout many threads and came to know that because of few checks in standred program (iNCLUDE:LMIGOKL3) these fields will not be updated WHERE IT always checks whether these fields are ready for input or not and if not ready then instead of assigning the values it throws worning message.
Now can you please through some light how can I go ahead as I have check out many threads and also tried to change value of cs_goitem structure using field symbol but throughing dump that it is blocked against changes through field symbol.
The helpful answers will be highly appriciated.Hi,
In the badi mentioned by you GOITEM is the importing parameters & if the relevant field is not used in any MIGO screen you cannot change the data.
Please check example BADI interface: IF_EX_MB_MIGO_BADI~LINE_MODIFY
Please check the BADI documentation:
Changed data in GOITEM is only adopted if the relevant fields are visible and ready for input.
Changed data in GOITEM is not adopted if the relevant field is not used in any MIGO screen (warning via MIGO 049).
Changed data in GOITEM is not adopted if the relevant fields are not ready for input (warning via MIGO 050)
Thanks and Regards,
Chandra
Maybe you are looking for
-
How do I turn off Air Drop on my MacBook Pro?
Realy don't like the idea of my MacBook being available to people around me.
-
Panasonic HC X900 No video files showing when connected to MacBook Pro?
I'm trying to import video files from a Panasonic HC X900 to my mac but the files are not showing on the memory card or the camera when its connected by the USB data cable but when going on the cameras playback view it shows all my video clips :/ Can
-
User info couldn't be get from info table from popup lov window
Hi, I'm tring to implement authorization on my test project. I'm tring to filter the data in pop-up lov window accoriding to logged user but in the below code, the userId is read as null. I have copied the code from developer guide and it works well
-
Can I sync reminders to my macbook without using iCloud?
Having issues syncing my reminders from my iphone to my macbook pro without using iCloud, can this be done?
-
How to change the residual payment document type?
Hi, When i make residual partial payment then the document type of the residual amt will become DZ/KZ. However this is wrong because all invoices must be DR or KR. How can i change this doc type for residual payments?