Use of global variables like g_cnt_transactions_transferred in the LSMW

Hi SapAll.
when i had a look at the some of the LSMW's whic use IDOC as the object of uploading data into SAP from external Files i have found in the coding under the step "Maintain Field Mapping and Conversion Rules" that they use some of the global variables like below
.if p_trfcpt = yes or sy-saprl >= '46A'.
  EDI_DC40-DOCNUM = g_cnt_transactions_transferred + 1.
endif.
.EDI_DC40-CIMTYP = g_cimtyp.
.EDI_DC40-MESTYP = g_mestyp.
.EDI_DC40-MESCOD = g_mescod.
.if p_filept = yes.
  EDI_DC40-SNDPOR = g_fileport.
elseif p_trfcpt = yes.
  EDI_DC40-SNDPOR = g_trfcport.
endif.
my doubt is where i can find these variables 'g_cnt_transactions_transferred ','g_cimtyp','g_mescod','g_fileport','g_trfcport' in the LSMW and what is the use of the variable  'g_cnt_transactions_transferred ' in the LSMW.
I have treid to find out the above listed variables looking in step 'Maintain Field Mapping and Conversion Rules' under global variabels list and the other lists also but i couldnt found.
can any one help me in this ?
regards.
Seetha.

Hi Seetha,
           In the LSMW Workbench go to the option user menu.  And check the option display conversion program.
Now when you execute with the radio button on dislplay conversion program, you ll see the code that got generated in the background while you built your LSMW.
The global variables that you have mentioned are bound to be there in this program generated in the background..
You can put a break point here and see for yourself what the value of these global variables are at runtime.
File port, TRFC port , no. of transactions executed by one run of the LMSW Idoc program , message type are some of the fields that you have asked for .
Regards,
Arun

