How to identify a user-change in USEREXIT_CHECK_VBAP
Hello,
I am writing a bit of code that will overwrite the payment terms in a sales order item based on a number of factors. (ship-to, incoterms, document type, etc)
I am using the following program MV45AFZB at Exit : USEREXIT_CHECK_VBAP. I am using this exit as the users need to see the payment terms after an item has been entered into the sales order and not have the value determined at sales order save.
I am not using USEREXIT_MOVE_FIELD_TO_VBAP as it is only triggered once at the time of creation and not when I change the document. I need it in USEREXIT_CHECK_VBAP as users could change the incoterms in VA02, so the code must be redetermined.
My code is working as expected, however, I have a problem when a user enters a sales order item line and then manually changes the payment terms, as my code then is over writes the users values.
The flow is as follows
As user creates a sales order
They populate the sales order header
They populate material number and qty
User exit USEREXIT_CHECK_VBAP is triggered and correctly determines the payment terms
The user then double clicks on the sales order item and decides to overwrite the payment terms.
My user-exit is retriggered and check to see if XVBAP-UPDKZ = I (insert)
As it is still an insert, my code triggers.
I have tried to check YVBAP, but no entry exist as it stills is seen as in insert? What I really need to know that while it is still an insert, the user has change the field value and my code should not over write the users value.
Hi
Please, read carefully SAP Note 178328 - Problems due to incorrect user exits in SD.
It says:
In general, the following connection exists between the update indicator
and the Y tables:
o When you create a document, only the update indicator 'I' can exist
in the X tables (or sometimes the update indicator remains
initial). No records exist in the Y tables.
o When you change a document, the following cases may occur:
- You add a table entry. There is only one entry in the X table
that has the update indicator I. There is no entry in the Y
table.
and it goes on with useful information.
I hope this helps you
Regards
Eduardo
Edited by: E_Hinojosa on Feb 20, 2012 9:20 AM
Similar Messages
-
How to identify the DDL changes ?
Hi all,
How to identify the DDL changes done to the database ?
By triggers only Or we can use Logminer also OR
SELECT * FROM USER_OBJECTS where object_type = 'TABLE' order by LAST_DDL_TIME desc;
OR
is there any other options are available ?
Thanks in advance,
PalSomething from asktom might help
tkyte@TKYTE816> create or replace trigger ddl_trigger
2 after create or alter or drop on SCHEMA
3 declare
4 l_sysevent varchar2(25);
5 l_extra varchar2(4000);
6 begin
7 select ora_sysevent into l_sysevent from dual;
8
9 if ( l_sysevent in ('DROP','CREATE') )
10 then
11 if l_sysevent = 'CREATE'
12 then
13 begin
14 select 'storage ( initial ' || initial_extent ||
15 ' next ' || next_extent || ' .... )'
into l_extra
16 from all_tables
where table_name = ora_dict_obj_name
17 and owner = user;
18 exception
19 when no_data_found then null;
20 end;
21 end if;
22
23 insert into log
24 select ora_sysevent, ora_dict_obj_owner,
25 ora_dict_obj_name, l_extra
26 from dual;
27 elsif ( l_sysevent = 'ALTER' )
28 then
29 insert into log
30 select ora_sysevent, ora_dict_obj_owner,
31 ora_dict_obj_name, sql_text
32 from v$open_cursor
33 where upper(sql_text) like 'ALTER%' ||
34 ora_dict_obj_name || '%'
35 and sid = ( select sid
36 from v$session
37 where audsid=userenv('sessionid') );
38 end if;
39 end;
40 / -
How to identify the user who created the variant
Hi All,
Can anyone tell me how to identify the user who created the variant ?Hi Dear,
For the same go to SE11 and view the table "VARID". This table give the details of the program,user,variant etc.
From this table u can know which user created the variant. Hope this solve your purpose.
Regards -
How to identify a user across multiple pages
Hi,
I'm doing a homebanking and I would like to know how to identify a user across multiple pages.
I have already take a look at HTTPSESSION, but I didn't understand.
Can someone help me.
I'm send the servlet Logon.
import java.io.*;
import java.sql.*;
import java.util.Date;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Cons_logon extends HttpServlet
private Connection conexao = null;
Login1 login1;
public void init (ServletConfig cfg) throws ServletException
super.init(cfg);
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conexao = DriverManager.getConnection("jdbc:odbc:bank");
catch (Exception e)
System.out.println(e.getMessage());
public void doPost (HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
String Suser, Spassword;
PrintWriter out;
res.setContentType("text/html");
out = res.getWriter();
String opcao = req.getParameter("log");
ThanksI would recommend using the authentication mechanism that's guaranteed by the servlet spec. If you do that, you can just call
request.getRemoteUser()
to get the user name across multiple pages.
If you want to use your own login scheme, you can create a new session object and map it to a user name somewhere in your app. Or you can just put the name of the user on the session. But the preferred way is to use the default authentication scheme defined by the spec. -
How to capture the user change in an input field on a selection screen?
I am coding a selection screen in which there are two input fields. The first field takes a Unix directory from the user input. Based on the input value, the second field will be populated with a the name of a file under the corresponding directory.
My question is how I can make the program capture the user input without having to make the user press ENTER after they enter the value in the first field?
Any help will be greatly appreciated.Venkat,
Actually you led me to the real solution! It's the function module DYNP_VALUES_READ that does the trick for me. This function enables the program to capture dynamic user changes without recourse to PAI. Please refer to the code below:
REPORT zreiabsintf MESSAGE-ID zreiabsintfmc.
*<HGDC------------------------------------------------------------------
* Selection screen for the conversion program
*HGDC>------------------------------------------------------------------
SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-001.
PARAMETERS: p_indir LIKE epsf-epsdirnam OBLIGATORY, " Inbound file directory
p_infile LIKE epsf-epsfilnam DEFAULT gc_infile OBLIGATORY, " Inbound file name
SELECTION-SCREEN END OF BLOCK input.
*<HGDC------------------------------------------------------------------
* Displays a file-open dialog when the user clicks the search
* help button next to the inbound file text field. The user
* can select the inbound file visually.
*HGDC>------------------------------------------------------------------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
* Capture any user change to the directory.
PERFORM check_dir_change.
* Display the file open dialog
PERFORM file_open_dialog CHANGING p_infile.
*<HGDC------------------------------------------------------------------
* Global constants
*HGDC>------------------------------------------------------------------
CONSTANTS:
gc_indir LIKE epsf-epsdirnam
VALUE '/interfaces/<SID>/inbound/', " Default inbound directory template
gc_infile LIKE epsf-epsfilnam VALUE 'input'. " Default inbound file name
*<HGDC------------------------------------------------------------------
* Global data
*HGDC>------------------------------------------------------------------
DATA:
gs_dynpfields TYPE dynpread, " Fields of the current screen
gt_dynpfields LIKE STANDARD TABLE OF gs_dynpfields. " Table of the screen fields
*& Form file_open_dialog
* Opens a dialog window for the user to choose a file in
* the specified Unix directory.
* <--P_FILE is the file to be selected.
FORM file_open_dialog CHANGING p_file.
* Validate the directory.
OPEN DATASET p_indir FOR INPUT IN BINARY MODE.
IF sy-subrc NE 0.
MESSAGE i001(zreiabsintfmc) WITH p_indir. " Unable to open the given directory
EXIT.
ENDIF.
CLOSE DATASET p_indir.
* Call the dialog window to open a file in the directory.
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = p_indir
IMPORTING
serverfile = p_file
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE i002(zreiabsintfmc). " Failed to open the file.
EXIT.
ENDIF.
ENDFORM. " file_open_dialog
*& Form check_dir_change
* text
* --> p1 text
* <-- p2 text
FORM check_dir_change .
CLEAR gs_dynpfields.
CLEAR gt_dynpfields.
gs_dynpfields-fieldname = 'P_INDIR'.
gs_dynpfields-fieldvalue = p_indir.
APPEND gs_dynpfields TO gt_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = gt_dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE gt_dynpfields INTO gs_dynpfields INDEX 1.
p_indir = gs_dynpfields-fieldvalue.
ENDFORM. " check_dir_change
Thanks for all your answers! The problem is now solved.
Edited by: Ning Hu on Apr 9, 2008 11:32 AM
Edited by: Ning Hu on Apr 9, 2008 11:34 AM -
How to identify different users on a network
I have a program that is currently located on a server and is being used by a number of different people. I am trying to get the jfilechooser to be able to remember a current directory from session to session, basically the last directory a given user opened a file from.
My problem is that each user will have a different current directory (usually on their desktop) at any given time. Is there a way to identify the user so that jfilechooser can have the correct current directory?
Thanksi would imagine so
as long as you have a username to identify each user (i.e. they login), you can lookup their personal preferences however you like
Edited by: SoulTech2012 on Aug 8, 2008 11:17 AM -
How can I have users change textures in acrobat 3d and Reader question tia sal2
I'm trying to have users in Acrobat reader change textures of a box which I made in acrobat 3d
how can I do this?
Example
I made three textures for a box and I would like the user to have the ability to change the textures if they choose. How can I do this? Any examples?
Can I have a user select the textures or the layers from a photoshop file in Acrobat 3d?
Tia sal2Yo ratboy,
You can do this. In order to map the images, they must be attached as a 3D resource. (There is a free plugin for this; search the forum for "Attach3DResource.api"). Once the images are attached, you can use the 3D Javascript API to map them to the meshes you desire.
For one doc, I attached 25 images in this manner. I then used the script below to create a bunch of empty meshes, and then apply the images to said meshes.
Hope this helps!
//3D javascript ========================================
//create 25 procedural meshes ======
var leftEdge = -180;
var horizontalOffset = leftEdge;
var verticalOffset = 0;
var myMesh = new Array();
var myVector = new Array();
for ( i=0; i<25; i++ ) { myMesh[i] = scene.createSquareMesh(64, 48, "myMesh" + i); myVector[i] = new Vector3( horizontalOffset, verticalOffset, 0 ); myMesh[i].transform.translateInPlace(myVector[i]); horizontalOffset += 74; if ( horizontalOffset > 180 )
horizontalOffset = leftEdge;
verticalOffset += 58;
//create image array and resource objs ============
var myImageResources = new Array();
var myImageFiles = new Array("8d91.jpg",
"ad2e.jpg",
"barnpond.jpg",
"Beach01.jpg",
"Beach04.jpg",
"Beach05.jpg",
"Beach06.jpg",
"Beach13.jpg",
"bike trailer.jpg",
"cobra.jpg",
"cr80xr200.jpg",
"craigs_place.jpg",
"Dandrea.jpg",
"dirtbike.jpg",
"e027.jpg",
"f5b5.jpg",
"f613.jpg",
"halfdome.jpg",
"Iceberg.jpg",
"island.jpg",
"kx100_gb.jpg",
"maui_horanhero.jpg",
"norcal_ocean.jpg",
"sierraLake.jpg",
"Smokey Light.jpg",
"test.txt");
//create resource objs
for ( i=0; i<25; i++ ) { myImageResources[i] = new Resource("pdf://" + myImageFiles[i]); }
//load images on meshes with handler ============
var myImageObjs = new Array();
var myImageMats = new Array();
myRenderer = new RenderEventHandler();
myRenderer.onEvent = function(renderEvent)
for ( i=0; i<25; i++ ) { //create image from resource myImageObjs[i] = new Image(myImageResources[i]); console.println("Image = " + i);
//add image to model
myImageMats[i] = myMesh[i].material;
myImageMats[i].diffuseTexture.setImage(myImageObjs[i]);
//remove handler
runtime.removeEventHandler(myRenderer);
runtime.addEventHandler(myRenderer);
//cause a recalculation of the scenegraph.
scene.update();
console.println("Call scene.update()");
console.println("Created 25 Square meshes: (64, 48, 'myMeshN')"); -
How to identify the user who has created accounts,lead, Opp in portal
Hi experts,
I am working in CRM 5.0 now i want to know the user who has created a particular account, Lead, and opportunity in Portal not in GUI kindly give some inputs regarding this .
Thanks in advance
AmarHi Frederic,
Thanks for your reply.
But is there any way by which we can make it happen in PCUI.
The customer is very particular about it. They use only PCUI to create new accounts and they want a facility to view change history in PCUI Account Application itself. They are not interested to go back to GUI to know change history for that BP.
We have just checked whether any related BSP structures containing change fields are assigned to COMM_BUPA but not successful.
Kindly help with a possible solution.
Regards,
Amar -
How to identify the last changes made in the smartform ?
Hi Form Experts,
My smartform's General attribute shows that there is some change performed 2 months back, Which is not reflected in my production server.
Could any one advice how to track the last performed changes in the system, I did not find version management for smartforms.
Regards
PrasathHi,
1.Go to smartforms->give formaneme>display>Utilities>Forminformation.
2.Go to smartforms->give formaneme>display-->General attributes.
Regards,
If helpful reward with points(Don't forget).
Edited by: shiva kumar on Apr 11, 2008 6:22 AM -
How to identify what to change with a BADI
I have to implement a BADI for the first time. I have no big problem with the general concept, but I am having a major problem with knowing what data structures can be modified.
I am implementing the BADI PARTNER_UPDATE in CRM. I have a break point in my implementation, but I cannot explicitly see what structures are available for me to modify.
The documentation for the BADI (which SAP expressly state must be comprehensively maintained) is non-existent in english. There are no structures passed in with the method, and when I look at the implementing object in the debugger I cannot see any of the atributes, public, statis or private.
So how can I find out what are the structures that can/should be updated in the BADI? This is irritating; at least function modules are self-documenting with respect to structures that can be used (provided that they are passed into the FM). Methods too, if they have parameters, but this BADI is not very helpful at all.
Kind regards,
Tony.Hi,
even i' am not able to find any thing.
it doesn't need any thing to pass..
but there is a sample implementation check it.
<b>CL_EX_PARTNER_UPDATE</b> in SE24.
two methods are implemented.
you can see the code also.
regards
vijay
Message was edited by: Vijay Babu Dudla -
How can I allow normal user change their LDAP password?
I use Solaris10 + Sun Directory server 5.2SP6 + Samba, how can allow normal user change the password themselves?
Thanks.Depends on application you are using. I use ColdFusion and here is how I allow users to change their passwords
<cfldap action="Modify"
dn="uid=#form.UserLogin#,ou=your_ou,dc=example,dc=com"
attributes="userpassword=#FORM.newPassword#"
server="#servername#"
Port="#portnumber"
username="uid=#form.UserLogin#,ou=your_ou,dc=example,dc=com"
password="#form.userpassword#"> -
ALV issue - capturing user changes in editable fields using custom button?
Hi,
I created a custom button in ALV tool bar. And also in my ALV grid I have couple of fields Editable option. User can change values for these 2 fields.
My question is -
After changing values for these editable fields(more than 1 record) , user will click on custom button and then I have to update all the user changed values in to my internal table(lt_tab) and then I have to process logic.
Problem is when user click on Custom button in ALV tool bar it is not having the changed values in lt_tab table.
Only when user clicks some thing on ALV grid records or fields then it is getting all the changed values in to lt_tab.
Can any one tell me how I can get changed values when user clicks on custom button?
1. Can we place custom button in ALV Grid? instead of ALV tool bar?
or
How I can capture user changes when they click on custom button?
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
TABLES
T_OUTTAB = lt_tab
Please check this logic-
CASE r_ucomm.
WHEN '&IC1'.
- It_tab having all changed field values
WHEN 'custom button'.
lt_tab - not having any changed values - showing all initial lt_tab values.
I highly appreciate your answers on this.
Thanks.
Rajesh.Hi,
Use this code, its working:-
*& Form ALV_DISPLAY
* SUB-ROUTINE ALV_DISPLAY IS USED TO SET THE PARAMETERS
* FOR THE FUNCTION MODULE REUSE_ALV_GRID_DISPLAY
* AND PASS THE INTERNAL TABLE EXISTING THE RECORDS TO BE
* DISPLAYED IN THE GRID FORMAT
FORM alv_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = v_rep_id " report id
i_callback_pf_status_set = 'PF' " for PF-STATUS
i_callback_user_command = 'USER_COMMAND' " for User-Command
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = wa_layout " for layout
it_fieldcat = it_field " field catalog
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = it_sort " sort info
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
i_save = 'A'
is_variant = wa_variant " variant name
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final " internal table
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " ALV_DISPLAY
*& Form USER_COMMAND
* SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
* AND EXECUTE THE APPROPIATE CODE
* -->LV_OKCODE used to capture the function code
* of the user-defined push-buttons
* -->L_SELFIELD text
FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
* assign the function code to variable v_okcode
lv_okcode = sy-ucomm.
* handle the code execution based on the function code encountered
CASE lv_okcode.
* when the function code is EXECUTE then process the selected records
WHEN 'EXECUTE'. "user-defined button
* 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.
* refresh the ALV Grid output from internal table
l_selfield-refresh = c_check.
ENDCASE.
ENDFORM.
This will reflect all the changes in the internal table. Now you can include your logic as per your requirement.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
How to identify the field value has been changed to new value?
Hi,
I am adding a custom field through CI include for 171 info type.
But I need to identify that whenever user enters into change mode and changes the value(Custom field) then I have to populate an error message(i.e Manitain date type in 41.).
I know we can identify that by change(AEDAT) date of that particular record but I could not identified that particular field has changed or not.
Please share your experience, if possible send pseudo code.
<REMOVED BY MODERATOR>
Thank you,
Ravi.
Edited by: Alvaro Tejada Galindo on Feb 6, 2008 12:37 PMCan you keep a copy of the record when you enter the infotype and check changes against that?
Rob -
How to Enforce User Change Password First Time User in Release 2?
Hi...
We discovered in Oracle Directory Manager(in unix is oidadmin), there actualy
column to expiry date.(the default is 60).
We follow this notes in metalink..
Note:176470.1 Subject: How To Pre-Expire Portal Passwords
Even though the note is for Portal30(release1), we just wangt to try it in our Release 2...
Extract from the note
"3. Set the value of the column LAST_PASSWD_CHANGE_TIME in the table WWSEC_PERSON$ in SSO schema to a value older than the password expiration period (default is 90 days) before the current time (e.g. sysdate - 100) for the appropriate user(s)
4. For example, if you have created a user called TEST
you would issue a command such as:
update wwsec_person$
set LAST_PASSWD_CHANGE_TIME =sysdate-70
where USER_NAME='TEST';
commit; "
But, when we try to login again in the portal, we can still login...
So, is the function still exist in Release 2?..
If not, why Oracle Portal throw that function away?
Why there still columns in WWSEC_PERSON$ that maybe linked to the password problem?
can anybody help/explain?
Thanks....Rather than rehash what has already been thoroughly discussed, check this thread. This should answer your question.
Can a user change his own password after admin has set it
The english version of Jose Troya's blog: http://obiee101.blogspot.com/2008/08/obiee-change-password.html
Edited by: LC143 on Aug 27, 2008 1:36 PM -
How To Block a User From Changing Total Field In AR Invoice
Hi all,
I would like to find out how to block a user from being able to change the total field at the bottom right hand side of the AR Invoice. Currently if a user creates an invoice and is still busy in that invoice they can adjust the total field which in turn will update the discount field as well.
Is this simply an authorization issue or am I going to have to do it in the transaction notification?
We are using SAP Business One PL 30 currently.Hi
Please review by note again -This is by system design .
I don't know why you are so worried abt this because by setting up discount max ,if user cannot post the document ,that means it is not in the system ,no matter they change multiple times in the fields .
But I think your scenario is different ,
You are copying with certain discount from Delivery to AR invoice and i think you don't want user to change the discount field , then you can solve your issue by using approval or sp_notification
If you really want it to be greyed out ,I think you might have to go through by SDK or Boyum addon.
Thank you
Bishal
Maybe you are looking for
-
Hi developers, I have one how to do question: In a tree I like to introduce a custom icon on each leaf. For this, I tried to introduce at the icon column sql #WORKSPACE_IMAGES#picture.gif but nothing happened, instead if I use #IMAGE_PREFIX#standard_
-
How can I group volume more than 30 disk on 6540
When I create RAID-1 profile and set number of disk to variable (Max 30 disk). Then create pool and found avaliable size only 1 TB. I need group all 94 disk drive (exclude 2 hot spare) for RAID 1+0. How can I expand number of disk.
-
Counter based maintenance Maintenance plan
Dear all, I Required help from all of you , I have made one no maintenaance plan with following details : Annual estimate 120000 Nos cycle lenth 10000 Nos schedule the plan 0 Nos and Plan date cal
-
I've just updated to OS X Lion. I cannot get gestures to work. I've looked in preferences and do not see an option to turn gestures on. What am I missing?
-
Hi Guys, Can any one please help me with a single SQL statement which can display all the dates of a month Ex: SELECT XXX FROM XXX WHERE MONTH = JUNE; SHOULD DISPLAY ALL THE DATES 01-JUN-2001 02-JUN-2001 30-JUN-2001 Thanks in anticipation r@m@