Function calling function passing data

We have developed an MQSERIES utility that is a function that calls many related functions and its purpose is to perform a variety of MQSeries functions with minimal interaction required by the user. The user provides the message, an activity code (pd for puts, gd for gets, pr for putting requests for replies, etc.) and a couple other parameters. The user gets back the message, a return flag (good, bad, truncated, etc). . Our MQSERIES function is a function of the calling module. Our function has it's series of includes with classes, functions, etc. The calling program needs a couple includes (to define the passed data areas) and a function prototype of our function (void mqcmd090(typefilefdi &, typefilemsg &, typefilemdi &);) and after the user does string copies and so forth into the passed data areas they currently call the function (mqcmd090(currpassarea, currmessage, currquetable);) After our function is called these passed data areas are manipulated by the user's module. They inquire into the return code, they may do activity (with message ids, etc), they manipulate the message and may send it back (replies, etc). Our dilemma is this. The users want our module to be stand-alone. It should be compiled and linked by itself. Their module should be compiled and linked by itself. They don't mind having a couple includes for the common passed structures but our modules should not be a function in theirs.
How can I compile our function (and how can they call it) so that we can keep the communications going both ways between modules? A system call can't do it because they can send us information but they can't receive information back. If our module needs an upgrade we should just be able to change and recompile ours and their next execution should get the changes.
I am at a loss and would greatly appreciate any assistance on this matter.
Thanks,
Dennis Bartizal

We have developed an MQSERIES utility that is a function that calls many related functions and its purpose is to perform a variety of MQSeries functions with minimal interaction required by the user. The user provides the message, an activity code (pd for puts, gd for gets, pr for putting requests for replies, etc.) and a couple other parameters. The user gets back the message, a return flag (good, bad, truncated, etc). . Our MQSERIES function is a function of the calling module. Our function has it's series of includes with classes, functions, etc. The calling program needs a couple includes (to define the passed data areas) and a function prototype of our function (void mqcmd090(typefilefdi &, typefilemsg &, typefilemdi &);) and after the user does string copies and so forth into the passed data areas they currently call the function (mqcmd090(currpassarea, currmessage, currquetable);) After our function is called these passed data areas are manipulated by the user's module. They inquire into the return code, they may do activity (with message ids, etc), they manipulate the message and may send it back (replies, etc). Our dilemma is this. The users want our module to be stand-alone. It should be compiled and linked by itself. Their module should be compiled and linked by itself. They don't mind having a couple includes for the common passed structures but our modules should not be a function in theirs.
How can I compile our function (and how can they call it) so that we can keep the communications going both ways between modules? A system call can't do it because they can send us information but they can't receive information back. If our module needs an upgrade we should just be able to change and recompile ours and their next execution should get the changes.
I am at a loss and would greatly appreciate any assistance on this matter.
Thanks,
Dennis Bartizal

