Displaying table using call function 'REUSE_ALV_GRID_DISPLAY'

I have created a table which has product code, product description, and product level.  I am trying to display it using REUSE_ALV_GRID_DISPLAY.  When I Check it, I get the following error message: "PVS2" is not an internal table - the "Occurs n" specification is missing.
Is it possible to copy PVS2 into another table, and then display that table using REUSE_ALV_GRID_DISPLAY?
I have patched together code from sdn, a client program, and my own code and I am starting to get confused.  So, please help me.
Regards,
Al Lal
REPORT  YABHINAV16.
* program to display products at chosen level *
Tables: T179, T179t.
types:  begin of hierarchy,
        prodh type t179-prodh,
        vtext type t179t-vtext,
        stufe type t179-stufe,
        end of hierarchy.
types: begin of text,
prodh type t179t-prodh,
vtext type t179t-vtext,
end of text.
data: pvs type standard table of hierarchy initial size 0.
data: pvs2 type hierarchy.
data: it_text type standard table of text,
wa_text type text.
TYPE-POOLS:SLIS.
*For ALV
DATA: GT_FLD TYPE SLIS_T_FIELDCAT_ALV,
      GT_EV TYPE SLIS_T_EVENT,
      GT_HDR TYPE SLIS_T_LISTHEADER,
      GT_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA: WA_FLD TYPE SLIS_FIELDCAT_ALV,
      WA_EV TYPE SLIS_ALV_EVENT,
      WA_HDR TYPE SLIS_LISTHEADER,
      WA_SORT TYPE SLIS_SORTINFO_ALV,
      WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
DEFINE FLD.
  WA_FLD-FIELDNAME   = &1.
  WA_FLD-TABNAME     = &2.
  WA_FLD-OUTPUTLEN   = &3.
  WA_FLD-SELTEXT_L   = &4.
  WA_FLD-SELTEXT_M   = &5.
  WA_FLD-SELTEXT_S   = &6.
  WA_FLD-COL_POS     = &7.
  WA_FLD-FIX_COLUMN  = &8.
  WA_FLD-DO_SUM      = &9.
  APPEND WA_FLD TO GT_FLD.
  CLEAR WA_FLD.
END-OF-DEFINITION.
CONSTANTS: C_TOP TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
           C_USER_COMMAND            TYPE  SLIS_FORMNAME  VALUE 'USER_COMMAND'.
DATA: MTRL LIKE SY-REPID,
      TITLE LIKE SY-TITLE.
select-options level for t179-stufe no intervals.
start-of-selection.
Select prodh stufe from T179 into corresponding fields of table pvs where stufe in level.
select prodh vtext from t179t into corresponding fields of table it_text for all entries in pvs where prodh = pvs-prodh.
end-of-selection.
sort pvs by prodh.
sort it_text by prodh.
loop at pvs into pvs2.
  read table it_text into wa_text with key prodh = pvs2-prodh.
  if sy-subrc eq 0.
    pvs2-vtext = wa_text-vtext.
    write: / pvs2-prodh, pvs2-vtext, pvs2-stufe.
  endif.
*  modify pvs2.
endloop.
perform BUILD_FIELDCAT.
perform GRID_DISPLAY.
form BUILD_FIELDCAT .
    FLD 'PRODH'   'PVS2'   '20'     'Product Hierarchy'        ' ' ' '  '1'  ''   '' .
    FLD 'VTEXT'   'PVS2'   '40'     'Description '        ' ' ' '  '3'  ''   '' .
    FLD 'STUFE'   'PVS2'    '5'    'Level'        ' ' ' '  '2'  ''   '' .
endform.                    " BUILD_FIELDCAT
form GRID_DISPLAY .
  call function 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM      = MTRL
      I_CALLBACK_USER_COMMAND = 'C_USER_COMMAND'
      I_CALLBACK_TOP_OF_PAGE  = C_TOP
      I_STRUCTURE_NAME        = 'PVS2'
      IS_LAYOUT               = WA_LAYOUT
      IT_FIELDCAT             = GT_FLD
      IT_SORT                 = GT_SORT
      I_DEFAULT               = 'X'
      I_SAVE                  = 'U'
      IT_EVENTS               = GT_EV
    TABLES
      T_OUTTAB                = PVS2[]
    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.                    " GRID_DISPLAY

TYPE-POOLS : SLIS.
DATA : BEGIN OF WA_T001,
             BUKRS LIKE T001-BUKRS,
             BUTXT LIKE T001-BUTXT,
             ORT01 LIKE T001-ORT01,
             END OF WA_T001,
             IT_T001 LIKE TABLE OF WA_T001.
DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
            WA_FCAT LIKE LINE OF IT_FCAT.
DATA : V_NAME LIKE  SY-REPID.
SELECT BUKRS BUTXT ORT01 FROM T001 INTO TABLE IT_T001 UP TO 15 ROWS. V_NAME = SY-REPID.
CALL FUCTION MODULE 'REUSE_ALV_FIELDCATLOG_MERGE. EXPORTING  I_CALBACK_PROGRAM =
V_NAME I_INTERAL_TABNAME = 'WA_T001' I_INCLNAME = V_NAME CHANGING CT_FIELDCAT =
IT_FCAT.
CALL FUNCTION MODULE "REUSE_ALV_GRID_DISPLAY"
EXPORTING
I_CALLBACK_PROGRAM = V_NAME
IT_FCAT = IT_FCAT.
TABLES
     T_OUTTAB  = IT_T001
