Z field addition in MM01 and updation of MARA table
Hi ABAPers
I have created a Z field in BASIC DATA1 TAB in MM01 transaction as Input/Output Enabled of length 1 and type CHAR.
Screen Name: SAPLZMGD1
Numer : 2313
And also added the same field in MARA table (Append structure) .
When I enter value in MM02 screen for this field and is getting updated in MARA table and in MM02/MM03 screen as well.
My requirement is to update this field through BAPI_MATERIAL_SAVEDATA throug a Z program.
To update using this BAPI , I have added this field to BAPI_TE_MARA and BAPI_TE_MARAX structures also and passing these values to EXTENSIONIN and EXTENSIONINNX tables.
But it is not getting updated when I supplied this value to BAPI , whereas other Z fields getting populated in MARA table.
So please let me know where Iam doing wrong or any settings I missed while creating Screen field -
Your quick response is highly appreciated
Thanks
Satya
Hi Reddy
Thanks for your reply
I did as you mentioned .
The field that I created is not getting populated and the other Z field on the same screen and same tab is getting populated correctly.
YYXPTY CHAR(4)
YYHISIND CHAR(1)
here the YYXPTY field is getting populated in MARA table correctly but not YYHISIND which is created by me.
The code that I have written is as below : [Please help me out]
REPORT ztest_yyxpty.
DATA: wa_bapimara TYPE bapimathead,
t_extn TYPE STANDARD TABLE OF bapiparex,
wa_extn TYPE bapiparex,
t_extnx TYPE STANDARD TABLE OF bapiparexx,
wa_extnx TYPE bapiparexx,
wa_return TYPE bapiret2,
t_rettab TYPE STANDARD TABLE OF bapi_matreturn2,
wa_makt TYPE bapi_makt,
t_makt TYPE STANDARD TABLE OF bapi_makt.
wa_bapimara-material = '500000000000088999'.
wa_bapimara-basic_view = 'X'.
wa_extn-structure = 'BAPI_TE_MARA'.
wa_extn-valuepart1+0(18) = '500000000000088999'. "Material number
wa_extn-valuepart1+65(4) = '0002'. " field YYXPTY
wa_extn-valuepart1+69(1) = 'A'. " field YYHISIND
wa_extnx-structure = 'BAPI_TE_MARAX'.
wa_extnx-valuepart1+0(18) = '500000000000088999'.
wa_extnx-valuepart1+27(1) = 'X'.
wa_extnx-valuepart1+28(1) = 'X'.
APPEND wa_extn TO t_extn.
APPEND wa_extnx TO t_extnx.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = wa_bapimara
IMPORTING
return = wa_return
TABLES
materialdescription = t_makt
returnmessages = t_rettab
extensionin = t_extn
extensioninx = t_extnx.
IF wa_return-type = 'S'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
WRITE: wa_return-type, wa_return-message, wa_return-message_v1,
wa_return-message_v2, wa_return-message_v3, wa_return-message_v4.
Similar Messages
-
Insert, Delete and Update options in Table control
Experts,
I have writen code for Insert, Delete and Update options in Table control. They are not working properly...
can any one send the code for the above please...
Thanks in advance..Hi,
Following steps will help you.
1.TOP-INCLUDE
DATA: ITAB1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
DATA: ITAB2 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
DATA: WA LIKE KNA1.
DATA: ANT TYPE I,CUR TYPE I.
DATA: OK_CODE TYPE SY-UCOMM.
CONTROLS: TABCTRL TYPE TABLEVIEW USING SCREEN 100.
IN FLOWLOGIC
PROCESS BEFORE OUTPUT.
LOOP AT ITAB1 CURSOR CUR WITH CONTROL TABCTRL.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE CLEAR_DATA.
LOOP AT ITAB1.
MODULE MOVE_DATA.
ENDLOOP.
ADD OK_CODE IN ELEMENT LIST. CLICK ON LAYOUT AND ADD TABLE CONTROL(name it as TABCTRL) AND PUSHBUTTONS AS FOLLOWS.
SELECT THE FIELDS FROM PROGRAM. SAVE CHECK AND ACTIVATE.
CLICK ON FLOWLOGIC EDITOR FROM APPLICATION TOOL BAR.
DOUBLE CLICK ON MODULE CLEAR_DATA.
write the in this module as below.
CLEAR ITAB2. REFRESH ITAB2.
DOUBLE CLICK ON MODULE MOVE_DATA.
write the code in this module as below.
APPEND ITAB1 TO ITAB2.
ACTIVATE PAI AND WRITE THE CODE AS BELOW.
CASE OK_CODE.
WHEN 'FETCH'.
SELECT * FROM KNA1 INTO TABLE ITAB1 UP TO 20 ROWS.
TABCTRL-LINES = SY-DBCNT.
WHEN 'ADD'.
GET CURSOR LINE CNT.
CNT = TABCTRL-TOP_LINE + CNT - 1.
CLEAR WA.
INSERT WA INTO ITAB1 INDEX CNT.
WHEN 'MODIFY'.
GET CURSOR LINE CNT.
READ TABLE ITAB2 INDEX CNT.
LOOP AT ITAB2.
MODIFY KNA1 FROM ITAB2.
ENDLOOP.
SELECT * FROM KNA1 INTO TABLE ITAB1.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
SAVE,CHECK AND ACTIVATE ALL.
CREATE TCODE AND EXECUTE.
contact if u hv any issues regarding this code.
reward points,if it is useful.
Thanks,
Chandu. -
Add fields to maintenance view and update then using events
Hi experts:
I've created a table with 4 fields, one of them is userid. Also, there is a maintenance view to add new entries.
I want to display user name when typing userid using events (1 or 21). I know how to do it if username is one of the fields of the table, but there is a requirement to not store username in the table, just userid.
My question is: is possible to add a field into the maintenance view and update it using events but not store the value in DB?.
Thanks in advance for your help.
Regards,
Carlos.In the save event just clear the entries of the field(user name) in the internal table.
-
Process to add new field to Account screen and update value from R/3...
We have CRM 7 and just wanted to ask what the process would be to add a new field to the Accounts screen. This field will be a read-only field and we'll source its value from R/3, based on some of the other data entered into the Accounts screen.
What exactly is involved in this process?.
I think I can use the new Application Enhancement Tool instead of EEWB to create the new field, but how does one identify which structure/table to change for say the 'Accounts' data, and, where does one place the code which populates this field, and, once the structure has been changed how do I physically add the field to the screen. I should be okay with reaching out to R/3 and populating the data, code-wise, but again wondered if there was anything inbuilt to do this, bearing in mind the closeness and constant access to R/3 from CRM.
Any help would be much appreciated.
Jason
Edited by: Jason Stratham on Apr 14, 2010 1:11 PMJason,
If you use EEWB or AET,, there is nothing manual you have to do, the fields will be added to all related tables and structures plus UI too.
May be sometimes you have to run the UI configration tool to add the field to the UI, again this is just a tool, there is not manual coding required.
you can enter the value for the fields direclty via UI, BUT if it is a display only field, at the time of save, you have to write couple of line to populate this field ( see set_property( ) method in the context node ).
Thats it...
Regards, Sudeep.. -
How to add fields in custom infotype and update its screens
Hi Experts
I want to enhance a custom infotype ( Add some new fields, and add special function on its screen). This custom infotype is created in previous release. is there any way to add fields in infotype? and let system automatcailly modify corresponding screens to add new fieldsGo to Transaction PM01.
2) Enter the custom Infotype number which you want to create (Should be a 4 digit number, start with 9).
3) Select the u2018Employee Infotypeu2019 radio button.
4) Select the u2018PS Structure Infotypeu2019.
5) Click on Createu2026 A separate table maintenance window appearsu2026
6) Create a PS structure with all the fields you want on the Infotype
7) Save and Activate the PS structure
8) Go back to the initial screen of PM01.
9) Click on u2018Allu2019 push button. It takes a few moments.
10) Click on u2018Technical Characteristicsu2019. Infotype list screen appears
11) Click on u2018Changeu2019(pencil) button
12) Select your Infotype and click on u2018Detailu2019 (magnifying glass) button
13) Give u2018T591Au2019 as subtype table
14) Give u2018T591Su2019 as subtype txt tab
15) Give your subtype field as subtype field
16) Save and come back to PM01 initial screen
17) Click on u2018Infotype Characteristicsu2019 u2026 Infotype list screen appears
18) Click on u2018Changeu2019 (pencil) button
19) Click on u2018New Entriesu2019
20) Enter your Infotype number and short text
21) Here we have to set different Infotype Characteristics as per the requirement. (Better open another session with some standard Infotypeu2019s infotype characteristics screen and use as the reference to fill yours)
22) Save your entries.
23) Now the Infotype is created and ready to use.
24) If you want to change the layout of the Infotype as per your requirementu2026
25) In the PM01 initial screenu2026Select u2018Screenu2019 radio button and give 2000 as the screen name, then click on edit.
26) In the next screen.. Select u2018Layout Editoru2019 and click u2018Changeu2019.
27) Screen default layout appearsu2026here you can design/modify the screen..change the attributes of the fields..etc.
28) Save and activate. (Donu2019t forget to u2018Activate at every level
i think u have to select CI_INCLUDE while enhanceing the Standrad Infotype -
Field TSABR is not getting updated in MHIS table.
Hi All,
The field TSABR (Scheduling Status: New Start Called) is not getting updated in MHIS table.
Please do tell me how it will get updated.
What is a logic behind it.
Many Thanks in advance.
Regards,
Sanjay TiwariHi,
I checked it my system and that field was getting updated ..
For calls with status "New start called " will get updated in MHIS and for these call you will only have the field scheduling status :planned date called " as marked . pls check
regrds
pushpa -
BTE for Parking a document and updating a custom table
Hi
I want to update a custom table whenever a new parking document got posted through FBV4. I want to use a BTE for this please advice....
Moderator message: please do some research before asking.
Edited by: Thomas Zloch on Mar 10, 2011 9:15 AMHi Gaurav,
First time the correct data i have entered..and pressed "Save" button it is going and updating .After that i given same priority to multiple absence types..it errored out.. till now everything is fine.. Again i changed to correct value.. and pressed "Save" button. It is error out with an error like :
JBO-25001: Name LOCATOR_SELECT3 of object type View Row Set Iterator already exists
Code :
int rowCount = vo.getFetchedRowCount();
RowSetIterator rIter1 = vo.createRowSetIterator("LOCATOR_SELECT3");
rIter1.setRangeStart(0);
rIter1.setRangeSize(rowCount);
int g=0;
rIter1.reset();
for ( int i=0;i<rowCount;i++)
XxchrResultSetVORowImpl row = (XxchrResultSetVORowImpl)rIter1.getRowAtRangeIndex(i);
String priority = ((String)row.getAbsencePriority());
System.out.println("First Priority" + priority);
for ( int j=0;j<rowCount;j++)
if(i==j)
g++;
//leave this row
else
XxchrResultSetVORowImpl rows = (XxchrResultSetVORowImpl)rIter1.getRowAtRangeIndex(j);
String priority2 = ((String)rows.getAbsencePriority());
//String priority2 = ((String)row[j].getAttribute("AbsencePriority"));
System.out.println("Second Priority" + priority2);
if(priority.equals(priority2))
//that means priority is repeated
throw new OAException("error",OAException.ERROR);
rIter1.closeRowSetIterator();
Serializable[] param = {Businessgroupname,Retroactivedays};
am.invokeMethod("Apply");
Thanks
Preeti -
Change the data in fieldcat and update the database table in alv oops
Hi,
my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
this has to be done using alv oops...Hi,
This code will reflect all the changes into the internal table that is being displayed.
* to reflect the data changed into internal table
DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
Now after this code is executed the internal table is modified as per the changes done in alv output.
Now you can use this internal table to update the database table.
Hope this helps you.
Regards,
Tarun -
How to Query and Update/Insert Large Tables ...
I have the following 2 tables:
Table 1: Pricing
This table holds pricing details of all Items (roughly 150,000 items). One Item has three types of prices Standard, Promotion, and Discounted. Therefore the table contains roughly 150,000 * 3 records. Also the prices may get updated frequently every day.
Item#---Type------------FromDate---ToDate-----Price
===================================
AAA-----Standard------01/01/05---31/12/05---1.50
AAA-----Promotion----16/12/05---20/12/05---1.40
AAA-----Discounted---10/12/05---15/12/05---1.20
BBB-----Standard------01/01/05---31/12/05---1.60
BBB-----Promotion----17/12/05---18/12/05---1.30
BBB-----Discounted---10/12/05---15/12/05---1.50
Table 2: BestPrice
At a given date, this table contains the best price (lowest price) of each item for the following 21 days (including the current date). The POS system is accessing this table to get the daily best price for billing customers.
Item#----Date--------BestPrice
=====================
AAA------17/12/05----1.40
AAA------18/12/05----1.40
AAA------19/12/05----1.40
AAA------20/12/05----1.40
AAA------21/12/05----1.50
BBB------17/12/05----1.30
BBB------18/12/05----1.30
BBB------19/12/05----1.60
BBB------20/12/05----1.60
BBB------21/12/05----1.60
Problem Statement:
Table 2 (BestPrice) needs to get updated from Table 1 (Pricing) at least once every day with the best price for each item for the next 21 days (including the current day). Whats the most efficient method to perform this job?I don't know really why your application needs to use BestPrice table!
It is not clear what it does for it because querying will not be better than querying the pricing table. This will be very fast with an index on intem#
On the other hand, why do you use three rows per item in Pricing table? it could be one row per item.
Any way, to populate the table for the first time :
insert into bestprice
select item#
, dte
, min(price) bestprice
from pricing, (select trunc(sysdate) + rownum - 1 dte from dual connect by rownum <= 21) t
where dte between fromdate and todate
group by dte, item#Now, you can have a row trigger (update) on Pricing table which can change BestPrice table according to a change in Pricing tabe.
Then you have to use a daily job that can be based on the following statement:
update BestPrice B
set dte = trunc(sysdate) + 20
, BestPrice =
select min(price)
from Pricing P
where P.item# = B.item#
and B.dte between P.FromDate and P.ToDate
where dte = trunc (sysdate) - 1Message was edited by:
Michel SALAIS
I forgot to say that that if your periods in the pricing table don't covere a desired date in the BestPrice table then my insert statement will not treat it and my update will put it to NULL -
Update Fields Size and Color in MARA table
Hi gurus,
I would like to ask what functionalities like BADI/BAPI/FM or any solution that can be used to update/populate records for SAP Std fields in MARA? There are no values on these fields.
COLOR_ATINN
SIZE1_ATINN
SIZE2_ATINN
COLOR
SIZE1
SIZE2
Thanks.We have now changed the code to:
On screen exit - PAI
EXPORT MARA-ZZSERVLEV TO MEMORY ID 'MARA_ZZSERVLEV'.
EXPORT MARA-ZZTECHLA TO MEMORY ID 'MARA_ZZTECHLA'.
EXPORT MARA-ZZMATRIX TO MEMORY ID 'MARA_ZZMATRIX'.
User Exit:
DATA zzservlev TYPE zservlev.
DATA zztechla TYPE ztechla.
DATA zzmatrix TYPE zmatrix.
IMPORT zzservlev FROM MEMORY ID 'MARA_ZZSERVLEV'.
IMPORT zztechla FROM MEMORY ID 'MARA_ZZTECHLA'.
IMPORT zzmatrix FROM MEMORY ID 'MARA_ZZMATRIX'.
MOVE zzservlev TO cmara-zzservlev.
MOVE zztechla TO cmara-zzservlev.
MOVE zzmatrix TO cmara-zzservlev.
Still custom fields are not getting updated. Any thing I am missing? -
Implement the Logic in Mapping to select, compare and update on one table
Hi All,
We have a Sales Order history table *(HISTORY_TABLE)* and we want implement the below logic in warehouse builder where we are using only one table for checking the condition and selecting the records to update in the HISTORY_TABLE.
Like
SELECT ORDERNO, LINENO, ORDERTYPE FROM HISTORY_TABLE A
WHERE EXISTS IN (SELECT ‘X’
FROM HISTORY_TABLE B
WHERE A. ORDERNO = B. ORDERNO
AND A. LINENO = B. LINENO
AND A.ORDERTYPE = B. ORDERTYPE
HAVING MAX (B.PDDJ) = 0)
Thanks in advance.Hi,
you can implement this as
SELECT A.ORDERNO, A.LINENO, A.ORDERTYPE FROM HISTORY_TABLE A,
(SELECT ORDERNO,LINENO,ORDERTYPE FROM HISTORY_TABLE GROUP BY ORDERNO,LINENO,ORDERTYPE HAVING MAX(PDDJ) = 0) B
WHERE A.ORDERNO = B.ORDERNO
AND A.LINENO = B.LINENO
AND A.ORDERTYPE = B.ORDERTYPE Use Aggregator (group by with having) and then Joiner
Regards,
Oleg -
Count records and update total in table
I have a class schedule that people use to register for a class. The schedule displays how many people are registered but that is a manual entery be me in the database. Is there a way to set this up to where all of the registrations for a class are counted and the total displayed in the schedule?
Using Access 2007.
registratron form
action page
schedule page
thnks JimHi Again,
I tried both the subselect and the two query method with no luck. The two query method did return less errors. I have included code and would really appreciate some feeback thank you --jim
form---------------------
<cfinput type="text" name="name" message="Please enter your full name." required="yes" id="name">
</div>
<div class="register">
<label for="county">COUNTY:</label>
<cfselect name="county" query="qcounty" value="county">
<option value="" selected="selected">Select a County</option>
</cfselect></div
<div class="register">
<label for="email">EMAIL:</label>
<cfinput type="text" name="email" message="Please enter a valid email address" required="yes" validate="email"></div>
<br />
<div class="register">
<cfinput type="submit" name="submit" value="Register"> <cfinput type="reset" name="Reset " value="Reset Form">
</div></fieldset></cfform>
action page-------------------
<cfinsert datasource="WebAdmin" tablename="mobiltyTrainingRegistration"
formfields=" Name, Email, County, Phone1, Phone2, Phone3, Class, classID, Comment">
<!--- populate #registered field in schedule--->
<cfquery name="qAttendance" datasource="webAdmin">
select count(class) as total
from mobiltyTrainingRegistration</cfquery>
<cfquery name="qAttendance" datasource="webAdmin">
insert into mobilityClassSchedule(status) values ("#qAttendance.RecordCount#")</cfquery>
schedule page-------------------------------------
<cfoutput query="training">
<tr>
<td class="c7" width="39%" align="left" style="font-size:0.90em;"> #Class#</td>
<td class="c7" width="19%" align="center" style="font-size:0.90em; text-align:left;">#Location#</td>
<td class="c7" width="21%" align="center" style="font-size:0.90em;">#DateFormat(DropDate, "mmm-dd-yy")#</cfoutput>
<cfoutput query="qAttendance">
<td width="21%" align="center" style="font-size:0.95em;">#qAttendance.Recordcount#</td>
</tr></cfoutput></table> -
How to track the changes to a table and update the other table ?
Hi Guys,
I am looking to track deletion of entries on KONV table and sync these missing entries in an other table which has primary key entries of KONV.
How to do this.. is ALE change pointer is any good for this purpose ?
Thanks
AJHi Sam,
In order to track the changes in the KONV table, go to table CDHDR and give objectclass and objectid, you will get all the details.
Regards,
ramesh. -
What is the field name for logo and site from but000 table
when i enter the logo , i should get all the sites of that logo,can u plz help me
Hello Neeraja,
You need the region for which entity - customer, vendor?
Data element for region is REGIO.
BR,
Suhas -
Custom field not updating in MARC table by mm01/mm02/mm03
Hi,
I have created a sub screen in Plant storage 2 of MM01 tcode with a custom field. The field is visible in the screen but the value is not getting updated in the MARC table. We can update the MARA table through the exit of MPA00001 but there is no option for updating the MARC table. Please let me know if there are any options.HI Geeta,
Chek this
DATA: H_ZE1MARCM LIKE ZE1MARCM.
IF F_CUST_SEGMENT-SEGNAM EQ 'ZE1MARCM'.
H_ZE1MARCM = F_CUST_SEGMENT-SDATA.
IF H_ZE1MARCM-ZMYFIELD = C_NODATA.
CLEAR H_ZE1MARCM-ZMYFIELD.
ELSE.
IF H_ZE1MARCM-ZMYFIELD IS INITIAL.
RES_FIELDS-FELDNAME = 'MARC-ZMYFIELD'.
APPEND RES_FIELDS.
ENDIF.
ENDIF.
F_MARC_UEB-ZMYFIELD = H_ZE1MARCM-ZMYFIELD.
ENDIF.
Given By Lars,
Regards,
Madhu.
Maybe you are looking for
-
Re-syncing restored iphone with new pics on it?
hi, im going to a concert and i would like to know if i could restore my iphone before the concert, take all of my pictures/videos, and then back up my phone
-
Hi sir as refer my account you are deduct the money from my bank account unfortunately but I can't see the subscription so I want to cancel all my subscription please help me to do this Thank &rRegards by K.Anandhan
-
"Open in new tab" menu when a link is right-clicked?
Is there any way in Flex 2 to make a link shows a contextual menu (when it's right-clicked) that shows "Open in new tab" à la Firefox (and probably in IE7)? I think such function is vital for the success of Flex 2. Any one out there who knows how to
-
Serial number of my Photoshop elements and Premiere?
Please how could I recover the serial number of my Photoshop elements and Premiere? I bought these programmes years ago and I installed them in my computer but I never registered. Now I have a new computer and I need the serial number to make it work
-
Kura Username/Password Change
Since past few days, I have been looking into the complete develop branch to figure out how to change the default username and password. I have checked in kura.properties to find out important info on changing default username and password but couldn