Similar Messages

  • How to use this function call function 'REUSE_ALV_COMMENTARY_WRITE' in alv

    hi all
    thanks in advance
    how to use this function in alv programming
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    why use and what purpose use this function plz tell me details
    plz guide me
    thanks

    Hi
    see this exmaple code where i had inserted a LOGO by useing this FM
    *& Report  ZTEST_ALV_LOGO
    REPORT  ztest_alv_logo.
    TYPE-POOLS : slis.
    *ALV Formatting tables /structures
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: gt_events   TYPE slis_t_event.
    DATA: gs_layout   TYPE slis_layout_alv.
    DATA: gt_page     TYPE slis_t_listheader.
    DATA: gs_page     TYPE slis_listheader.
    DATA: v_repid     LIKE sy-repid.
    *ALV Formatting work area
    DATA: w_fieldcat TYPE slis_fieldcat_alv.
    DATA: w_events   TYPE slis_alv_event.
    DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.
    INITIALIZATION.
      PERFORM build_events.
      PERFORM build_page_header.
    START-OF-SELECTION.
    *perform build_comment.     "top_of_page - in initialization at present
      SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.
    *perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
    *USING = Row, Column, Field name, display length, table name, heading
    *OR
      PERFORM build_fieldcat.
      gs_layout-zebra = 'X'.
    *top of page event does not work without I_callback_program
      v_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program                = v_repid
          i_structure_name                  = 'BSID'
       i_background_id                   = 'ALV_BACKGROUND'
          i_grid_title                      = 'This is the grid title'
      I_GRID_SETTINGS                   =
          is_layout                         = gs_layout
          it_fieldcat                       = gt_fieldcat[]
          it_events                         = gt_events[]
        TABLES
          t_outtab                          = gt_bsid.
    Form..............:  populate_for_fm
    Description.......:  Populates fields for function module used in ALV
    FORM populate_for_fm USING p_row
                               p_col
                               p_fieldname
                               p_len
                               p_table
                               p_desc.
      w_fieldcat-row_pos      = p_row.          "Row Position
      w_fieldcat-col_pos      = p_col.          "Column Position
      w_fieldcat-fieldname    = p_fieldname.    "Field name
      w_fieldcat-outputlen    = p_len.          "Column Lenth
      w_fieldcat-tabname      = p_table.        "Table name
      w_fieldcat-reptext_ddic = p_desc.         "Field Description
      w_fieldcat-input        = '1'.
      APPEND w_fieldcat TO gt_fieldcat.
      CLEAR w_fieldcat.
    ENDFORM.                    " populate_for_fm
    *&      Form  build_events
    FORM build_events.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = gt_events.
      READ TABLE gt_events
                 WITH KEY name =  slis_ev_user_command
                 INTO ls_event.
      IF sy-subrc = 0.
        MOVE slis_ev_user_command TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
      READ TABLE gt_events
                 WITH KEY name =  slis_ev_top_of_page
                 INTO ls_event.
      IF sy-subrc = 0.
        MOVE slis_ev_top_of_page TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
    ENDFORM.                    " build_events
    *&      Form  USER_COMMAND
    When user command is called it uses 2 parameters. The itab
    passed to the ALV is in whatever order it currently is on screen.
    Therefore, you can read table itab index rs_selfield-tabindex to get
    all data from the table. You can also check r_ucomm and code
    accordingly.
    FORM user_command USING  r_ucomm     LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      READ TABLE gt_bsid INDEX rs_selfield-tabindex.
    error checking etc.
      SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.
      CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
    ENDFORM.                    "user_command
    *&      Form  top_of_page
    Your own company logo can go here if it has been saved (OAOR)
    If the logo is larger than the size of the headings in gt_page,
    the window will not show full logo and will have a scroll bar. Thus,
    it is a good idea to have a standard ALV header if you are going to
    use logos in your top of page.
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_page
          i_logo             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "top_of_page
    *&      Form  build_fieldcat
    *Many and varied fields are available here. Have a look at documentation
    *for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
    FORM build_fieldcat.
      w_fieldcat-fieldname  = 'BUDAT'.
      w_fieldcat-seltext_m  = 'Dte pst'.
      w_fieldcat-ddictxt(1) = 'M'.
      w_fieldcat-edit = 'x'.
    Can change the position of fields if you do not want them in order
    of the DDIC or itab
    w_fieldcat-row_pos = '1'.
    w_fieldcat-col_pos = '10'.
      APPEND w_fieldcat TO gt_fieldcat.
      CLEAR w_fieldcat.
    ENDFORM.                    " build_fieldcat
    *&      Form  build_page_header
          gt_page is used in top of page (ALV subroutine - NOT event)
          *H = Header, S = Selection, A = Action
    FORM build_page_header.
    For Headers, Key is not printed and is irrelevant. Will not cause
    a syntax error, but is not used.
      gs_page-typ  = 'H'.
      gs_page-info = 'Header 1'.
      APPEND gs_page TO gt_page.
      gs_page-typ  = 'H'.
      gs_page-info = 'Header 2'.
      APPEND gs_page TO gt_page.
    For Selections, the Key is printed (bold). It can be anything up to 20
    bytes. It gets printed in order of code here, not by key value.
      gs_page-typ  = 'S'.
      gs_page-key  = 'And the winner is:'.
      gs_page-info = 'Selection 1'.
      APPEND gs_page TO gt_page.
      gs_page-typ  = 'S'.
      gs_page-key  = 'Runner up:'.
      gs_page-info = 'Selection 2'.
      APPEND gs_page TO gt_page.
    For Action, Key is also irrelevant.
      gs_page-typ  = 'A'.
      gs_page-info = 'Action goes here'.
      APPEND gs_page TO gt_page.
    ENDFORM.                    " build_page_header

  • Put SQL query in a function/ call function from region

    How can I write a SQL query (like SELECT EMPNO, ENAME, JOB FROM EMP) as PL/SQL function, and then call this function from the PL/SQL Function Returning SQL Statement region?
    Thanks, Tom

    thanks jverd for your quick reply.
    I know passing in a reference to an object will do the job if I want to change the value several parameters in one function call.
    But I want to ask, is there any other ways?
    the following code works.....
    public class TestParameter {
         public static void main(String[] args) {
              Test2 t2 = new Test2();
              invokeChange(t2);
              System.out.println("x = " + t2.x + "\t y = " + t2.y);
         static void invokeChange(Test2 t2) {
              t2.x = 10;
              t2.y = 15;          
    class Test2 {     
         int x;
         int y;     
    }

  • Error in function call when passing timestamp as parameter

    Hi All,
    I have created a function in database "Calulate_Wegs" whcih takes two parameter one "number" and other is "timestamp". I am able to get the output from function when running in database.
    But when i tries to call the function in OBIEE as EVALUATE('Calulate_Wegs(%1,%2)' AS INTEGER , Inv_BMM.s_view.Unit_id, CAST (Inv_BMM.s_view.T_date AS TIMESTAMP )) then it throws following error.
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 42015] Cannot function ship the following expression: Evaluate( Calulate_Wegs(%1,%2),D904.c4, cast(D904.c5 as TIMESTAMP ) ) .
    I am not getting any clue about this error. Looking for suggestions. Thanks in advance.
    Thanks
    Ashok

    Hi,
    I have a similar problem, and the documentation definitely does not help !
    The message is :
    +State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 42015] Cannot function ship the following expression: Evaluate( MIN(%1) KEEP (DENSE_RANK FIRST ORDER BY %2) OVER (PARTITION BY %3),D903.c3, D903.c4, D903.c5) . (HY000)+
    With the expression :
    EVALUATE('MIN(%1) KEEP (DENSE_RANK FIRST ORDER BY %2) OVER (PARTITION BY %3)' AS  DOUBLE PRECISION , Funds.NAV.NAV, Funds."Time Dimension"."Calendar Date", Funds.Fund."Subfund")
    By the way, %2 is not TIMESTAMP, but DATETIME. %1 is DOUBLE and %3 VARCHAR.
    If anyone can help ...
    Edited by: luxFarenheit on Jul 16, 2009 5:27 PM

  • CALL FUNCTION 'BAPI_QUOTATION_CREATEFROMDATA2'

    Hi,
    when I am using this function CALL FUNCTION 'BAPI_QUOTATION_CREATEFROMDATA2', this is giving error message that insufficient parameters.
    Can I get some sample code where this function is used with necessary data.
    Please suggest me how to solve this...
    thanking you............
    krishna

    Hi
       Please try passing the values as below and check if it works for you.
    QUOTATION_HEADER_IN & QUOTATION_HEADER_INX:
       Document Type
       Sales Organization
       Distribution Channel
       Division
       Requested Delivery Date
    QUOTATION_ITEMS & QUOTATION_ITEMSX
       Material
       Target Qty
    QUOTATION_PARTNERS
       Partner Role - Sold To Party
       Partner Number - Customer Number
    QUOTATION_SCHEDULES_IN & QUOTATION_SCHEDULES_INX
       Requested Delivery Date
       Requested Quantity
       I guess above parameters should be enough to create a quotation, can improvise from here basing on your requirement.
       Hope the above info helps you.
    Kind Regards
    Eswar

  • CALL FUNCTION SEND ERROR when displaying attendance report in PDF format.

    We implemented SSO/webgui.  The users did not have any issues with printing reports from SAPGUI.  In webgui, however, we had to define a Local PDF1 printer, per SAP Note  771683.  When users prints this report, it is generating 1-5 CALL_FUNCTION_SEND_ERROR.  We have Central Instance and 5 additional instances on 3 app servers.  Sometimes it generates 1 dumps, sometimes 2, etc.  The dump do not occurred on the instances you are logged into. The dump contains the following:
    ShrtText                                                      
        " " (I/O error)                                           
    What happened?                                                
        "CPIC-CALL: 'ThCMSEND'#connection closed#"                                                                               
    An error occurred when executing a Remote Function Call.    
    Error analysis                                                           
        An error occurred when executing a Remote Function Call.                                                                               
    "CPIC-CALL: 'ThCMSEND'#connection closed#"                                                                               
    Status of connection.... "CODE=CM_DEALLOCATED_NORMAL CM_SEND_RECEIVED
         CM_COMPLETE_DATA_RECEIVED SAPCODE=0 CONV=04892091"                  
        Internal error code.... "RFC_IO5"                                                                               
    There is an error in the communication system. To clarify            
        and resolve the error, contact your system administrator.                                                                               
    Transaktion......... " "                                                    
      Programm............ "SAPLSICM"                                             
      Dynpro.............. "SAPMSSY1 3004"                                        
      Dynprozeile......... 2                                                                               
    Informationen zum Aufrufer des Remote Function Calls (RFC):                 
      System.............. "HRP"                                                  
      Datenbank-Release... 640                                                    
      Kernel-Release...... 640                                                    
      Verbindungstyp...... 3 (2 = R/2, 3 = R/3, E = Extern, R = Reg. Extern)      
      Aufrufsart.......... "asynchron with reply (imode 0)" (S = Synchron, a/A =  
       Asynchron, T = Transakt. )                                                 
      Mandant............. 600                                                    
      Benutzer............ "CG1981"                                               
      Transaktion......... " (Program: SAPLSICM)"                                 
      Funktionsbaustein... "ICM_CACHE_UPLOAD"     
    Information on where terminated                                                                  
        The termination occurred in the ABAP program "SAPLSICM" in "ICM_CACHE_UPLOAD".               
        The main program was "SAPMSSY1 ".                                                                               
    The termination occurred in line 18 of the source code of the (Include)                      
         program "LSICMV11"                                                                               
    of the source code of program "LSICMV11" (when calling the editor 180).                      
    Source Code Extract                                                                               
    Line  SourceCde                                                                               
    1 *******************************************************************                        
        2 *   THIS FILE IS GENERATED BY THE FUNCTION LIBRARY               **                        
        3 *   NEVER CHANGE IT MANUALLY, PLEASE!                            **                        
        4 *******************************************************************                        
        5 FORM ICM_CACHE_UPLOAD %_RFC.                                                               
        6 * Parameter declaration                                                                    
        7 DATA URL TYPE                                                                               
    8 ICMURL                                                                               
    9 .                                                                               
    10 DATA DATA TYPE                                                                               
    11 ICMDATA                                                                               
    12 .                                                                               
    13 DATA GLOBAL LIKE                                                                               
    14 SY-INDEX                                                                               
    15 .                                                                               
    16 * Assign default values                                                                    
       17 * Call remote function                                                                     
    >>>>>   CALL FUNCTION 'ICM_CACHE_UPLOAD' %_RFC                                                   
       19      EXPORTING 
      20        URL = URL      
      21        DATA = DATA    
      22        GLOBAL = GLOBAL
      23   .                   
      24 ENDFORM.                                                                               
    We are on ERP 2004, kernel level 156, and Basis SP18.  I have Adobe Reader 8.
    Our CI Service Port is 8009.
    I have not seen any posting if there is a PDF limitation, e.g., width limitation, report contains rows highlighted in various colors.

    Dear Elaine,
    check notes
    <a href="https://service.sap.com/sap/support/notes/764734">764734</a>
    <a href="https://service.sap.com/sap/support/notes/688372">688372</a>
    or you might want to try to comment out line 118 of the function module
    ICM_CACHE_UPLOAD which reads like this
    PERFORMING RECEIVE_DATA_UPLOAD ON END OF TASK
    If this does not solve the problem, give a detailed description on how to reproduce the dump and put that into an error message with SAP. It should go to BC-CST-IC.
    Best Regards,
    Tim

  • Call Function Modules of R/3 from an Excel file.

    HI All,
    The requirement is to create a button on the excel file. On Click of the button, the data present in Excel file shud be uploaded to a R/3 DataBase table. Is it possible? If yes, how ?
    Regards
    Mrinalini

    I am sure it's specific requirement otherwise yuo can create button in SAP applicaation toolbar and upload from excel
    using FM TEXT_CONVERT_XLS_TO_SAP function .
    TYPE-POOLS : truxs.
    -Create selection screen Parameter for file path.
    PARAMETERS : pa_file LIKE rlgrap-filename DEFAULT 'C:\excel.xls'.
    -The selection-screen uses cl_gui_frontend_services=>file_open_dialog method for displaying Windows type file exporer for file open dialog screen.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_file.
    " Display File Open Dialog control/screen
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title = 'Select Source Excel File'
      default_filename = '*.xls'
      multiselection = ' '
    CHANGING
      file_table = lt_it_tab
      rc = lv_subrc.
    -At user command 'PUSHBUTTON'
        CALL functionTEXT_CONVERT_XLS_TO_SAP function
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
      i_line_header = 'X'
      i_tab_raw_data = g_raw_data
      i_filename = pa_file
    TABLES
      i_tab_converted_data = gt_Vendors[] " Data
    EXCEPTIONS
      conversion_failed = 1
      OTHERS = 2.
    ~Pramod

  • CALL FUNCTION 'SX_OBJECT_CONVERT_ALI_RAW' fields have changed since 46C

    We are implementing upgrade to mysap 700 from 46C
    PROGRAMS USING function call to 'SX_OBJECT_CONVERT_ALI_RAW'  fields have changed
    we used to send tables directly and now we are sendin fields to be changed
    i have tried to send the data but continue to have errors
    700 version has this function with these paramaters
    CALL FUNCTION 'SX_OBJECT_CONVERT_ALI_RAW'
      EXPORTING
        FORMAT_SRC            = SOURCE_NAME
        FORMAT_DST            = OUT_NAME
        ADDR_TYPE             = 'FAX'  " int or fax
        DEVTYPE               = DEVTYPE
       FUNCPARA              = 255
      CHANGING
        TRANSFER_BIN          = LISTOBJECT
        CONTENT_TXT           = content_txt
        CONTENT_BIN          = content_bin
       OBJHEAD              =
        LEN                   = OUTLEN
    EXCEPTIONS
       ERR_CONV_FAILED       = 1
       OTHERS                = 2
    changing
    TRANSFER_BIN        TYPE      SX_BOOLEAN                                         
    CONTENT_TXT         TYPE      SOLI_TAB                                           
    CONTENT_BIN         TYPE      SOLIX_TAB                                          
    OBJHEAD             TYPE      SOLI_TAB                                           O
    LEN                 TYPE      SO_OBJ_LEN                    
    when ran we get an abap dump content_bin                     
    Error analysis                                                                       
        An exception occurred that is explained in detail below.                         
        The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was     
         not caught in                                                                   
        procedure "GET_MEMORY_LIST" "(FORM)", nor was it propagated by a RAISING         
         clause.                                                                         
        Since the caller of the procedure could not have anticipated that the            
        exception would occur, the current program is terminated.                        
        The reason for the exception is:                                                 
        The call to the function module "SX_OBJECT_CONVERT_ALI_RAW" is incorrect:                                                                               
    The function module interface allows you to specify only                         
        fields of a particular type under "CONTENT_BIN".                                 
        The field "CONTENT_BIN" specified here is a different                            
        field type                                                                       
    it looks like i need to set <fs> pointer to the field but i am akwardly at this any help please will do well.
    this is how we used to use the function
    CALL FUNCTION 'SX_OBJECT_CONVERT_ALI_RAW '
          EXPORTING
               FORMAT_SRC      = SOURCE_NAME
               FORMAT_DST      = OUT_NAME
               DEVTYPE         = DEVTYPE
               FUNCPARA        = FUNCP
               LEN_IN          = INLEN
          IMPORTING
               LEN_OUT         = OUTLEN
          TABLES
               CONTENT_IN      = LISTOBJECT
               CONTENT_OUT     = OBJTXT
          EXCEPTIONS
               ERR_CONV_FAILED = 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.

    ok i solved my own problem.... i new i could.  here is the results
    first i had to dig into the bapi to find the proper definition to declare in my program i will present the code
    and let you exame the example.
    FORM GET_MEMORY_LIST TABLES   P_MYSECOND STRUCTURE ZLIPOV.
    DATA: LSIND LIKE SY-LSIND,
          LISTTAB LIKE ABAPLIST OCCURS 1 WITH HEADER LINE,
          OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE,
          SOURCE_NAME LIKE SXCONVERT-FORMAT_SRC,
          OUT_NAME    LIKE SXCONVERT-FORMAT_DST,
          DEVTYPE     LIKE SXSERV-DEVTYPE,
          FUNCP       LIKE SXFUNCPARA,
          INLEN       LIKE  SOOD-OBJLEN,
          OUTLEN      LIKE  SOOD-OBJLEN,
          UPDFLG      TYPE I VALUE 0,
          LNCNT       TYPE I VALUE 0,
          LABLNCNT    TYPE I VALUE 0,
          PRVLN       TYPE I VALUE 0.
    this is the added structures for the new fields
    used for SX_OBJECT_CONVERT_ALI_RAW and the rest of the SX_OBJECT_CONVERT family
    data:
         TRANSFER_BIN TYPE  SX_BOOLEAN, " SHOULD BE SET TO X
         OBJHEAD like SOLI occurs 0,
         content_txt   LIKE soli  OCCURS 0,
         content_bin  LIKE solix OCCURS 0.
    CLEAR LISTOBJECT[].
    CLEAR OBJHEAD.
    CLEAR CONTENT_TXT[].
    CLEAR CONTENT_BIN[].
    CALL FUNCTION 'LIST_FROM_MEMORY'
         TABLES
              LISTOBJECT = LISTTAB
        EXCEPTIONS
             NOT_FOUND  = 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.
    CALL FUNCTION 'TABLE_COMPRESS'
       IMPORTING
            COMPRESSED_SIZE =
         TABLES
              IN              = LISTTAB
              OUT             = CONTENT_BIN   " this will receive the data
       EXCEPTIONS
            COMPRESS_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.
      SOURCE_NAME = 'ALI' .
      OUT_NAME    = 'RAW'.
      DEVTYPE     = 'POSTSCPT'.
    TRANSFER_BIN ='X'. " set to x our program will fail to convert stupid but needed
    describe table listtab lines inlen.
    DESCRIBE TABLE LISTOBJECT LINES INLEN.
    SX_OBJECT_CONVERT_ALI_RAW
    SX_OBJECT_CONVERT_ALI_PRT
    SX_OBJECT_CONVERT_OTF_RAW
    SX_OBJECT_CONVERT_OTF_PRT
    SX_OBJECT_CONVERT_INT_RAW
    DESCRIBE TABLE content_bin LINES INLEN.
    CALL FUNCTION 'SX_OBJECT_CONVERT_ALI_RAW'
      EXPORTING
        FORMAT_SRC            = SOURCE_NAME
        FORMAT_DST            = OUT_NAME
        ADDR_TYPE             = 'FAX'  " int or fax
        DEVTYPE               = DEVTYPE
       FUNCPARA              = 255 " this is used to prevent wrapping if beyond 132 characters
      CHANGING
        TRANSFER_BIN          = TRANSFER_BIN
        CONTENT_TXT           = content_txt " returns the data we want to address and work with
        CONTENT_BIN          = content_bin" data is conpressed and in binnary format
        OBJHEAD              = OBJHEAD
        LEN                   = OUTLEN
    EXCEPTIONS
       ERR_CONV_FAILED       = 1
       OTHERS                = 2
    move content_txt[] to OBJTXT[]. " in my case the program origianly used OBJTXT
                                                        "  so i chose to compy the data back here

  • Call function problem

    Hello
    I'm calling a remote function:
    CALL FUNCTION 'Z_RFC_TEST' DESTINATION i_rfc-host
    At first it worked. But now I always get the error: "FUNCTION MODULE Z_RFC_TEST not found.
    Any idea what this could be?
    Greets.

    Hi,
      You have to check out two main things as follows:
      1. Check whether the function module exists in the remote system or not. If it exists just go the properties and check whether the remote enabled option have selected or not.If the function module is not exist just create it as a remote enabled function module. Also there might be some problem with the function group where the function module is resided. So just activate the function group.
      2. Just check out the RFC destination name. I think you are passing the RFC destination name to the variable as i_rfc-host.
    Just make sure the destination name.
    Regards,
    Sankar.

  • Call Function using DESTINATION

    Hi there!
    Abapers, I'm needing some help here with RFCs.
    My destinations (SM59):
    ERP_100
    ERP_120
    ERP_130
    PI_200
    PI_300
    I have to call a function in PI from ERP. I'm doing in this way:
    CALL FUNCTION 'pi_function_module' DESTINATION 'PI_200' ...
    It's working. But the destination can not be hard coded. With the program in ERP_100 (DEV) and ERP_120 (QAS) the destination is PI_200 (PI DEV) and with the program in ERP_130 (PRD) the destination is PI_300 (PI PRD).
    How can I handle this?
    Thanks in advance!
    Best regards,
    Charles

    Hi Charles,
    Refer [this|Re: Deciding RFC destination dynamically; thread.
    I quote the last post by Micky Oestreich - "This solely depends on the naming conventions you are using. Since the name of the RFC destination is arbitrary, there is 'no' way of determining the name of the destination."
    So, your design approach could either be by building a customizing table where you maintain the destination values or use a 'CASE' statement in your code before calling the remote function module....something like:
    DATA:
      lv_own_system  TYPE logsys,
      lv_rfcdest     TYPE rfcdest.
    CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
      IMPORTING
        own_logical_system             = lv_own_system
      EXCEPTIONS
        own_logical_system_not_defined = 1
        OTHERS                         = 2.
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CASE lv_own_system.
      WHEN 'ERP_100' or 'ERP_120'.
         lv_rfcdest = 'PI_200'.
      WHEN 'ERP_130'.
        lv_rfcdest = 'PI_300'.
      WHEN OTHERS.
    ENDCASE.
    "Now call the remote function
    CALL FUNCTION 'pi_function_module' DESTINATION lv_rfcdest ...
    Hope this helps,
    Cheers,
    Sougata.

  • RFC Function Call - System not available

    Hello,
    in my own program i´m using an RFC function call to get data out of our BW - System like this:
    CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA' DESTINATION i_dest
        EXPORTING
          i_query               = i_query
          i_view_id             = i_view_id
          i_t_parameter         = i_t_parameter
        IMPORTING
          e_axis_data           = gt_axis_data
          e_cell_data           = e_cell_data
        EXCEPTIONS
          system_failure        = 1
          communication_failure = 2
          OTHERS                = 3.
    This works fine and fast as long the BW System is up and running. If the BW system is for some reason down my program has very bad performance because this RFC function call is trying for about 10 seconds every time.
    Is there a way to avoid this long waiting time? A kind of parameter?
    If there is no answer after one or two seconds the programm should continue.
    Any ideas for this?
    Thanks a lot.
    Best regards
    Manfred

    try the following like look for TTL(time to live) in the doc
    http://www.google.co.in/url?sa=t&source=web&cd=5&ved=0CDkQFjAE&url=http%3A%2F%2Fwww.erpgenie.com%2Fsapgenie%2Fdocs%2FSAP%2520Connectors.doc&rct=j&q=ttl%20for%20rfc%20call%20in%20sap%20abap&ei=DShnTv7VGYbWrQeYgPXcCg&usg=AFQjCNGvnINnxj8kYx9IeelUHy0dQPmuMA&cad=rja

  • Call Function - Dest "RFC"

    Hello,
    i have a big problem.
    I´ve written a web dynpro programm.
    In this program i call a function:
    CALL FUNCTION 'READ_DAT' DEST 'Z_READ_DAT".
    Z_READ_DAT is a RCF which points on a exe file on my pc.
    When is use this Function in SAPGUI all works fine, but when i call it in WDA there is a dump.
    "Cannot open RFC". ST22 says EXEC_SAPGUI : cannot open sapgui.
    What can i do?

    Hi Benjamin Pfahl  ,
                                   there are cetain RFCs that cannot be used with Webdynpro, like gui_upload and all. the Fm 'READ_DAT' DEST 'Z_READ_DAT, since its working fine in normal abap means it cannot be used with wda, the Fm might be using sap gui to fetch from your pc.
    Regards
    Sarath

  • Call function IN BACKGROUND TASK don't work

    Hello,
    I've a interface RFC to JDBC asyncronous.
    When i call function in R3 (IN BACKGROUND TASK), sy-subrc = 0, however i don't see any message in SXMB_MONI and runtime workbench.
    The CC sender (for RFC) is OK,
    what happen?
    thanks very much

    Have this code after your call function:
    CALL FUNCTION 'START_OF_BACKGROUNDTASK'
         EXPORTING
              STARTDATE = SY-DATUM
              STARTTIME = TIME
         EXCEPTIONS
              OTHERS    = 1.
    IF SY-SUBRC = 1.
      EXIT.
    ENDIF.
    COMMIT WORK.
    Also, if you want to call your RFC function module in async mode, you can try
    Call function '<fm name>' in update task....
    Regards,
    Ravi Kanth Talagana

  • Problem calling function

    Hi,
    i have creted a function module which read stock quantity using BAPI_MATERIAL_AVAILABILITY.
    Import - MFRPN
    Export - QNTY
    If i execute function module from SAP the result it's OK but when i call function from PHP it does not output nothing.
    $sap = new saprfc(array(
                                       "logindata"=>array(
                                            "ASHOST"=>"192.168.3.1"          // application server
                                            ,"SYSNR"=>"00"                    // system number
                                            ,"CLIENT"=>"200"               // client
                                            ,"USER"=>"rfc"               // user
                                            ,"PASSWD"=>"123456789"          // password
                                       ,"show_errors"=>true               // let class printout errors
                                       ,"debug"=>false)) ;                     // detailed debugging information
              // Call-Function
              // Call-Function
              $result=$sap->callFunction("Z_READ_QNTY",
                                                             array(
                                                                     array("IMPORT","MFRPN",$_POST['cod']),
                                                                     array("EXPORT","QNTY",$quantity),
              // Call successfull?
              if ($sap->getStatus() == SAPRFC_OK)
                   echo $quantity;
              else
                   // No, print long Version of last Error
                   $sap->printStatus();
                   // or print your own error-message with the strings received from
                   //           $sap->getStatusText() or $sap->getStatusTextLong()
    Please someone help me.
    Thank you.

    hi Dan,
    i will send you an working code sample. The  Fuba ZGET_MAKTX is easy  MATNR as import parameter and MAKTX as export parameter.
    you will receive the material short description.
    hope this will help you a little bit.
    in your code i thing you forgot to fill the $quantity    like this    $quantity = saprfc_export($fce,"QNTY");   before         echo $quantity;
    regards
    Tony
    <?php
         //Login to SAP R/3
         $login = array ("ASHOST"=>"vsap3", "SYSNR"=>"2", "CLIENT"=>"200","USER"=>"vsrfc", "PASSWD"=>"********", "CODEPAGE"=>"1100");
         $rfc = saprfc_open($login);
         if (!$rfc) {
              echo "RFC connection failed";
              exit;
         $fce = saprfc_function_discover($rfc,"ZGET_MAKTX");
         if (!$fce) {
              echo "Discovering interface of function module failed";
              exit;
         saprfc_import($fce,"MATNR","200200");
         $rc = saprfc_call_and_receive ($fce);
             if ($rfc_rc != SAPRFC_OK) { if ($rfc == SAPRFC_EXCEPTION ) echo ("Exception raised: ".saprfc_exception($fce)); else echo (saprfc_error($fce)); exit; }
             $maktx = saprfc_export($fce,"MAKTX");
             echo $maktx;
             saprfc_function_free($fce);
             saprfc_close($rfc);
    ?>
    Edited by: Tony Wienhold on Oct 7, 2008 11:19 AM
    Edited by: Tony Wienhold on Oct 7, 2008 11:22 AM

  • Use of CALL FUNCTION - STARTING NEW TASK parameter_list.

    SELECT strt_code
                 city_code
                 commu_code
                 regiogroup
          INTO TABLE gt_adrstreet1
          FROM adrstreet
          FOR ALL ENTRIES IN gt_street_district
          WHERE strt_code EQ gt_street_district-strt_code.
    To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....
    by spliting the above internal table gt_street_district into two internal tables and use the value of each internal table into two different queries and these queries will be put in call function - start new task ....so that these queries are run in different workprocess and thus improve the performance of the program.
    Can you please let me know if this would be a good option and also how to implement the same.
    Thanks.....

    >To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....
    nonsense! You should not try parallel processing for a non-optimized SELECT statement.
    Better add the first key field of the WHERE condition as said above and check
    + whether the driver table is empfty
    + and whether there are duplicated entries
    ... And it is also a good idea to really use the SINGLE RECORD BUFFER, therefore you must write
    field-symbol:  <fs>  type ...
    LOOP AT gt_street_district ASSIGNING <fs>
       SELECT *
                    INTO TABLE gt_adrstreet1
                    FROM adrstreet
                    WHERE counrty =
                     AND       strt_code = <fs>-strt_code.
    ENDLOOP.
    Then it will be extremely fast!

Maybe you are looking for

  • Cannot get MP950 printer to work under osx Mavericks

    When I try to configure my MP950 Canon printer under OSX Mavericks, I get an error occurred while trying to add the selected device. I have tried connecting it directly to my USB port and from the network.The system crashes with this error: Any help

  • Final cut pro vs. final cut express

    I'm a complete newbie looking to get into basic video. What are the main differences between final cut pro and xpress. Thanks!!

  • Problem with AutoCAD files in AI

    Hi all I hope I have a simple problem :-) I need to prepare some EPS files for printing. The problem is if I open AutoCAD DWG or DXF file in AI CS4 I am getting streight lines, not nice arcs: I have got: should be: I can open file in the AI with nice

  • Deleted Safari and Can't Re-Install?

    I deleted Safari because I no longer used it. I began using Firefox, and now regret it. My wife has the CD in Austin, and I am in Lubbock going to school this summer. Is there a way to install Safari without the CD? I have tried downloading it from t

  • How do you center an image within a PDF?

    How do you center align an image in a pdf? Thank you.