SY-REPID IS THE SYSTEM VARIABLE WHICH IS HAVING THE ABAP PROGRAM 
OR CURRENT MAIN PROGRAM.
----- Sample Progam -
***INCLUDE YRVR058_DEST_WISE_SUMMARY_DF01 .
*&      Form  DISPLAY_DATA
      text      *-- Rajesh Vasudeva
-->  p1        text
<--  p2        text
FORM DISPLAY_DATA .
  IF ITAB[] IS NOT  INITIAL.
    PERFORM F_APPEND_BLOCK.
  ELSE.
    MESSAGE 'Data not found for the selection
criteria' TYPE 'S'.
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " display_data
*&      Form  f_append_block
      text
-->  p1        text
<--  p2        text
FORM F_APPEND_BLOCK .
  DATA : L_WA_SORT    TYPE SLIS_SORTINFO_ALV,   "For
sort
         L_WA_EVENTS  TYPE SLIS_ALV_EVENT.      "For
events
Event (Top of List)
  CLEAR L_WA_EVENTS.
  L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_LIST.
  L_WA_EVENTS-FORM = C_TOPOFPAGE.
  APPEND L_WA_EVENTS TO I_EVENTS_PART.
Event (Top of Page)
  CLEAR L_WA_EVENTS.
  L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
  L_WA_EVENTS-FORM = 'F_DISPLAY_HEADER_PARTA'(031).
  "f_display_header_part
  APPEND L_WA_EVENTS TO I_EVENTS_PART.
Event (End of List)
  CLEAR L_WA_EVENTS.
  L_WA_EVENTS-NAME = SLIS_EV_END_OF_LIST.
  L_WA_EVENTS-FORM = C_END_OF_LIST.
  APPEND L_WA_EVENTS TO I_EVENTS_PART.
Set Layout Zebra
  STRUCT_LAYOUT-ZEBRA          = 'X'.
  STRUCT_LAYOUT-NUMC_SUM       = 'X'.
  STRUCT_LAYOUT-TOTALS_TEXT    = 'TOTAL:'(032).
set field catalog
  PERFORM F_FIELD_CATALOG_PART.
  ASSIGN ITAB[] TO <F_OUTTAB>.
  V_PART = 'A'.  "initiating list is A
  PERFORM F_DISPLAY_BLOCK USING STRUCT_LAYOUT
                               I_FIELD_CAT_PART[]
                               C_TAB
                               I_EVENTS_PART[]
                               I_SORT_PART[].
ENDFORM.                    " f_append_block
*&      Form  f_field_catalog_part
      text
-->  p1        text
<--  p2        text
FORM F_FIELD_CATALOG_PART .
  REFRESH I_FIELD_CAT_PART.
  CLEAR I_FIELD_CAT_PART.
  PERFORM F_CREATE_CATALOG USING :
*Month
C_TAB 'MONTH'  'MONTH'      SPACE 'L' 7
I_FIELD_CAT_PART[],
*OBD
*C_TAB 'VBELN'  'Delivery'      SPACE 'L' 12
I_FIELD_CAT_PART[],
*DATE
C_TAB 'WADAT_IST'  'Date'      SPACE 'L' 10
I_FIELD_CAT_PART[],
*Destination
C_TAB 'CITY1'  'Destination'      SPACE 'L' 25
I_FIELD_CAT_PART[],
*Qty By Road
C_TAB 'NTGEW_ROAD'  'Road Quantity'   SPACE 'R' 16
I_FIELD_CAT_PART[],
*Rail Qty
C_TAB 'NTGEW_RAIL'  'Rail Quantity'  SPACE 'R' 16 I_FIELD_CAT_PART[],
*Total  Qty C_TAB 'TOT'  'Total Quantity'  SPACE 'R' 16 I_FIELD_CAT_PART[], *RR/Trk No.
  C_TAB 'EXTI2'  'Truck/RR No.' SPACE 'L' 17 I_FIELD_CAT_PART[].
ENDFORM.                    " f_field_catalog_part
*&      Form  f_DISPLAY_block
      text
     -->P_STRUCT_LAYOUT  text
     -->P_I_FIELD_CAT_PART[]  text
     -->P_C_TAB  text
     -->P_I_EVENTS_PART[]  text
     -->P_I_SORT_PART[]  text
FORM F_DISPLAY_BLOCK  USING  FP_LAYOUT         TYPE
SLIS_LAYOUT_ALV
                             FP_I_FCAT         TYPE
SLIS_T_FIELDCAT_ALV
                             VALUE(FP_TABNAME) TYPE
ANY
                             FP_I_EVENTS       TYPE
SLIS_T_EVENT
                             FP_I_SORT         TYPE
