Calling Function in a loop for CM

Hi,
I have the program to create Credit Memo with user selected records. It is working if the user selects any one customer and it will create CM for that customer. But now user wants to select different customers and based on each different vkorg vtweg spart kunnr it has to create different Credit Memo's. How should I put the function in the loop so that it creates different CM's based on each customer.
Please help me.
Thanks,
Neelu.
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'CMEMO'.
      DESCRIBE TABLE gt_zprice LINES lv_cnt.
      DO lv_cnt TIMES.
        lv_index = sy-index + 1.
        READ LINE lv_index FIELD VALUE chbox.
        IF chbox = 'X'.
          READ TABLE gt_zprice INTO gs_zprice1 INDEX sy-index.
          IF sy-subrc EQ 0.
            gs_zprice1-index = sy-index.
            APPEND gs_zprice1 TO gt2_zprice.
            CLEAR gs_zprice1.
          ENDIF.
        ENDIF.
        CLEAR chbox.
      ENDDO.
      gt4_zprice[] = gt2_zprice[].
*      SORT gt2_zprice BY vkorg vtweg spart kunnr.
*      DELETE ADJACENT DUPLICATES FROM gt2_zprice
*                      COMPARING vkorg vtweg spart kunnr.
*      DESCRIBE TABLE gt2_zprice LINES lv_lines.
*      IF lv_lines = 1.
          LOOP AT gt4_zprice INTO gs_zprice1.
            AT NEW kunnr.
              MOVE 'Y' TO lv_flg.
            ENDAT.
            IF lv_flg EQ 'Y'.
              PERFORM headerdata.
              PERFORM texts.
              CLEAR lv_flg.
            ENDIF.
            PERFORM itemdata.
            APPEND gs_zprice1 TO gt3_zprice.
            CLEAR gs_zprice1.
          ENDLOOP.
          lv_itemno = 10.
          PERFORM call_function.
          PERFORM update_pricetable.
          PERFORM errorcheckandcommit.
          PERFORM displaydata.
          REFRESH gt2_zprice.
          CLEAR chbox.
          CLEAR lv_lines.
          REFRESH partner.
          REFRESH item.
          REFRESH itemx.
          REFRESH lt_schedules_in.
          REFRESH lt_schedules_inx.
          REFRESH conditions1.
          REFRESH order_text.
        ELSE.
          REFRESH gt2_zprice.
          CLEAR chbox.
          EXIT.
        ENDIF.
  ENDCASE.

call the credimemo create routines at end of kunnr inside the loop.
LOOP AT gt4_zprice INTO gs_zprice1.
            AT NEW kunnr.
              MOVE 'Y' TO lv_flg.
            ENDAT.
            IF lv_flg EQ 'Y'.
              PERFORM headerdata.
              PERFORM texts.
              CLEAR lv_flg.
            ENDIF.
            PERFORM itemdata.
            APPEND gs_zprice1 TO gt3_zprice.
            CLEAR gs_zprice1.
<b>at end of kunnr.
      PERFORM call_function.
          PERFORM update_pricetable.
          PERFORM errorcheckandcommit.
          PERFORM displaydata.
          REFRESH gt2_zprice.
          CLEAR chbox.
          CLEAR lv_lines.
          REFRESH partner.
          REFRESH item.
          REFRESH itemx.
          REFRESH lt_schedules_in.
          REFRESH lt_schedules_inx.
          REFRESH conditions1.
          REFRESH order_text.
endat.</b>
          ENDLOOP.
          lv_itemno = 10.
       ELSE.
          REFRESH gt2_zprice.
          CLEAR chbox.
          EXIT.
        ENDIF.
  ENDCASE.

