Using external subroutine

my subroutine is written in one program.
I m using it in another program.
i checked with the breakpoint...
The control goes to the subroutine fetches the data in the structure but when the control returns to the main program the structure is empty.
Now wat should i do either write the routine in the same program or have to use import & export memory which is best based on performance.

hi
let us also the location of the subroutine..i mean in differnt client no or in the same. If the subroutine is in the same client no..then you can use the Perform statement in the sapscript to call the extra functionality from the print program or in any location but with in the same system(client).
In case of external subroutine, i think you need to use the client-specified statement in the print program while selecting the data.
eg.
select f1
          f2
          f3
          from zzkna1
          into i_tab
          cleint-specified where mandt = <client no from where you are fetching the data>
this may work.
regards,
shamim.

Similar Messages

  • Select-options as a external subroutine

    hi all,
    plz solve my problem.
    this is my first program.
    tables vbak.
    select-options x for vbak-vbeln.
    types : beginf of ty,
    a tupe vbak-vbeln,
    b type vbak-ernam,
    end of ty.
    data : itab type table of ty,
             wa type ty.
    perform sub(znava) using x.
    this is my secomd program
    report znava.
    form sub using x.
    select vbeln ernam from vbak into table itab where vbeln in x.
    loop at itab into wa.
    write :/ wa-a,wa-b.
    endloop.
    endform.
    in the above two programs are separate,and i am using external subroutine but it will show some error how can i rectify.
    anyone plz guide me.
    thanks and regards,
    navneeth.
    Edited by: Navaneetha KRISHNAN on Feb 19, 2008 5:50 PM

    First of all SELECT-OPTIONS are TABLE type. 
    You just can't use USING  keyword, you've to use TABLES keyword.
    second point is,, in your second program are you defining ITAB and WA??? otherwise second program is not going to identify ITAB & WA... so I suggest you try like this..
    "program 1.
    TABLES vbak.
    SELECT-OPTIONS x FOR vbak-vbeln.
    PERFORM sub(znava) TABLES x .
    "program 2
      TYPES : BEGIN OF ty,
      a TYPE vbak-vbeln,
      b TYPE vbak-ernam,
      END OF ty.
      DATA : itab TYPE TABLE OF ty,
      wa TYPE ty.
    FORM sub TABLES x.
      SELECT vbeln ernam FROM vbak INTO TABLE itab WHERE vbeln IN x.
      LOOP AT itab INTO wa.
        WRITE :/ wa-a,wa-b.
      ENDLOOP.
    ENDFORM.                    "sub

  • Script external subroutine for multiple fileds display

    Hi,
    can anybody tell
    how to write external subroutine in script.
    i want to display multiple fields data in script by using external subroutine.
    Regards,
    Kumar.

    HI,
    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    Syntax in a form window:
    /: PERFORM <form> IN PROGRAM <prog>
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM

  • Visibility of global parameters while working with external subroutines

    Hi all,
       I am trying to use external subroutines in my current report. But I am not able to access the global variable values of my calling program  through  the called external subroutines.Please let me know whether the accessibility of global parameters will be possible through the external subroutine calls.

    Hi Jaya,
    It is NOT Possible.
    Using the external Subroutine,
    1) We can only import some required result only (using the CHANGING option).
    2) Or, we can do some other execution on the DB based on the input which we gave as Export
        Parameters.
    Rgds,
    Ramani N

  • External subroutine in script

    Hi,
    Could any one tell me is that possible to use external subroutine.  Actually my script is the output of ML83. Driver program which passing the info. to script is Std one.  Is there any filed relavent to this driver program is updating when 'Service entry is revoked'.  Plz help me out... this is very urgent.
    Thanks
    Sai.

    Hi,
    'Service entry is revoked' means blocked or released..
    Sorry..I am not an expert on Service entry..But I am trying to search for the fields which you are looking for..
    Thanks,
    Naren

  • Using HR_INFOTYPE_OPERATION in external subroutine for Dynamic Actions

    Hi,
    I am calling an external subroutine in the Dynamic Actions of an Infotype. In this external subroutine, I am using HR_INFOTYPE_OPERATION to modify OTHER records of the same Infotype number.
    However, when I tried to trigger the Dynamic Actions in PA30, the other infotypes get modified as intended. But when I refreshed the PA30 screen, the changes were reversed back as if the HR_INFOTYPE_OPERATION were not carried out at all. I have COMMIT WORK after the HR_INFOTYPE_OPERATION, refreshed the buffer. But it doesn't seem to work.
    My question is: Can i use HR_INFOTYPE_OPERATION in an external subroutine which is called during dynamic actions? As I have some complicated logic, I do not want to embed the coding in the Dynamic Actions. Is there a way for HR_INFOTYPE_OPERATION to work in the external subroutine with the changes being committed to the database?
    Thank you.

    Hi,
    I remember the same problem being faced by some of the forum members.
    Suresh Datti had replied that "Call the subroutine in a nother program using a SUBMIT statement. This will create two sessions and will update the DB". This was working fine for the users.
    Hope you can try this.
    Just call a program using SUBMIT statement and code your form routine inside that.
    Hope this helps you.
    Regards,
    Subbu.

  • SAPscript external subroutine - select not pulling data

    Hi all,
    I am calling an external subroutine in my SAPscript. In this subroutine, I am using a simple select statement:
    * get sales order number
      SELECT vbelv posnv
        FROM vbfa
        INTO CORRESPONDING FIELDS OF TABLE it_so
         WHERE vbeln = gv_deldoc
           AND posnn = gv_posnr.
    The problem is no data is being pulled into it_so. I have confirmed in VBFA (through SE16N) that data exists in the system so this isn't the problem. Are there restrictions with using selects in SAPscript?
    Thanks,
    Edited by: pistols123 on Sep 8, 2011 9:11 PM

    Hi,
    Please refer below code.
    In SAP Script ,SE71: call the subroutine pool program with the below sysntax.
    /: PERFORM GET_DATA IN PROGRAM ZXXXX
    /: USING &XXXX-MATNR&
    /: CHANGING &V_YYYY&
    /: CHANGING &V_YYY2&
    /: ENDPERFORM
    Using Parameter will be the input in the subroutine pool to fetch the data.
    Changing Paramter will be the your output to pass the data into SAP Form.
    now goto SE38,and create a subroutine pool program with the name ZXXXX,follow the below code.
    FORM get_data TABLES tbl_in  STRUCTURE itcsy
                           tbl_out STRUCTURE itcsy.
    READ TABLE tbl_in INDEX 1.
      IF sy-subrc EQ 0.
        XXXX-Matnr = tbl_in-value.
    "Pass it through the conversion exit CONVERSION_EXIT_ALPHA_INPUT before SELECT."
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        input         = gv_deldoc
    IMPORTING
       OUTPUT        = gv_deldoc
    SELECT vbelv posnv
        FROM vbfa
        INTO (l_vbelv,l_posnv)
         WHERE vbeln = gv_deldoc
           AND posnn = gv_posnr.
    READ TABLE tbl_out INDEX 1.
      IF sy-subrc = 0.
        MOVE l_vbelv TO tbl_out-value.
        MODIFY tbl_out INDEX 1.
      ENDIF.
      READ TABLE tbl_out INDEX 2.
      IF sy-subrc = 0.
        MOVE l_posnv TO tbl_out-value.
        MODIFY tbl_out INDEX 2.
      ENDIF.
    Moderator message - Welcome to SCN. But please do not ask for "rewards"
    Regards,
    VSNM
    Endform.
    Edited by: Rob Burbank on Sep 8, 2011 4:18 PM

  • External subroutine in sapscript

    hi all
    can anyone explain me how to handle an external subroutine in a script with a simple example.
    rg
    sandeep

    Hi Sandeep,
    Try this :
    Use PERFORM from SAPSCRIPT
    /: PERFORM BIN_LOCATION IN PROGRAM Z_SAPSCRIPT_PERFORMS
    /: USING &RESBD-MATNR&
    /: USING &CAUFVD-IWERK&
    /: USING &RESBD-LGORT&
    /: CHANGING &MARD-LGPBE&
    /: ENDPERFORM
    REPORT z_sapscript_performs.
    SUBROUTINES FOR CALLING FROM SAPSCRIPTS
    FORM bin_location TABLES in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
    get default bin location from MARD for this material/plant/storage *
    location
    DATA: l_matnr TYPE matnr, "material
    l_werks TYPE werks, "plant
    l_lgort TYPE lgort, "storage location
    l_lgpbe TYPE lgpbe. "bin location
    Get first parameter in input table.
    READ TABLE in_tab INDEX 1.
    WRITE in_tab-value TO l_matnr .
    Get second parameter in input table
    READ TABLE in_tab INDEX 2.
    MOVE in_tab-value TO l_werks.
    Get third parameter in input table
    READ TABLE in_tab INDEX 3.
    MOVE in_tab-value TO l_lgort.
    read bin location
    SELECT SINGLE lgpbe INTO l_lgpbe FROM mard
    WHERE matnr = l_matnr
    AND werks = l_werks
    AND lgort = l_lgort.
    IF l_LGPBE IS INITIAL.
    l_LGPBE = 'NONE'.
    ENDIF.
    read & update only parameter in output table
    READ TABLE out_tab INDEX 1.
    out_tab-value = l_lgpbe.
    MODIFY out_tab INDEX 1.
    ENDFORM.
    Regards,
    Lanka

  • Can I use external APIs to authenticate users?

    I have been asked to develop a lightswitch application either as desktop client or HTML client. Now I am confused about the authentication
    mechanism in LightSwitch, and it leads a question: Can I authenticate my users from an external website or application?  
    For the HTML client, I have been thinking that whether I could use external APIs like Facebook Login API to authenticate my users? If I could, the code should be JavaScript, then where should I put it, and how can I configure my LS application?
    For the desktop client, same question, if I could identify my users by pulling some user information from an external website, what kind of code/Programming Language shall I use? 

    Hey ConnorTx!
    This is not supported out of the box.
    For in-browser desktop applications, you can hack around this by setting up the social media credentials, then redirecting to your desktop application while passing the self-encrypted credentials.  I explained this workaround in
    this article.
    I don't have enough production experience with HTML apps yet.  However when you use Forms authentication, I suspect you can simply fill in the IPrincipal on the HttpContext.Current, then redirect to your HTML app, and the LightSwitch Forms Auth mechanism
    would pick up your principal as valid credentials.  I wish I had time to show you some code for this, would make a great blog post :/
    Keep rocking LS!
    Jan
    It's your story - time to switch on the innovation.||About me||LightSwitch blog

  • After upgrading to Lion, the Finder will increase the virtual memory while using external HD

    after upgrading to Lion, the Finder will increase the "virtual memory size" while using external HD. I check it using Activity Monitor and found that "Finder" wll increase the "Virtual Memory Size" and "Private Memory Size". and then after a while. the system told me my HD is full and hanging there.
    My External HD is 1TB. and I have installed new version Paragon NTFS for Mac V.9.01. I am not sure it is related or not.
    but I attached my external HD. the "Finder" will start to increase the "Virtual Memory Size".
    please help out this case and solve this issue.
    thank you !!!

    The one has nothing to do with the other. Virtual memory size and Private memory size are used by developers to analyze their software. it has nothing to do with anything related to the user.

  • Empty report returned from WEBI and Crystal report when using external hier

    Hi,
    WEBI and Crystal report build from BEX query returned empty report when we used external hierarchy 0PROFIT_CTR.  In BEX we don't have any problems with it.
    No authority check is perfomed on the hierarchy when we start the report in WEBI/Crystal. Only check on the hierarchy is performed when the root authorization is assigned to the user

    We using BO4  SP12

  • How can I use external clock to implement a delay?

    Hi all,
      I am testing to use external clock to drive dev/PFI0 (on device 6711) which is used as the clock for the analog ouput. I have thinking two applications by using the external clock but I don't have much idea on the implementation yet.
    First of all, I have a sequence of data (array) with each sample being sent at the interval of 1us. I use an external clock (10MHz) driving the PFI0 so it is pretty easy to achieve that goal. I am thinking what happen if I want each sampel being sent at different time. For example, if I have 5 samples, I want the first one sent 1us after the task start and wait 2us to send the 2nd sample, wait 5us to send the 3rd sample and wait 11 us to send the 4th sample, and wait 1us to send the last sample. Is it possible to achieve that based on the external clock?
    Second question is about the delay. My code require ciritcal timing and the builtin delay doesn't behave very well because I am running in windows. I can increase the priority of the vi to highest, it helps a bit but still not perfect. I am thinking if it is possible to implement hardward delay based on the external clock. Any idea?

    Hello dragondriver,
    To answer your first question, yes you could send data in that fashion. You would have to programmatically build a pulse train and use that to trigger the sending of data. The answer to the second question is essentially the same. You should be able to programmatically build a pulse train with a delay and use it as trigger to begin whatever operation you have.
    Jonathan L.
    Applications Engineer
    National Instruments

  • How to remove namespaces in mapping when using External Definition

    Hi,
    I read in the blog (/people/sameer.shadab/blog/2005/12/05/how-to-remove-namespaces-in-mapping--xi) that you are able to remove namespaces in mapping by deleting the value from XML Namespace under the Message Type. However, is it possible to do this when you are using External Definition (xsd) ? The blog only describe how to do this if you define a Data Type.

    Hi ,
    No ..it is not possible to remove the namespace once you imported into IR of external defintion.You can remove your namesapce from external definition before importing into IR.
    Sekhar

  • Is there a way to run an existing PS-JS script using external interface

    I have several previously written Photoshop JS scripts which I'd like to run through buttons on PS panels, much like the example for the HelloWorld introduction. I assume that--using external interface--I'll somehow be able to fire off these script files. Is this a correct assumption?
    Thanks!

    Certainly, but not with external interface.
    Have a look at the cookbooks. There are examples of how to use the root host object to call directly into extendscript.

  • Error in using External Process in the Process Flow

    I Created a Process Flow with an external process to Move the file from one location to another location,
    I gave the below parameters for the External Process
    COMMAND: move
    PARAMETER_LIST: ?F:\\FlatFiles\\in\\company.txt?F:\\FlatFiles\\error\\company.err
    SUCCESS_THRESHOLD: 0
    SCRIPT:
    The environment is
    Windows 2003
    OWB 9.2.0.8
    OWF Builder 2.6
    When I deploy and execute using Deployment Manager, it gave me the below error
    Starting Execution TEST
    Starting Task TEST
    Starting Task TEST:EXTERNALPROCESS
    CreateProcess: move move F:\FlatFiles\in\company.txt F:\FlatFiles\error\company.err error=2
    Completing Task TEST:EXTERNALPROCESS
    Completing Task TEST
    Completing Execution TEST
    What am I missing something here?
    Is my Parameters correct?
    GIve me the link where I can find more on using External process.
    Please...please...help me..
    Shree

    Nikolai,
    I have created a simple process flow which only calls the external process. The script is on the same host as the process flow is deployed to.
    I have used two diffent values for the command parameter.
    1. I placed the full path of the file in the command parameter and left the script parameter blank:
    COMMAND: /edwftp/ppas/scripts/ClearPPAS.sh
    PARAMETER_LIST:
    SUCCESS_THRESHOLD: 0
    SCRIPT:
    2.I placed the bash command in the command parameter and the full path in the script parameter.
    COMMAND: /usr/bin/sh
    PARAMETER_LIST:
    SUCCESS_THRESHOLD: 0
    SCRIPT: /edwftp/ppas/scripts/ClearPPAS.sh
    Both of these appear to work as they print out the statements inside the script but the files that are supposed to be removed still remain.
    Starting Execution EXTER_FILE
    Starting Task EXTER_FILE
    Starting Task EXTER_FILE:EXTERNALPROCESS
    Removing ActivatedAudit.dat...
    Removing ActivatedCustomers.dat...
    Removing ActiveAudit.dat...
    Removing ActiveCustomers.dat...
    Done!
    Create the Activated Customers data file...
    Create the Active Customers data file...
    Done!
    WARNING: Log file truncated - see RAB for further information.
    /edwftp/ppas/scripts/ActivatedCustomers.sh: /edwftp/ppas/log/ActivatedCustomers.log: cannot create
    /edwftp/ppas/scripts/ActiveCustomers.sh: /edwftp/ppas/log/ActiveCustomers.log: cannot create
    WARNING: Log file truncated - see RAB for further information.
    Completing Task EXTER_FILE:EXTERNALPROCESS
    Completing Task EXTER_FILE
    Completing Execution EXTER_FILE
    The permissions on the /log direcotry are 775. The user I register the file location with owns this directory.
    Can't think of anything else I have missed. I really appreciate your help :)
    Ryan