SLIS_T_SORTINFO_ALV.
  DATA: V_REPID  TYPE SYREPID,                 
"current Program id
        C_SAVE       TYPE CHAR1 VALUE 'A'.     
"variant save
  V_REPID = SY-REPID.
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = V_REPID
      IS_LAYOUT          = FP_LAYOUT
      IT_FIELDCAT        = FP_I_FCAT[]
      IT_SORT            = FP_I_SORT[]
      I_SAVE             = C_SAVE             "variant
save
      IT_EVENTS          = FP_I_EVENTS[]
    TABLES
      T_OUTTAB           = <F_OUTTAB>
    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.                    " f_DISPLAY_block
*&      Form  f_create_catalog
      text
     -->P_C_TAB  text
     -->P_0085   text
     -->P_0086   text
     -->P_SPACE  text
     -->P_0088   text
     -->P_5      text
     -->P_I_FIELD_CAT_PART[]  text
FORM F_CREATE_CATALOG  USING  FP_I_TABNAME   TYPE
SLIS_TABNAME
                              FP_I_FIELDNAME TYPE SLIS_FIELDNAME
                              FP_I_SELTEXT   TYPE
SCRTEXT_L
                              FP_I_DOSUM     TYPE
CHAR1
                              FP_I_JUST      TYPE C
                              FP_I_OUTPUTLEN TYPE
OUTPUTLEN
                              FP_I_FCAT      TYPE
SLIS_T_FIELDCAT_ALV.
Record for field catalog
  DATA: L_REC_FCAT TYPE SLIS_FIELDCAT_ALV.
  L_REC_FCAT-TABNAME   = FP_I_TABNAME.
  L_REC_FCAT-FIELDNAME = FP_I_FIELDNAME.
  L_REC_FCAT-SELTEXT_L = FP_I_SELTEXT.
  L_REC_FCAT-DO_SUM    = 'X'.
*l_rec_fcat-do_sum    = ' '.
  L_REC_FCAT-JUST      = FP_I_JUST.
  L_REC_FCAT-OUTPUTLEN = FP_I_OUTPUTLEN.
  L_REC_FCAT-DECIMALS_OUT = '2'.
  L_REC_FCAT-KEY          = '1'.
  APPEND L_REC_FCAT TO FP_I_FCAT.
ENDFORM.                    " f_create_catalog
     Subroutines for Headings
*&      Form  f_display_header_partA
      Display header for report for Part A
*&      Form  top_of_page
      text
-->  p1        text
<--  p2        text
FORM TOP_OF_PAGE .
  SKIP 1.
  WRITE:/25 ' Name of Company ',80 'RUN DATE' ,
SY-DATUM.
SKIP 1.
WRITE:/60 'RUN DATE' , SY-DATUM.
  SKIP 1.
  DATA: YR(4) TYPE N,
         FIN_PRD(10) TYPE C.
  IF S_DTABF-LOW+4(2) LT '04'.
    YR = S_DTABF-LOW+0(4) - 1.
    CONCATENATE YR '-' S_DTABF-LOW+2(2) INTO FIN_PRD.
  ELSE.
    YR = S_DTABF-LOW+0(4) + 1.
    CONCATENATE S_DTABF-LOW0(4) '-' YR2(2) INTO
FIN_PRD.
  ENDIF.
  WRITE:/5 'DETAILS OF THE MONTH/DATE WISE DESPATCHES
MADE BY ROAD/RAIL DURING THE YEAR ' , FIN_PRD  .
  SKIP 1.
WRITE :/ 'SALES OFFICE : ' , P_SALES,' ' , RNAME.
SKIP 1.
ENDFORM.                    " DISPLAY_DATA
Award Points If Useful...

