Help with User Exit
Hello,
I am and include within a user exit and what i am trying to do is:
populating a field that shows up in a screen popup. transaction is iw32 for which the program name is different than that of the screenvalue that im trying to populate. in iw32, in components tab, i add a component and then i get a popup to populate the purchasing group field and this is the field that i am trying to put a default value into so that I do not get prompted. Please help.
Thanks.
Hey Jasmeet
You can definitely get the values of RESBD in this exit. Please use the code below to get the resbd-ingrp value from the screen:
DATA:l_field(60) TYPE C VALUE '(SAPLCOMK)RESBD',
ls_resbd TYPE resbd.
FIELD-SYMBOLS: <fs_resbd> TYPE ANY.
*Fetching the Component Item from the Screen. This is for read-only
*purpose and content should not be changed.
ASSIGN (l_field) to <fs_resbd>.
if sy-subrc eq 0.
ls_resbd = <fs_resbd>.
UNASSIGN <fs_resbd>.
endif.
Now you have all the values in the structure ls_resbd and you can easily set the value for ingrp according to your conditions.
Hope this helps. Let me know if this is what you want.
cheers
shivika
Similar Messages
-
BPS Help with user exit.----- Quick one for Marc.B?
Hi All,
I'm using an user exit to prefix the GL/account with '2' to make it a stat account.In the fields to be changed , i have included all the characteristics like gl account,region,line of business...key fig name..etc.However when i run the exit, my key figure amount is doubling up.Need a quick fix or a second pair of eyes..also found that xth_data cannot be used in MODIFY statement because of hash table .so I'm using a collect.But as soon as i exit out of the loop, the key figure amount doubles....any pointers????
Here is the code.................................
FUNCTION Z_SEM_PREFIX_2ACCOUNTS.
""Local interface:
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_Y_AREA
*" REFERENCE(I_PLEVEL) TYPE UPC_Y_PLEVEL
*" REFERENCE(I_PACKAGE) TYPE UPC_Y_PACKAGE
*" REFERENCE(I_METHOD) TYPE UPC_Y_METHOD
*" REFERENCE(I_PARAM) TYPE UPC_Y_PARAM
*" REFERENCE(IT_EXITP) TYPE UPF_YT_EXITP
*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL
*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA
*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF
*" EXPORTING
*" REFERENCE(ET_MESG) TYPE UPC_YT_MESG
*" CHANGING
*" REFERENCE(XTH_DATA) TYPE HASHED TABLE
DATA:
ls_data TYPE t_s_alloc,
lth_data TYPE t_th_alloc.
*Loop thru the data and check if its a valid GL account.
*If its a valid GL account, Prefix '2' to the beginning of the
*account and also add 'DDD' to the transaction type in order to
*identify the record.once the prefixing is over , you will have the old as well as the new set of records.
*records as they will not have the 'LOB' flag in the transaction type.
lth_data = xth_data.
LOOP AT lth_data INTO ls_data.
if ls_data-s_chas-0gl_account
is not initial.
if ls_data-s_chas-0gl_account+3(1) = '0' AND
ls_data-s_chas-0gl_account+4(1) <> '0'.
concatenate '000' '2'
ls_data-s_chas-0gl_account+4(6)
into ls_data-s_chas-0gl_account.
ls_data-s_chas-zoctrtype = 'LOB'.
endif.
endif.
collect ls_data into lth_data.
ENDLOOP.
DELETE Lth_data
where s_chas-0gl_account+3(1) <> '2' and
s_chas-zbpsflag = 'C'.
xth_data = lth_data.
ENDFUNCTION.Hi Sudz,
you got it almost right. If you do the collect the system will add the changed records to the exiting ones since you start with lth_data = xth_data. So use the following logic:
start with empty table
refresh lth_data.
now process all exiting data
LOOP AT xth_data INTO ls_data.
if ls_data-s_chas-0gl_account is not initial.
if ls_data-s_chas-0gl_account+3(1) = '0' AND
ls_data-s_chas-0gl_account+4(1) <> '0'.
concatenate '000' '2' ls_data-s_chas-0gl_account+4(6)
into ls_data-s_chas-0gl_account.
ls_data-s_chas-zoctrtype = 'LOB'.
endif.
endif.
and collect the new data
collect ls_data into lth_data.
ENDLOOP.
return only the new data
xth_data = lth_data.
Regards,
Marc
SAP NetWeaver RIG -
Hello all,
I need to create a customer exit variable to get a field (0calmonth) from an infoobject attribute and use this field to filter the query.
I need some help to finish the code:
WHEN 'my variable'.
IF I_STEP = 2. "before the popup
SELECT 0CALMONTH INTO ??? "0calmonth is the attribute.
FROM /BIC/TZFECHAVAL "infoobject table.
WHERE... "conditions.
Any help? Thanks. Points will be assigned.Hi,
Pls check the below sample code.. and change the code
WHEN 'Your Variable' .
TYPES : BEGIN OF ls_batch ,
batch TYPE /bi0/oibatch,
END OF ls_batch.
DATA : lt_batch TYPE TABLE OF ls_batch.
DATA : wa_batch TYPE ls_batch .
SELECT batch FROM /bi0/mbatch
INTO TABLE lt_batch
WHERE batch = 'XYZ'
OR batch = 'ABC' .
SORT lt_batch BY batch .
DELETE ADJACENT DUPLICATES FROM lt_batch COMPARING batch .
LOOP AT lt_batch INTO wa_batch .
l_s_range-low = wa_batch-batch.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDLOOP.
Thanks
Reddy -
Please help me with user-exits or baids for TCode : FOE2 & FOE1
Hi Experts
Please help me with user-exits or baids for TCode : FOE2 & FOE1.
I found these but not picking values from VIMI01,VIOB03 and VIOB41.
User-exits
FVCH0001 CH-specific enhancements: Esp. POR
ISRE0001 Determine bank procedure account no.
ISRE0002 IPD reporting data retrieval
Business Add-in
FVD_HANDLE_FORMULA Processing of Condition FormulasHi,
ASk your basis regarding the CI_CSKB table active issue, and first of all i dont see any table with the name CI_CSKB.
And check this exit-COOMKS03 whether it works for your screen exits.
Cheers!!
VEnk@
Edited by: Venkat Reddy on Nov 4, 2008 5:59 PM -
Valuation price with user exit/BADI/Enhancement Spot (In valuation variant)
Hi all,
i am facing problem finding enhancement when creation of sales order of Valuation price with user exit/BADI/Enhancement Spot (In valuation variant)
For refferenece:
When going to t.code VA03, select one item and go to extras in the menu bar and select costing then you find some amounts calculation i.e valuation price automatically.
So when creation of sales order i am giving material and that material price automatically takes from material master and creating sales order.
My customer requirement is to get the valuation price of the input material from Z-table during the sales order cost estimate.
This Z-table contains the material code, plant , grade of the material.
Ex:
Material Plant Grade Price
A 1000 XYZ 25000
A 1000 PQR 35000
A 1000 BCD 45000
Suppose it depends on sales document type and which grade price i have to take.
So first of all i am unable to find enhancement where to change this code to get change the valuation price.
Does anybody have any idea , is there any user exit/BADI/enhancement for this.
So please help me in this issue.
Thanks & Regards,
lokeshgoudpls allow me to post the questions
-
Need help for user exit mereq001
Hi,
I need help for user exit mereq001. I think I messed up with include table CI_EBANDB and CI_EBANMEM. And When I tried to check the syntax . It gives me error like : <b>Class IF_PURCHASE_REQUISITION. Inconsistency in the dictionary for the structure mereq_item_s_cust_data.</b> Anyone had experience for this exit? I just need to extract costcenter information of the each item from the requisition and block the requisiton if the costcenter are differents from each other before the requisition is saved. Any one has idea about it?
Thanks.biao,
Have you checked this struture consistency from SE11. Also check the activation log.
If there are any errors and you are not able to rectify the same use RSDDCHECK program, give your table name and run the report.
This will list down the error structures releated this table and also prompts for you to activate it.
Regds
Manohar -
Valuation price with user Exit on activity types
Hi All,
Our customer could have different activity cost for different products even if they are processed on the same cost center, same activity type and same activity time. So I wonder whether SAP has valuation price with user Exit on activity types as what on material valuation, when we select "U" in the relevant valuation variant. Could anyone knows advise please?
Regards
WalterHi Walter,
an idea might be to include an ABC template into the costing. ABC tempaltes allow a big degree of freedom in determinin which processes to use and in which quantities. To use the product as a cost driver is certainly not an issue. I doubt that you can directly influence the process 'price' to be applied, but to change the quantity could bring the same result.
See the docu for more info:
[http://help.sap.com/saphelp_erp60_sp/helpdata/en/7e/cb7d1443a311d189ee0000e81ddfac/frameset.htm]
best regards,
Udo -
Formula variable with User Exit
Hi,
Can we create a Formula Variable of processing type USER EXIT...which will display a constant Value Y
Any syntax would be helpful
ThanksHi,
check this for formula variables with user exits;
http://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/customer-exit-to-derive-formula-variable-to-text-variable-sap-bw-35-3030684
Also Check the issues and solution :
Formula Variable with User Exit....Problem
Thanks
Hemav -
Difference between the different structures while dealing with User-Exits
While dealing with User-Exits, we come across the different structures/Tables like XVBAP,YVBAP,TVBAP,IVBAP,*VBAP....
What is the difference between them ?Usually X<tablename> and Y<tablename> are used in change document management to determine records updated (Y is old values and X new ones). (Look at transaction SCDO)
T<tablename is an internal table read from database and I<tablename> is an import table parameter of the same structure. <tablename> is an equivalent of <tablename> declared with statement TABLES and contains usually the "old" value.
Look at exit documentation. start at [User Exits In Sales Document Processing|http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/content.htm]
Regards -
Help needed: user exit for CO02
I have a problem with user exit. I need to display an error message when the quantity of a specific component of a material is changed in CO02 and user hits save button.
I inserted my code in include program ZXCO1U01. Based on the material type if the user changes the quantity I will display a message. But the problem is the documentation shows that we cant insert a error message in this exit. Its giving a dump if I do that.
I am calling a new screen to display a message but if I try to execute CO02 again for the same order its displaying error messages as that component will remain locked.
Please help me regarding this.
ThanksHi Bobby,
We had similar issue and we have added a code to send an e-mail message to the user is any error occurs.
You can't insert an error meesage in this user exit.
Lanka -
MRP Run with User Exit key for Follow up material
Dear Gurus,
I want to run MRP only for followup materials by using User exit key. For example i have a material X(with discontinued Indicator as 1) and it's follow material is Y.
So we have a user exit key as ZFL, with coding as shown below. Now when i run MD01 with user exit key ZFL and parametre as 1, it only runs MRP for material X and not for material Y. What else we need to do so that when i run MD01 with user exit key ZFL, it shoudl consider both X and Y.
WHEN 'ZFL'.
DATA : BEGIN OF ITAB5 OCCURS 0,
KZAUS LIKE MT61D-KZAUS,
END OF ITAB5.
TRANSLATE USER_PAR TO UPPER CASE.
SPLIT USER_PAR AT ',' INTO TABLE ITAB5.
IF ITAB5[] IS INITIAL.
EXIT.
ENDIF.
CLEAR: NO_PLANNING, STOP_PLANNING.
READ TABLE ITAB5 WITH KEY KZAUS = MT61D-KZAUS.
IF SY-SUBRC <> 0.
NO_PLANNING = 'X'.
ENDIF.Hi Kumar,
You can use either MRP Type, MRP Controller, MRP Group in this user exit to control the MRP run. For these set of Materials you have to assign any of same value or at least differentiate these material from other material. Then only you can control the MRP by using this user exit even though if you use different MRP Group and MRP Controller. In User Exit, you may have to add your dependent material's MRP Group/MRP Controller. Make sure that these set of materials are different than all other materials.
If you don't have any plan to run MRP for other materials then as per Ajit suggestion you make that material's MRP type as "ND". But, in your business case they may want to activate the MRP for all the material not now but may be latter.
Thanks -
Issue with user exit ZXPADU01 and ZXPADU02
Hi,
I am trying to change the existing record for the info type 0015 for an employee in Pa30 transaction.
my requirement is i need old value and new value when i am changing the existing record in info type 0015.
When i kept break point in user exit ZXPADU01 it is not triggering it is triggering only when we creating the record.
i tried with user exit ZXPADU02 it is not working as per my requirement.
My requirement is :whenever i am changing the existing record(modifying record) i need old value and new value.
Anybody can suggest me how to fix this issue.
Thanks,
MaheedharDear Maheedhar,
The best way to achieve this requirement is to use the PAI user exit ZXPADU02 import parameter PSAVE. The PSAVE parameter contains the PBO original / initial record, before any changes take place.
The INNNN parameter contains the current PAI record as usual, in order to be used for customer check and new values. Thus, you've got both the old and the new record in place, and you can make your comparison according to the business requirements: -
Help on User Exits with example needed
Hello Experts,
Need help/material on:
1)Understanding Advanced Customization (VOFM, User Exits)
2)Calculating Freight Charges
3)Integrating Credit and Payment Cards
4)Interfacing with Other Modules (MRP, AR)
5)Using Batch Delivery Processing
Regards
InnovaHi,
There are a number of techniques SAP have used over the years to implement user-exits.
The most recent exits will be found in CMOD. Using CMOD (or SMOD), you can list all the enhancements available, that use this technique. As usual in the SAP world, the later the version of SAP you are using, the more exits are available.
Other exits do not use the enhancement technique. For example, in Sales Order Processing (SAPMV45A), SAP have provided empty forms, such as USEREXIT_SAVE_DOCUMENT_PREPARE that can be used to provide customer functionality. With one client, this was used to set the blocking indicator on a sales order, if a manual change had been made to pricing. The requiredscript is written in between form and end form.
Another technique is the use of validation and substitution rules in the financial modules.
The best way to find the user exits available is through the IMG. The relevant nodes will take you to where the customisation can be performed. Usually, the associated IMG note details the use of each exit, though there are gaps.
Award points if helpful.
Message edited by
Mohan -
Help required with User exit logic
Hi gurus,
Please help me with the logic I wrote for the user exit for a PP Work Center View extract structure. Here is the details of the add on fields: VGW01, VGW02, VGW03, STEUS(from table PLPO); DataSource: 2LIS_04_P_ARBPL,
data: l_s_pp1 like MC04P_0ARB(extract structure of 2LIS_04_P_ARBPL),
l_tabix like sy-tabix,
lv_VGW01 like PLPO-VGW01.
lv_VGW02 like PLPO-VGW02.
lv_VGW03 like PLPO-VGW03.
lv_STEUS like PLPO-STEUS.
tables : PLPO.
case i_datasource.
when '2LIS_04_P_ARBPL'.
loop at c_t_data into l_s_pp1.
select single vgw01into lv_vgw01
from PLPO
where field = l_s_pp1-field.
if sy-subrc = 0.
l_s_pp-zzvgw01 = lv_vgw01.
l_s_pp-zzvgw02 = lv_vgw02.
l_s_pp-zzvgw03 = lv_vgw03.
l_s_pp-zzsteus = lv_steus.
endif.
modify c_t_data from l_s_pp1 index l_tabix.
endloop.
Any additional comments welcome. Thanks in advance.Hi,
Try coding as per the below code
case i_datasource.
When '2LIS_04_P_ARBPL'.
DATA: lt_data TYPE TABLE OF MC04P_0ARB.
FIELD-SYMBOLS: <ls_data> TYPE MC04P_0ARB.
Internal table for
TYPES:
BEGIN OF ty_tbl1,
lv_VGW01 TYPE PLPO-VGW01,
lv_VGW02 TYPE PLPO-VGW02,
lv_VGW03 TYPE PLPO-VGW03,
l_bmsch TYPE XXXX-XXXX,
l_plnnr TYPE XXXX-XXXX
l_datuv TYPE XXXX-XXXX
l_aennr TYPE XXXX-XXXX
l_plnkn TYPE XXXX-XXXX
l_plnal TYPE XXXX-XXXX
END OF ty_tbl1.
DATA:
lt_tb1 type standard table of ty_tbq,
ls_tb1 type ty_tb1.
lt_data[] = c_t_data[].
Read data into internal memory using jOins
select aVGW01 aVGW02 aVGW02 aVGW02 bbmsch bplnnr bdatuv baennr bplnkn bplnal into into CORRESPONDING FIELDS OF TABLE
lt_tb1 from PLPO as a innerjoin XXXX as b where aXXXX=bXXXX.
use the internal table to get the data to the enhaced fileds
LOOP AT lt_data ASSIGNING <ls_data>.
read table lt_tb1 into ls_tb1
with key XXXXX = <ls_data>-XXXX .
if sy-subrc eq 0.
<ls_data>-lV_VGW01 = ls_tb1-lv_VGW01,
<ls_data>-lV_VGW02 = ls_tb1-lv_VGW02,
<ls_data>-lV_VGW03 = ls_tb1-lv_VGW03,
<ls_data>-bmsch = ls_tb1-bmsch,
<ls_data>-plnnr = ls_tb1-plnnr,
<ls_data>-datuv = ls_tb1-datuv,
<ls_data>-aennr = ls_tb1-aennr,
<ls_data>-plnkn = ls_tb1-plnkn,
<ls_data>-pln1l = ls_tb1-plnal.
MODIFY lt_data FROM <ls_data>.
endif.
ENDLOOP.
REFRESH c_t_data.
c_t_data[] = lt_data[].
Note that the code is not written with the exact fields. Change the fields where necessary(also i have joined only 2 tables if needs to be joind form more than 2 table change the join statement accordingly).
Thanks,
Nagarjuna
Edited by: Nagarjuna Reddy on Oct 20, 2011 3:39 AM -
Urgent Help in User-Exit for MM!
Hi,
1. I am writing code in the Exit "EXIT_SAPLMGMU_001".
2. I have to pop-up error/warning messages for incorrect data entered in various fields/screens/views of MM01/MM02 transaction.
3. The Exit gets triggered when i press "SAVE" after modification.
4. When I create the Classification View, i enter the class type as "001" for material class.
5. Then i need to enter a value "Z_Product" in the class column(on the screen in classification view). This class is the "Product Class" (description).
My problem is to find this value that i enter on screen before "Save" i.e. when i am creating material for the first time in MM01, i dont want the error message to pop-up if i am entering any value in the class column and also entering values in the internal characteristics for that class.
Basically i want to read the values (before "SAVe") entered in the class column as well as want to know the values for the internal characteristics of the class.
For Class, the std. field is "RMCLF-Class" , but i have no buffer field available in my exit that contains the value for the Class. I have also tried using "Get parameter ID", but it doesnt work.
For Internal Characteristic values (of the class) that are entered in the tab(that appears on pressing "Enter" after filling the Class value) below the Class tab, i am fetching data from std. table AUSP to check for corresponding entries for that particular material number....but this table will get updated only after "SAVE" and so i would be able to read the values only in MM02.
Please help me in finding out a way for reading the class values & Characteristic values in my user-exit.
Thanks & Regards,
TejasHi Ronak.
You can try with <b>'EXIT_SAPLCLFM_002' (CLFM0002)</b>. This is the exit for the classification view. You can get this for the transaction CL22N / CL24N.
This is also called in MM01 for classification values. This classification details are cross application components. So This is also called from other transaction.
Regards
Rusidar.
Maybe you are looking for
-
Mac App Store broken...?
Hi guys, I can't open the Mac App Store. I deleted it for experimentation purposes and tried to bring it back, and it didn't work. It's in my Applications folder, but has no Icon. When I drag it onto my dock, it's just a blank space that says "App St
-
Hi All, I am facing a problem in quality server. When I click on f4 help for UOM field (which is UNIT field of structure BBPS_SC_APP_ITEM) I get this message "Internal unit KNM, language EN is not maintained" though F4 is also displayed. I just fail
-
i sign in app store with my own apple id but when i want to update some of my apps it asks me for a password for onther apple id i dont know whose belong to
-
Hi guys i wrote a simple Session Bean App ... The Codes as follows ... ---------DatabaseHome------------------------------------ package DatabaseBeans; import java.rmi.RemoteException; import javax.ejb.CreateException; import javax.ejb.EJBHome; publi
-
ORA-15031 disk specification '/dev/vguat1/rdata2' matches no disks
HI All, I tried creating a disk group for a ASM instance. But it is failing with the below error. SQL> create diskgroup data_grp 2 failgroup data_grp_f1 disk '/dev/vguat1/rdata1' 3 failgroup data_grp_f2 disk '/dev/vguat1/rdata2'; create diskgroup dat