Regarding function modules return parameters

hi experts,
thnx in advance
i have requirement to make a rfc enabled function mudule, that will return some messages mat be error or information , such as 'read is implausible in sap-isu' etc, so how can make the export parameters of  this fm, so that it return such mesages thru export parameters but not thru exceptions
pls help

either you can create a string table as return parameter which will hold your messages, then you can display them.
or a better method can be as seen in BAPIs..
a table of type BAPIRETURN.
just goto SE37, open any BAPI (BAPI* - then F4).
see in the table of type BAPIRETURN.
here you can pass the message details ... and use them from where you have called it.

Similar Messages

  • Web Services  from ABAP function modules return values- leading zeros

    I am using several web services from SAP CRM (5.0) that were created from Function modules ( I am assuming that that they are in ABAP).
    I can call the web services fine and they work as expected, but I am seeing a lot of leading zeros in the return values of fields in tables from the Web service.
    The ABAP er’s are telling me that they cannot see the leading zero’s.
    So my question is where these are appended to the values in the whole process. When I execute the Function Module in SAP CRM from transaction SE37 I can see the leading zeros. So I think that this is something that has to be handled by the ABAP er’s and not in the client consuming the web service.
    Are the functions in SAP CRM that can remove leading zeros for fields in a table (that is an export parameter?)
    Jawahar

    Hello Jawahar
    If you run your (RFC-enabled) function modules using the SAP-GUI (i.e. in dialog) then the GUI automatically replaces leading zero when the function module returns any data. However, calling the same function module remotely you will always see these leading zeros.
    These so-called conversion exits are defined as attribute of domains in the ABAP dictionary. If the function module used for the WebService is a standard fm then you have little chances to get rid of the leading zero. Perhaps the WebService has some attribute to suppress conversion exits or activate them when retrieving the data.
    Regards, 
       Uwe

  • Function Module TABLES parameters

    Hi All,
           I want to pass my internal table to a function module but when I try to access the componenbts of the table it is giving me syntax error. Is it required that I should create DDIC structure for this? Is there any other option?
    I have declared the internal table using types. And in function module tables parameters just declared internal table.
    Regards,
    Dilip

    Hi
    In the function
    Say import parameter is TAB ( with no type definition )
    From program you pass an internal table ITAB .
    You don't need to define TAB in your function.
    In the code you can diretcly use
    LOOP AT TAB.
    ENDLOOP.
    ( At runtime TAB will take the structure of ITAB from program )
    Cheers

  • Authorization check on Function module return values

    Hi,
    I have a tricky situation. In our BW implementation, many of the FI infoobjects are authorization relevent. One of the objects is 0COSTCENTER.  A user has been assigned with authorization profile, in which the user is authorised for COST CENTER = A* and #.  All planning templates were working nice.
    We were on SP 12 earlier, now we upgraded to SP 20. Now came a issue, the user gets error that user is not authroised for the data. After our analysis, we found nothing wrong as such, so contacted SAP. They came back with a root cause
    In my planning function, an ABAP function module is used. The function module returns a COSTCENTER value. This return value is then assigned to a variable, this variable is of type 0COSTCENTER.
    SAP said there was a bug in their own design. The bug was, if the cost center value is directly used in planning function for other calculations, it will throw an authorization error.  But, if the COST CENTEr value is given to a variable and that variable is used for other calculations,  it works fine. Thats why it worked for us earlier.
    Now, they have removed that bug, so variables are also checked against authorizations and they said we need to either change the code or give * for the COST CENTER authorization.
    So we have a problem. It is not straight forward to give * for COSTCENTER in FI BW implementation. SAP theory is that they cannot say which value the functional module will return. So they will check against ALL the values for COSTCENTER but not the authorised values.
    Has anyone seen this issue before? is it only specific to planning function or its just ABAP concept? Any suggesations to come out this problem?

    Bindu, thanks,
    The error is coming at the program compile level itself i.e. before executing the planning group itself. As per the F1 help on forumla editor and from their support, the system reads all the reference data,  So when it sees the function module and its export parameter, it captures all the data for COST CENTER as reference data.
    Thus even I am sure that the return value will be always authorized, the reference data is checked for the full authorization. Thus its failing

  • Query regarding function module SPOOL_RQ_READ_BAPI_EXPORTS (EBP-SRM Module)

    query regarding function module SPOOL_RQ_READ_BAPI_EXPORTS (EBP-SRM Module)
    shopping cart
    Hi in FM SPOOL_RQ_READ_BAPI_EXPORTS
    i want to relate the internal tables requisition_items and requisition_services.
    but in am not getting the key on which they should be joined
    here i have to take the quantity and other fields from requisition_services
    right now i am using the joining condition as
    requisition_items-pckg_no = requisition_services-pckg_no.
    any help in this regard is welcome.
    Thanks and regards,
    Vithalprasad

    Hi Kathirvel,
    Thank you for reply. I am making changes for standard code only.
    " Call FM SPOOL_DPO_READ_BAPI_EXPORTS to read PO data exported to backend.
    Use this data to call FM B46B_DPO_TRANSFER and copy errors tab from
    ' lt_bapi_return ' to ' et_messages' retrun tab in 'doc_check' badi. "
    Thank you.
    Regards, Sunu

  • Dought regarding Function module

    Hi ,
        I have small dought regarding fm....
    since  Read_text is a function module   can it be changed to RFC , since i need to retrive data from sap to informatica .
    since some of the long text are also need to retrived to a non sap system .
    if i creat a zread _text as a RFC .
    will this work  .am i in the right path ,need ur advice on the same .
    if its right what are the steps needs to be followed .to create a zread_text
    Thanks ,
    VInay .

    Create a new function module in SE37, e.g. Z_RFC_READ_TEXT and tick that it is RFC enabled.  The Import, Export, and Tables parameters should mirror those in READ_TEXT, but you might like to add another table so you can return any exception messages to the caller (e.g. "OT_RETURN" with a structure like BAPIRET2)... you might also have local standard for naming parameters in custom code which you may need to follow.  Inside your "Z" function module you just call 'READ_TEXT' using the parameters of the "Z" function.  Any exceptions from 'READ_TEXT' should be added into OT_RETURN so that the external caller can be advised of the problem.

  • Regarding Function module HR_MAINTAIN_MASTERDATA.

    hi experts,
    i have a requirement where in i need to inseert data in to infotype:0000,0001,0105,9010,0041  and update the infotypes:0015,0014,0008,0009 by using function module HR_MAINTAIN_MASTERDATA . i have used ACTIO as 'INS' and 'MOD' (since T589A table doesn't contain the 'UPD' operation).
    but using this "MOD' i am unable to update all the infotypes, instead it is throwing the error as entry doesn't exist in T589A for P.
    i need to know whether the following code is correct or not and also to overcome the error.. Please let me know the changes needed.
    DATA: BEGIN OF IT_INFTY,
              INFTY TYPE PPROP-INFTY,
            END OF IT_INFTY .
    DATA:  LV_PERNR          TYPE PSPAR-PERNR.
    LV_PERNR = '430102'.
    if ( IT_INFTY-infty = '0000' or IT_INFTY-infty = '0001'
              or  IT_INFTY-infty = '9010'
                or IT_INFTY-infty = '0105' OR IT_INFTY-infty = '0041' ).
        LV_OPERATION = 'INS'.
      elseif ( IT_INFTY-infty = '0007' or IT_INFTY-infty = '0008'
           or IT_INFTY-infty = '0014' or IT_INFTY-infty = '0015').
        LV_OPERATION = 'MOD'. 
      endif.
      CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
        EXPORTING
          NUMBER             = LV_PERNR  "WA_SOURCE_DATA-pernr
    IMPORTING
      RETURN             =
      LOCKING_USER       = sy-uname
      CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
       EXPORTING
         PERNR                    = LV_PERNR
      MASSN                    =
         ACTIO                    = LV_OPERATION        "'INS'
         TCLAS                    = 'A'
         BEGDA                    = SY-DATUM
         ENDDA                    = '99991231'
      OBJPS                    =
      SEQNR                    =
      SPRPS                    =
      SUBTY                    = lv_subty
      WERKS                    =
      PERSG                    =
      PERSK                    =
      PLANS                    =
         DIALOG_MODE              = '2'
      LUW_MODE                 = '1'
      NO_EXISTENCE_CHECK       = ' '
      NO_ENQUEUE               = ' '
       IMPORTING
         RETURN                   = RC
         RETURN1                  = RC1
      HR_RETURN                =
        TABLES
          PROPOSED_VALUES          = PROPOSED_VALUES
      MODIFIED_KEYS            =
      write : / rc-message.
      CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
        EXPORTING
          NUMBER = LV_PERNR  "WA_SOURCE_DATA-pernr
    IMPORTING
       RETURN        =
    kindly suggest.
    regards,
    joy.

    hi,
    i have a similar situation wherein i need to use the two operations insert and modifications for the infotypes.
    the problem i am facing is ,i need to put the logic in a method and it doesnt allow the usage of with header line. so how can we refer to the fields if the following logic is used.
    TYPES : begin of ty_infty,
                    infty TYPE pprop-infty,
                  END OF ty_infty.
    DATA: it_INFTY TYPE STANDARD TABLE OF TY_INFTY,
               proposed_values   TYPE  pprop occurs 0 with header line,
              wa_INFTY TYPE TY_INFTY.
    *************************updation of 0000***********************
    lv_fval = '01'.
      wa_proposed_values-infty = '0000'.
      wa_proposed_values-fname = 'P0000-MASSG'.
      wa_proposed_values-fval = LV_FVAL.
      wa_proposed_values-fname = '00'.
      append wa_proposed_values to proposed_values.
        it_infty-infty = wa_proposed_values-infty.
      clear wa_proposed_values.
    ***similarly we update the values for other infotypes
    if ( it_infty-infty = '0000' or it_infty-infty = '0001'
            or it_INFTY-infty = '0041' or it_INFTY-infty = '9010'
              or it_INFTY-infty = '0105').
        lv_operation = 'INS'.
      elseif ( it_INFTY-infty = '0007' or it_INFTY-infty = '0014' ).
            "or IT_INFTY-infty = '0014' or IT_INFTY-infty = '0015').
        lv_operation = 'MOD'.
      endif.
    CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
        EXPORTING
          NUMBER             = lv_pernr
    IMPORTING
      RETURN             =
      LOCKING_USER       = sy-uname
      CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
       EXPORTING
         PERNR                    = lv_pernr
      MASSN                    =
         ACTIO                    = lv_operation       
         TCLAS                    = 'A'
         BEGDA                    = SY-DATUM
         ENDDA                    = '99991231'
      OBJPS                    =
         DIALOG_MODE              = '2'
      LUW_MODE                 = '1'
      NO_EXISTENCE_CHECK       = ' '
      NO_ENQUEUE               = ' '
       IMPORTING
         RETURN                   = rc
         RETURN1                  = rc1
      HR_RETURN                =
        TABLES
          PROPOSED_VALUES          = proposed_values
      MODIFIED_KEYS            =
      write : / rc-message.
      CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
        EXPORTING
          NUMBER = lv_pernr
    IMPORTING
       RETURN        =
    here its giving an error that it_infty is a table without headerline and has no field as infty.
    how to over come this, please guide me in this regard. if this is not the correct logic please tell me the appropraite one..
    thanks in advance,
    Durga.

  • Regarding Function Module AC_DOCUMENT_RECORD

    Hi All,
    I am working on one Report in which I am calling the function module
    <b>AC_DOCUMENT_RECORD</b>. I am Exporting values for all the parameters to this function except
    I_AWSYS, I_AWTYP_INCL,I_AWTYP_EXCL.
    These parameters will be treated as Default to SPACE.
    Can anyone please tell me what these parameters are and what type of value or what value shall
    I Export to these Parameters.
    Regards,
    Rishi

    Dear Rishi,
    All these three parameters are optional. You can comment them if you do not want to pass any data. The system would treat them as SPACE.
    I_AWSYS -  Logical System (Character Type of Length 10: ACCHD-AWSYS)
    I_AWTYP_INCL - Reference procedure (Character Type of Length 5 :ACCHD-AWTYP)
    I_AWTYP_EXCL - Reference procedure (Character Type of Length 5 :ACCHD-AWTYP)
    Regards,
    Naveen.

  • ABAP Programing help regarding function modules coding

    Hi,
    i'm currently creating a function module that retrieve a number from a table and add one to it and return back the value to the table.
    the codes are as follow:
    FUNCTION ZFM_NUMBER
    " * " Local Interface:
    " EXPORTING
    "      VALUE (ZZNUMBER) TYPE ZNUMBER
    "      VALUE (ZENUMBER) TYPE ZNUMBER
    SELECT ZNUMBER FROM ZTAB_NUM into ZZNUMBER.
    END SELECT.
    ZENUMBER = ZZNUMBER + 1.
    UPDATE ZTAB_NUM SET ZNUMBER = ZENUMBER WHERE ZNUMBER = ZZNUMBER.
    END FUNCTION.
    this function module works finely, but now i need to concatenate the number with the year to store it into another table.
    i know something about the sysdatum where i select only the first 4 characters...but i'm not sure how could i do that?
    do i need to create another function module to call the above function module and concatenate it with the year?
    or i just need to continue the codes in the same function module?
    and how should i code it?
    i'm very new to abap coding and i could'nt get help from anyone in my team. your help is very much appreciated!!!
    Thanks,
    leesyy

    hi you can do it in the same function module.
    SELECT ZNUMBER FROM ZTAB_NUM into ZZNUMBER.
    END SELECT.
    instead of the above statement use the following statement, it improves performance of your program
    SELECT single ZNUMBER FROM ZTAB_NUM into ZZNUMBER.
    in the above statement you can also specify some where condition
    ZENUMBER = ZZNUMBER + 1.
    UPDATE ZTAB_NUM SET ZNUMBER = ZENUMBER WHERE ZNUMBER = ZZNUMBER.
    data: var_date type sy-datum,
          var_yyyy(4) type c,
          var_numyear(10) type c.                   
    var_date = sy-datum.
    var_yyyy = var_date+0(4).
    concatenate ZENUMBER var_yyyy into var_numyear.
    UPDATE ZTAB_NUMyear SET ZNUMyear = var_numyear WHERE ZNUMBER = ZZNUMBER.
    Regards
    Sajid
    Edited by: shaik sajid on Jan 14, 2010 5:08 AM
    Edited by: shaik sajid on Jan 14, 2010 5:09 AM

  • Regarding Function Module for Locking ( enque)

    Hi,
    I am facing a Problem that is when iam running Call transaction one popup is coming because some other user currently editing that Tcode at that time i need to lock tcode using enque specially for table . If suppose some other user editing at that time it will shoe that popup and it will exit from their with out doing any other process For that i need Function module for Lock and Delock.
    thanks in advance,
    murali krishna.

    So in this example, I am doing a loop and check for a lock, if I don't get one, I wait for 5 seconds, this loop continues untill 30 seconds, no lock then it quits and gives message.
    report zrich_0001.
    data: counter type i.
    parameters: p_equnr type equi-equnr.
    start-of-selection.
      clear counter.
      do.
    Exhausted,  no luch in getting a lock, get of of DO loop.
        if counter > 6.
          sy-subrc = 1.
          exit.
        endif.
    Try for lock
        call function 'ENQUEUE_EIEQUI'
          exporting
            mode_equi            = 'E'
            mandt                = sy-mandt
            equnr                = p_equnr
       _wait                = 'X'
          exceptions
            foreign_lock         = 1
            system_failure       = 2
            others               = 3.
    Got a lock, get out of DO loop.
       if sy-subrc  = 0.
          exit.
        endif.
    Still here?  Then wait another 5 seconds
        wait up to 5 seconds.
        counter = counter  + 1.
      enddo.
    Report status
      case sy-subrc.
        when  0.
          message s001(00) with 'Lock could not be established'.
        when  1.
          message i001(00) with 'Lock could not be established'.
      endcase.
    Regards,
    rewards point

  • Regarding function module RKD_REPORT_START

    Hi,
    Can anyone tell me the functionality of the function module RKD_REPORT_START.
    Regards,
    Sowmya

    Hi
    Soumye
    this function module is used for setting the SELECT_OPTIONS  and PARAMETERS
    dynamically.
    identify report and variant
    PARAMETER: APPCLASS LIKE RKB1D-APPLCLASS,
    SUBCLASS LIKE RKB1D-SUBCLASS,
    REPID LIKE RKB1D-REPID,
    TABNAME LIKE RKB1D-TABNAME,
    VARIANT LIKE RKB1D-VARIANTE.
    CALL FUNCTION 'RKD_REPORT_START'
    EXPORTING
       APPLCLASS = APPCLASS
    FUNCTION = 'EXEC'
    REPID = REPID
    I_VARIANT = VARIANT
    RSTI_CALL = ' '
    SMODUS = 'N'
    SUBCLASS = SUBCLASS
    TABNAME = TABNAME
    I_INFOMODE = 'V'.
    Regards
    Hareesh

  • Functional module table parameters values not getting displayed in Java sys

    Hi,
    We are calling the Table parameter through Java code from functional
    module ZCRM_ICSS_PROJ_CUST_USR is not giving any rows value .If I execute
    the same functional module with passing the import parameter value User
    id: MLDL010 its giving value in CRM.
    I am checking Function module( Remote enabled ) in Debugging mode,
    before displaying values it is raising message like
    SY-MSGNR - 005
    SY-MSGTY - CRM_LINK
    in T100 Table
    SPRSL : EN
    ARBGB : CRM_LINK
    MSGNR : 005
    TEXT :'No Links corresponding to the specified data could be determined'
    Is that related to any communication problem CRM & JAVA ICSS System ?
    Regards,
    Pavan.

    The message in simple English just means that "You are doing something really bad" !!! It is absolutely not the communication problem, but understanding problem.
    Though you may be executing the same function using SE37 or in the webshop application through JCo, the runtime context is different and without knowing what exactly your Z rfc is doing, it is very difficult to help. To start with, the userid - that is who is running the RFC is different in both situations. In SE37, it is the logon user and in the web, depending upon whether the connection is stateless or stateful, it could be the anonymous ICSS user or the logged in user. Here again, if you have used UME, it is the user id and if you have used ALIAS user, then it is the alias user id. This is just an example. Your runtime context can be different due to many other reasons too.
    So, to make this simpler - what is that you are trying to do?
    BTW, try not to create multiple threads for the same issue..

  • Regarding Function Module 'SO_NEW_DOCUMENT_SEND_API1'

    Hi All,
    I am having a issue in using Function Module 'SO_NEW_DOCUMENT_SEND_API1'.
    <b>I am presently sending the E-mail as follow:</b>
    From: [email protected]
    To: [email protected]
    Subject: You have Missing Time
    Please Do Not Respond To This E-mail  ***
    BOHAN          JAMES     P. S25751
    07/01/2005 4.00 HRS
    07/07/2005 4.00 HRS
    07/27/2005 1.50 HRS
    For any missing time greater than 30 calendar days, please complete a Salary Request for Labor Hours Transfer Form (SA8250).  If you have any questions, please contact Salary Timekeeping on extension 6-5571 or 6-5500.  
    <b>But the user wants it to be in following way:</b>
    From: [email protected] [mailto:[email protected]]
    Sent: Monday, August 15, 2005 10:44 AM
    To: [email protected]
    Subject: You have Missing Time
    Please Do Not Respond To This E-mail  ***
    BOHAN          JAMES     P. S25751
    07/01/2005 4.00 HRS
    07/07/2005 4.00 HRS
    07/27/2005 1.50 HRS
    For any missing time greater than 30 calendar days, please complete a Salary Request for Labor Hours Transfer Form (SA8250).  If you have any questions, please contact Salary Timekeeping on extension 6-5571 or 6-5500.  
    <i>I want following Extra row to be added in when i send Emails to recipients.They should receive Date & Time when i sent that E-mail in following way.</i>
    <b>Sent: Monday, August 15, 2005 10:44 AM</b>
    Can any body help how can i solve this issue.
    Thanks in advance.
    Thanks & Regards,
    Rayeezuddin.

    Hi,
    check this link:
    http://www.sapdevelopment.co.uk/reporting/email/email_sapmail.htm
    It has options for date and time while sending a mail.
    Best Regards,
    Anjali

  • Regarding function module in update task

    Hi,
    I have a function module(Zxxx) which is update type. i have called the fun.module in my program (Zyyy) using the syntax CALL FUNCTION ZXXX IN UPDATE TASK. As I suppose to debug the function module, I activated the update debugging in the debugging screen. But the controll still not goen into the function module. Please let me know solution.
    Thanks & regards,
    Suresh

    >
    sureshkumar vaniyasekar wrote:
    > I activated the update debugging in the debugging screen. But the controll still not goen into the function module.
    Hello Suresh,
    What do you mean by not going?
    If you are trying to do an F5 at the function call, the debugger is not "enter" into the FM. This is because at this point the function call is registered but the FM is not executed.
    Update FM calls registered in a particular LUW are executed(in a special "UPD" workprocess) when there is a COMMIT encountered(may be explicit or implicit).
    Did you read the online help on [Update Debugging|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/c6/617d0ce68c11d2b2ab080009b43351/content.htm] & [Breakpoint behaviour during Update Debugging|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/c6/617cbee68c11d2b2ab080009b43351/content.htm]?
    BR,
    Suhas

  • Regarding Function module call

    Hi Guru s
    Can any body explain  how many Function modules are stored in One function group.
         And What happen when I call 1 function module in a F.Group.
    Thanks in advance,
    Kumar.

    Hi,
    Function group can be defined it as collection of Function
    modules. This Function groups are presents in the Packages
    where we can create in the SE38. So,that all packages are
    consists in the Function Groups.All function groups are
    consists Function Modules.This function modules are created
    at enhancements/Exists.
    A function group can hav any no. of FM's.
    there is no restriction.
    reward if useful
    thanks and regards
    suma sailaja

Maybe you are looking for

  • Keyboard and trackpad freeze when left idle after installing hard drive

    Installed a Samsung HM640jj hard drive in my Macbook Pro. Since then the keyboard and trackpad freeze if not in use. As long as I keep scrolling around on the pad everything works fine but as soon as I stop they both freeze. On startup the freezes on

  • Performance Problem : High CPU on a simple Insert

    I have a simple INSERT ( INSERT into TABLE values ( :1, :2 ) etc. ) But this statement is exhibiting following characteristics Optimizer Cost : 1 Buffer Gets : 26 million !!! Rows : 750,000 Gets/Execution : 35,000 This is causing performance problem

  • Struggling with collection Query

    Hi guys, I'm struggling to wrap my head around the queries for collection memberships. I've got quite a few computer collections attached to AD group memberships that I then use to deploy applications to. That way the helpdesk guys just put a PC in t

  • ODS Object-Specific Properties BUG

    Hi Bhanu & Experts, I have a Variable on particular InfoObject. The RSD1 property is "Only Value in the Infoprovider". When i use the variable from Infocube it only show the values from the Infoprovider in the Variable screen.But when i use the same

  • Email os file as attachment

    I want to send os file as attachment using utl_mail package , how can I do this. Regards