Calling same form multiple times

Hi, i need to call a single form with different table names as parameters depending on conditions.
for eg here is the approach
if flag1_is_set
  call form1 multiple times with table1, table2....... as parameters
"and i can avoid this
"  form 1 using table 1
"  form 1 using table 2
"  form 1 using table 3
"  form 1 using table 4
"  form 1 using table 5
elseif
  flag2_is_set
    form 1 using table 2
elseif
  flag3_is_set
   form 1 using table 3.
but i cannot call forms like this. can someone suggest
an equivalent implementation on how to do this.
if i dont implement in the above mentioned approach i have to code the same thing with minor changes multiple times
thanks.
your help would be appreciated.
kranthi.

You might try passing a field symbol (itab) in the tables.
And assign the filed symbol with your itab as per the condition.
Check if the program below gives you any idea.
REPORT  Z_RAM_DYN_TAB_IN_FORM.
PARAMETERS : P_TAB1 TYPE C.
DATA: lt_users2 type standard table of usr02.
DATA: lt_users1 type standard table of usr01.
FIELD-SYMBOLS: <fs_itab> type standard table.
SELECT * into table lt_users1 FROM usr01.
SELECT * into table lt_users2 FROM usr02.
IF P_TAB1 eq 'X'.
   ASSIGN lt_users1 to <fs_itab>.
ELSE.
   ASSIGN lt_users2 to <fs_itab>.
ENDIF.
PERFORM test_form TABLES <fs_itab>.
FORM test_form TABLES x_itab .
FIELD-SYMBOLS: <fs_wa> type any.
FIELD-SYMBOLS: <fs_field> type any.
  LOOP AT x_itab ASSIGNING <fs_wa>.
    DO 5 times.     "Write first 5 fields of itabs.
      ASSIGN COMPONENT sy-index OF STRUCTURE <fs_wa> to <fs_field>.
      WRITE :  <fs_field>.
    ENDDO.
    WRITE :/.
  ENDLOOP.
Thanks,
Ram
Message was edited by: Ram Manohar Tiwari