Similar Messages

  • Performance issue: CALL FUNCTION inside a Loop.

    Hi Friends
    I have a Performance Issue. That is, inside a loop...endloop a CALL FUNCTION has been used which gets data from another database table. Finally it's appended into another internal table. Please see this :
      LOOP AT i_mdkp.
        REFRESH lt_mdtbx.
        CLEAR lt_mdtbx.
        CALL FUNCTION 'READ_MRP_LIST'
          EXPORTING
            idtnum        = i_mdkp-dtnum
            icflag        = 'X'
          tables
            mdtbx         = lt_mdtbx
        APPEND LINES OF lt_mdtbx TO i_mdtb.
      ENDLOOP.
    It happens for each record available in i_mdkp. Suppose, i_mdkp have around 50000 records, it needs to call the function module till that much time.
    So, I want to split it. Can I?
    Please give me your valueable suggestions.
    Regards
    Senthil

    If internal table i_mdkp has 50,000 records it does not mean that you need to run 50,000 iterations. You just need dtnum from internal table i_mdkp so you number of iterations should be eqaul to the unique number of dtnum in the internal table. Sort the internal table by dtnum and delete adjacent duplicates from the internal table comparing dtnum before looping. Look at the code below.
    DATA i_mdkp_tmp LIKE TABLE OF i_mdkp.
    IF NOT i_mdkp[] IS INITIAL.
      i_mdkp_tmp[] = i_mdkp[].
      SORT i_mdkp BY dtnum.
      DELETE ADJACENT DUPLICATES FROM i_mdkp COMPARING dtnum.
      REFRESH i_mdtb.
      LOOP AT i_mdkp.
        CALL FUNCTION 'READ_MRP_LIST'
          EXPORTING
            idtnum = i_mdkp-dtnum
            icflag = 'X'
          TABLES
            mdtbx = lt_mdtbx.
        APPEND LINES OF lt_mdtbx TO i_mdtb.
        REFRESH lt_mdtbx.
      ENDLOOP.
      i_mdkp[] = i_mdkp_tmp[]
    ENDIF.

  • How to call function module in BPS for step by step execution.??

    Hi All,
    I used the Exit(function module) in char relation ship for derivation,combination check and proposal defined the source char and target char and function module for Derivation,every thing working fine.But how can i call the function module once i entered the data in my planning layout.Just i need to validate my function module working fine or not???
    How can i debug the function modules in BPS ,because we are using the exits in different places,please any one can explain each place how we can do the debug??Where we have to put the break points?? .
    Just give the path i can try in my system BPS 4.0 version we are using.
    Note:I know how to debug the function module only.but I don't know Using BPS screen's .
    Thanks,

    Hi ,
    Thanks for replies about my question??.
    If i am using the exit in my char relation ship how can i debugg that exit???
    if i am using BPS0 how to do it???If i am using BPS_WB how to do it??
    Case1.Variable (type Exit) I known how to do debugg this one in BPS0 but i'm not sure in BPS_WB??
    Case2:Char Relation Ship(Type Exit) how to do in BPS0 and BPS_WB??.
    Thanks.

  • Calling a function in a loop

    Hello,
    I have something like this:
             declare
             cursor c is
               select 2,3,4 from dual;
             begin
             for r in c loop
               dbms_output.put_line( prod_stb(81852225, r, 'STB 1 HORECA'));
             end loop;
             end;I wanna call (and output the results) that function in a loop, for all 2,3,4 values for the 2nd parameter.
    How can i do this?
    with simple 'r' in the 2nd parameter does not work
    Thanks!

    So the 2nd parameter should be 2,3 and 4 (in a loop).Well, as far as I understand, that's exactly what you'll get:
    SQL> begin
      2    for r in ( select level+1 col from dual connect by level <= 3 )
      3    loop
      4      dbms_output.put_line( r.col);
      5    end loop;
      6  end;
      7  /
    2
    3
    4
    PL/SQL procedure successfully completed.

  • How to use select a vi function inside a loop?

    I am modifying the notifier basics part 2.vi to send a notifier to each of 64 sub-vi's. How can you use the 'select a vi' function inside a loop for 64 iterations to access the individual filenames??
    Attachments:
    Notifier_BASICS_Part_2.vi ‏87 KB

    If all you are trying to do is send notifiers to each of these 64 subVIs, I would suggest not doing it in a loop, but rather just placing the 64 subVIs in your diagram.
    The alternative is of course to use the call by reference node and have an array of VI names. This is a little cleaner on the diagram, but 1) doesn't occur in parallel and 2) is a bit tricky. Additionally, you have to be sure that your array of filenames is correct, and that you NEVER move or rename those VIs. Of course, you could always put them in a directory and create an array by reading the directory contents.
    Either way, good luck, it doesn't sound like fun.

  • Function module in SRM for adding number to date excluding weekends

    Hi Experts,
    Please help to get the standard FM in SRM for adding number to date and getting next date excluding weekends.
    Thanks in Advance.
    Thanks,
    Sahil

    This kind of custom FM can be created easily.
    But if you want to use standard FM then "DATE_CONVERT_TO_FACTORYDATE" FM is good but you need a factory calendar id which has all working days and weekend days specified (also public holidays if required). Then call this FM in loop for a count of days and it will give working day after "entered date + number of days"
    So if calendar has only weekdays and weekends specified, it will add number of days in specified date excluding weekends.
    Thanks,
    Murtuza

  • How to call function which return and out

    My function specifcation is
    FUNCTION GetGoogleScholarActivation (
    pi_clnt_id IN google_scholar_status.clnt_id%TYPE,
    pi_status_type IN ci_status_type_tab_type,
    po_status OUT ci_status_tab_type,
    po_date OUT ci_date_tab_type
    RETURN NUMBER ;
    where type is
    TYPE ci_status_type_tab_type IS TABLE OF VARCHAR2 (1) INDEX BY BINARY_INTEGER;
    TYPE ci_status_tab_type IS TABLE OF VARCHAR2 (10) INDEX BY BINARY_INTEGER;
    TYPE ci_date_tab_type IS TABLE OF VARCHAR2 (8) INDEX BY BINARY_INTEGER;
    I am trying to call function in SQL PLUS for testing as
    declare
    var number ( 10);
    TYPE p_st1 IS TABLE OF VARCHAR2 (1) INDEX BY BINARY_INTEGER;
    p_st p_st1 ;
    type p_status1 IS TABLE OF VARCHAR2 (1) INDEX BY BINARY_INTEGER;
    p_status p_status1 ;
    TYPE p_date1 IS TABLE OF VARCHAR2 (8) INDEX BY BINARY_INTEGER;
    p_date p_date1 ;
    Begin
    p_st(0) := 'A';
    var := PQDKGOSH.GetGoogleScholarActivation(11920 , p_st, p_status ,p_date );
    dbms_output.put_line ('Activation_status '|| p_status(0) );
    dbms_output.put_line ('Activation_date '|| p_date(0) );
    dbms_output.put_line ('Retun Value'|| var );
    End;
    but getting error PLS-00306: wrong number or types of arguments in call to
    'GETGOOGLESCHOLARACTIVATION'
    so how to test from SQL Plus

    HI
    I tried to execute below like this
    declare
    var number ( 10);
    p_st ci_status_type_tab_type ;
    p_status ci_status_tab_type;
    p_date ci_date_tab_type;
    Begin
    p_st(0) := 'A';
    var := PQDKGOSH.GetGoogleScholarActivation(11920 , p_st, p_status ,p_date );
    dbms_output.put_line ('Activation_status '|| p_status(0) );
    dbms_output.put_line ('Activation_date '|| p_date(0) );
    dbms_output.put_line ('Retun Value'|| var );
    End;
    still iget error
    PLS-00201: identifier 'CI_STATUS_TYPE_TAB_TYPE' must be declared
    becuse this declareation i did in package specification .
    and i am trying to execute the function .

  • Calling Function Module RV_ORDER_FLOW_INFORMATION in a Loop!

    Hi Guys,
    I need to fetch SD document Flow data into Bw for which I have created an Extractor using function modules. I am using a Standard FM  "RV_ORDER_FLOW_INFORMATION" which is called in the LOOP as below.
    LOOP AT VIT_VBRK INTO VFL_VBRK.
        CLEAR VBCO6.
        VBCO6-MANDT = SY-MANDT.
        VBCO6-VBELN = VFL_VBRK-VBELN.
        REFRESH TVBFA_TAB[].
        CLEAR TVBFA_TAB.
    CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
      EXPORTING
       AUFBEREITUNG        = '2'
       BELEGTYP            = VFL_VBRK-VBTYP
        COMWA               = VBCO6
       NACHFOLGER          = 'X'
       N_STUFEN            = '50'
       VORGAENGER          = 'X'
       V_STUFEN            = '50'
    IMPORTING
       BELEGTYP_BACK       = BELEG_TYP
      TABLES
        VBFA_TAB            = TVBFA_TAB
    EXCEPTIONS
       NO_VBFA             = 1
       NO_VBUK_FOUND       = 2
       OTHERS              = 3
    IF SY-SUBRC <> 0.
    ENDIF.
    *OTHER CODE LOGIC*
    ENDLOOP.
    Now the problem is if I run this only once, i.e VIT_VBRK having only 1 document, the result I get is correct. However, if this same code is run in a LOOP with many different values in VIT_VBRK, the first Loop gives correct values and all subsequent values (value of TVBFA_TAB- RFMNG to be precise) are incorrect.
    I am guessing this is b'coz of some internal tables and work areas specific to the function module are not refreshed and the values of earlier iterations are adding up in the subsequent runs. can any one tell me if theres any specific 'REFRESH' statement or FM to be called before calling this FM.
    Thanks in Advance,
    Parth Shah.

    Hi Matt,
    I debugged the Function module like u said in 2 different Session, what I found was that there is a yet another function module called with in the FM RV_ORDER_FLOW_INFORMATION, i.e "GET_HANDLE_SD_DOCUMENTFLOW_SP" heres what the code in this FM looks like.
    FUNCTION GET_HANDLE_SD_DOCUMENTFLOW_SP.
    *"Lokale Schnittstelle:
    *"  EXPORTING
    *"     REFERENCE(HANDLE) TYPE REF TO  IF_EX_BADI_SD_DOCUMENTFLOW
    *"     VALUE(ACTIVE) TYPE  XFELD
    IF L_HANDLE_SD_DOCUMENTFLOW IS INITIAL.
        CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
          IMPORTING
            ACT_IMP_EXISTING = BADI_SD_DOCUMENTFLOW_ACTIVE
          CHANGING
            INSTANCE         = L_HANDLE_SD_DOCUMENTFLOW
            EXCEPTIONS
            OTHERS           = 1.
        IF NOT SY-SUBRC = 0.
          CLEAR BADI_SD_DOCUMENTFLOW_ACTIVE.
        ENDIF.
      ENDIF.
      HANDLE = L_HANDLE_SD_DOCUMENTFLOW.
      ACTIVE = BADI_SD_DOCUMENTFLOW_ACTIVE.
    ENDFUNCTION.
    the only difference I found in the two sessions was that L_HANDLE_SD_DOCUMENTFLOW  is initial in the first run and then in all subsequent run its value remains the same, while in fact it should reset. Sadly there is no REFRESH procedure / Subroutine for it.
    Any idea how i can refresh it, or may be by-pass this check (IF L_HANDLE_SD_DOCUMENTFLOW IS INITIAL) ?
    Edited by: shahparth on Feb 17, 2011 8:39 AM

  • Example/help for CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' editable

    hello experts,
    are there any example using function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'  with editable columns.
    Or, have somebody an idea to resolve my problem.
    I can edit the fields in the alv-grid, but I don't see the changes in the internal table using 'LVC_TRANSFER_FROM_SLIS' function.
    thanks and regards.
    K. WErner

    hi,
    here is the code for editable Hieararchical ALV
    TYPE-POOLS : slis.
    TABLES : mseg.
    DATA : BEGIN OF itab_head OCCURS 0,
            mat LIKE mseg-matnr,
    *        matnr LIKE mseg-matnr,
            werks LIKE mseg-werks,
           END OF itab_head.
    DATA : BEGIN OF itab_item OCCURS 0,
    *        mat LIKE mseg-matnr,
            matnr LIKE mseg-matnr,
            werks LIKE mseg-werks,
            mblnr LIKE mseg-mblnr,
            menge LIKE mseg-menge,
           END OF itab_item.
    DATA : t_fcat TYPE slis_t_fieldcat_alv,
           key_info TYPE slis_keyinfo_alv,
           t_eve TYPE slis_t_event,
           gt_subtot TYPE slis_t_sortinfo_alv,
           subtot LIKE LINE OF gt_subtot,
           t_listhead TYPE slis_t_listheader,
           st_line TYPE slis_listheader.
    DATA : lin_no TYPE i.
    DATA : t_mtdoc LIKE mseg-mblnr.
    SELECT-OPTIONS : mat FOR mseg-matnr.
    INITIALIZATION.
      PERFORM build_cat USING t_fcat.
      PERFORM build_eve.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM dis_data.
    *&      Form  build_cat
    *       text
    *      -->TEMP_FCAT  text
    FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.
      DATA : wa_fcat TYPE slis_fieldcat_alv.
      wa_fcat-tabname = 'ITAB_HEAD'.
      wa_fcat-fieldname = 'MAT'.
      wa_fcat-seltext_m = 'Material'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB_HEAD'.
      wa_fcat-fieldname = 'WERKS'.
      wa_fcat-seltext_m = 'Plant'.
      wa_fcat-edit = 'X'.
      wa_fcat-input = 'X'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB_ITEM'.
      wa_fcat-fieldname = 'MBLNR'.
      wa_fcat-seltext_m = 'Material Doc.'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB_ITEM'.
      wa_fcat-fieldname = 'MENGE'.
      wa_fcat-seltext_m = 'Quantity'.
      wa_fcat-edit = 'X'.
      wa_fcat-input = 'X'.
      wa_fcat-do_sum = 'Y'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      subtot-spos = 1.
      subtot-fieldname = 'MAT'.
      subtot-tabname = 'ITAB_HEAD'.
      subtot-up = 'X'.
      subtot-group = 'X'.
      subtot-subtot = 'X'.
      subtot-expa = 'X'.
      APPEND subtot TO gt_subtot.
    ENDFORM.                    "build_cat
    *&      Form  build_eve
    *       text
    FORM build_eve.
      DATA : wa_eve TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         i_list_type           = 0
       IMPORTING
         et_events             = t_eve
    *   EXCEPTIONS
    *     LIST_TYPE_WRONG       = 1
    *     OTHERS                = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE t_eve INTO wa_eve WITH KEY name = 'TOP_OF_PAGE'.
      IF sy-subrc = 0.
        wa_eve-form = 'TOP_OF_PAGE'.
        MODIFY t_eve FROM wa_eve INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    "build_eve
    *&      Form  get_data
    *       text
    FORM get_data.
      SELECT matnr werks mblnr menge FROM mseg INTO CORRESPONDING FIELDS OF TABLE itab_item
      WHERE matnr IN mat.
    ENDFORM.                    "get_data
    *&      Form  dis_data
    *       text
    FORM dis_data.
      key_info-header01 = 'MAT'.
      key_info-item01 = 'MATNR'.
      key_info-header02 = 'WERKS'.
      key_info-item02 = 'WERKS'.
      REFRESH itab_head.
      LOOP AT itab_item.
        ON CHANGE OF itab_item-matnr OR itab_item-werks.
          MOVE-CORRESPONDING itab_item TO itab_head.
          itab_head-mat = itab_item-matnr.
          APPEND itab_head.
        ENDON.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
          i_callback_program             = 'ZALV_PRDS'
          it_fieldcat                    = t_fcat
          it_sort                        = gt_subtot
          it_events                      = t_eve[]
          i_tabname_header               = 'ITAB_HEAD'
          i_tabname_item                 = 'ITAB_ITEM'
          is_keyinfo                     = key_info
        TABLES
          t_outtab_header                = itab_head
          t_outtab_item                  = itab_item
    * EXCEPTIONS
    *   PROGRAM_ERROR                  = 1
    *   OTHERS                         = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "dis_data
    *&      Form  top_of_page
    *       text
    FORM top_of_page.
      CLEAR st_line.
      st_line-typ = 'H'.
      st_line-info = 'Dhwani Shah'.
      APPEND st_line TO t_listhead.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = t_listhead
    *   I_LOGO                   =
    *   I_END_OF_LIST_GRID       =
    *   I_ALV_FORM               =
    ENDFORM.                    "top_of_page
    reward if usefull.....

  • Help:alternate for calling function in where clause

    Hi ,
    In below query i'm calling function in where clause to avoid COMPLETE status records,due to this query taking 700 secs to return result.If i'm remove below function condition it's returning results with in 5 secs.Can you some one advice to any alternate idea for this?
    WHERE mark_status != 'COMPLETE'
    SELECT assessment_school,
      subject,
      subject_option,
      lvl,
      component,mark_status,
      mark_status
      NULL AS grade_status,
      NULL AS sample_status,
      :v_year,
      :v_month,
      :v_formated_date,
      :v_type,
      cand_lang
    FROM
      (SELECT assessment_school,
        subject,
        subject_option,
        lvl,
        programme,
        component,
        paper_code,
        cand_lang,
        mark_entry.get_ia_entry_status(:v_year, :v_month, assessment_school, subject_option, lvl, cand_lang, component, paper_code) AS mark_status
      FROM
        (SELECT DISTINCT ccr.assessment_school,
          ccr.subject,
          ccr.subject_option,
          ccr.lvl,
          ccr.programme,
          ccr.language AS cand_lang,
          ccr.paper_code,
          ccr.component
        FROM candidate_component_reg ccr
        WHERE ccr.split_session_year = :v_year
        AND ccr.split_session_month  = :v_month
        AND EXISTS
          (SELECT 1
          FROM IBIS.subject_component sc
          WHERE sc.year          = ccr.split_session_year
          AND sc.month           = ccr.split_session_month
          AND sc.paper_code      = ccr.paper_code
          AND sc.assessment_type = 'INTERNAL'
          AND sc.subject_option NOT LIKE '%self taught%'
          AND sc.component NOT IN ('PERFORMANCE  PRODUCTION','PRESENTATION WORK','REFLECTIVE PROJECT','SPECIAL SYLLABUS INT. ASSESSMENT')
        AND NVL(ccr.withdrawn,'N') = 'N'
        AND ccr.mark_status       != 'COMPLETE'
        AND EXISTS
          (SELECT 1
          FROM school s
          WHERE s.school_code   = ccr.assessment_school
          AND s.training_school = 'N'
    WHERE mark_status != 'COMPLETE';

    One thing you can test quickly is to put the function call in it's own select ...from dual.
    This might make a difference.
    However, only you can check this, I don't have your tables or data.
    So, what happens if you use:
        paper_code,
        cand_lang,
      (select mark_entry.get_ia_entry_status(:v_year, :v_month, assessment_school, subject_option, lvl, cand_lang, component, paper_code) from dual ) AS mark_status
      FROM
        (SELECT DISTINCT ccr.assessment_school,  --<< is the DISTINCT really needed?
          ccr.subject,
          ccr.subject_option,
    ...Also, try to find out the purpose of that above DISTINCT, is it really needed or is there some join missing?

  • Calling a user defined function as default value for a column

    Hi All
    Can we call a user defined function as default value for a column ??
    for example:
    create or replace  function test1  return number is
    begin
    return 10;
    end;
    create table testt
    (id  as test1,
      name varchar2(20));
    getting error:
    Error at line 1
    ORA-02000: missing ( keywordThanks
    Ashwani
    Edited by: Ashwani on Jan 16, 2012 1:19 AM

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Database » SQL and PL/SQL which you can get more quick response
    Regard
    Helios

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • Direct approach for - Message class used in Call Function - possible?

    Hi All
    This is I guess a very simple question, but I could not find the solution.
    If i use the function: POPUP_TO_CONFIRM, I can hand over to the export some text symbols directly from the text elements.
    Example:
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            titlebar              = text-011
            text_question         = text-030
            text_button_1         = text-024
            icon_button_1         = 'icon_checked '
            text_button_2         = text-026
            icon_button_2         = 'icon_incomplete'
            default_button        = '2'
            display_cancel_button = ''
            start_column          = 25
            start_row             = 6
          IMPORTING
            answer                = answer.
    But I'm using a message class in this progamm.
    <b>So my question is, how can I use directly a message from the message class within the function?</b>
    I'm not asking for a 2-step approach (copy into text1 and set text1 to function). I would like to know how to use the text from the class directly into the function.
    Thanks
    Petra

    Hi
    May be this way.
       data : v_text1(72) type c,
              v_text2(72) type c,
           v_text3(72) type c,
              v_text4(72) type c.
        message i175(YVV) into v_text1.
        message i176(YVV) into v_text2.
        message i177(YVV) into v_text3.
        message i178(YVV) into v_text4.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            titlebar              = v_text1
            text_question         = v_text2
            text_button_1         = v_text3
            icon_button_1         = 'icon_checked '
            text_button_2         = v_text4
            icon_button_2         = 'icon_incomplete'
            default_button        = '2'
            display_cancel_button = ''
            start_column          = 25
            start_row             = 6
          IMPORTING
            answer                = answer.
    aRs

  • Modify toolbar for alv using CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'

    Hi Experts,
    I am using CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC' inside an exit.
    I need to modify the tolbar with just three options :-
    a-  add new row
    b- delete rows
    c- save data
    Please guide me step by step as how to proceed as I am very new to ALV.
    and after applying your solution to show the toolbar what should I do to Make these buttons working.
    Thanks a lot for your replies in advance.
    regards,
    Udit

    I'm not really sure why you would use an ALV grid display in a user exit.  I'm not sure how that works.  Another point is that the ALV object is really easier to use once you get used to it.
    However:
    Usually you would create a GUI status, and just add your buttons to it.  Then when the function module is called specify the gui status, and user command.
    For example
    v_repid = sy-repid.
    w_user_command = 'USER_COMMAND'
    w_set_status = "Status you define below.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_bypassing_buffer       = 'X'
          i_callback_program       = w_repid
          i_callback_pf_status_set = w_set_status
          i_callback_user_command  = w_user_command
          is_layout                = w_layout
          i_structure_name         = 'ZGOODSMOVE'
        tables
          t_outtab                 = gt_outtab
        exceptions
          program_error            = 1
          others                   = 2.
      if sy-subrc <> 0.
        message e000 with 'Error in Displaying the Output Report'(025).
      endif.
    Put your code for the different functions into one user function module
    form user_command using r_comm like sy-ucomm
                            rs_selfield type slis_selfield.
      read table it_final1 index rs_selfield-tabindex.  " This will give you back the row you selected
      if sy-subrc = 0.
      endif.
    endform.
    To define the GUI Status:
    Copy the status from
    Then change it to add your fields

  • Which is the best way for a called function to identify caller class name.

    Which is the best way for a called function to identify the caller class name .
    1)Using sun.reflect.Reflection from called function
                    Class caller = Reflection.getCallerClass(2);
                    System.out.println("Caller Class Name ::"+caller.getName());2) Analyzing current threads stack trace from called function
                    StackTraceElement[] stElements=Thread.currentThread().getStackTrace();
                    System.out.println("Caller Class Name ::"+stElements[3].getClassName());Is there any alternate ways to achieve the same .Which is the best way ?
    Called function doesn’t have any arguments, I don’t want t pass any arguments from caller function to called function.
    Plz help.
    With kind regards
    Paul

    798185 wrote:
    Which is the best way for a called function to identify the caller class name .
    Is there any alternate ways to achieve the same.SecurityManager
        // 0 is the anonymous SecurityManager class
        // 1 is this class (also works in static context)
        // 2 is calling class
        static Class getClass(int i) {
            return new SecurityManager() {
                protected Class[] getClassContext() {
                    return super.getClassContext();
            }.getClassContext();

Maybe you are looking for