Maybe you are looking for

  • Urgent help needed: registry.dat is missing when i run my form in web base

    Hi gurus, i configured my forms and report server in windows 2003 and i received the following error msg when tryin to access my web base forms 6I. FRM-92129: Registry file http://domain.com/form60java/oracle/forms/registry/Registry.dat is missing. D

  • SharePoint 2010 : How to display ALL Version History of a list item's multiline text box in a same list as a list view column?

    In SharePoint 2010 , I have version history enabled multiple text box 'issue details'.  Users mainly uses Data Sheet view and it does not show all version history of that multiple line text box, is there anyway we can display list view column in data

  • Itunes store want connect. WHY?

    Hello Apple haters, For some reason i can only connect to itunes store sometimes. My internet connection is great so that is not an issue. Messages like we could not complete your request . an unknown error occured (-1200) or (0x80090318). Typing a s

  • Stock on hand info

    Hi All, this query would be used to have info about stock on hand qty of batch item. I am not so sure about it, could you please make sure if it is wrong or not ? The query: SELECT T0.[ItemCode], T0.[ItemName], T0.[ItmsGrpCod], T2.[WhsCode], T1.[Batc

  • Install Developer 7.1 trial on a Discovery Server

    Hi, I am trying to install CE 7.1 on a discovery server (V3) and it seems to be tripping over the existing installed maxdb. My first question is 'Is CE developer edition supported on MS Server 2003 (32 bit)' The various documents available seem to co