Call to Fm dynamically

HI all,
i need to call this Fm for 5 times,
my question is instead of calling to the Fm 5 times one by one there is way to do
that better (nicer) ,i don't want to use perform.
e.g.
lv_domain_name = 'DATFM'.
  CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      tabname        = iv_table_name
      langu          = sy-langu
      lfieldname     = iv_domain_name
    TABLES
      fixed_values   = lt_domain_values
    EXCEPTIONS
      not_found      = 1
      internal_error = 2
      OTHERS         = 3.
  IF sy-subrc <> 0.
Implement suitable error handling here
  ENDIF.
lv_domain_name = 'DCPFM'.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      tabname        = iv_table_name
      langu          = sy-langu
      lfieldname     = iv_domain_name
    TABLES
      fixed_values   = lt_domain_values
    EXCEPTIONS
      not_found      = 1
      internal_error = 2
      OTHERS         = 3.
  IF sy-subrc <> 0.
Implement suitable error handling here
  ENDIF.
and so on...for 5 times
Best Regards
Nina

You can check below sample,  Or you can prepare an internal table using changing parameters and call function in loop statement.
TYPE-POOLS abap.
DATA: line     TYPE c LENGTH 80,
      text_tab LIKE STANDARD TABLE OF line,
      filename TYPE string,
      filetype TYPE c LENGTH 80,
      fleng    TYPE i.
DATA: func TYPE string,
      ptab TYPE abap_func_parmbind_tab,
      ptab_line TYPE abap_func_parmbind,
      etab TYPE abap_func_excpbind_tab,
      etab_line TYPE abap_func_excpbind.
func = 'GUI_DOWNLOAD'.
filename = 'c:\temp\text.txt'.
filetype = 'ASC'.
ptab_line-name = 'FILENAME'.
ptab_line-kind = abap_func_exporting.
GET REFERENCE OF filename INTO ptab_line-value.
INSERT ptab_line INTO TABLE ptab.
ptab_line-name = 'FILETYPE'.
ptab_line-kind = abap_func_exporting.
GET REFERENCE OF filetype INTO ptab_line-value.
INSERT ptab_line INTO TABLE ptab.
ptab_line-name = 'DATA_TAB'.
ptab_line-kind = abap_func_tables.
GET REFERENCE OF text_tab INTO ptab_line-value.
INSERT ptab_line INTO TABLE ptab.
ptab_line-name = 'FILELENGTH'.
ptab_line-kind = abap_func_importing.
GET REFERENCE OF fleng INTO ptab_line-value.
INSERT ptab_line INTO TABLE ptab.
etab_line-name = 'OTHERS'.
etab_line-value = 10.
INSERT etab_line INTO TABLE etab.
CALL FUNCTION func
  PARAMETER-TABLE
    ptab
  EXCEPTION-TABLE
    etab.
CASE sy-subrc.
  WHEN 1.
ENDCASE.

