Can not use Global Variable in Event Structure
I am using LabVIEW 2009.
In my LabView project I have a Boolean Global variable called EStop. I can read and write the Global variable. If I double click on the Global variable, it takes me to EStop.vi which includes a Text Button. EStop.vi is part of my Project.
In one of my VIs, I have an Event Structure. If I go to one of the Event Handlers in that Event Structure and right click and then select Add Event Case, I get a list of possible events. But that list does not include EStop or an EStop events.
I want to Add an Event Case for EStop: Value Changed.
Why can't I Add events to an Event Case that include events on Global Variables like value changed?
How do I add EStop: value changed event to my Event Structure.
Solved!
Go to Solution.
dbaechtel wrote:
I have many events throughout the system that might need to cause the system to do an Emergency Stop action. So I want ro use a Global variable that is accessible from anywhere in the system. Any action or condition that occurs anywhere in the system can activate the emergency Stop condition by setting the boolean EStop Global variable to True. When the Global bolean variable goes true(value changed), I want to detect that event in an Event Structure and do the actions necessary to accomplish a system Emergency Stop.
Sorry, I am not familiar with your terminologies. What is your definition of a "system".
One big VI with many parallel loops?
Several VIs running in parallel?
LabVIEW Champion . Do more with less code and in less time .
Similar Messages
-
Can i use global variable in web forms
guys can any one tell me if i can use global variables when i am
deplying the forms on the web,.....
thank you
vas
nullGlobal variables work in their perfection even when you deploy
your forms on the WEB.
null -
Can I use a variable across events?
Hi there,
SDK newbe! I'm successfully parsing an GroupWise WebAccess event log.
At the beginning of each days log is a line with the server name and IP
address. Subsequent events only have the date/time and event message.
How can I capture the name and IP of the sever and then use it for
SourceIP and SourceHostName for all the other subsequent events?
if (this.s_RXBufferString.search(/^.*?IP Address: (\w+) \((.+)\)/) !=
-1) {
/^.*?IP Address: (\w+) \((.+)\)/.exec(this.s_RXBufferString);
var InitSrvr = RegExp.$1;
var InitSrvrIP = RegExp.$2;
this.evt = "Test_IP_Variable";
this.bm = this.s_RXBufferString;
this.sip = InitSrvrIP; //This does work
this.shn = InitSrvr; //This does work
this.sun = ("KirkWasHere " + InitSrvr);
instance.SEND_EVENT = true;
return true;
// give the following a try. $1-$3 are mm-dd-yy, $4-$6 are hh-mm-ss,
else if (this.s_RXBufferString.search(/(\d{2})-(\d{2})-(\d{2})
(\d{2})\d{2})\d{2}) (Login failed): (\S+)/) != -1) {
/(\d{2})-(\d{2})-(\d{2}) (\d{2})\d{2})\d{2}) (Login failed):
(\S+)/.exec(this.s_RXBufferString);
this.evt = RegExp.$7;
this.sun = RegExp.$8;
this.sip = InitSrvrIP; //This does not work?
this.shn = InitSrvr; //This does not work?
this.bm = this.s_RXBufferString;
this.sev = "3";
instance.SEND_EVENT = true;
return true;
kmaule
kmaule's Profile: https://forums.netiq.com/member.php?userid=306
View this thread: https://forums.netiq.com/showthread.php?t=46902kmaule,
First, ARGH! Why can't systems create audit data? Or if just logging
data, why can't they do something sensible like have a date in there like
everything else? *sigh*
Okay, I feel better now. I have not tried either of the following ideas,
but I want to share them so you can figure them out and hopefully post
back their feasibility. I'm hoping to have time to test this next week,
but who knows with how things have been lately... busy busy. Here are the
two ideas:
1. Collector development has the idea of a 'Session' object which is made
to span across two events. This is useful when you need to link two
original events to create one Sentinel events, such as with OES and
filesystem auditing; in that case the OES system sends three lines per
filesystem event and Sentinel must group them to create one Sentinel
event. Similarly, eDirectory object-create events are actually two events
(object create without object class, and add-value with the object class)
that become one in Sentinel (eDir auditing is just THAT lost-level...
crazy) and also LDAP events from eDir consist of the LDAP Request event
and the LDAP Response event. Session objects make this possible, but they
are meant to exist for a short period of time (I think usually one second
or so, though they have a customizable timeout as I recall) and are meant
to be created and then used when other conditions are satisfied. My hope
is hat you can abuse this functionality to store a variable between events
and then nuke the old session object when a new date comes through. More
on sessions:
http://www.novell.com/developer/plug..._sessions.html As I
read more about this I think it's not going to be as possible as I
thought. Hmmmm
2. Set a variable on the collector object somehow, and I mean in-memory,
not in the hard-coded plugin or something. I need to get the debugger
going to see how this could work, but the problem with your local
variables is that they're local variables, so they do not persist when the
current variable scope (the current function/method) returns to whatever
called it, so the next time something calls it then they are brand new
again. The logic needs to set these variables somewhere that will persist
(Session or collector object instance level) so that it can be retrieved
from there for each subsequent event.
Other dirty things I would not recommend, but which may work. I believe
you can get at dynamic list data in collectors. You could potentially
store the date there when it comes in and then retrieve it on subsequent
events.
Other dirty things... use the current date for everything. Pulling this
up in code should be trivial, but it implies that events come in on the
current date. That's probably a safe assumption 99.99% of the time, but
some events may come in wrong at the start of a new day, though you could
add logic to help with that too.
Ideally GW needs better logs, and more than that it needs a true auditing
interface of some kind.
Good luck.
On 02/21/2013 08:54 AM, kmaule wrote:
>
> Hi there,
>
> SDK newbe! I'm successfully parsing an GroupWise WebAccess event log.
> At the beginning of each days log is a line with the server name and IP
> address. Subsequent events only have the date/time and event message.
> How can I capture the name and IP of the sever and then use it for
> SourceIP and SourceHostName for all the other subsequent events?
>
> if (this.s_RXBufferString.search(/^.*?IP Address: (\w+) \((.+)\)/) !=
> -1) {
> /^.*?IP Address: (\w+) \((.+)\)/.exec(this.s_RXBufferString);
> var InitSrvr = RegExp.$1;
> var InitSrvrIP = RegExp.$2;
> this.evt = "Test_IP_Variable";
> this.bm = this.s_RXBufferString;
> this.sip = InitSrvrIP; //This does work
> this.shn = InitSrvr; //This does work
> this.sun = ("KirkWasHere " + InitSrvr);
> instance.SEND_EVENT = true;
> return true;
> }
>
> // give the following a try. $1-$3 are mm-dd-yy, $4-$6 are hh-mm-ss,
> else if (this.s_RXBufferString.search(/(\d{2})-(\d{2})-(\d{2})
> (\d{2})\d{2})\d{2}) (Login failed): (\S+)/) != -1) {
> /(\d{2})-(\d{2})-(\d{2}) (\d{2})\d{2})\d{2}) (Login failed):
> (\S+)/.exec(this.s_RXBufferString);
> this.evt = RegExp.$7;
> this.sun = RegExp.$8;
> this.sip = InitSrvrIP; //This does not work?
> this.shn = InitSrvr; //This does not work?
> this.bm = this.s_RXBufferString;
> this.sev = "3";
> instance.SEND_EVENT = true;
> return true;
>
> -
Can I use Ctlref in a event structure with a mouse up event?
I have a large number of controls on a front pannel. I'm using a event structure that triggers the motion of a given motor when the corresponding control is pressed. However, I would like to avoid creating N mostly identical events, so I was planning on using a mouse down event on the front pannel, then retrieve the control reference using the Ctlref node (with gives "Reference to the control on which the event occurred" according to labview manual) and scan a array of references to find out which motor is supposed to move. However, it seems that this node does not appear (contrary to what the manual says).
I have found other ways to do what I need (I was thinking of using an array containing the coordinates of my controls and the coords node of the event structure), but I wanted to know why I can not find that node (which appears for "value change" event for instance). I'm using Labview 2013.
Solved!
Go to Solution.Bad luck for you. Mouse down on panel does not have the control refnum as it is not operating on a control. Mouse down on a control does have it and since you can configure mouse down events on several controls in the same event case, it provides also a control refnum so that you can still operate on the control in question.
This is probably also the issue Jeff might have seen. When configuring multiple events for the same frame LabVIEW will only show the event terminal that are present in all of those events. Terminals that don't exist in at least one specific event of the multiple events for that frame are not selectable anymore.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
My iPhone 5s was bought with full price in the USA from Sprint, and I was told that it is a global phone. And I can use it in china.
But I can not use it in the USA, so could you mind help me to solve that problem.
I think someone of you must help me to solve this problem !
Details:
SN:F2*****FDR
<Edited by Host>See the response in your other thread:
https://discussions.apple.com/message/24641427#24641427 -
How can I define global variable in user exit whic I can use anywhere.
Hi all,
How can I define global variable( Table ) which I can use when it come back to same user exit where I defined and stored some data.
What I mean is I want to define 1 global table.
In user exit when it comes I store some information. and again when it will come I will have that stored information so I can use it.
Thanks a lot in advance.You can use EXPORT TO MEMORY ID and IMPORT FROM MEMORY ID Statement for this.
EXPORT T_ITAB FROM T_ITAB TO MEMORY ID 'ABC'.
IMPORT T_ITAB TO T_ITAB FROM MEMORY ID 'ABC.' -
My iPhone 5s was bought with full price in the USA from Sprint, and I was told that it is a global phone. And I can use it in china.
But I can not use it in the USA, so could you mind help me to solve that problem.
I think someone of you must help me to solve this problem !
Details:
<Edited by Host>xinyi93 wrote:
My iPhone 5s was bought with full price in the USA from Sprint, and I was told that it is a global phone. And I can use it in china.
But I can not use it in the USA, so could you mind help me to solve that problem.
Yes, the iPhone 5S is a global phone. However, Sprint will only unlock phones for use on GSM networks outside of the U.S. In the U.S., that phone can only be used on Sprint's network. -
Problem using local variable in event loop
I have a state machine from which I want to monitor various controls, including "Start" and "Stop" buttons. Not every state needs to monitor the controls. At present, most states run timed loops. In the first state that reads the front panel, I have an Event structure (inside a While loop) that monitors the various controls' Change Value events. For numeric controls, I update variables (in shift registers) as needed. The "Start" button is used to end the While loop controlling the Event structure, allowing the State to exit to the next state.
My problem comes in subsequent states that employ this same idea. Here, I put a Local Variable bound to the Start button and use the same code, but it frequently happens that when I enter this particular state, I cannot "turn on" the control -- I push the button, but it stays off. Curiously, if it was On when I enter, I can turn it off, but then I'm stuck not being able to turn it on.
I mocked up a very simply routine that illustrates this. There are two sequences (corresponding to the two states). Both use an Event loop with a local variable bound to my Stop button (really this is an LED control with custom colors). I've deliberately moved the "initialization" (the declaration of the control in the block diagram) out of the Event loops -- putting it inside the first loop modifies the behavior in another strange way.
Here's my thinking on how I would expect this to work: The code outside Event Loop 1 should have little effect. Assume the Stop button is initially Off. You will "sit" in Event Loop 1 until you push the Stop button, changing its value to True; this value will be passed out of the Event case and cause the first While loop to exit. You now enter the second sequence. As I understand the Exit tunnel, it defaults to "False", so I'd expect to stay in the second Event loop until I turn the Stop button from On to Off, which will pass out a False, and keep me in the While for one more button push. However, this doesn't happen -- I immediately exit, as though the "True" value of the Stop local variable is being seen and recognized by the Event loop (even though it hasn't changed, at least not in the context of this second loop).
An even more curious thing occurs if I start this routine with the Stop button turned on. Now I start in my Event loop waiting for a change, but this time the change will be from On to Off, which won't cause an exit from the frame. This will be reflected by having the While loop count increment. We should now be in the state of the example above, i.e. in an Event loop waiting for the control to be pushed again, and turned On. However, clicking the control has no effect -- I cannot get it to "turn on".
Where am I going astray in my thinking? What is it about this method of doing things that violates the Labview paradigm? As far as I can tell, what I'm doing is "legal", and I don't see the flaw in my reasoning, above (of course not -- otherwise I'd have fixed it myself!). Note that because I'm using local variables inside Event loops (and I'm doing this because there are two places in my code where I want to do such testing), the Stop control is not latching (as required). Is there something that gets triggered/set when one reads a latched control? Do I need to do this "manually" using my local variable?
I'll try to attach the simple VI that illustrates this behavior.
Bob Schor
Attachments:
Simple Stop Conundrum.vi 14 KBaltenbach wrote:
Ravens Fan wrote:
NEVER have multiple event structures that share the same events.
Actually, that's OK. NOT OK is having multiple event structures in the same sequence structure.
See also: http://forums.ni.com/ni/board/message?board.id=170&message.id=278981#M278981
That's interesting. I had always thought I read more messages discouraging such a thing rather than saying it was okay. Your link lead me to another thread with this message. http://forums.ni.com/ni/board/message?board.id=170&message.id=245793#M245793. Now that thread was mainly concentrating on registered user events which would be a different, but related animal.
So if you have 2 event structures they each have their own event queue? So if you have a common event, one structure pulls it off its event queue and it does not affect the other structure's event queue? I guess the inherent problem with this particular VI was that the second event structure locked the front panel. Since the code never got to that 2nd event structure because the first loop never stopped because the change was from true to false. After reading your post and the others, I did some experimentation and turned off the Lock front panel on the 2nd structure, and that prevented the lockup of the program.
Overall, the example VI still shows problems with the architecture and I think your answer should put the original poster on the right track. I think as a rule I would probably never put the same event in multiple structures, I feel there are better ways to communicate the same event between different parts of a program, but I learned something by reading your reply and about how the event structures work in the background. Thanks. -
How can I access global variables in a loaded Applescript?
How can I access global variables in a loaded script, in Xcode, ApplescriptObjC? Basically, I have a global variable defined in my parent script using "property", and I need to modify objects connected to those variables inside of a loaded script.
Example:
Parent script:
script AppDelegate
property myTextField : missing value
//linked to a text field object
tell myScript to myAwesomeHandler_()
end script
Loaded script:
on myAwesomeHandler_()
myTextField's setStringValue_("The new Xcode is so glitchy ugh")
//changes value of linked text field of parent script
end myAwesomeHandler_
The problem is, the variable is undefined in the Loaded script, and I need it to have the same value as the parent script, and I don't want to pass the variable through the Handler. Any ideas?I think want you are looking to do will need to be done in two steps. Because myTextField needs to be a property for the ObjectiveC part of the code you cannot turn it into a global.
However if you make a temporary variable global assign the string to it in the handler then set myTextField off of it.
global myTextFieldGlobal
script AppDelegate
property myTextField : missing value
//linked to a text field object
tell myScript to myAwesomeHandler_()
myTextField's setStringValue_(myTextFieldGlobal)
end script
on myAwesomeHandler_()
set myTextFieldGlobal to "The new Xcode is so glitchy ugh"
//changes value of linked text field of parent script
end myAwesomeHandler_
I know you stated you did not want the handler to return a value but I have to ask why? Global's, imo, are not a good idea and really should be used as a last resort.
One other possibility is to pass a reference to the property to the handler. Not sure if that works in AS of if that would satisfy our requirement of not passing the variable through the handler
<edit>
Another though have you tried to define the property outside the script? That is
property myTextField : missing value
script AppDelegate
Not sure if that will work.
You might also want to have a look at Scope of Properties and Variables Declared in a Script Object -
Using Global variable in Record Group
Hi,
I have a requirement where in I need to pull a column name from a table and then use that value in the select statement of a record group. I have tried using global variables but it is not working. Here is the record group I would like to use.
RG_DOMAIN is based on LOV_DOMAIN
SELECT :GLOBAL.DOMAIN_COLUMN_NAME, DESCRIPTION FROM
DM_T_DOMAIN_VALUES
WHERE DOMAIN_NAME := BLOCK.ATTRIBUTE;
In the Key-Listval I have a select statement in which does this :
SELECT DOMAIN_COLUMN
INTO :GLOBAL.DOMAIN_COLUMN_NAME
FROM DM_T_DOMAIN_RULES WHERE DOMAIN_NAME = :BLOCK.ATTRIBUTE;
SHOW_LOV('LOV_DOMAIN');
The problem is I am not getting the value I am just getting the Domain_column name. For example for Domain_name 'CALC_TYP' the Domain_column is COLUMN_10 and I just see COLUMN_10 my LOV when I want to see the value of COLUMN_10 from the DM_T_DOMAIN_VALUES table.
I tried using Name_in and Copy but not working. Can anyone suggest a solution?
ThanksFrancois ,
I tried this but I am getting error saying record group does not exist. Can you tell me what should I go in Populate_group... and show_lov..maybe I am doing something wrong?
Declare
LC$Req Varchar2(512) ;
Begin
LC$Req := 'SELECT ' || :GLOBAL.DOMAIN_COLUMN_NAME || ' FROM ....' ;
Create_Group_From_Query( rg_group, LC$Req ) ;
Populate_group(RG_DOMAIN); ?? --- is this correct?
Show_Lov(LOV_DOMAIN) ; -- and is this correct?
End; -
Why can not catch the standard BACK event in ALV's USER_COMMAND event,
Hi expert, why i can not catch the standard BACK event in ALV's USER_COMMAND event,
Code:
DATA G_CON_UC_FORM TYPE SLIS_FORMNAME VALUE 'F_USER_COMMAND',
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = G_CON_FORM
I_CALLBACK_USER_COMMAND = G_CON_UC_FORM
IT_FIELDCAT = G_TAB_FIELDCAT
IT_SORT = G_TAB_SORT_INF
I_SAVE = G_CON_U
*<<<Liang
IT_EVENTS = G_TAB_ALV_EVENTS
*<<<Liang
TABLES
T_OUTTAB = G_TAB_OUTPUT_DATA
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
*& Form F_USER_COMMAND
ALV USER COMMAND processing
FORM F_USER_COMMAND .
IF SY-UCOMM = '&FO3'.
LEAVE TO SCREEN 0.
ENDIF.
ENDFORM. " F_USER_COMMAND
When I set breakpoint on this subrouting ,and try to click stardard BACK or CANCEL button, the callback form do not run, but if double click one of line of alv report, the callback form works well,
so why??hi
good
check this report and change your code accordingly.
THESE LINES ARE FOR THE MAIN PROGRAM ***
SAP V40B ***
REPORT Z_PICK_LIST .
TABLES: RESB.
SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-BL1.
SELECT-OPTIONS: S_WERKS FOR RESB-WERKS," Plant
S_AUFNR FOR RESB-AUFNR," Order number
S_BDTER FOR RESB-BDTER." Req. date
SELECTION-SCREEN END OF BLOCK BL1.
PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT DEFAULT '/STANDARD'.
DATA: BEGIN OF OUT OCCURS 10,
AUFNR LIKE RESB-AUFNR, " Order number
MATNR LIKE RESB-MATNR, " Material
BDMNG LIKE RESB-BDMNG, " Requirements in UM
MEINS LIKE RESB-MEINS, " Unit of Measure (UM)
ERFMG LIKE RESB-ERFMG, " Requirements in UE
ERFME LIKE RESB-ERFME, " Unit of Entry (UE)
MAKTX LIKE MAKT-MAKTX, " Mat. description
END OF OUT.
INCLUDE Z_ALV_VARIABLES.
INITIALIZATION.
REPNAME = SY-REPID.
PERFORM INITIALIZE_FIELDCAT USING FIELDTAB[].
PERFORM BUILD_EVENTTAB USING EVENTS[].
PERFORM BUILD_COMMENT USING HEADING[].
PERFORM INITIALIZE_VARIANT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
PERFORM F4_FOR_VARIANT.
AT SELECTION-SCREEN.
PERFORM PAI_OF_SELECTION_SCREEN.
START-OF-SELECTION.
PERFORM GET_ORDERS.
PERFORM GET_MATERIAL_DESCRIPTION.
END-OF-SELECTION.
PERFORM BUILD_LAYOUT USING LAYOUT.
PERFORM BUILD_PRINT USING PRINTS.
PERFORM WRITE_USING_ALV.
FORM INITIALIZE_FIELDCAT *
--> P_TAB *
FORM INITIALIZE_FIELDCAT USING P_TAB TYPE SLIS_T_FIELDCAT_ALV.
DATA: CAT TYPE SLIS_FIELDCAT_ALV.
CLEAR CAT.
ENDFORM. " INITIALIZE_FIELDCAT
*& Form GET_ORDERS
text
FORM GET_ORDERS.
SELECT AUFNR MATNR BDMNG MEINS ERFMG ERFME
FROM RESB
APPENDING TABLE OUT
WHERE XLOEK EQ SPACE " deletion indicator
AND XWAOK EQ 'X' " goods movement indicator
AND WERKS IN S_WERKS " plant
AND BDTER IN S_BDTER " req. date
AND AUFNR IN S_AUFNR. " pr. order
ENDFORM. " GET_ORDERS
*& Form GET_MATERIAL_DESCRIPTION
text
FORM GET_MATERIAL_DESCRIPTION.
SORT OUT BY MATNR.
LOOP AT OUT.
SELECT SINGLE MAKTX
INTO OUT-MAKTX
FROM MAKT
WHERE MATNR EQ OUT-MATNR
AND SPRAS EQ 'EN'.
MODIFY OUT.
ENDLOOP.
SORT OUT BY AUFNR MATNR.
ENDFORM. " GET_MATERIAL_DESCRIPTION
FORM TOP_OF_PAGE *
FORM TOP_OF_PAGE.
DATA: L_POS TYPE P.
first line
WRITE:/ TEXT-001. " Plant:
IF S_WERKS-HIGH NE SPACE.
WRITE: S_WERKS-LOW, TEXT-TO1, S_WERKS-HIGH.
ELSEIF S_WERKS-LOW NE SPACE.
LOOP AT S_WERKS.
WRITE: S_WERKS-LOW.
ENDLOOP.
ELSEIF S_WERKS-LOW EQ SPACE.
WRITE: TEXT-ALL.
ENDIF.
L_POS = ( SY-LINSZ DIV 2 ) - ( STRLEN( TEXT-TIT ) DIV 2 ).
POSITION L_POS. WRITE: TEXT-TIT.
L_POS = SY-LINSZ - 20.
POSITION L_POS. WRITE: TEXT-011, SY-UNAME RIGHT-JUSTIFIED. " User:
second line
WRITE:/ TEXT-002. " Order:
IF S_AUFNR-HIGH NE SPACE.
WRITE: S_AUFNR-LOW, TEXT-TO1, S_AUFNR-HIGH.
ELSEIF S_AUFNR-LOW NE SPACE.
LOOP AT S_AUFNR.
WRITE: S_AUFNR-LOW.
ENDLOOP.
ELSEIF S_AUFNR-LOW EQ SPACE.
WRITE: TEXT-ALL.
ENDIF.
L_POS = SY-LINSZ - 20.
POSITION L_POS. WRITE: TEXT-012,SY-DATUM. " Date:
third line
WRITE:/ TEXT-003. " Req. Date:
IF S_BDTER-HIGH(1) NE '0'.
WRITE: S_BDTER-LOW, TEXT-TO1, S_BDTER-HIGH.
ELSEIF S_BDTER-LOW(1) NE '0'.
LOOP AT S_BDTER.
WRITE: S_BDTER-LOW.
ENDLOOP.
ELSEIF S_BDTER-LOW(1) EQ '0'.
WRITE: TEXT-ALL.
ENDIF.
L_POS = SY-LINSZ - 20.
POSITION L_POS. WRITE: TEXT-013, SY-PAGNO. " Page:
ENDFORM. " TOP_OF_PAGE
FORM END_OF_LIST *
FORM END_OF_LIST.
DATA: L_POS TYPE P.
ULINE.
WRITE:/ '|', TEXT-021. " Delivered by:
L_POS = SY-LINSZ DIV 2.
POSITION L_POS. WRITE: '|', TEXT-031. " Received by:
L_POS = SY-LINSZ.
POSITION L_POS. WRITE: '|'.
WRITE:/ '|'.
L_POS = SY-LINSZ DIV 2.
POSITION L_POS. WRITE: '|'.
L_POS = SY-LINSZ.
POSITION L_POS. WRITE: '|'.
ULINE.
WRITE:/ '|', TEXT-012. " Date:
L_POS = SY-LINSZ DIV 2.
POSITION L_POS. WRITE: '|', TEXT-012. " Date:
L_POS = SY-LINSZ.
POSITION L_POS. WRITE: '|'.
WRITE:/ '|'.
L_POS = SY-LINSZ DIV 2.
POSITION L_POS. WRITE: '|'.
L_POS = SY-LINSZ.
POSITION L_POS. WRITE: '|'.
ULINE.
ENDFORM. " END_OF_LIST
*& Form WRITE_USING_ALV
text
FORM WRITE_USING_ALV.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = REPNAME
I_INTERNAL_TABNAME = 'OUT'
I_INCLNAME = REPNAME
CHANGING
CT_FIELDCAT = FIELDTAB.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_FIELDCATALOG_MERGE'.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPNAME
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
I_STRUCTURE_NAME = 'OUT'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELDTAB
I_DEFAULT = 'A'
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_EVENTS = EVENTS[]
IS_PRINT = PRINTS
TABLES
T_OUTTAB = OUT.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_LIST_DISPLAY'.
ENDIF.
ENDFORM. " WRITE_USING_ALV
THESE LINES ARE FOR THE INCLUDE ***
***INCLUDE Z_ALV_VARIABLES .
TYPE-POOLS: SLIS.
DATA: FIELDTAB TYPE SLIS_T_FIELDCAT_ALV,
HEADING TYPE SLIS_T_LISTHEADER,
LAYOUT TYPE SLIS_LAYOUT_ALV,
EVENTS TYPE SLIS_T_EVENT,
REPNAME LIKE SY-REPID,
F2CODE LIKE SY-UCOMM VALUE '&ETA',
PRINTS TYPE SLIS_PRINT_ALV,
TITLE(40) TYPE C,
G_SAVE(1) TYPE C,
G_EXIT(1) TYPE C,
G_VARIANT LIKE DISVARIANT,
GX_VARIANT LIKE DISVARIANT.
CONSTANTS: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE',
FORMNAME_END_OF_LIST TYPE SLIS_FORMNAME VALUE 'END_OF_LIST',
FORMNAME_BEFORE_LINE TYPE SLIS_FORMNAME VALUE 'BEFORE_LINE',
FORMNAME_AFTER_LINE TYPE SLIS_FORMNAME VALUE 'AFTER_LINE'.
FORM MAIN_STATEMENTS *
THIS IS THE CODE THAT MUST BE INSERTED IN THE MAIN PROGRAM
FORM MAIN_STATEMENTS.
Declare the parameter P_VARI wherever you want it. If you don't
want it, hide it with NO-DISPLAY, but it must exist.
parameters: p_vari like disvariant-variant. " ALV Variant
You have to add the following line after the data and parameter
declaration:
include z_alv_variables.
Then, after the data/parameter declaration, add these lines:
*initialization.
repname = sy-repid.
perform initialize_fieldcat using fieldtab[].
perform build_eventtab using events[].
perform build_comment using heading[].
perform initialize_variant.
If you are using the variable P_VARI (ALV Variant), also add this:
*at selection-screen on value-request for p_vari.
perform f4_for_variant.
*at selection-screen.
perform pai_of_selection_screen.
After the "END-OF-SELECTION" statement, add these lines:
perform build_layout using layout.
perform build_print using prints.
perform write_using_alv.
You also have to create the following forms: (you can find samples
in this program)
INITIALIZE_FIELDCAT
USER_COMMAND (only if you are creating a STATUS)
WRITE_USING_ALV
ENDFORM.
*& Form INITIALIZE_FIELDCAT_SAMPLE
THIS IS A SAMPLE, DO NOT USE THIS FORM IN YOUR PROGRAM
-->P_FIELDTAB[] text *
FORM INITIALIZE_FIELDCAT_SAMPLE USING P_TAB TYPE SLIS_T_FIELDCAT_ALV.
DATA: CAT TYPE SLIS_FIELDCAT_ALV.
CLEAR CAT. " Always clear before use
CAT-TABNAME = 'I'. " Your internal table
CAT-REF_TABNAME = 'ZCUSTMAS'. " The data dictionary reference table
CAT-FIELDNAME = 'KUNNR'. " Name of your field in the itable.
CAT-COL_POS = 1. " Output position
APPEND CAT TO P_TAB.
CAT-FIELDNAME = 'NAME1'. " Next field
CAT-COL_POS = 2.
APPEND CAT TO P_TAB.
CAT-FIELDNAME = 'STRAS'. " and the next
CAT-COL_POS = 3.
APPEND CAT TO P_TAB.
CAT-FIELDNAME = 'LOEVM'.
CAT-SELTEXT_S = 'Del'. " You can always override the descrip-
CAT-SELTEXT_M = 'Delivery'. " tion (short, medium, large)
CAT-SELTEXT_L = 'Delivery Num'.
CAT-COL_POS = 4.
APPEND CAT TO P_TAB.
CAT-FIELDNAME = 'FKIMG'.
CAT-DO_SUM = 'X'. " You want totals calculated.
CAT-NO_OUT = 'X'. " and hidden.
APPEND CAT TO P_TAB.
ENDFORM. " INITIALIZE_FIELDCAT
*& Form BUILD_EVENTTAB
THIS IS THE SAME FOR ALL THE PROGRAMS
-->P_EVENTS[] text *
FORM BUILD_EVENTTAB USING P_EVENTS TYPE SLIS_T_EVENT.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = P_EVENTS.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
CLEAR LS_EVENT.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_END_OF_LIST
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_END_OF_LIST TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
CLEAR LS_EVENT.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_BEFORE_LINE_OUTPUT
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_BEFORE_LINE TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
CLEAR LS_EVENT.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_AFTER_LINE_OUTPUT
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_AFTER_LINE TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
CLEAR LS_EVENT.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
ENDFORM. " BUILD_EVENTTAB
*& Form BUILD_COMMENT
NOT REALLY NEEDED, BUT I'LL LEAVE IT THERE, JUST IN CASE...
-->P_HEADING[] text *
FORM BUILD_COMMENT USING P_HEADING TYPE SLIS_T_LISTHEADER.
DATA: HLINE TYPE SLIS_LISTHEADER,
TEXT(60) TYPE C,
SEP(20) TYPE C.
CLEAR: HLINE, TEXT.
HLINE-TYP = 'H'.
write: text-101 to text+23.
HLINE-INFO = TEXT.
APPEND HLINE TO P_HEADING.
ENDFORM. " BUILD_COMMENT
*& Form INITIALIZE_VARIANT
VERY IMPORTANT WHEN YOU USE VARIANTS!!!
FORM INITIALIZE_VARIANT.
G_SAVE = 'A'.
CLEAR G_VARIANT.
G_VARIANT-REPORT = REPNAME.
GX_VARIANT = G_VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = G_SAVE
CHANGING
CS_VARIANT = GX_VARIANT
EXCEPTIONS
NOT_FOUND = 2.
IF SY-SUBRC = 0.
P_VARI = GX_VARIANT-VARIANT.
ENDIF.
ENDFORM. " INITIALIZE_VARIANT
*& Form PAI_OF_SELECTION_SCREEN
ALSO FOR VARIANTS
FORM PAI_OF_SELECTION_SCREEN.
IF NOT P_VARI IS INITIAL.
MOVE G_VARIANT TO GX_VARIANT.
MOVE P_VARI TO GX_VARIANT-VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
I_SAVE = G_SAVE
CHANGING
CS_VARIANT = GX_VARIANT
EXCEPTIONS
WRONG_INPUT = 1
NOT_FOUND = 2
PROGRAM_ERROR = 3.
IF SY-SUBRC EQ 0.
G_VARIANT = GX_VARIANT.
ELSE.
PERFORM INITIALIZE_VARIANT.
ENDIF.
ELSE.
PERFORM INITIALIZE_VARIANT.
ENDIF.
ENDFORM. " PAI_OF_SELECTION_SCREEN
*& Form F4_FOR_VARIANT
text
FORM F4_FOR_VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
IS_VARIANT = G_VARIANT
I_SAVE = G_SAVE
IMPORTING
E_EXIT = G_EXIT
ES_VARIANT = GX_VARIANT
EXCEPTIONS
NOT_FOUND = 2.
IF SY-SUBRC = 2.
MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
IF G_EXIT = SPACE.
P_VARI = GX_VARIANT-VARIANT.
ENDIF.
ENDIF.
ENDFORM. " F4_FOR_VARIANT
*& Form BUILD_LAYOUT
STANDARD LAYOUT
-->P_LAYOUT text *
FORM BUILD_LAYOUT USING P_LAYOUT TYPE SLIS_LAYOUT_ALV.
P_LAYOUT-F2CODE = F2CODE.
P_LAYOUT-ZEBRA = 'X'.
p_layout-detail_popup = 'X'.
P_LAYOUT-TOTALS_TEXT = SPACE.
P_LAYOUT-SUBTOTALS_TEXT = SPACE.
ENDFORM. " BUILD_LAYOUT
FORM BUILD_PRINT *
STANDARD PRINT OPTIONS *
--> P_PRINT *
FORM BUILD_PRINT USING P_PRINT TYPE SLIS_PRINT_ALV.
P_PRINT-NO_PRINT_LISTINFOS = 'X'.
P_PRINT-NO_PRINT_SELINFOS = ' '.
ENDFORM. " BUILD_PRINT
FORM PF_STATUS_SET *
NAME YOUR STATUS ALV. IF YOU NEED IT.. *
FORM PF_STATUS_SET USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ALV' EXCLUDING EXTAB.
ENDFORM. " PF_STATUS_SET
FORM USER_COMMAND_SAMPLE *
--> UCOMM *
--> SELFIELD *
FORM USER_COMMAND_SAMPLE USING UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
CASE UCOMM.
WHEN 'MSXL'. " Export to Excel
perform set_excel_export.
CLEAR UCOMM.
WHEN 'MM03'.
set parameter id 'MAT' field selfield-value.
call transaction 'MM03' and skip first screen.
CLEAR UCOMM.
WHEN 'BGR1'.
perform fill_available.
perform graph_available.
CLEAR UCOMM.
WHEN 'DOCU'.
call function 'Z_HELP' exporting repname = repname.
ENDCASE.
ENDFORM. " USER_COMMAND
*& Form WRITE_USING_ALV_SAMPLE
*THIS IS A SAMPLE AND MUST BE WRITTEN DIRECTLY IN THE MAIN PROGRAM
FORM WRITE_USING_ALV_SAMPLE.
YOU CAN MERGE WITH A DATA DICTIONARY TABLE USING THIS:
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = repname
i_internal_tabname = 'I'
i_inclname = repname
changing
ct_fieldcat = fieldtab.
if sy-subrc <> 0.
write: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_FIELDCATALOG_MERGE'.
endif.
OR JUST DISPLAY IT USING THIS:
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = repname
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'I'
is_layout = layout
it_fieldcat = fieldtab
i_default = 'A'
i_save = g_save
is_variant = g_variant
it_events = events[]
is_print = prints
tables
t_outtab = i.
if sy-subrc <> 0.
write: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_LIST_DISPLAY'.
endif.
ENDFORM. " WRITE_USING_ALV
thanks
mrutyun^ -
Can we use Substitution variables in MAXL?
Hi,
Can we use substitution variables in MAXL script?
I have to run this MAXL command for clearing a slice of ASO cube on V11.1.1.3.
alter database Apname.DBname clear data in region 'CrossJoin({[2009]},{[Dec]})';
I am planning to use Current_year & Current_month variables instead of hardcoding 2009 & Dec as I have to use this everymonth to clear the current months data.
If it is allowed, what is the syntax?
Is there any alternative apart from substitution variables?
Appreciate your thoughts.
Thanks,
-Ethan.You would just use ampersand and the variable name instead of the hard coding e.g. &yearVar &periodVar.
Not tried it on aso clears but in theory it should work as ...'CrossJoin({&yearVar},{&periodVar})';
just change yearVar and periodVar for your substitution variable names.
Cheers
John
http://john-goodwin.blogspot.com/ -
Please help
I run a PA company (Big sound systems) and at events i play music through the system using my ipad or iphone. this has never been a problem until recently. since i updated my OS on my iphone4 and ipad2 i open itunes like normal, select a song and it tells me i can not play the song because it is on my cloud and i am not connected to the internet. as far as i know i never took my music off my phone or ipad and when i plug them in it even tells me space is being taken up on my phone from all the audio stored on it, yet i can not play a single track without connecting to the internet through wifi.
if i had internet everywhere there wouldn't be a problem but thats just not possible. some of the event i do are in the middle of no where and i cant be without my music. Also i can not use my phone like a personal music player like anyone else would just walking around with earphones because as soon as i go out of wifi range i can not play anything from itunes.
why did it have to change in the first place,
please help.does that mean I can not buy a movie or tv show from itunes and watch it on my car tv through my iphone? Does that also mean I can not watch any video even the ones I take via the iphone camera? That makes no sense, f that is true what is the rational? And how come it works from the IPOD?
-
I pay 25 euros for three moit for illustrator but I can not use it. I try to cancel my subscription, but it's impossible because it is written that I have not paid subscription! Yet adobe takes me 25 euro per month!
Delphine,
I believe this is one for a chat,
Creative Cloud support (all Creative Cloud customer service issues, chat open between 5AM and 7PM PST/PDT on workdays)
http://helpx.adobe.com/x-productkb/global/service-ccm.html
or for Adobe phone Support,
http://helpx.adobe.com/adobe-connect/adobe-connect-phone-numbers.html -
Using Global Variables in Data Quality Address Cleanse Transforms
I am currently developing in Data Services 12.2.
I am trying to dynamically populate the List Owner information in the option tabs of the USA Regulatory Address Cleanse by using global variables. It populates the 3553 with the variable name instead of the value assigned.
According to the Technical Manual, it is possible to use global variables in Data Quality Address Cleanse transforms:
However, you can use substitution parameters in all places where global variables are supported, for example:
Query transform WHERE clauses
Mappings
SQL transform SQL statement identifiers
Flat-file options
User-defined transforms
Address cleanse transform options
Matching thresholds
Does anyone know if it is possible to use global variables in the option tab of the Address Cleanse; if so, can you describe how it is done?
Thanks in advance,
RickHi,
U can refer to the following links in help.sap.com
GlobalContainer Object
http://help.sap.com/saphelp_nw04/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/content.htm
Container Object
http://help.sap.com/saphelp_nw04/helpdata/en/78/b4ea10263c404599ec6edabf59aa6c/content.htm
Also some of the RUN TIME CONSTANTS are available in your BPM. So if you are trying to retrieve those variables in your Mapping(that is used in BPM), also read the following thread.
Re: Message id in BPM
Cheers,
Siva Maranani.
Maybe you are looking for
-
Error in installing Workbench 8.2. Trial..
Trying to install the Lifecycle ES trial....Followed the recommendation to install Acrobat 9 Pro extended first... this worked... Installing the Workbench produces the following error. This is after putting in the serial number...and the installer ha
-
Pi71,Error while creating processcompoent model in folder
Hi Friends, we are creating folders under modelling.once the folder is created we are trying to create Process component models under this folder.Its throwing an Access error. " write access needed to complete this operation".Do we need to edit any r
-
Once you create a printable form in Acrobat Pro 9, how do you add a submit button?
I have created printable PDF forms, but don't know how to add a submit button so they can be filled out and emailed. Currently if the people filling them out only have Reader they can only be printed out. They cannot be saved, and they cannot be emai
-
LR 2.7, How to Edit Copyright Metadata at Export?
Attempted to edit metadata but my changes aren't saved...that's one issue. So, I created a new metadata preset can't quite figure out how to select the new preset at export; I'm unable to change the metadata preset to the new one at export screen. C
-
Problems with sysex midi dumps (Jomox Xbase 888 Logic Pro 8)
Hello, I am trying to record sysex midi dumps FROM (Jomox Xbase888) TO Logic Pro 8 but I can't get the two devices to communicate. Can somebody help out? Many thanks. Seb