Similar Messages

  • Call function 'REUSE_ALV_GRID_DISPLAY' display like list alv

    Hi experts,
    I checked a standard tcode-IDCP.
    It will be displayed like grid alv if I run it directly. However, it will be displayed like list alv if I call the tcode using BDC in a z-report even it call function 'REUSE_ALV_GRID_DISPLAY'.
    Does anyone know why?
    Kindly help.

    Hi Franklin,
    I think when alv grid is running in background, it will be switched to basic list.
    Here I list a part of code in FM 'REUSE_ALV_GRID_DISPLAY' (From Line 106 in ECC6EHP5):
    if ( is_layout-allow_switch_to_list ne space
       and boolean eq if_salv_c_bool_sap=>true )
       or ( sy-binpt eq abap_true ).
         perform globals_push.
         call function 'REUSE_ALV_LIST_DISPLAY'
    endif.
    Thanks,
    Sam

  • CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    Dear Experts,
    I hv created a report using ALV.
    Problem is ,  until I call "CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'" function module, my internal table is sorted fine. but after this function module ( i hv seen in debug mode) , the sort order is getting changed.
    I hv not used any kind of sort in update catalog funcion.
    w_repid = sy-repid.
      PERFORM update_catalog.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                 = w_repid
         I_CALLBACK_USER_COMMAND            = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE             = 'TOP-OF-PAGE'
         IT_FIELDCAT                        = i_fcat[]
         I_SAVE                             = 'X'
        TABLES
          T_OUTTAB                          = i_faglflexa_all
    *  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.
    can any one suggest something.
    Regards,
    maverick

    Thanks for ur reply.
    itab_open.
    status doc no 
    open     101
    open     102
    open     103
    itab_all.
    append itab_open[] to itab_all.
    sort itab_all by date.
    itab_clear
    status doc no 
    clear     104
    clear     105
    claer     106
    loop at itab_clear.
      append itab_clear to itab_all.
    endloop.
    i hv sorted my internal table itab_all based on date only once after copying the data from itab_open. Then i appended the data from itab_clear.
    now  I call CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                 = w_repid
         I_CALLBACK_USER_COMMAND            = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE             = 'TOP-OF-PAGE'
         IT_FIELDCAT                        = i_fcat[]
         I_SAVE                             = 'X'
         IT_SORT                            = ''
        TABLES
          T_OUTTAB                          = itab_all
    *  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.
    and i get the following output.
    status doc no 
    open     101
    open     102
    clear     104
    clear     105
    claer     106
    open     103
    tha's the problem.  why one open item is displayed at the end.  i sorted itab_all after  copying the data from itab_open and after itab_clear.
    regards,
    Maverick

  • 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

  • Updating custom table using call transaction

    How to update a custom table using Call Transaction method. How can we use Table control (Module Pool) for this purpose).

    Vignesh,
    Create a table maintenance transaction for ur custom tables. Check this link for ref...
    http://allaboutsap.blogspot.com/2007/04/table-maintenance-in-sap-step-by-step.html
    And create a BDC recording and code a program accordingly...
    regards,
    karthik

  • Update sap table using a function module call by php code

    Hello,
    I m trying to update the table VBAP using a function module ZZ_SET_DISTANCE  call by a php code.
    But I have this problem:
    the saprfc seems to work well but when I look to the table VBAP the fields have not been update.
    I tried the function module in debug mode and it work good. The fields are update.
    I also handle the saprfc call function and the return SAPRFC_OK
    This are the function module ZZ_SET_DISTANCE, and the php code
    //PHP CODE
    $fce = saprfc_function_discover($sap,"ZZ_SET_DISTANCE");
                  if (! $fce ) {echo "Echec d'ouverture du module fonction "; exit;}
                   saprfc_import ($fce,"COMMANDE", '0000001998');
                   saprfc_table_init($fce,"TBLE_CMDE");
                        $val=array();
                        $val['NUM_POST']='000030';
                        $val['HN_EXP']='';
                        $val['ST_EXP']='';
                        $val['PC_EXP']='';
                        $val['CI_EXP']='';
                        $val['CO_EXP']='';
                        $val['HN_REC']='';
                        $val['ST_REC']='';
                        $val['PC_REC']='';
                        $val['CI_REC']='';
                        $val['CO_REC']='';
                        $val['DIST']='popo';
                        saprfc_table_append ($fce,"TBLE_CMDE", $val);
                 $rfc_rc = saprfc_call_and_receive ($fce);
                 echo "\n".$rfc_rc;
                 if ($rfc_rc != SAPRFC_OK) { if ($sap == SAPRFC_EXCEPTION ) echo ("Exception raised: ".saprfc_exception($fce)); else echo (saprfc_error($fce)); }else{echo '/execution de la function ;}
                 saprfc_function_free($fce);
    //FUNCTION MODULE ZZ_SET_DISTANCE
    FUNCTION ZZ_SET_DISTANCE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(COMMANDE) TYPE  VBELN
    *"  TABLES
    *"      TBLE_CMDE STRUCTURE  ZADD_COM_LOXAN
    DATA : NUMC TYPE VBELN.
    NUMC = COMMANDE .
    WHILE STRLEN( NUMC ) < 10 .
      CONCATENATE '0' NUMC INTO NUMC .
    ENDWHILE .
    DATA tble_addrcomm LIKE LINE OF TBLE_CMDE .
    LOOP AT  TBLE_CMDE INTO  tble_addrcomm.
      DATA : NUMP TYPE POSNR.
      NUMP = tble_addrcomm-NUM_POST.
      WHILE STRLEN( NUMP ) < 6 .
      CONCATENATE '0' NUMP INTO NUMP .
      ENDWHILE .
      UPDATE VBAP SET ARKTX = tble_addrcomm-DIST
      WHERE VBELN EQ COMMANDE
      AND POSNR EQ NUMP.
    ENDLOOP.
    ENDFUNCTION.
    Is anybody can help me?
    thank.

    Marie, create a Blog please, about more details for dummies....
    1) how to connect to sap system?
    2) you run the php code where? in a webserver or where?
    3) wich is the url for run the FM: ZZ_SET_DISTANCE
    4) you placed some dlls files on the web server?
    please is interesting this...
    Thanks

  • How to use CALL FUNCTION '/1BCDWB/SF00000014' in smartform urgent

    hiiiiiiiii
    Iam doing classical report n i want my output to be printed in smartform.
    So my output is in IT_FINAL table.In smartform in Form Interface Table column i had declare :::
    Parameter Name: IT_FINAL
    Type Assignment:LIKE
    Associated Type:ZSD_FINAL ( Its a structure of IT_FINAL)
    And in SE38..iam using...............
    data: FM_NAME1 type RS38L_FNAM.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = 'ZCSF_SDPRSR03_PR'
    importing
    FM_NAME = FM_NAME1.
    CALL FUNCTION FM_NAME1
    EXPORTING
    IT_FINAL = IT_FINAL.
    So while running its giving dump..
    I DONT KNOW HOW TO USE THE ABOVE FUNCTION MODULE.
    CALL FUNCTION '/1BCDWB/SF00000014'
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Please suggest me with example if possible......URGENT.
    (Rewards if solved)
    Regards.

    Hi
    see the below doc and do accordingly
    How to create a New smartfrom, it is having step by step procedure
    http://sap.niraj.tripod.com/id67.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Here is the procedure
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    <b>call function 'SSF_FUNCTION_MODULE_NAME'</b>
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    <b>call function FM_NAME</b>
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Smartform
    you can check this link here you can see the steps and you can do it the same by looking at it..
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    SMARTFORMS STEPS.
    1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
    2. Create Table type(t_struct) of stracture in se11.
    3. In your program declare Internal table(Itab) type table of structure(struct).
    4. Define work area(wa) like line of internal table.
    5. Open Tcode Smartforms
    6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
    7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
    8. In form pages and window, create Page node by default Page1 is available.
    9. In page node you can create numbers of secondary window. But in form there is only one Main window.
    10. By right click on page you can create windows or Go to Edit, Node, Create.
    11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
    12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
    13. In table there are three areas Header, Main Area, Footer.
    14. Right click on the Main area create table line by default line type1 is there select it.
    15. Divide line into cells according to your need then for each cell create Text node.
    16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
    17. Save form and activate it.
    18. Then go to Environment, function module name, there you get the name of function module copy it.
    19. In your program call the function module that you have copied from your form.
    20. In your program in exporting parameter of function pass the internal table(itab).
    SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
    configure forms with data from an SAP System for the relevant business processes.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
    What Transaction to start SAP Smart Forms?
    Execute transaction SMARTFORMS to start SAP Smart Forms.
    Key Benefits of SAP Smart Forms:
    SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.
    You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
    To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
    These actions do not include writing of coding lines or using a Script language.
    Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.
    For Web publishing, the system provides a generated XML output of the processed form.
    Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
    SmartForms System Fields
    Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.
    System fields of Smart Forms
    &SFSY-DATE&
    Displays the date. You determine the display format in the user master record.
    &SFSY-TIME&
    Displays the time of day in the form HH:MM:SS.
    &SFSY-PAGE&
    Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.
    &SFSY-FORMPAGES&
    Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.
    &SFSY-JOBPAGES&
    Contains the total page number of all forms in the currently processed print request.
    &SFSY-WINDOWNAME&
    Contains the name of the current window (string in the Window field)
    &SFSY-PAGENAME&
    Contains the name of the current page (string in the Page field)
    &SFSY-PAGEBREAK&
    Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])
    &SFSY-MAINEND&
    Is set as soon as processing of the main window on the current page ends
    &SFSY-EXCEPTION&
    Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception <exception name >).
    Example Forms Available in Standard SAP R/3
    SF_EXAMPLE_01
    Simple example; invoice with table output of flight booking for one customer
    SF_EXAMPLE_02
    Similar to SF_EXAMPLE_01 but with subtotals
    SF_EXAMPLE_03
    Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request
    Advantages of SAP Smart Forms
    SAP Smart Forms have the following advantages:
    1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.
    2. Displaying table structures (dynamic framing of texts)
    3. Output of background graphics, for form design in particular the use of templates which were scanned.
    4. Colored output of texts
    5. User-friendly and integrated Form Painter for the graphical design of forms
    6. Graphical Table Painter for drawing tables
    7. Reusing Font and paragraph formats in forms (Smart Styles)
    8. Data interface in XML format (XML for Smart Forms, in short XSF)
    9. Form translation is supported by standard translation tools
    10. Flexible reuse of text modules
    11. HTML output of forms (Basis release 6.10)
    12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)
    Regards
    Anji

  • How can use  CALL FUNCTION   READ_TEXT

    Dear SAP Expert,
    I am working in Journal Voucher of smart form.  I want to show Long Text in SF. 
    So i am  using  the READ_TEXT function module to read SAP long text. and use Range of Clear Doc. in driver program.
    i have one ITAB which have 20 rows.
    problem is that CALL FUNCTION   READ_TEXT is not working properly ...........
    i WANT  store Long text   clear Doc. no. wise in my ITAB .
    DATA: FORMNAME TYPE     TDSFNAME VALUE 'ZFI_S_JOUR_VOUCHER'.
      DATA: FM_NAME  TYPE     RS38L_FNAM.
    lv_name = ITAB-BELNR.            
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          id        = c_id
          language  = 'E'
          name      = lv_name
          object    = c_object
        TABLES
          lines     = lt_lines
        EXCEPTIONS
          id        = 1
          language  = 2
          name      = 3
          not_found = 4
          object    = 5.
        IF sy-subrc = 0.
        ELSE.
          LOOP AT lt_lines INTO wa_lines.
            CONCATENATE ld_text wa_lines-tdline INTO ld_text.
          ENDLOOP.
        ENDIF.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME = FORMNAME
        IMPORTING
          FM_NAME  = FM_NAME.
      DATA: V_PRCTR LIKE BSIS-PRCTR.
      CALL FUNCTION FM_NAME
    EXPORTING
        V_TYPE_DES                 = V_TYPE_DES
        P_BUKRS                    = P_BUKRS
    TABLES
          IT_BKPF                    = IT_BKPF
          ITAB                    = Itab
          TY_BSIS                    = TY_BSIS.
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    " call_sm

    hI [See this |http://wiki.sdn.sap.com/wiki/display/BOBJ/FunctionExampleREAD_TEXTABAPwrapper+function]
    Check out the wiki session .
    FUNCTION Z_AW_READ_TEXT_ALL.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(ID) TYPE  THEAD-TDID
    *"     REFERENCE(LANGUAGE) TYPE  THEAD-TDSPRAS
    *"     REFERENCE(NAME) TYPE  THEAD-TDNAME
    *"     REFERENCE(OBJECT) TYPE  THEAD-TDOBJECT
    *"  EXPORTING
    *"     REFERENCE(TEXT) TYPE  CHAR2000
    DATA BEGIN OF TEXTHEADER.
            INCLUDE STRUCTURE THEAD.
    DATA END OF TEXTHEADER.
    DATA BEGIN OF TEXTLINES OCCURS 10.
            INCLUDE STRUCTURE TLINE.
    DATA END OF TEXTLINES.
    CLEAR TEXTHEADER.
    data: l_name type TDOBNAME."TR
    l_name = name."TR
    CALL FUNCTION 'READ_TEXT'
           EXPORTING
                OBJECT                  = OBJECT
                ID                      = ID
                LANGUAGE                = LANGUAGE
                NAME                    = l_NAME "TR
           IMPORTING
                HEADER                  = TEXTHEADER
           TABLES
                LINES                   = TEXTLINES
           EXCEPTIONS
                ID                      = 1
                LANGUAGE                = 2
                NAME                    = 3
                NOT_FOUND               = 4
                OBJECT                  = 5
                REFERENCE_CHECK         = 6
                WRONG_ACCESS_TO_ARCHIVE = 7
                OTHERS                  = 8.
    LOOP AT TEXTLINES.
       CONCATENATE TEXT TEXTLINES into TEXT SEPARATED BY space.
    ENDLOOP.
    ENDFUNCTION.
    Regards,
    koolspy.

  • Unalbe to delete lock entry table using Dequeue function module

    Friends,
    I display a base ALV list with custom app. tool bar. When i click on a button, i submit another report which updates a z-table for that corresponding row. I create a lock object for this entry before submitting the report. After updating the table, I try to delete the lock object using dequeue function module in the called report, but though the subrc is 0, the lock entry is not getting deleted in SM12. The called report, after dequeue, again submits report 1 (the caller). So, when i try to do some operation for the same row which I first selected, it triggers Foreign_lock exception. When I completely go out of the base list, only then the entry is deleted. Can anyone tell me the reason? I have tried with parameters _SCOPE & _SYNCHRON, but same result.
    Regards,
    Sathish R

    Hi,
    The triggering of the dequeue is not in the proper position as it need to be placed.
    Thats the only problem as per u have described the issue.
    Place the deque as soon as the report is return the value.
    I hope it may work ur issue.

  • How to use CALL FUNCTION '/1BCDWB/SF00000014' in smartform

    hiiiiiiiii
    Iam doing classical report n i want my output to be printed in smartform.
    So my output is in IT_FINAL table.In smartform in Form Interface Table column i had declare :::
    Parameter Name: IT_FINAL
    Type Assignment:LIKE
    Associated Type:ZSD_FINAL ( Its a structure of IT_FINAL)
    And in SE38..iam using...............
    data: FM_NAME1 type RS38L_FNAM.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME              = 'ZCSF_SDPRSR03_PR'
        importing
           FM_NAME              = FM_NAME1.
      CALL FUNCTION FM_NAME1
        EXPORTING
          IT_FINAL = IT_FINAL.
    So while running its giving dump..
    I DONT KNOW HOW TO USE THE ABOVE FUNCTION MODULE.
    CALL FUNCTION '/1BCDWB/SF00000014'
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Please suggest me with example if possible......URGENT.
    (Rewards if solved)
    Regards.

    Hi Hemant
    Before running u r program agai  run ur smartfor the it will release fm take that one and place ur program and change that name to FM_NAME1 and check once

  • Table used in function module

    Hi,
    As I am programming ABAP for the first time I have a question which I think is pretty basic.
    I have created a function module Z_POPUP_GET_VALUES which calls the function POPUP_GET_VALUES. I got some sample code from another forum post and it defines a table name and fieldname. But I am not sure what this table is suppose to be (or do)? Is it an ABAP dictionary table? If so, how do I create one based on the characteristic I want to display??
    The implemented code is as follows:
    DATA: i_sval Like sval occurs 1 with Header Line.
    data: v_subrc like sy-subrc.
    i_sval-tabname =
    i_sval-fieldname = '?????'.i_sval-fieldtext = 'Eiendelsområde'.
    i_sval-field_obl = 'X'.
    append i_sval.
    CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
    NO_VALUE_CHECK = ' '
    POPUP_TITLE = 'Asset Area'
    START_COLUMN = '5'
    START_ROW = '5'
    IMPORTING
    RETURNCODE = v_subrc
    TABLES
    FIELDS = i_sval
    EXCEPTIONS
    ERROR_IN_FIELDS = 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.
    All help appreciated!
    Best regards,
    TM

    Hi,
    Tables in function modules are parameter to that function module.
    That can be processed when the function module code is called.
       and the result can be stored in the tables.
    Tables have a structure like ABAP Dictionary structure .ie. You will be
    define the table type as a dictionary table.
    Regards,
    <b>Ramganesan K</b>

  • Populate SELECT-OPTIONS default value using CALL FUNCTION

    Hi Experts,
    I would like to populate SELECT-OPTIONS s_currm default with value in w_currm, however, it doesn't seem to work.  Can you please advise what the correct syntax is.
    Note that CALL FUNCTION 'GET_CURRENT_YEAR' is working correctly and populating w_currm (as I can use it in a SQL SELECT statement), however, it does not seem to work for SELECT-OPTIONS s_currm.
    Thank you for your time.
    Code snippet is as a follows:
    REPORT  Z_DOWNLOAD_BSIS_TEST.
    *Data Declaration
    DATA: w_currm TYPE BSIS-MONAT.
    *Define current fiscal month
    CALL FUNCTION 'GET_CURRENT_YEAR'
      EXPORTING
        BUKRS         = 'X999'     " Company Code
        DATE          = SY-DATUM   " Date to find fiscal year for
      IMPORTING
        CURRM         = w_currm.   " Current Fiscal Month
    SELECT-OPTIONS s_currm FOR w_currm
                   DEFAULT w_currm. " The default value is NOT being populated (appears blank)

    Hi Venkat.O,
    Thank you for your clear response.  I have implemented your suggestion and it works, however, I now have a new problem. 
    Each time the report is executed or the "multiple selection" button is clicked the selection fields are populated once again with the default (low) values.
    For example, when report is first opened the s_curry field displays '2010'.  Clicking "multiple selection" results in another '2010' being populated.  After executing the report the selection screen is populated again with '2010' (so we now have '2010' listed 3 times in the s_curry field).
    How do I prevent the default values from repeating?
    REPORT  Z_DOWNLOAD_BSIS_TEST
    *Data Declaration
    DATA:  w_currm TYPE BSIS-MONAT,
           w_curry TYPE BSIS-GJAHR,
           w_prevm TYPE BSIS-MONAT,
           w_prevy TYPE BSIS-GJAHR.
    SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME TITLE text-001 .
    *Parameters to enter the path
    PARAMETERS: FILENAME(128) OBLIGATORY DEFAULT '/usr/sap/tmp/TEST.txt'
                             LOWER CASE.
    SELECT-OPTIONS: s_curry FOR w_curry,
                    s_currm FOR w_currm.
    SELECTION-SCREEN END OF BLOCK b11.
    AT SELECTION-SCREEN OUTPUT.
    *Define current/previous financial periods
    CALL FUNCTION 'GET_CURRENT_YEAR'
      EXPORTING
        BUKRS         = 'X999'     " Company Code
        DATE          = SY-DATUM   " Date to find fiscal year for
      IMPORTING
        CURRM         = w_currm    " Current Fiscal Month
        CURRY         = w_curry    " Current Fiscal Year
        PREVM         = w_prevm    " Previous Fiscal Month
        PREVY         = w_prevy.   " Previous Fiscal Year
        s_curry-low = w_curry.
        s_curry-option = 'EQ'.
        s_curry-sign = 'I'.
        APPEND s_curry.
        CLEAR  s_curry.
        s_currm-low = w_currm.
        s_currm-option = 'EQ'.
        s_currm-sign = 'I'.
        APPEND s_currm.
        CLEAR  s_currm.

  • Exporting Data Of an RDBMS Table to another RDBMS Table using ODI Functions

    Hi,
    I'm facing a problem while Exporting Data Of an RDBMS Table to another RDBMS Table using ODI User Functions.
    Name:- User_Func
    Group:- Training
    Syntax:- User_Func($(SrcField))
    Implementation Syntax:-
    (CASE
    WHEN $(SrcField) > 40000 THEN 'HIGH'
    WHEN $(SrcField) BETWEEN 30000 AND 40000 THEN 'MEDIUM'
    ELSE 'LOW'
    Linked Technology:-Oracle
    To map the GRADE column of my TARGET_EMPTABLE I write
    User_Func(SRC_TABLENAME.SALARY)
    using Expression Editor.
    I got the following error
    ODI-1227: Task ODI_FUNC_INTERFACE (Export) fails on the source ORACLE connection Source_DataServer.
    Caused By: java.sql.SQLSyntaxErrorException: ORA-00905: missing keyword
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:947)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1283)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1441)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3823)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1671)
         at oracle.odi.query.JDBCTemplate.executeQuery(JDBCTemplate.java:189)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:89)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:1)
         at oracle.odi.runtime.agent.execution.DataMovementTaskExecutionHandler.handleTask(DataMovementTaskExecutionHandler.java:70)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:619)
    and in code tab it is:-
    select     
         SRC_FUNC_TABLE.E_NUMBER     E_NUMBER,
         SRC_FUNC_TABLE.E_NAME     E_NAME,
         SRC_FUNC_TABLE.E_LOC     E_LOC,
         (CASE
    WHEN SRC_FUNC_TABLE.E_SAL > 40000 THEN 'HIGH'
    WHEN SRC_FUNC_TABLE.E_SAL BETWEEN 30000 AND 40000 THEN 'MEDIUM'
    ELSE 'LOW'
    )     E_GRADE
    from     SOURCE_SCHEMA.SRC_FUNC_TABLE SRC_FUNC_TABLE
    where     (1=1)
    Please Help

    Anindya Chatterjee wrote:
    Hi,
    I'm facing a problem while Exporting Data Of an RDBMS Table to another RDBMS Table using ODI User Functions.
    Name:- User_Func
    Group:- Training
    Syntax:- User_Func($(SrcField))
    Implementation Syntax:-
    (CASE
    WHEN $(SrcField) > 40000 THEN 'HIGH'
    WHEN $(SrcField) BETWEEN 30000 AND 40000 THEN 'MEDIUM'
    ELSE 'LOW'
    )Your CASE statement syntax is not correct
    It is missing an END key word
    It should be
    (CASE
    WHEN $(SrcField) > 40000 THEN 'HIGH'
    WHEN $(SrcField) BETWEEN 30000 AND 40000 THEN 'MEDIUM'
    ELSE 'LOW'
    END )
    Linked Technology:-Oracle
    To map the GRADE column of my TARGET_EMPTABLE I write
    User_Func(SRC_TABLENAME.SALARY)
    using Expression Editor.
    I got the following error
    ODI-1227: Task ODI_FUNC_INTERFACE (Export) fails on the source ORACLE connection Source_DataServer.
    Caused By: java.sql.SQLSyntaxErrorException: ORA-00905: missing keyword
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:947)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1283)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1441)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3823)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1671)
         at oracle.odi.query.JDBCTemplate.executeQuery(JDBCTemplate.java:189)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:89)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:1)
         at oracle.odi.runtime.agent.execution.DataMovementTaskExecutionHandler.handleTask(DataMovementTaskExecutionHandler.java:70)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:619)
    and in code tab it is:-
    select     
         SRC_FUNC_TABLE.E_NUMBER     E_NUMBER,
         SRC_FUNC_TABLE.E_NAME     E_NAME,
         SRC_FUNC_TABLE.E_LOC     E_LOC,
         (CASE
    WHEN SRC_FUNC_TABLE.E_SAL > 40000 THEN 'HIGH'
    WHEN SRC_FUNC_TABLE.E_SAL BETWEEN 30000 AND 40000 THEN 'MEDIUM'
    ELSE 'LOW'
    )     E_GRADE
    from     SOURCE_SCHEMA.SRC_FUNC_TABLE SRC_FUNC_TABLE
    where     (1=1)
    Please Help

  • Add entries to database tables using update function module

    Hi All,
    I have a small requirement, in which I need to update Z-tables usimg update function module in update task. In the calling program, I have gathered the data in a field symbol value of type any. I need to pass the same to that function module to update the data which is in the field symbol.
    Please guide me how to achieve this technically.
    Thanks in advance,
    Pradipta .

    Hi,
    I believe you already have evrything with you.....Start Coding the same and come back with any Coding issue.
    I believe you will not be able to pass the Field Symbol in FM Interface.....You need to pass the Variable which Field Symbol is referring....

  • Displaying alias using MemberAlias function

    Hi,
    In my HFR report, I have Product dimension in the Page axis as user prompt. I need to display the prompt selection in the report header. For that I am using the function MemberAlias.
    MemberAlias("Grid1",Current,"Product"). But this doesn't return the alias of the selected Product member. It shows the member name.
    This problem occurs for the dimensions which are there in the Page axis. For dimensions on Row and Column axis, it works fine.
    Please help.
    Thanks in advance
    -Aparna

    Hi Aparna,
    Sorry I was a little distracted. member name can never display alias. :-)
    Actually this is a bug in a FR that page member, never shows up alias by using functions.
    Anyway what can you do as a work around, is to create a another grid having prompt on that dimension. Define prompt exactly in the same way as in the first grid. Then use merge similar prompts option in the workspace, so that user get it only once.
    Then refer the cells of the second grid to get alias inside a text box. and for that either you can use <<Getheading >> or <<MemberAlais >>
    fucntions. Hope this will help you to get what you want.
    Regards,
    Rahul

Maybe you are looking for