Similar Messages

  • What is the difference between using a global variable,passing a valuee and using a reference?

    I have created a project that consists of several VIs.  Only the main VI has a front panel and the others perform functions.  The function VIs are dependent on controls on the main VI's front panel.  I have several ways of passing the value of the controls.  One is to use a global variable and just place it on the dependent VIs.  Another option is to strictly connect the terminal from the control to a VI connector block and pass the value directly.  My last option is to create a reference of the control and reference it inside the dependent VIs, but this would also require connections to be made to the VI block.
    What are the advantages/disadvantages of these options?
    -Stephen

    5thGen wrote:
    I have created a project that consists of several VIs.  Only the main VI has a front panel and the others perform functions.  The function VIs are dependent on controls on the main VI's front panel.  I have several ways of passing the value of the controls. 
    1) One is to use a global variable and just place it on the dependent VIs.
    2) Another option is to strictly connect the terminal from the control to a VI connector block and pass the value directly. 
    3) My last option is to create a reference of the control and reference it inside the dependent VIs, but this would also require connections to be made to the VI block.
    What are the advantages/disadvantages of these options?
    -Stephen
    1) Globals are evil and introduce race conditions.
    2) The sub-VI only get the value when it was called and updates that occur while the sub-VI is runing are not sensed by the sub-VI
    3) This uses property node "value" or "value signaling" both of which run the user interface thread which is single-threaded and you incur a thread swap hit to performance. You also have a potential for race conditions.
    The are various methods for sharing dat to/from sub-VI which include Queues and Action Engines.
    I hope that hleps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to Set and Use a global variable within a session?

    Dear All,
    I'm new to jsp, and would like to ask how to set and use a global variable within a session?
    Thanks in advance.
    Regards,
    Cecil

    With session.setAttribute("name",object) you can store a Attribute in the session object.
    with session.getAttribute("name") you can get it.
    That's it.
    Regards,
    Geri

  • How to use a global variable for reading a query resultset in JDBC lookup?

    Hi Friends,
    Using JDBC lookup, I am trying to read from a table Emp1 using a user defined function. In PI 7.0, this function returns values of a single column only even if you fire a " Select * " query. I am planning to use a global variable(array) that stores individual column values of the records returned by a "select *" query. Need pointers on as to how a global variable can be declared and used to acheive the above scenario. Kindly explain with an example. Any help would be appreciated.
    Thanks,
    Amit.

    Hi Amit,
    Sounds like a good idea but then you would need an external db and update the table in a thread safe way !.
    Regarding your question as to how to work with global variable please refer https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1352. [original link is broken] [original link is broken] [original link is broken]
    Rgds
    joel

  • How to declare global variables using another global variable in ODI

    I am declaring a gloabal variable using another global variable.
    say for example:
    I have a global variable empid.
    I am decalaring another global variable empname in refreshing tab of global variables and the select statment is
    select empname from emp where empno = #GLOBAL.empid -------if i write like this i am getting error as invalid character.
    select empname from emp where empno = '#GLOBAL.empid'-------if i write like this i am getting error as invalid number.
    I have kept the datatype as numeric and action as non persistent
    Please help
    Thank you in advance.

    Hi,
    You cant test/refresh empname standalone.
    You need to create a new package drag and drop both variables and make them as refresh variable and execute that package and test.
    Flow,
    empid----> empname
    Thanks,
    Guru

  • Using functional global variables to transfer data between touch screen device and other targets

    Hi,
    We are currently developing a control system that will operate on a cRIO with a touch screen interface. During development we have been using functional global variables (FGVs) to handle most of the settings/data etc, however we have just realised that we may have an issue updating the data on the touch screen, and vice versa.
    Previously we have implemented similar programs using shared variables, however we were wondering if there is anyway to implement FGVs in a similar manner, whether it'd be a combination of FGVs and shared variables.
    Regards,
    Mike
    Software version: Labview 8.2.1

    See this thread on LAVA about sharing FGV's across projects. THis should be extendable to cross paltforms (I believe).
    You also may want to concider an upgrade to LV 8.5.1. We have found a number of performance related issues with LV 8.2.1 and RT.
    If you decide not to upgrade, just remeber what I wrote (above) when you have reason to question the performance.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How can I programmatically create and use a global variable?

    I have an app where the number of AI DAQmx tasks I create are specified in a config file.  I have a monitor task that periodically looks at the latest values from all DAQ tasks.  I've been doing this with a set of global variables because it was the simplest way to do it.  But to do this, I have to explicitly create a separate AI task that uses the hard-coded global variable name for the DAQmx samples.  I would prefer to only write one VI for the DAQ loop that writes to a global variable that I programmatically create based on the config file.  The only solution I can think of is to use a global variable "pool" that is sized bigger than I expect to need, and then have a big switch case to select which one I want based on the task index.  But this sounds pretty silly.

    I tend to agree with Ben. I don't buy the concept of taking the asy way out (globals) because it very rarely will things remain static. You almost always have to extend the features and functionality of an application and then you will run into issues with sloppy and lazy implementations. The solutions offered may require a little time to learn but once you do it doesn't really require any extra effort.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Error in SQL Query The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query

    hi Experts,
    while running SQL Query i am getting an error as
    The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    T2.LineText
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,T2.LineText
    how to resolve the issue

    Dear Meghanath,
    Please use the following query, Hope your purpose will serve.
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    CAST(T2.LineText as nvarchar (MAX))[LineText]
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry --where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,CAST(T2.LineText as nvarchar (MAX))
    Regards,
    Amit

  • Hi Friends... I'm trying to delete a back-up file on mu TC but I get the message "The operation could not be completed because the item "bands" is in use. I'd like to start the Back from scratch, could help me out with deleting the current file?

    Hi Friends...
    I’m trying to delete a back-up file on mu TC but I get the message “The operation could not be completed because the item “bands” is in use. I’d like to start the Back from scratch, could help me out with deleting the current file?

    Sorry, I am very confused. I asked the following question....
    Is this the only backup file on your Mac, or do you have other backup files and data on the Time Capsule disk?
    The answer that you gave was....
    This is the only one
    Now you are saying that....
    But I have lots of other files on Time Capsule! The back up file is only one of them.
    Can you clarify, please?

  • ESB - Global Variables? access of the variables outside the transformation

    I am working on one of the ESB services for my project(not looking for BPEL).
    1. Database adapter polls the data table (Say X and Column C1, C2, C3....Cn,CountofRecordsof Other table Y)
    2. Routing Service calls other database adapter for pulling the data from other table(Say Y) in another schema based on the C1,C2,C3 from X.
    3. After getting the count(i only need the count of records based on the C1, C2 and C3 conditions from Y table), I have to update the table X which corresponds to the row C1.
    The trouble what I have is
    1. How do I update the records which is for the C1 as the return of the value (which is the count) from the second adapter gives only the record count but it doesn't store the identifier from the first table.
    2.Is there anything called global variable concept in the ESB?
    3.How to access the varilable which are outside the schema in the current transformation. i.e, consider I have two schemas, Schema A and Schema B,where I am mapping the variables in the transformation, and considering I need a variable which is the schema which was populated with values during runtime in Schema C.
    Let me know if needs more clarification!
    thanks,
    Prashanth

    Hi,
    >>
    1. Database adapter polls the data table (Say X and Column C1, C2, C3....Cn,CountofRecordsof Other table Y)
    2. Routing Service calls other database adapter for pulling the data from other table(Say Y) in another schema based on the C1,C2,C3 from X.
    3. After getting the count(i only need the count of records based on the C1, C2 and C3 conditions from Y table), I have to update the table X which corresponds to the row C1.
    >>
    I suppose your RS at step 2 gives C1, C2, C3 as input and you invoke DB adapter to get count and forward response to other service.
    >>
    The trouble what I have is
    1. How do I update the records which is for the C1 as the return of the value (which is the count) from the second adapter gives only the record count but it doesn't store the identifier from the first table.
    >>
    If I understand your task correctly, try to use ESBREQUEST to accomplish your task.
    >>
    2.Is there anything called global variable concept in the ESB?
    >>
    No, there are no global variables in ESB, such in BPEL.
    I think, this should be known when you first starting a design your ESB processes.
    You can accomplish your task in next way:
    add global variable to your XML payload.
    For example, your XML payload looks like:
    <payload><some content/></payload>
    You can extend your XML schema to include global variable, so you payload may looks like:
    <payload><some content/><global_var>value</global_var></payload> (I think this's the best way, if you really need something that can be accessed in many parts of your ESB process)
    >>
    3.How to access the varilable which are outside the schema in the current transformation. i.e, consider I have two schemas, Schema A and Schema B,where I am mapping the variables in the transformation, and considering I need a variable which is the schema which was populated with values during runtime in Schema C.
    >>
    Sorry, I didn't understand. What schema do you mean? XML schema or DB schema?

  • Applicatio​n Builder - Use of Global Variables

    Hello,
    I have an application which consists one one main VI running for the user interface, and one VI running in the background dealing with CAN communications.  These two VIs must communicate using global variables.  In the main VI, I have to open a reference to the global variable VI in order to write data to it.  The application works correctly in LabVIEW environment.  However when I build the application using application builder, I receive an error with the open reference VI in opening the global variable VI.  The error given is Error Code 7: File not found.  The path to the Global variable VI is correct however.  I am pretty sure of this because in my main VI, I open up other VIs based on the open reference function and a path.
    Therefore:
    1) I can open references to normal VIs and use properties such as run VI without a problem.
    2) This does not work for my global variable vi.
    Build settings:
    Im dont understand all the build options completely but the settings I use are:
    1) Single target file contening all the VIs
    2) All the VIs I use are located in the same folder
    I hope the explaination is clear enough.
    Do you have any suggestion to explain what happens and how can I make it work correctly?
    Thanks
    Julien

    Your usage sounds very weird. Normally, the best reason to use a standard global is that it's easy to use. You simply place it in the diagram and select the one you want. Your use case of opening a reference to the VI sounds weird.
    You say that the path is correct. There is a very simple way to check this. Place a path indicator showing the path you built and you will see exactly. The most common reason for path problems in executables is if you build relative paths since the executable itself is treated as another directory, so you have an extra level. The common way to go around this is to use the Application.Kind property and if you're running in the RTE perform an extra strip. Another problem you might have is that if you are dynamically loading the VI, it will not get included in the build automatically. You have to include it manually either by selecting it as a support file or by including a VI which calls it normally.
    After all that, though, my suggestion would simply be to avoid the global. If you need inter-VI communication you can use a lot of other global options like LV2 globals, named queues, notifiers, etc. or even use globals as they were intended and they will all probably be simpler than the way you currently use globals. Note that global communication in LabVIEW is very risky because you can easily create race conditions and it's important to look out for that.
    Try to take over the world!

  • How can I run two different vi's in same project which are accessing same global variable with out effecting the speed of the execution of both the vi's

    Hi
    I have build an Labview project with FPGA target .  I have configured an FPGA VI and an host Vi to acquire data and logged the data to a file and stored the latest data in a global variable simultanously. I have configured one more VI in the same project  to access the global variable.  I have build a dll to access both the VI as functions in LabWindows/CVI code.  My task in CVI is to update configured GUI with latest data periodically and run the  host VI continously for a long time and log the data to a file. GUI should update for every one second with latest data for this I am using the second VI in which I am accessing the global varibale in which the latest data has been stored in host VI.

    Duplicate Post (go here)

  • Using a global variable within a function

    Hi all,
    I'm trying to learn how to use global variables, but can't quite get it right:
    Im trying to use two buttons, named UpButton and DownButton to control one global variable, p1
    A text field, named "Value" displays p1.
    Here's my code:
    p1 = 0;
    ButtonClick("UpButton", p1, 100,"Value");
    ButtonClick("DownButton", p1,(-100),"Value");
    function ButtonClick(ButtonName,Var,Increment,TextToChange){
                        sym.$(ButtonName).click(function(){
                        Var = Var + Increment;
                        sym.$(TextToChange).html(Var);
    However, it seems to be treating p1 as two different variables.
    Here's a link to the page to show you what I mean, apologies but this link wont work in google chrome because I'm using dropbox as a server temporarily
    In other browsers you may need to click "Show all content" or similar to any security warnings...
    https://dl.dropboxusercontent.com/u/83693404/ButtonTest/buttons.html
    Here are the project files:
    https://app.box.com/s/0shocivto8fl295h62uq
    Any help greatly appreciated, sorry if this is a stupid question,
    Katherine

    Hi Katherine,
    However, it seems to be treating p1 as two different variables.
    Indeed, your code created two different variables in two different scopes (I guess it as to do with JavaScript closures, but do  not ask me more, I am still a bit foggy about that idiosyncrasy ).
    In JavaScript, a primitive parameter – this is the case here with p1, a Number value –, is passed by value. In other words, a copy of the value is made. Your code handles two copies of the value stored in p1.
    This contrasts with an object parameter, which is passed by reference (address in memory), without copy. Your code would work if Numbers were passed by reference : the two Var (p1) would then point to the same address.
    The intent behind your trial is a global variable.
    1) Let us be as simple as possible :
    Stage : document.compositionReady event handler
    p1 = 0;
    buttonClick = function( Increment)
      p1 += Increment;
      sym.$( "Value").html( p1);
    Stage : DownButton.click event handler
    buttonClick(-100);
    Stage : UpButton.click event handler
    buttonClick(100);
    Without being preceded by the var keyword the variables are global.
    So the Number variable p1 can be accessed inside function buttonClick.
    And the Function variable buttonClick as well, is accessible inside click event handlers, everything (function definition +function calls) being inside the same symbol (Stage).
    2) Now, suppose this is no longer the case : you want to access a variable from another symbol.
    We create a new GraySquare symbol, instantiated both in the DownButton symbol (instance name DownSquare) and in the UpButton symbol (instance name DownSquare).
    Stage : document.compositionReady event handler
    p1 = 0;
    sym.buttonClick = function( Increment)
      p1 += Increment;
      sym.$( "Value").html( p1);
    The sym. prefix is now necessary to make the variable (here a Function, but you would proceed exactly the same with a String, Number or Boolean) accessible in other symbols.
    DownButton symbol : DownSquare.click event handler
    sym.getComposition().getStage().buttonClick( -100);
    UpButton symbol : UpSquare.click event handler
    sym.getComposition().getStage().buttonClick( 100);
    From these other symbols, the sym.getComposition().getStage(). prefix is necessary to acces to our global variable (function).
    The two examples are downloadable here : https://app.box.com/s/6vkyiqk7i8zwlw0j1wk1
    Gil

  • Static used on global variable declaration

    I have inherited a CVI project that contains a single .C file and a couple of .UIR files with their associated .H files.
    Many of the global variables have STATIC in their declaration - I believe this is due to the fact the original developer originally had them inside various functions and at some point changed strategy to make them global, leaving the STATIC keyword in place when copy/pasting.
    As I understand it the ONLY implication of STATIC on a global variable would be to keep its visibility only to the .C file in which it is declared. In this instance that is moot since there is only one .C file in the project.
    Is there anything about LabWindows/CVI which I might not be aware of that makes this use of STATIC cause something different than if STATIC were not used?
    Thanks for any input you might have since I'm new to CVI

    Roberto and menchar said it well:
    "static variables are declared at compile time and survive when their block of code terminates. If declared at function level, their value survives from one call of the function to another, so that they can be used over time to store permanent values locale to the function. If declared at module level, they are common to all functions in the module and are allocated outside the stack so that their values are not lost during program life. In every case they can be accessed and modified in values by functions in the program. If arrays, they cannot be dinamically changed in size."
    "The static keyword can be used with a function name also, meaning the function name isn't exported to the linker, and the function is in scope only to code within the module."

  • Application Builder - Use of Global Variables

    Hello,
    I have an application which consists one one main VI running for the user interface, and one VI running in the background dealing with CAN communications.  These two VIs must communicate using global variables.  In the main VI, I have to open a reference to the global variable VI in order to write data to it.  The application works correctly in LabVIEW environment.  However when I build the application using application builder, I receive an error with the open reference VI in opening the global variable VI.  The error given is Error Code 7: File not found.  The path to the Global variable VI is correct however.  I am pretty sure of this because in my main VI, I open up other VIs based on the open reference function and a path.
    Therefore:
    1) I can open references to normal VIs and use properties such as run VI without a problem.
    2) This does not work for my global variable vi.
    Build settings:
    Im dont understand all the build options completely but the settings I use are:
    1) Single target file contening all the VIs
    2) All the VIs I use are located in the same folder
    I hope the explaination is clear enough.
    Do you have any suggestion to explain what happens and how can I make it work correctly?
    Thanks
    Julien

    Duplicate.
    Try to take over the world!

