how to add condition to not execute code for given user - abap

I want to pass some abap code without executing according to sap user.
Here an example:
if userName is John Then
pass this code block without executing...
endif
Is it possible?
Is it possible to debug it so that when we add break <user_name>, the debug runs only for that user?

Yes you could if it is absolutely necessary . The system stores the user alias executing the program under the variable sy-uname and you can use this to do your condition check . But I wouldn't recommend this approach as it is not immediately visible why a certain block of code is being executed for some users and is bypassed for others. This would/should never pass a stringent quality check during code analysis .

Just for completeness, the technical solution would be:
IF sy-uname NE 'JOHN'.
* Code that is not executed for SAP user 'JOHN'
ENDIF.

Related

I am facing issue in jmeter

When I record and run the test in login transaction one request is failed.i check that request I found in post data session id keep on chenging.i did correlation for that Id .after I want to replace the variable name insted of that Id.but it not replace. Because that Id is not there any subsequent requests and any parameter value undre the requests.how I need to handle that Id how to replace it... please help me for the above issue
Note: I search that ID in view results tree it showing that Id passing in 3subsequent requests
Make sure that you really "did correlation for that Id", i.e.
Double check that the variable has the anticipated value using Debug Sampler and View Results Tree listener combination
Make sure that the placement of the Post-Processor performing the correlation is correct as according to JMeter Scoping Rules the Post-Processor is applied to:
One Samples only if it's placed as a child of this sampler
All the Samplers which reside at the same level (or lower) with the Post-Processor
so it might be the case you're overwriting the variable with the empty value somewhere else.

Catch Post Goods Issue event while outbound delivery processing

I am using the user exit USEREXIT_SAVE_DOCUMENT_PREPARE to check some positions in a delivery for some specific criteria.
I just want to do this whenever PGI is triggered. For this I use this condition in the user-exit:
IF ( sy-tcode EQ 'VL01N' OR
sy-tcode EQ 'VL02N' ) AND
sy-ucomm EQ 'WABU_T'.
But now I am afraid that this is not enough for cases like:
booking the exit directly from vl02n (without checking the positions)
book the exit via "Edit --> Post Good Issue"
editing the positions and book
Are there some further options which can be checked to make sure that there is a booking?
How can I make completely sure that a post of goods was triggered in fact?
You can try to utilize Workflow to cover all possible cases.
Create Workflow event which will be triggered upon delivery creation/change and check for Post Goods Issue there. Delivery BO is LIKP so go to tcode SWU_EWCD and enter data like this
Workflow events are based on change documents so every times smth is written to the table it will be fired. Check that your event is properly created in SWEC transaction.
You can also create events based on NACE conditions. After that use your event to generate your own workflow.
Also BAdI LE_SHP_DELIVERY_PROC may be of interest for you, it has method
SAVE_AND_PUBLISH_BEFORE_OUTPUT which is executed before saving of delivery.
You have to check value in T180-TRTYP. If value is 'H' then it is create booking otherwise it is change booking.It is better to remove transaction code and sy-ucomm condition and condition for T180-TRTYP.
regards,
Umar Abdullah

Dialog box appear

I'm using decode for my query but when every time I run my query, there's a two dialog box appeared and need to input some number in those dialog box before to see the result. What should I need to remove it?
Please help me.
Thank you.
Here's some of my query..
SELECT (CODE_SALESROOM) POS_ID
,DECODE(CODE_SALESROOM, '60001', 'ABM SYSTEM'
,'50001', 'Acenet Unlimited Business Computer'
,'40002', 'RL My Phone - Robinsons Galleria') AS POS_NAME
FROM OWNER_DWH.DC_SALESROOM
WHERE CODE_SALESROOM NOT IN ('XAP', 'XNA', '10001')
Sounds like you're being prompted for substitution variables, because part of your query has somethling like and col = 'AT&T' - the ampersand is interpreted as a variable by default, and you're prompted for a value for &T (or whataver your actual value is interpreted as).
You can add set define off to your script to stop it looking for, and prompting for, a value when that is not what you want.
(The links are for SQL*Plus documentation, but much of that applies to SQL Developer as well; the documentation for that is a bit sparser),

using Selenium: how to use output from one test as input to another test

I'm a Selenium n00b... it's clear how easy it is to run a test and verify a particular response, but how can I take a value from one response and use it in the next test?
an example might be a contact creation form...
type in name/email and click submit
response arrives with new ContactID
grab the ContactID that was returned and put it into "get" textbox and click "submit"
response arrives with contact details
verfy the name/email match the first set
how might I go about doing this in Selenium?
And now something completely different:
Now I understand when you say "test", you mean a single assertion within one test case. So you want to use a value returned from a request as input for another request in the same test case.
Assuming you use selenium ide: To do this, use one of the "store..." commands in selenium ide and store the value into a variable. The contactID can be found using a matching selector with the storeText command. For example:
command: storeText
target: selector for element containing contactId
value: contactId
Then, use variable substitution and the type command to insert that text somewhere else.
command: type
target: selector for target input box
value: ${contactId}
Hope this helps :)
(This answer is still correct I think if you interpret "test" as "test case". For another, totally different answer see below.)
You don't do this. Each test should be independent from all other tests. For your second test, just repeat the steps in the first test. This way, you can reproduce test success and failures in a reliable way.
If you have many tests which all start from a certain application state which requires many steps to reach, just write a private helper method to reach that state.
The alternative: All steps you describe can be put into a single test. There is no reason not to have several asserts in one test.

Logging Application Block-Microsoft Enterprise Library 4.1

In Logging Application Block in Logger.Write it takes event id as one of the parameter which is integer.So how to decide what should be passed as event id?
btw, do you really need to use the eventId? I think you can just pass the string you want to log:-
Logger.Write("SomeMessage");
EDIT :- I meant there should be another overload which takes just the string you want to write.
EDIT :- From here :-
EventId - a value you can use to
further categorise Log Entries
(defaults to 0 for a LogEntry and to 1
for a LogEntry implicitly created by
Logger.Write);
What we do is gather the different "stories" that you want to report on and then assign a sequence of event IDs to each of those stories. So in short, come up with a system that works for you and document it for future reference.