Similar Messages

  • Avoid opening same Form Multiple times

    hi
    Can anyone help me , how to put restruction not to open the same form multiple times .
    regds/sanjay

    I'm not suggesting that the following is great idea but..
    You could start a timer and keep updating the row in the table with a timestamp and then have a job which checks if there are rows in the table that have timestamps older than the timer interval.
    I actually think that that is really bad idea.
    I think its more important to ask why this is a requirement? I currently write sytems for police officers and even they can grasp the concept that someone else might be updating the same data at the same time as them and can work multiple sessions. Its hard for them, and sometimes I think they may just be hitting their keyboards with a truncheon, but they do get it.

  • HT1689 Billed for same app multiple times

    We were billed for the same app multiple times, how do I contact apple iTunes to get this fixed?

    FOR ASSISTANCE WITH ORDERS - iTUNES STORE CUSTOMER SERVICE
    For assistance with billing questions or other order inquiries, please refer to our online support page by clicking here: http://www.apple.com/support/itunes/store/. If you cannot find the answers you are seeking in our robust knowledge base, you can contact us by visiting the following URL http://www.apple.com/support/itunes/store/, clicking on the appropriate Customer Service topic, then using the contact button or email form at the bottom of the page. Responses to emails will be provided as soon as possible.
    Phone: 800-275-2273 How to reach a live person: Press 0 four times
    Hours of Operation: Mon-Fri: 9am-5pm ET
    Email: [email protected]
    How to report an issue with Your iTunes Store purchase
    http://support.apple.com/kb/HT1933
    iTunes Purchase Problems: How to Report a Problem to iTunes Support
    http://tinyurl.com/7tscpa7
    iOS: Troubleshooting applications purchased from the App Store
    http://support.apple.com/kb/TS1702?viewlocale=en_US&locale=en_US
    How to Get a Refund from the App Store
    http://gizmodo.com/5886683/how-to-get-a-refund-from-the-app-store
    Getting Refunds for your iTunes Store Purchases
    http://www.labnol.org/software/itunes-app-store-refunds/13838/
    Canceling a Digital Subscription
    http://gadgetwise.blogs.nytimes.com/2011/10/14/qa-canceling-a-digital-subscripti on/
     Cheers, Tom

  • Calling stored procedure multiple times in the JDBC receiver

    Hi,
    I am calling the stored procedure(SP) to update a DB table in the JDBC receiver.
    SP has 10 input parameters, and SP can receive one value for each parameter at a time.
    In my case, i will have multiple rows to insert using SP.i.e multiple values for each parameter.
    Its working correctly for a single value for each parameter, but when i have multiple values i want to call the SP multiples times.
    Is this possible and how?
    Thanks,
    Varghese.

    Varghese,
    I think you can have multiple statements in the JDBC Adapter's XML, as in http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm.
    Here the StatementName1 node can be inserted into your JDBC XML as often as you want.
    Kind regards,
    Koen

  • Why is Apple TV showing the same computer multiple times for Home Sharing?

    Why is my Apple TV showing the same computer multiple times for Home Sharing? Also have connectivity issues. Sometimes will lose signal.
    JonRod's music
    JonRod's music
    JonRod's music
    JonRod's music
    JonRod's music
    I recently updated to Yosemite and never had this issue before.

    I'm not 100% sure of the ins and outs, but it's some sort of known issue between Yosemite, Airport and wifi. All you can do is wait for a fix and keep restarting your equipment as and when needed, unless you have the ability to connect your Mac via ethernet.

  • Can I gift the same app multiple times to multiple users?

    Can I gift the same app multiple times to multiple users?
    Like, if I wanted to buy iMovie for 3 friends, could I buy the app as a gift 3 times?

    You should be able to gift it multiple times
    Gifting content : http://support.apple.com/kb/HT2736

  • Is it possible to copy the same database multiple times simultaneously?

    This is the setup of my environment.
    I have a 'master' database that contains the full schema plus some pre-populated data such as default settings. When database schema changes are made, they get made to the master database. When a new customer signs up for the service, I make a copy of this
    master database (using SMO) that will now be the database containing all of the customer's information. The database is rather large, and the copy operation can take a couple minutes.
    Everything works fine as expected, unless I try to provision two new customers at the same time. It appears that Azure only allows for one DB copy operation at a time. Is there a way to allow for copying the same database multiple times simultaneously?
    Thanks for you input. I understand that this is likely not the optimal setup, and that there is many better ways of doing this, but I am somewhat heavily invested in the current process and I would like to find out how to make it work if I can.

    BTW, you can do this programatically by using PowerShell (https://msdn.microsoft.com/en-us/library/ee210569.aspx), SqlPackage (http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/)
    or the SQL Server binaries for .NET (http://www.vijayt.com/Post/Deploying-a-data-tier-application-in-SQL-Azure-programatically)
    Hope this helps.
    Alex

  • Same parameter multiple times in Execute SQL Task

    Hi all,
    i have a fairly long parametrized query that needs to be run within an Execute SQL task. It has only 2 unique parameters, but these need to be used multiple within that query. The connection is OLEDB.
    ill simplify my requirement by making up an arbitrary T-SQL "where" clause that will illustrate what i need:
    where
    x = @param1
    and y = @param1
    and z > @param2
    and w > @param2
    moving this into an SSIS execute SQL task will require the following:
    where
    x = ?
    and y = ?
    and z > ?
    and w > ?
    I know i need to specify 4 parameters and remap the same variables multiple times.. like so:
    User:aram1   -> 0
    User:aram1   -> 1
    User:aram2   -> 2
    User:aram2   -> 3
    isnt there a better way? i ask this because in my real task i have 2 params, each is reused 4 and 5 times respectively and it seems stupid to repeat params like this.

    @ _proffy_
    you can pass the same variable or value as parameter multiple times sql task.
    follow the steps below.
    1) type the sql query with parameters in SQL statement tab of sql task editor
    2. in the parameter mapping, select the variables.
      you can select the same variables more than once.
     give the parameter name as 0,1,2,3..... based on variables you require.
    do not forget to chooose the appropriate Datatype.
    ex:
    select * from table1
    where a= ?
    and b=?
    and c= ?
    parameters:
    Var name               param Name
    user::Var1               0   
    user::Var1               1
    user::Var2               2
    so the value becomes a=var1, b= var1 and c= var2

  • Problem Calling a WebService multiple times

    Hi Guys,
    I am a relatively new user of DS 12.2 doing a proof-of-concept to call an in-house WebService for a batch of customer records - lets say 1000.
    The WS has an input schema where it's parameters are within a nested table such that it can be called for many customers in a single call if desired. WS input schema (made-up example)=
    -WS
    --$REQUEST_SCHEMA **added by DS on import
    ---CustVerification
    src_nr
    src_state
    I have successfully been able to create a Data-Flow that builds the input-schema such that 1 WS call is made with a nested input of all 1000 customers. This works and the output from the single call is correct (many records relating to the many inputs etc). Input schema =
    - <CustVerification>
    - <Details>
    <src_nr>1234<src_nr />
    <src_state>KY</src_state>
    </Details>
    - <Details>
    <src_nr>1234<src_nr />
    <src_state>KY</src_state>
    </Details>
    - <Details>
    <src_nr>1234<src_nr />
    <src_state>KY</src_state>
    </Details>
    </CustVerification>
    Now the problem - I am wanting to do this flow so that it calls the WS once PER customer i.e. 1 entry in many of the nested CustVerification structures.
    I have, again, been able to produce the correct XML schema (at least it looks correct) which repeats the Input Schema for each customer record. HOWEVER, when hooking this up to the function call of the WS as before, I either get only 1 single call like before with the last entry in the file run through it..... or, after playing with the query's input schema to add an extra root level and changing FROM clauses to map to the function call schema I then get a huge ACCESS_VIOLATION dump which mentions "LoadDFXML::put_string()+2427 byte(s)" and other such XML-related but non-helpful messages.
    New input schema is:
    - <CustVerification>
    - <Details>
    <src_nr>1234<src_nr />
    <src_state>KY</src_state>
    </Details>
    </CustVerification>
    - <CustVerification>
    - <Details>
    <src_nr>1234<src_nr />
    <src_state>KY</src_state>
    </Details>
    </CustVerification>
    - <CustVerification>
    - <Details>
    <src_nr>1234<src_nr />
    <src_state>KY</src_state>
    </Details>
    </CustVerification>
    So.... am I missing something simple in how I call a WS multiple times as opposed to once with multiple inputs? Could this be a setting/property somewhere? IS this linked with how I do a QueryTransform in a certain way to get the function called the right number of times? Anything else??
    Thanks for any advice/help.
    Flip.

    Thanks for the responses guys.... I actually got past the error with a change to the NRDM structure (as mentioned in the first reply, I think a small problem here really changes things).
    So - what I had to do to get this working properly was to add a new 'dummy' level into the structure - this kept it clean to denote that the 1 large bulk of messages were going to be sent through the WS many times. So - structure looks like this:
    Input_Query:
    - <ROOT>
    - <CustVerification>
    - <Details>
    <src_nr>1234<src_nr />
    <src_state>KY</src_state>
    </Details>
    </CustVerification>
    - <CustVerification>
    - <Details>
    <src_nr>1234<src_nr />
    <src_state>KY</src_state>
    </Details>
    </CustVerification>
    - <CustVerification>
    - <Details>
    <src_nr>1234<src_nr />
    <src_state>KY</src_state>
    </Details>
    </CustVerification>
    </ROOT>
    Then, in the Output schema for the function call, I had to create a dummy extra schema level also - say 'WS_Call', and put the function call within this structure. The FROM mapping has to be set so that both the input_query level AND the input_query.root level are mapped to the WS_Call schema.
    And then it works!
    Summary -- its a bugger.... but playing with the structure levels (and adding your own at times) and FROM clauses can work!
    Cheers,
    Flip.

  • How to stop someone from filling out pdf form multiple times?

    My customers order my service by down loading a .pdf form. They then fill out the form and submit the form to my email. How do I stop a customer from submitting the form multiple times. I would like for the customer to submit the form only once filled out. If I need more info I could follow up to their order manually via email. Thanks for your help!

    One of the main reasons why you have a customer posting multiple submits would be because for some reason he/she doesn't know the first one was successful.
    Add a property your form to record whether or not a valid submit has already happened. Use script to set that property on submit. Check each time the submit operation is fired to see if the property is set. If it is display an error dialog and stop the submit from occurring.
    If someone wants to open multiple copies of your form and fill it out and send it to you, well there's nothing you can do about that.

  • TS3276 how do I get Mail to stop downloading the same email multiple times?

    My mail keeps downloading the same email multiple times.  I've had as many as 10 of the same emial.  How do I stop this?

    Me too - did you ever figure it out?
    You can't even delete from the server in mountain lion.... I did it from my old mac, but it didn't work. I keep having 11,000 new emails that can not even be deleted in blocks!!!
    Was it a gmail account? Mine is, and my other 2 are fine...

  • How to automate saving the same image multiple times?

    Hello. I wish to save the same image multiple times in a folder... is there a way to automate this function? I also need the flexibility of determining the starting number in this image sequence. Thanks.

    Good day!
    I would recommend asking for help over at
    Photoshop Scripting
    And going into more detail about what you want to achieve (maybe post a screenshot, diagram, mock-up to illustrate it).
    Regards,
    Pfaffenbichler

  • Address book has same entries multiple times how can I go back to original cesium

    Address book has same entries multiple times how can I go back to original cesium

    After a couple of days, I'm noticing that the repeat(ing) offenders have more than 10 episodes, and seem to keep repeating them every time I sync.
    They only show once in my phone and in the iTunes Podcasts, but through iTunes and looking at what's in my phone is when I see the repeats.
    Even after I've marked a podcast as played, and deleted it from within my phone, as well as telling iTunes to delete the played episodes, it still shows multiples of the played episodes.
    There doesn't seem to be any rhyme or reason to it either. They aren't the newest ones either.

  • Running the same code multiple times with different paramters automatica​lly

    Hi guys,
    I want to run the same code multiple times with different paramters automatically. Actually, I am doing some sample scans which takes around 2 hours n then I have to be there to change the paramters and run it again. Mostly I do use folowing paramters only
    X_Intial, X_Final, X-StepSize
    Y_Intial, Y_Final, Y-StepSize
       Thanks,
    Dushyant

    All you have to di is put all of the parameters for each run into a cluster array. Surround your main program with a for loop and wire the cluster array through the for loop. A for loop will autoindex an input array so inside the for loop you just have to unbundle the cluster to get the parameters for each run.
    Message Edited by Dennis Knutson on 07-13-2006 07:50 AM
    Attachments:
    Cluster Array.JPG ‏9 KB

  • Printing form multiple times

    Hi Experts,
    how to print the form multiple times? . i have multiple shipto entries....for every new shipto entry form should be printed..can you please provide me with sample code..

    Hi,
    I cannot see if you are using sapscript or smartforms. I expect sapscript.
    You need an ABAP change. The program must as first determine the SHIP TO Addresses.
    Then a loop over these adresses and making the several forms (also using open and close form).
    If you use a smartform you have still a loop over the adresses. But  know you have also to change the smartform. You must give the addressnumber as parameter to the smartform. And the smartform must print that adressnumber,'
    If you need more info. Let me know
    Gr., Frank

Maybe you are looking for