Maybe you are looking for

  • Online number does not appear as caller ID for out...

    I have a Skype Premium account and an Online Number based in Stockholm, Sweden. I have verified the Caller ID for my account is set for the Online Number starting with +468. When I call my mobile phone (Swedish mobile operator), the ID appears as "Un

  • Yellow Discoloration

    Unless otherwise noted, your Submission should either be a technical support question or a technical support answer. Locked by an Apple Discussions Host I have a three week old Macbook. The plastic on the palm rest and on the screen bezel where you o

  • Camera Raw 4.6 and DNG Converter available on Adobe Labs

    http://labs.adobe.com/wiki/index.php?title=Camera_Raw_4.6 Additional Detail Here: http://blogs.adobe.com/lightroomjournal/2008/09/camera_raw_46_and_dng_converte.html Regards, Tom Hogarty Lightroom, Camera Raw, DNG Product Manager

  • For Each Combination of Two Cols Create a Record

    How do I PL/SQL creating a new record in table B for each combination of two columns in table A? Do I need to create a cursor? my_cursor IS SELECT col1, col2 FROM tableA and then with a FOR loop somehow write SELECT FROM INSERT INTO? Thanks,

  • Comp viewer becomes flat blue at certain zoom levels

    This is a problem I've had with several different versions of After Effects, and on more than one computer and I haven't been able to find any information about it. Sometimes, especially after RAM previewing, my comp viewer will turn blue and I can't