Confusion on using USING/CHANGING in PERFORMS and FORMS

I got a little confused with PERFORM statements.
As far as I understood, the FORM definition is the one that ultimately defines which variable is going to be handled by value and which by reference (Using either USING, USING VALUE(...) or CHANGING (which is a particularity to deal with recursive functions). Thus, why does the PERFORM statement also accepts the CHANGING option ?
Should I worry with the way the PERFORM statement is written or can I simply imply from it the values of the parameters passed, in a given moment of execution ?
Thanks
Avraham

Hi
The USING and CHANGING additions in the FORM statement define the formal parameters of a subroutine. The sequence of the additions is fixed. Each addition can be followed by a list of any number of formal parameters. When you call a subroutine, you must fill all formal parameters with the values from the actual parameters. At the end of the subroutine, the formal parameters are passed back to the corresponding actual parameters.
Within a subroutine, formal parameters behave like dynamic local data. You can use them in the same way as normal local data objects that you would declare with the DATA statement. They mask global data objects with the same name. The value of the parameters at the start of the subroutine is the value passed from the corresponding actual parameter.
Parameters Passed by Reference
You list these parameters after USING or CHANGING without the VALUE addition:
FORM <subr> USING    ... <pi> [TYPE <t>|LIKE <f>] ...
            CHANGING ... <pi> [TYPE <t>|LIKE <f>] ...
The formal parameter occupies no memory of its own. During a subroutine call, only the address of the actual parameter is transferred to the formal parameter. The subroutine works with the field from the calling program. If the value of the formal parameter changes, the contents of the actual parameter in the calling program also change.
For calling by reference, USING and CHANGING are equivalent. For documentation purposes, you should use USING for input parameters which are not changed in the subroutine, and CHANGING for output parameters which are changed in the subroutine.
To avoid the value of an actual parameter being changed automatically, you must pass it by value.
Input Parameters That Pass Values
You list these parameters after USING with the VALUE addition:
FORM <subr> USING    ... VALUE(<pi>) [TYPE <t>|LIKE <f>] ...
The formal parameter occupies its own memory space. When you call the subroutine, the value of the actual parameter is passed to the formal parameter. If the value of the formal parameter changes, this has no effect on the actual parameter.
Output Parameters That Pass Values
You list these parameters after CHANGING with the VALUE addition:
FORM <subr> CHANGING ... VALUE(<pi>) [TYPE <t>|LIKE <f>] ...
The formal parameter occupies its own memory space. When you call the subroutine, the value of the actual parameter is passed to the formal parameter. If the subroutine concludes successfully, that is, when the ENDFORM statement occurs, or when the subroutine is terminated through a CHECK or EXIT statement, the current value of the formal parameter is copied into the actual parameter.
If the subroutine terminates prematurely due to an error message, no value is passed. It only makes sense to terminate a subroutine through an error message in the PAI processing of a screen, that is, in a PAI module, in the AT SELECTION-SCREEN event, or after an interactive list event.
reward if useful
Regards
Pavan

Similar Messages

  • How to use buttons in hcm process and forms?

    Hi Experts,
    I want to know how to use buttons in HCM process and form.
    And when i click on the button it was validating all the fields and it was throwing an error ( complete SACHP fields) i am not using this filed in any where of my form.
    So, please help in getting out of this error. And help me with some document, which method will  trigger once we click on the button.
    Thanks & Regards,
    Rocky

    You do not need to add this field to your list. In the view V_T588MFPROPS (SAP delivered), this field is set as mandatory. In configuration, you must maintain the view V_T588MFPROPC (Customer area) and make sure the field is not set to mandatory. This will override the SAP delivered setting and the error message will be not be displayed.
    Derrick Banks
    Banks & Company, LLC

  • Perform and Form statements

    Hello,
    can anyone give egs of using PERFORM and FORM statement. what do these statements do actually.
    thanks.

    See this sample for PERFORM ... USING...CHANGING
    DATA : c1 TYPE i, c2 TYPE i, res TYPE i.
    c1 = 1.
    c2 = 2.
    <b>PERFORM sum USING c1 c2 CHANGING res.</b>
    WRITE:/ res.
    **& Form sum
    ** text
    form sum using p_c1 p_c2 changing value(p_res).
    p_res = p_c1 + p_c2.
    endform. " sum
    Note the difference between the above and below perform.
    DATA : c1 TYPE i, c2 TYPE i, res TYPE i.
    c1 = 1.
    c2 = 2.
    <b>data: subroutinename(3) VALUE 'SUM'.
    PERFORM (subroutinename) IN PROGRAM Y_JJTEST1 USING c1 c2 CHANGING res</b>.
    WRITE:/ res.
    **& Form sum
    text
    form sum using p_c1 p_c2 changing value(p_res).
    p_res = p_c1 + p_c2.
    endform. " sum
    ANother sample for simple perform
    PERFORM HELP_ME.
    FORM HELP_ME.
    ENDFORM.
    <b>... TABLES itab1 itab2 ...</b>
    TYPES: BEGIN OF ITAB_TYPE,
             TEXT(50),
             NUMBER TYPE I,
           END OF ITAB_TYPE.
    DATA:  ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH
                     NON-UNIQUE DEFAULT KEY INITIAL SIZE 100,
           BEGIN OF ITAB_LINE,
             TEXT(50),
             NUMBER TYPE I,
           END OF ITAB_LINE,
           STRUC like T005T.
    PERFORM DISPLAY TABLES ITAB
                    USING  STRUC.
    FORM DISPLAY TABLES PAR_ITAB STRUCTURE ITAB_LINE
                 USING  PAR      like      T005T.
      DATA: LOC_COMPARE LIKE PAR_ITAB-TEXT.
      WRITE: / PAR-LAND1, PAR-LANDX.
      LOOP AT PAR_ITAB WHERE TEXT = LOC_COMPARE.
      ENDLOOP.
    ENDFORM.
    Hope this helps.
    Reward points if this helps u.

  • Any one used the interface /RPM/IF_PFS_ITEM and form /RPM/FORM_PFS_ITEM

    Hi Friends,
    Any one used the above interface and form
    Regards,
    sasidhar

    Hi Karen,
    It seems to me that because the decision point happens before the tabular form is rendered (via the tree right?) you don't really need a "On Change" DA.
    I think you either need find the hms field c030, which could be hidden or visible, as depending on that value go hide or show the hms_info field.
    You'll want to do this either on Page Load or After Refresh or both, it depends on how the tabular form gets refreshed.
    Your DA On Load would be
    Event: Page Load
    Action: Javscript Code
    The code:
    $(".hms").each(function(index) {
      if ($v(this) == 'N') {
      var rowTR = $x_UpTill(this, 'TR');
      $(rowTR).find(".hms_info").hide();
    This code will find ALL your hms fields. if the field has a N then we go up to the TR, find the hms_info and hide it.
    If your page refreshes on every row and the Y/N values don't change after the page loads then you're done!
    What do you think?
    Thanks
    -Jorge
    PS.  This is odd... I thought I was replying to the previous thread.  Weird.
    Message was edited by: jrimblas

  • Create Adobe Form using Design Time for Processes and Forms

    Hi all,
    I am trying to create a form that have 3 fields:
    1. pernr
    2. ename
    3. effective_date
    I done all the necessary setup of BADI ,class, interface and form.
    I need the step to step guide where you create the adobe form using the Design Time for Processes and Forms. Anyone have any idea?
    Edited by: Siong Chao on Jan 3, 2011 4:54 AM
    Edited by: Siong Chao on Jan 3, 2011 5:00 AM

    Hi,
    I couldn't get to your query..
    What do you mean by step by step procedure for a design time & process for forms.
    if you are a beginner and looking for basic examples to implement adobe forms there are lot of them in SDN, please search them.
    let me know if your query was a very specific one.
    Cheers,
    Sai

  • New iPad user; confused after apple ID change of password and email address. New details NOT recognised by iCloud and actual iPad? Help! Thank you

    I'm new to my iPad &amp; Apple!
    I have updated/ changed details within my Apple ID; email, contact details and changed password.
    This has worked &amp; recognised when using updated password for use with Apple's web site (e.g. Able to login to this site) &amp; all other apps with the EXCEPTION of iCloud and also my actual iPad ("internal/own" software/OS I would presume?!).
    Shortly after turning my iPad on, the Apple ID request pops up showing my old email address. I have tried entering old &amp; new passwords which both fail. I now cancel this request and continue ok.
    This also happens with iCloud: as just mentioned, the request for Apple ID comes up with old email address and neither old or new passwords are accepted (&amp; therefore I can not back-up to iCloud).
    Can anyone help please?
    With anticipated appreciation and thanks,
    NJohnR
    (Maybe I should mention that while I live in the UK; Scotland, I am currently on holiday in France while I have made further changes to my ID password, though was at home when made initial changes).

    I have resolved this problem!
    I try &amp;change my email details within my iPad's iCloud settings. Though the primary (old) email could not be changed.
    So I took advice from further searches here &amp; on the iCloud site &amp; went ahead and deleted my iCloud account. Success! Immediately after deleting the account I had a request to open &amp; login to a new iCloud account with my new Apple ID login details already there (showing my new email address &amp; requesting my password- all which worked fine). Also I have not lost any files.
    I hope that this may help someone else in the future.
    Happy Appleing all

  • Use check box for report and form

    Hi Expert,
    I try to use check box to select multiple rows in a report and then click on a button to go to a form on another page to choose some values from the form and then do a mass update for records selected in reports.
    I read the "How to Work with Check Boxes" in 2 Day Developer guide, it works fine to select mutiple rows in report and do update with process in that report page.
    However, if I click on a button to go to another page which contains a form, seems the values stored in the package array are cleared and not passed to that page.
    Do you know how I could make this work?
    Thanks a lot,
    Jessie

    Hello Sakti,
    I am also in ECC6.0 & if i see the definition of the BAdI BADI_TAX1_XTXIT_SET, "Multiple Use" checkbox is checked! What are you trying to do - trying to create an implementation?
    @Prabhu: Although the BAdI is "multiple-use", but there is not filter applied to it. Next time do your checks properly before replying
    BR,
    Suhas

  • Perform and form params, here's a thing i don't understand

    Hi all experts,
    a simple & dumb doubt I'd like to clarify about parameters in a form, if anybody can help
    Here's the declarative part of my sample code:
    TYPES: BEGIN OF ty_loghier,
                otype TYPE otype,
                objid TYPE hrobjid,
                stext TYPE stext,
               END OF ty_loghier.
        TYPES: tbl_ty_loghier TYPE TABLE OF ty_loghier.
        DATA: loghier TYPE tbl_ty_loghier WITH HEADER LINE.
    The FILTER form that follows should operate on the previously declared internal table, as follows:
    PERFORM filter CHANGING loghier[].
    I declared the form as follows:
    FORM filter CHANGING itab TYPE tbl_ty_loghier.
    but the syntax checker tells me that "TABLE- expected, not tbl_".
    I don't understand why, and also, I'd like to declare the form such that the itab used in the form is meant to be an internal table with header line. Seems quite a simple question but... I'm wasting a lot of time :P

    Hi ,
    Try this code...
    TYPES: BEGIN OF ty_loghier,
                otype TYPE otype,
                objid TYPE hrobjid,
                stext TYPE stext,
               END OF ty_loghier.
    DATA: loghier TYPE STANDARD TABLE OF ty_loghier .
    DATA : wa_loghier TYPE ty_org_data.
    PERFORM filter CHANGING wa_loghier.
    FORM filter CHANGING itab TYPE ty_loghier.
    Regards,
    Sachin M M
    Edited by: Sachin Mathapati on Jun 17, 2009 4:19 PM

  • Customizing change requests (class and form) yields error when closing/cancelling

    I'm having the exact issue that was posted here:  http://social.technet.microsoft.com/Forums/systemcenter/en-US/880a19f9-d5a7-4044-bdb4-fbd43c3c8d5b/closing-cr-using-extended-form-error?forum=customization
    However, it appears there was never a resolution.  I've created a custom class (named TestChangeRequest) inheriting from System.WorkItem.ChangeRequest as the base -- but whenever I try to run the Close or Cancel task I'm getting the error described
    in the above link.  Does anyone know the proper way to resolve this?

    Hi,
    You created a new class and have to build new console tasks for all problematic actions like Close and Cancel in your case.
    Start with
    this.
    Cheers,
    Marat
    Site: www.scutils.com  Twitter:
      LinkedIn:
      Facebook:

  • What is the use of change pointer technique in IDOC

    hi
    could anybody suggest me
    what is the use of change pointer technique and how to use it
    thank you
    kalyan.

    Change pointers are used for changes to the master data objects are flagged for distribution by SMD Tool.i.e.shared Master Data.
    You need change pointers to distribute changes with the ALE SMD tool. If you do not use this tool, you do not need to write change pointers.
    You can deactivate change pointers and activate them again with the transaction BD61
    The SMD tool is connected to the change document interface. If the master data changes are to be distributed, the application writes a change document. The contents of this are passed to the SMD tool. The tool writes change pointers, reads the application data and creates the master IDoc.
    The master IDoc is then passed to the ALE layer, which sends it to all interested systems.
    The change pointer tables (BDCP und BDCPS) should be as small as possible. Use as few change pointers as possible and delete change pointers which you no longer need.
    You can increase the rate of processing by using the Analyze Change Pointer and Reorganize Change Pointer functions.

  • Interface programs of changing Bid Invitation and Quotation

    I have a problem about changing Bid Invitation and Quotation in SRM.
    I want to create custom applications including interface programs, so I think I have to call BAPI (Tr-cd:BAPI), Function Module (Tr-cd:SE37), or Enterprise Services (http://help.sap.com/content/documentation/esoa/docu_esoa_srm.htm).
    I found "BidInvitationEC" and "SupplierQuotationEC" in SRM BAPIs, but each of BAPIs doesn't support changing method. (Only Create Method is supported.)
    Please help us if you have a good solution.

    Thank you for your reply.
    We are going to create our custom application inside SRM,
    but we don't know which Functional Module we should use
    to change Bid Invitation and Bid documents.
    Please, tell me if you know a way to change these documents.

  • InDesign Buttons and Forms... Not Working

    Hello Guys,
    I'm using Adobe InDesogn CC 10.1.0.70 x64 Build, the problem is with the check box option from Buttons and Forms, They are, simply, not working... I'm trying to add a check box on my pdf I'm creating in InDesign.. I'm using checkbox from "Sample Buttons and forms".. but nothing is working.. I'm just dragging the Check Box samp and drop it in my canvas, exporting it as PDF with "Hyperlinks" checked.. and Interactive Elemnts with Include Appearance chosen but the check box doesn't having any action!! I don't know what I should do to make this work please help  

    Start by restoring your InDesign preferences:
    Trash, Replace, Reset, or Restore the application Preferences

  • Dynamic Parallel Approval for HCM Process and Forms

    Hi everyone,
    I have a scenario where I need to use the "Dynamic Parallel Approval" (or to keep it simple, initially I tried using the "Parallel Approval" wizard)for a workflow used in the HCM Process and Forms.
    The standard task for approval in process and forms is TS17900101. I have mentioned a multiline container in the Miscellaneous tab of this task. However,I was unable to use this task in the wizard. There are no results attahced to this task unlike any other standard approval task (like TS30200147). I need to use the task TS17900101 in the workflow assigned to process and forms, but not sure how to handle this scenario (parallel approval).
    If this is not the right way of doing it, Is there any workaround for "Parallel Approval" in HCM Process and Forms.
    Could anybody throw some light around this area.
    Thanks for your help.
    - MM

    Thanks Anuj. But I believe, the container element that I add in the miscellaneous tab does not necessarily have to be used in the agent assignment. The multiline container is just to instantiate the workitem 'n' number of times. Correct me if I am wrong.
    My concern is that I was unable to use this approval task (TS17900101) in the workflow wizard for dynamic paralle/parallel approval.
    Arghadip - Thanks for your suggestion. I have seen some your nice contributions in the WF forum.
    I actually tried using the 'Blocks'. But this is what I ran into. When I send multiple approval requests (say 3), if one person has approved it and the second has rejected it,I need to take out the workitem from the third person's list (because it has been rejected by someone in the group). I am not sure if this is possible using Blocks. And in my case the third person is still having the workitem, but gets a dump/error when he tries to open it.
    Also, if any one has rejected the request, I do not have to wait for the rest to take any action on the workitem and proceed further. But I guess in 'Blocks' it will not let you go out unless every workitem has been processed.
    To summarize,here's what I need - I need to come out of the block for two conditions. One, if everyone has approved, comeout of the block with an apprval flag. Two, if anyone has rejected (even if some have not processed their workitem), delete the workitems from others inbox and come out of the block with a rejection flag.
    So, any kind of input or suggestions on how this could be handled would be highly appreciated.
    Thanks
    MM

  • Worklow in HCM process and Forms

    Hi Gurus,
    We have recently upgraded from HR SP level 14 to level 24. After the HRSP upgrade, we find that the workflows used in the HCM process and forms which were working fine earlier are not working now.
    To trigger the workflow, I am using the class CL_HRASR00_WF_PROCESS_OBJECT and event TRIGGERED. First, we faced the problem in the standard task TS17900110,which imports the values from form to workflow container.After Implementing the SAP notes suggested by SAP,the workflow got triggered and the values got imported and it is working fine now.
    Now we are facing the problem in the 2nd level,where the manager trying to 'Approve or Reject'.The information message is thrown in backend HRASR_DT  as, "Work Item not found; check workflow Log".
    Standard Task used in the 2nd level TS17900101  to approve/reject.
    Can anyone suggest how to proceed on this issue ?
    Regards,
    Paramasivan Krishnan

    Hi Paramasivan Krishnan,
    First,  welcome you to SCN forum. However, I am afraid you posted on a wrong forum. Here is dedicate to SAP Business One. Not related to HCM.
    Thanks,
    Gordon

  • Diff Using and changing in Perform

    Hi All,
           What is the difference betwen USING and CHANGING in Perform.
    Thanks in advance
                                                  Ranjith

    hi,
    Using helps to use the parameter value passed.
    Changing helps to change the parameter value and then use the same in main program with changed value.
    Sample:
    data : val1 type i value 1,
           val2 type i value 0.
    perform calc using val1 changing val2.
    Write / : 'Changing :' , val2.
    write / : 'Using :' , val1.
    *&      Form  calc
          text
         -->P_VAL1  text
         <--P_VAL2  text
    form calc  using    p_val1
               changing p_val2.
    p_val2 = p_val1 + 100.
    *p_val1 = p_val1 + 100.
    *Since p_val1 is passed as using,the above is not *permitted
    endform.                    " calc
    This link will clear all your Doubts reagrding Perform Statement.
    Have a look:
    http://help.sap.com/saphelp_erp2005/helpdata/en/9f/db977635c111d1829f0000e829fbfe/frameset.htm
    rgds
    anver

Maybe you are looking for

  • How to configure virtual hosts and separate tiers

    The configuration we require with WLS must: 1) provide virtual hosts that can operate under their own SSL environments (some one way, some two way, with different certs) 2) perform all XML parsing of received message objects in the web layer in order

  • Electronic signature - I am not able to sign it, it appears "cryptoghrapy problem code error 13" ?

    Last week I was able to sign documents electronically. I got the version Adobe Distiller 9. My electronic signature is linked to a FIS certificate issued by Exostar. This is a corporate FIS certificate, work for Rolls Royce. Everytime that I am going

  • Record count per message

    How do we count the number of records send in a message. the scenario is from FTP to Proxy. No graphical mapping involved. Need to count the number of records that XI processed for a particular message.

  • Selective deletion in master data

    Hi all, I m unableto delete a particular employee from the 0EMPLOYEE master data.Please help me on this Thanks, Mahee

  • Email notification sending problem

    Anyone can help me regarding my email notification sending. I have a program developed in netbeans which sends an email notification. Using the jar file generated when building/compiling the program, i created a batch file to run the jar. When i trie