Similar Messages

  • Call transformation with dynamic table

    hi
    i uploaded the xml file from application server into a internal table
    data : begin of t_x occurs 0,
    d type string,
    end of t_x.
      OPEN DATASET file FOR INPUT IN TEXT MODE ENCODING DEFAULT .
      DO.
        READ DATASET file INTO t_x-d.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
        append t_x.
        clear t_x.
        ENDIF.
      ENDDO.
      CLOSE DATASET filename.
    and after i want to call call transformation but i can't put a structure ref to a table like this
    CALL TRANSFORMATION ('ID')
    SOURCE XML xmlupl
    RESULT tab = t001[]
    because my file xml are not always the same structure.
    So is it possible to have a call transformation wit dynamic structure
    thanks for your help
    serge

    Hello Serge
    If you know what kind of structure you require for your itab you can dynamically create the appropriate itab:
    DATA:
      gd_struc    TYPE tabname,
      gdo_data    TYPE REF TO DATA.
    FIELD-SYMBOLS:
      <gt_itab>   TYPE TABLE.
    * Somehow find the required structure name
      gd_struc = 'KNA1'.  " for example
    * Create data reference with required type (dynamically)
      CREATE DATA gdo_dref TYPE (gd_struc).
    * Assign the data reference to your field symbol
      ASSIGN gdo_data->* TO <gd_itab>.
    * NOTE: <gd_itab> has the line structure of 'KNA1'.
    Regards
       Uwe

  • Can a transaction be called in background dynamically using ABAP program??

    Hi Experts,
    Can a transaction be called in background dynamically using ABAP program without BDC???
    Regards,
    Mansi.

    u can create job dynamically through programming..Try this sample code..
    data: jobname like tbtcjob-jobname value
                                 ' TRANSFER TRANSLATION'.
    data: jobcount like tbtcjob-jobcount,
          host like msxxlist-host.
    data: begin of starttime.
            include structure tbtcstrt.
    data: end of starttime.
    data: starttimeimmediate like btch0000-char1.
    Job open
      call function 'JOB_OPEN'
           exporting
                delanfrep        = ' '
                jobgroup         = ' '
                jobname          = jobname
                sdlstrtdt        = sy-datum
                sdlstrttm        = sy-uzeit
           importing
                jobcount         = jobcount
           exceptions
                cant_create_job  = 01
                invalid_job_data = 02
                jobname_missing  = 03.
      if sy-subrc ne 0.
                                           "error processing
      endif.
    Insert process into job
    SUBMIT zreport and return               << Here it is a static call but u can make it dynamic
                    with p_param1 = 'value'
                    with p_param2 = 'value'
                    user sy-uname
                    via job jobname
                    number jobcount.
      if sy-subrc > 0.
                                           "error processing
      endif.
    Close job
      starttime-sdlstrtdt = sy-datum + 1.
      starttime-sdlstrttm = '220000'.
      call function 'JOB_CLOSE'
           exporting
                event_id             = starttime-eventid
                event_param          = starttime-eventparm
                event_periodic       = starttime-periodic
                jobcount             = jobcount
                jobname              = jobname
                laststrtdt           = starttime-laststrtdt
                laststrttm           = starttime-laststrttm
                prddays              = 1
                prdhours             = 0
                prdmins              = 0
                prdmonths            = 0
                prdweeks             = 0
                sdlstrtdt            = starttime-sdlstrtdt
                sdlstrttm            = starttime-sdlstrttm
                strtimmed            = starttimeimmediate
                targetsystem         = host
           exceptions
                cant_start_immediate = 01
                invalid_startdate    = 02
                jobname_missing      = 03
                job_close_failed     = 04
                job_nosteps          = 05
                job_notex            = 06
                lock_failed          = 07
                others               = 99.
      if sy-subrc eq 0.
                                           "error processing
      endif.
    Regards,
    JOy.

  • Need to call a configuration dynamically in SAP CRM 2007

    Hi,
    I need to call one configuration dynamically. In the runtime one configuration should be called upon fulfilling some conditions.
    I need your help regarding this.
    Points, Guaranteed.
    Thanks,
    Santosh

    Hi Santosh,
    We have made a solution where we call different configurations based on the UI object type. In the IMG entry called "Define UI Object Types" you can create a new custom object type. This you can use when you configure your view in transaction BSP_WD_CMPWB. Here you then copy your standard configuration to a new one. In the new one you set Object type = the object you have created in customizing. And config key you set to the same as you normally use. Then you have two different configurations that can be called depending on your requirements. We call it based on the business role of the users. But you can of course yourself determine on what criteria the method should call one or the other configuration.
    In the method you will need to set the variable cv_object_type to the name of your own object type. Then the system will use this key to determine the configuration. After implementation you will see that it uses this object type by clicking F2 button in the UI.
    /Anders

  • Calling Function Modules Dynamically

    Hi All,
           Is it possible to call a function module dynamically i.e. to pass the module name and the import and export parameters dynamically at runtime. Please provide a way of achieving this.
    Regards,
                 Milan Thaker

    Hello,
    Read this SAP documentation on calling function modules dynamically: [http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_DYNAMIC.htm|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_DYNAMIC.htm] Here you have an example explaining the technique.
    Also check this link on [ABAP FAQs|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/840ad679-0601-0010-cd8e-9989fd650822#q-29].
    Cheers,
    Suhas
    Edited by: Suhas Saha on Mar 9, 2010 3:33 PM

  • Calling a procedure dynamically in forms

    Hi all
    I'm using Oracle 6, is there anyway to call a procedure dynamically, i mean the procedure called differs according to a certain condition. The procedure is local in the form not in the database, how can this be achieved
    Thanks

    Hello,
    user497979 wrote:
    what i want is as the following
    IF cond = 1 THEN
    proc1;
    ELSIF cond = 2 THEN
    proc2;
    ELSIF cond = 3 THEN
    proc3;
    .................. so onWell, i think the way you are showing with IF CONDITION is smart enough to call the procedures. And it will be also easy to understand.
    I'm searching for a way to call the procedure as follows
    proc||cond for exampleBut why? What is the purpose to do like this? Any efficiency or any logical reason?
    Another option You can create one procedure and call the code depend on parameter you pass like
    PROCEDURE MY_PROC(pCond IN NUMBER) IS
    BEGIN
      IF pCond=1 THEN
        -- Do something here...
      ELSIF pCond=2 THEN
       -- Do something here...
      ELSE
       -- Do something here...
      END IF;
    END;And while calling the procedure you can call the procedure by passing the value of pCond upon your requirement like
    MY_PROC(<parameter value>);But still the IF CONDITION exists either you use inside or outside the procedure.
    -Ammad

  • Call javascript function dynamically

    Can this be done to call Javascript function dynamically? What I mean is suppose I use Javascript to submit form and target the reply to a popup window:
      function cForm() {
         win=window.open('','myWin','toolbars=0');
         document.aForm.q.value='12345';     
         document.aForm.target='myWin';
         document.aForm.submit();
      }I target the form reply to popup window myWin. Suppose the reply body contains some Javascript function doX(). Is it possible to call doX() automatically, after the submit and the reply is loaded on myWin, maybe using some onload event in the popup window?

    On the PopUo Windows BODY onLoad, call the method doX()

  • In EPM10, how do you call/reference a dynamic range from a macro.

    Hi Gurus
    In EPM10, [we are using SP16,P1], how do you call/reference a dynamic range from a macro.
    EG, in the BPC input sheet below, we have BPC reports ‘000’,’001’,’002’. For report ‘001’,users are able to select from diffent versions which each have different number of months. In the forecast version below, there are 7 months. We require a macro to select & delete f'cast data content of report ‘002’, there after we will manipulate it via the macro and return it. However, standard excel named ranges don’t work per BPC7.x and don’t dynamically expand.
    The macro code in 7.x was:
    Range(“REPORT1_RANGE”).Select >> Does any oneknow the replacement in EPM10 please?

    The following macro which accesses API's looks like it would help to define the report range:
    Sub TopLeftCell()
    Range("c26").Select
    Application.Run "EPMExecuteAPI", "GetDataTopLeftCell", "", "Sales Planning", "001"
    End Sub
    Anybody able to assist with the syntax of this macro..it currently runs without error, however does not return any result?? Note:
    * the parameter ''" relates to the text which i believe can be left if using macros
    *the parameter "Sales Planning" is my worksheet name
    *the parameter "001" is my report definition.
    I was hoping to return the result back to cell C26. Thanks All

  • Method to call a FORM dynamicly

    Hi,
        Is there a method to call a form dynamicly? I need something to replace "PERFORM FORM1" to "PERFORM variable".
    Thanks
    Lilan

    Hi Lilan
    I think its useful for u.
    DATA : BEGIN OF itab OCCURS 0,
              objid TYPE i,
              endda TYPE d,
           END OF itab.
    FIELD-SYMBOLS : <ttext>.
    itab-objid = 1.itab-endda = sy-datum.
    APPEND itab.
    itab-objid = 2.itab-endda = sy-datum.
    APPEND itab.
    itab-objid = 3.itab-endda = sy-datum.
    APPEND itab.
    itab-objid = 0.itab-endda = sy-datum.
    APPEND itab.
    itab-objid = 4.itab-endda = '20041212'.
    APPEND itab.
    itab-objid = 5.itab-endda = '99991212'.
    APPEND itab.
    itab-objid = 0.itab-endda = '99991212'.
    APPEND itab.
    CLEAR itab.
    LOOP AT itab.
      WRITE : / itab-objid , itab-endda.
    ENDLOOP.
    WRITE :/.
    DELETE itab WHERE endda+0(4) NE '9999' AND objid IS INITIAL.
    ASSIGN 'PRINT' TO  <ttext>.
    PERFORM <ttext>.
    *&      Form  <ttext>
    FORM <ttext>.
      LOOP AT itab.
        WRITE : / itab-objid , itab-endda.
      ENDLOOP.
    ENDFORM.                    " <ttext>
    Reward all the helpful answers..
    With Regards
    Navin Khedikar

  • Info group being not called while using Dynamic Actions

    Hi,
    I am facing a scenario that, while we execute some action from PA40 like termination, then it will call my subroutine for dynamic actions which will be calculating the last day worked and updating the same in Info Type 0041.
    For updating the IT 0041, i am using the function module HR_MAINTAIN_MASTERDATA. and IT0041 is getting updated properly. But now the problem is coming that when the control comes out of subroutine, it is going back to the PA40 Screen and not to the next screen of the Info group.
    What can be the cause for the same.
    RND I have done on my part: I have commented/uncommented the return parametre RP50D-Date1, commented/uncomented the use of function modules to lock and Unlock the pernr.
    Please give ur comments.
    Thanks in Advance.

    Hi Nisha,
    Not sure if I have understood correctly, but if you just wanted to calculate leaving date and write the same date in IT0041 then you don't need a function module:
    1. Create a small program, as follows:
    REPORT  ZHR_PY_R0008                           .
    INCLUDE MPPDAT00.
    TYPE-POOLS HRQTA.
    TABLES: P0000,
            RP50D,
            T001P.
    ROUTINE CALLED BY TABLE T588Z
    FORM CHANGE_DATE.
      RP50D-DATE1 = P0000-BEGDA - 1 .
    ENDFORM.                    " CHANGE_DATE
    This program will give you the last working day written to RP50D-DATE1
    2. Simply enter the following lines into table T588Z:
    0000 04 499*- LEAVING ACTION - Populate Infotypes with leave date -*
    0000 04 500 P T001P-MOLGA='08'
    0000 04 501 P PSPAR-TCLAS='A'
    0000 04 502 P PSPAR-MASSN='*'/X   (* equals your leaving action types)
    0000 04 503 P PSPAR-MASSN='*'/X   (* equals your leaving action types)
    0000 04 504 F CHANGE_DATE(ZHR_PY_R0008)
    0000 04 505 ******** INF.0041  ********
    0000 04 506 I COP,0041,,,(P0000-BEGDA),(P0000-ENDDA)/D
    0000 04 507 W P0041-DAR07='*'   (* equals your date type)
    0000 04 508 W P0041-DAT07=RP50D-DATE1
    or if you are simply looking to delimit IT0041 with the leave date then replace lines 506-508 with:
    0000 04 506 I MOD,0041,,,(RP50D-DATE1),(RP50D-DATE1)/D
    0000 04 507W     P0041-ENDDA=RP50D-DATE1
    This will solve your problem : - )

  • Calling search helps dynamically in module pool program

    Hi Experts,
    I have created two search helps. I need to call these search helps in my module pool program dynamically for a single field (i.e ZMATNR).
    you might be known... if it is a single search help, we can assign that in field attributes.
    But here... I need to call different search helps for a single field based on the condition.
    Pls help me.
    Thanks
    Raghu

    Hi,
    Use the below function module and  pass the search help created in search help field according to the condition.
    Process on Value-request.
    if condition = A.
    call function " F4IF_FIELD_VALUE_REQUEST"
    TABNAME           =                                                         
    FIELDNAME        =                                                       
    SEARCHHELP     =  "Mention search help created                                                          
    Elseif  Conditon =B.
    call function " F4IF_FIELD_VALUE_REQUEST"
    TABNAME           =                                                         
    FIELDNAME        =                                                       
    SEARCHHELP     =  "Mention search help created      
    Endif.
    Regards,
    Prabhudas

  • How to call communication channel dynamically? Please help!

    Hi Experts,
       BizTalk -
    > XI -
    > SAP SYS01
                          XI|----
    >SAP SYS02
       We are integrating Biztalk with SAP via XI. BizTalk send rosattenet PIP via JMS adapter to XI. XI then sends the PIP data to SAP system using RFC adapter.
       In the PIP we have a parameter for plant code. Now if plant code is 'ABC' then we need to send the data to SAP SYS01 else if plant code is 'XYZ' then send the data to SAP SYS02.
      In other words we have RFC communication channel one each for each SAP system.
      This is like calling the communication channel dynamically based on palnt code.
      How can we do this in XI? Please help!
    Thanks & Regards,
    Gopal
    Edited by: GOPAL BALIGA on Jan 12, 2009 7:35 AM

    this is a typical case for a XPATH based conditional routing. note that your receiver will have binding with the interface and the communication channel
    ref:
    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

  • Calling Message mapping Dynamically based on a field value

    Hi gurus,
    I have
    1 source inteface
    1 target interface
    3 Message mapping programs based on the 1 source and 1 Target Interfaces
    I need to decide Dynamically as which message mapping program should be called based on the Input provided by the source system.
    For example:
    If the souce side file sends a field value=1 then message mapping 1 should be called
    If the source side file sends a field value=2 then message mapping 2 should be used...
    Pls provide me help on this ASAP.

    As ur source and target structures are always same, u should have used same mapping with multiple conditions instead of using three different mappings.
    Right now for ur requirement, in ID -> standard Interface Determination, u can use multiple interface mappings based on condition.
    Check heading "Specifying Conditions (for Multiple Inbound Interfaces)" here
    http://help.sap.com/saphelp_nw04s/helpdata/en/42/ea20e737f33ee9e10000000a1553f7/content.htm
    Regards,
    Prateek

  • Calling the package dynamically inside a procedure

    HI
    i have table which contains contains package name, procedurename,input parameters and output parameters as columns like below.
    Table name is PKG_META_DATA.
    package_name Procedure_name input parameters output parameters
    pkg1 prc1 i_location,i_type o_date
    pkg2 prc3 i_location o_date ,o_prev_date
    Note:Input parameters and output parameters will vary according to package
    Now i need to write a procedure which calls package dynamically and display the output values.
    i have tried it in this way but it it is not working.please help
    declare
    l_text varchar2(1000);
    cursor c1 is select package_name,Procedure_name,input parameters,output parameters from pkg_meta_date;
    begin
    for cur in c1 loop
    execute immediate 'begin '||package_name||'.'||Procedure_name||'('||input parameters ||output parameters||');'
    --display output values from a package
    dbms_output.put_line( o_date );
    dbms_output.put_line( o_prev_date );
    end loop;
    end;

    user12057782 wrote:
    Now i need to write a procedure which calls package dynamically and display the output values.Why do such a silly and stupid thing? Do you have technical justification for wanting to call code dynamically?
    And if you reallly and truly need to use dynamic PL/SQL calls, then using bind variables is mandatory. Unless you want to fragment and trash the shared pool and waste a lot of CPU by burning it on hard parsing.
    This also means that execute immediate is the wrong choice. (it does not support dynamic binding)
    And if I foam a bit at the mouth with this response - simply that I'm getting utterly frustrated seeing yet again dynamic SQL being (ab)used, without the foggiest notion of how to do so correctly, and with complete ignorance of the repercussions on security and performance.
    Dynamic coding is NOT the best thing since slice bread. It was never even a consideration as a being better choice.
    What it is, is wrong - 99% of the time. Wrong ito design. Wrong for security. Wrong for performance. Wrong for flexibility.

  • Multiple procedure calls in a dynamic command

    The point of grouping procedures calls in the same command was to reduce network traffic and improve performance.
    I am trying to convert this dynamic command that works with MSSQL :
    sprintf(strcmd,"execute MyProc '%s' execute %s '%s'",arg1,dynproc,arg1);
    Is there a way to translate this command to Oracle ODBC ?
    I tried things like {Call MyProc '%s'}{Call %s('%s')} but it does not work.
    Thanks in advance for any help.
    null

    Have you tried executing the second procedure from within the first? It looks reasonable since they both have the same args.
    TKW
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Pascale Lacroix ([email protected]):
    The point of grouping procedures calls in the same command was to reduce network traffic and improve performance.
    I am trying to convert this dynamic command that works with MSSQL :
    sprintf(strcmd,"execute MyProc '%s' execute %s '%s'",arg1,dynproc,arg1);
    Is there a way to translate this command to Oracle ODBC ?
    I tried things like {Call MyProc '%s'}{Call %s('%s')} but it does not work.
    Thanks in advance for any help.
    <HR></BLOCKQUOTE>
    null

  • Calling search helps dynamically

    Hi all,
    I have two search helps. I need to call these search helps in my Application dynamically for a single field (PARNR) based on PARVW.
    If it is a single search help, we can assign that in field attributes.
    But here... I need to call different search helps for a single field based on the condition.
    Pls help me.
    Thanks
    Kiran

    Hi Kiran,
    I Think by using OVS help u can acieve this, using WDR_OVS as used component.
    here examples... check
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/70cee684-ccbb-2c10-3c94-91e806e5f7ac
    /people/shruti.rathour/blog/2008/05/05/ovs-help-in-web-dynpro-abap
    http://wiki.sdn.sap.com/wiki/display/WDABAP/InputhelpofObjectValueSelectioninWDABAP
    Cheers,
    Kris.
    Edited by: kissnas on Mar 26, 2011 5:17 AM

Maybe you are looking for

  • How Insert the input parameter to database through Java Bean

    Hello To All.. I want to store the input parameter through Standard Action <jsp:useBean>. jsp:useBean call a property IssueData. this property exist in SimpleBean which create a connection from DB and insert the data. At run time when I click on subm

  • Open link in new tab next to original tab?

    I've noticed since updating to FF12 that now when I click to get "open link in new tab," the new tab opens on the far right of my tabs rather than next to the tab I clicked from, as it did in FF3.6. Is there any way to get it to work the old way? Tha

  • My c5180 will print in color but not black and white

    I can't print in black and white with my HP Photosmart C5180 all in one. I put in a new cartage and it still only print in color without black ink. I've tried all the buttons in HP Print and Scan Doctor but I don't know what it is that I should like

  • ITunes only play audio with videos. regular songs won't play

    I have tried everything from updating, to uninstalling and downloading a new version. Music videos, movies, TV, etc. as long as there is video sound will play but plain audio won't play. I audio diamond won't move either. Everything transfers to my i

  • How to group the values with this partition over clause ?

    Hi, I have a nice request : select  c.libelle "Activité", sum(b.duree) "Durée" from    fiche a, activite_faite b,         activites c, agent d where   a.date_activite BETWEEN TO_DATE('20/09/2009', 'DD/MM/YYYY') AND TO_DATE('26/10/2009', 'DD/MM/YYYY')