I need to create RFC function module which creates the IDOC

Hi-
Any idea how to create RFC function module which creates the outbound IDOC. If you have any sample code please forward to me.
Thanks,
Sony

My Problem is
Whenever they create Invoice using T-code's like FV65(Parked Document), automatically should create IDOC's...
I have used message type FIDCC1 but this message type is usefull only for Posting documents.
1. Whenever they create parked document, entries will be stored in BKPF(Parked Document-Filed-BKPF-BSTAT = 'V') and Bseg....
2. I have to read entries from those tables and should create IDOC...
3. I checked FM's(FI_IDOC_CREATE_FIDCC1, FI_IDOC_PREPARE) but are not useful...
4. Now I need to write one RFC function module and that FM should create the IDOC's....
Can anyone please help me out?
Thanks,
Sony

Similar Messages

  • How to create RFC function module and how to call this function module

    Hi,
    i want to know step for creating RFC function module and then How to  use this function module from some other sap system.
    Thnaks,
    jigar

    Jigar,
    To implement a remote function module in ABAP, perform the following steps:
    Register the module as remotely callable in the RFC server system.
    In the function module Administration screen (transaction code SE37), set the field Can be called via REMOTE CALL. Registering a module as remote causes an RFC stub to be generated for it.
    Write the code for the function module.
    Create the destinations.....................
    Displaying, Maintaining and Testing Destinations
    To display, create or modify destinations, choose Tools ® Administration ® Administration ® Network ® RFC destinations or enter transaction code SM59.
    Remote Destinations are stored in table RFCDES. The RFCDES table describes logical destinations for remote function calls.
    It is not possible to maintain the RFCDES table directly.
    You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® AcceleratedSAP ® Customizing ® Execute Project ® SAP Reference IMG.
    In the Implementation Guide, expand the following hierarchy structure:
    Basis
    Application Link Enabling (ALE)
    Sending and Receiving Systems
    Systems in Network
    Define Target Systems for RFC Calls
    Displaying Destinations
    The initial screen for this transaction displays a tree:
    Different connection types (i.e. partner systems or programs) are possible. For further information, see Types of Destinations.
    To display all information for a given destination, double-click it, or place the cursor on it and press F2 .
    To search for a destination, press the Find button and specify your selection. You get a list of all entries matching your selection. Place the cursor on the one you want, and press F2 or simply double-click the destination. All information for the given entry appears.
    Creating Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    All available connection types are explained in Types of Destinations.
    To create a new RFC destination, press the Create button. A new screen is displayed with empty fields for you to fill in.
    If you want to create a new destination
    As you create a remote destination, you can specify a particular application server or a group of servers for a balanced distribution of system load.
    For details of the destination parameters, see Entering Destination Parameters.
    Changing Existing Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    You can display all information for a given destination by double-clicking it or pressing F2 on it.
    To change an existing destination, double-click it, or place the cursor on it and press the Change button.
    For details of the destination parameters, see Entering Destination Parameters.
    Testing Destinations
    To test a destination, choose the appropriate function from the Test menu.
    Connection (also available via the Test connection pushbutton)
    Authorization (checks logon data)
    Local network (provides a list of application servers)
    You can use the CALL FUNCTION statement to call remote functions, just as you would call local function modules. However, you must include an additional DESTINATION clause to define where the function should run:
    CALL FUNCTION RemoteFunction
    DESTINATION Dest
    EXPORTING
    f1 =...
    f2 =...
    IMPORTING
    f3 =...
    TABLES
    t1 =...
    EXCEPTIONS......
    The field Dest can be either a literal or a variable: its value is a logical destination (for example, "hw1071_53") known to the local SAP System. Logical destinations are defined in the RFCDES table (or the TRFCD table in R/2 Systems) via transaction sm59 or the following menu path: Tools ® Administration, Administration ® Network ® RFC destinations. You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® Customizing ® Enterprise IMG. In the Implementation Guide, you can then choose Cross-application components ® ALE ® Communication ® Define RFC destination.
    The remote function call concept, for example, allows you to access a function module in an R/2 System from an ABAP program in an R/3 System. If you want to read a customer record from your R/2 System’s database, create a remotely callable function module in the R/2 environment which retrieves customer records. Call this function from your R/3 System using a remote function call and listing the destination for the target R/2 System:
    Pls. reward if useful

  • Function Module which creates goods receipt document

    Dear all:
    Do you know a function module which creates goods receipt document?
    Thanks
    Bac

    Hello, Satyanarayana and Mickael,
    I found the function module.  It is called BAPI_GOODSMVT_CREATE. 
    Thank you for your suggestion.  I think your suggestion works also, so now I have two solutions that I can use.
    Bac

  • Function module  which changes the Storage Unit (SU) Block Data like LS32

    Hi,
    Is there any Function module  which changes the Storage Unit (SU) Block Data as done in  LS32.
    Thank you,
    Prashanth A.

    Hello Pablo.
    Yes we did run LT04 and it does encounter that same error message after clicking the Stock Removal button.  But eventually error msg will be removed by entering the value at the Storage Unit Type field because it directly fills in LTAP-LETYP.
    We have resolved that the function module will not really fill the desired Storage unit type therefore TO background creation is not feasible in our scenario (non-SU managed transfer to SU-managed storage type).  And I found this thread too:  http://scn.sap.com/thread/1947358
    So issue is still open but we have considered of changing the process since this is still just a new scenario for us.
    Thanks a lot for your inputs!

  • RFC function module always creating BPs with the same user name (RFC user )

    Hi All
    I posted the below question in a different area before. But thought it would be more suitable here.
    Moderators - Please let me know if am doing any mistake.
    Question:
    I have a RFC function module in CRM that creates Business Partners in ECC (XD01 tcode).
    I am using a dialog RFC destination configured in SM59 in CRM.
    But my RFC function module in CRM is always creating the Business Partners in ECC with the RFC user id (the user that we maintain for the RFC destination in SM59).
    This is a problem for the users because they are not able to track the actual person responsible for creating these Business Partners.
    Can somebody please let me know how to solve this problem?
    Thanks
    Raj

    Hi.
    You may use the trust relationship between CRM and R/3 and in SM59 instead of set a specific username, you set the flag "current user".
    With this flag, the system will access R/3 system with the user logged in CRM system. The Trust relationship must be created between CRM and R/3 in order to the system doesn't ask for a password to login in R/3.
    If you need more details please reply.
    Kind regards,
    Susana Messias

  • Want to create a function module  which will convert smartform into PDF .

    Hi All ,
    Requirement : I want to create a function module/report  which will convert smartform into PDF .
    Thanks in advance

    Hi All ,
    zsuresh_test : for converting smartform into pdf.
    when I am excuting this report(zsuresh_test) and by passing the smartform name FOPCR_STANDARD_F1
    I am getting error :
    Incorrect parameter with CALL FUNCTION
    Can you  please help me out..
    REPORT zsuresh_test.
    Variable declarations
    DATA:
    w_form_name TYPE tdsfname VALUE 'FOPCR_STANDARD_F1',
    w_fmodule TYPE rs38l_fnam,
    w_cparam TYPE ssfctrlop,
    w_outoptions TYPE ssfcompop,
    W_bin_filesize TYPE i, " Binary File Size
    w_FILE_NAME type string,
    w_File_path type string,
    w_FULL_PATH type string.
    Internal tables declaration
    Internal table to hold the OTF data
    DATA:
    t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    Internal table to hold OTF data recd from the SMARTFORM
    t_otf_from_fm TYPE ssfcrescl,
    Internal table to hold the data from the FM CONVERT_OTF
    T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    This function module call is used to retrieve the name of the Function
    module generated when the SMARTFORM is activated
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = w_form_name
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    fm_name = w_fmodule
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Calling the SMARTFORM using the function module retrieved above
    GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
    format of the output
    w_cparam-no_dialog = 'X'.
    w_cparam-preview = space. " Suppressing the dialog box
    " for print preview
    w_cparam-getotf = 'X'.
    Printer name to be used is provided in the export parameter
    OUTPUT_OPTIONS
    w_outoptions-tddest = 'LP01'.
    CALL FUNCTION w_fmodule
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    control_parameters = w_cparam
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    output_options = w_outoptions
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    job_output_info = t_otf_from_fm
    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.
    t_otf[] = t_otf_from_fm-otfdata[].
    Function Module CONVERT_OTF is used to convert the OTF format to PDF
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    ARCHIVE_INDEX = ' '
    COPYNUMBER = 0
    ASCII_BIDI_VIS2LOG = ' '
    PDF_DELETE_OTFTAB = ' '
    IMPORTING
    BIN_FILESIZE = W_bin_filesize
    BIN_FILE =
    TABLES
    otf = T_OTF
    lines = T_pdf_tab
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    ERR_BAD_OTF = 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.
    To display File SAVE dialog window
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
    WINDOW_TITLE =
    DEFAULT_EXTENSION =
    DEFAULT_FILE_NAME =
    FILE_FILTER =
    INITIAL_DIRECTORY =
    WITH_ENCODING =
    PROMPT_ON_OVERWRITE = 'X'
    CHANGING
    filename = w_FILE_NAME
    path = w_FILE_PATH
    fullpath = w_FULL_PATH
    USER_ACTION =
    FILE_ENCODING =
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    NOT_SUPPORTED_BY_GUI = 3
    others = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
    presentation server
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = W_bin_filesize
    filename = w_FULL_PATH
    FILETYPE = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
    tables
    data_tab = T_pdf_tab
    FIELDNAMES =
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Is there a BAPI function module which reverses the sign of an integer

    Hi Friends,
                     Could u plz tell me  a BAPI function module which can reverse the
    sign of an integer ?
    For example:       
    if i get the integer value in work area as <number> <sign> , i need to change it to <sign><number>. 
    i.e if i get the integer value in work area as    "248-" ("-" indicates minus sign) to " -248 ".
    i.e if i get the sign after the value , my requirement is to get the sign before the value.
    The actual ABAP query is:
    data: QTY_1 TYPE CHAR10,
            QTY_2  TYPE CHAR10,
            WA_DISTK_PORTLET-QUANTITY TYPE INT4.
    QTY_1 = WA_DISTK_PORTLET-QUANTITY.
                    SEARCH QTY_1 FOR '-'.
            IF SY-SUBRC = 0 AND SY-FDPOS <> 0.
              SPLIT  QTY_1 AT '-' INTO  QTY_1 QTY_2.
              CONDENSE  QTY_1.
              CONCATENATE '-'  QTY_1  INTO QTY_1.
              CONDENSE  QTY_1.
            ELSE.
              CONDENSE  QTY_1.
            ENDIF.
            CLEAR: WA_DISTK_PORTLET-QUANTITY.
         MOVE : QTY_1 TO  WA_DISTK_PORTLET-QUANTITY.
    when i move this QTY_1 to work area  quantity field The sign is coming after the numeric value.
    Note: There is no possibility to change the datatype of quantity field.
    I have tried my level best with 'CLOI_PUT_SIGN_IN_FRONT' function module.
    I will assign full points to the correct function module.

    Hi Ram,
    try this ang look into fields.
    data: fields type table of SVAL with header line.
    fields-tabname = 'MARA'. fields-fieldname = 'MATNR'. append fields.
    fields-tabname = 'BKPF'. fields-fieldname = 'BUDAT'. append fields.
    CALL FUNCTION 'POPUP_GET_VALUES'
      EXPORTING
        POPUP_TITLE           = 'Value Insert'
      TABLES
        FIELDS                = fields.
    Regards, Dieter

  • Function module which sort the entries in Table maintance generator

    hi
        I want to know the function module which is used to sort the entirs in table maintance genrator.
    Thanks

    Hi,
    Go to the TMG program .You can change the code there.
    Rgds,
    Anversha

  • Variables passed to Function module for posting the Idoc

    Hi,
    For Posting the Inbound Idoc a Function module is created what should be the values passed to
    1) return_variable and
    2) workflow_result.
    I saw in many of the program like this if there is an error in posting.
    I gave return_variable-wf_param = ' Error Idoc'.
    and workflow_result = '99999'.
    Why are these values passed, where are they used.

    Josephine,
    In your parntner profile for your customer/vendor ( depending on your idoc type and business scenario) , you would have assigned the post processing permitted agent.
    In case the function module errors out, these values are carried out to the WF container and appropriate post processing notifications are sent to the agents. That is the purpose of having these variables in here.
    It could be a success/failure, agents are notified in either case.
    Ganesh

  • Creating RFC Function Module

    I am trying to use PHP and SAPRFC to pull out some information from our SAP database.  I've been reading documentation and I've stumbled across this in the SAP documentation:
    There are two restrictions on writing remote functions that are to be called transactionally:
                    + Transactional calls cannot return parameter values. As a result, the interface for these functions should not specify any EXPORT parameters.
                    + Functions that run transactionally may not perform call-backs: the caller's context does not necessarily still exist when the call-back is relayed back to the original system.
    If this is true then how am I suppose to receive any data back from the RFC?  I am trying to pull a couple of variables out of a few tables using basic select statements like this:
    FUNCTION Z_RFC_COMMISSION_INDIVIDUAL.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(COMM_ACCOUNT) TYPE  LIFNR DEFAULT 000000
    *"  EXPORTING
    *"     VALUE(NAME) TYPE  LFA1-NAME1
    SELECT SINGLE name1 FROM lfa1 INTO name
      WHERE lifnr = comm_account.
    ENDFUNCTION.
    I can connect to the SAP database but I am still not clear on the best way to pull out single values instead of a whole table from SAP using PHP.  Does anyone have any example function module source code they could share?

    Hi Mark,
    I used this code (copy of you)
    DATA: comm_info_output TYPE TABLE OF bdi_entry.
    DATA: comm_info TYPE TABLE OF lfa1.
    DATA: nametab TYPE TABLE OF bdi_mfgrp.
    DATA: sel_tab TYPE TABLE OF bdsel_stat.
    CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
        EXPORTING
          tabname               = 'LFA1'
        TABLES
          tabentry              = comm_info_output
          nametab               = nametab
          sel_tab               = sel_tab
        EXCEPTIONS
          system_failure        = 1  MESSAGE l_mes
          communication_failure = 2
          OTHERS                = 3.
    comm_info[] = comm_info_output[].
    and I get no error message. Where exactly do you get error message. Resp. is it going to short dump? (if so please attach list from st22).
    I think the problem is not in function module but in setting of unicode / non unicode systems. Probably with FM you get some not allowed characters.
    I found following thread:
    RFC Lookup after unicode conversion of target R/3
    Is it suitable for you?
    Sorry I am not expert for this. Maybe if you identify exact problem and you don't know solution create a new thread with good description in the title and you will find unicode issues experts.
    Regards,
      Karol
    Edited by: Karol Seman on Jul 30, 2008 2:18 PM

  • Error when creating rfc function module

    Hi,
    now i am creating one rfc functionmodule (ZSUSR_USER_AGR_ACTIVITYGR_GET) by copying existing general standard functionmodule. problem is, in tables i have one parameter called USER_ACTIVITYGROUPS i referred this one with TYPE-POOLS TYPE ZUSTY_T_AGR, when i am trying to save this function module it is giving this message <i><b>Type zusty_t_agr is unknown.</b></i>
    it is very urgent
    Please help me

    Hi,
             Check this link. It has got all the information about RFC.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f078394a-4469-2910-c4bf-853c75674694
    Regards

  • Sample coding for creating a function moudle to post the Idoc

    hi,
    I am working on Inbound idoc,
    Aim : to update the Ztable
    I have created the message type , idoc type and the segment type.
    For creating an idoc i have used the Function module IDOC_INBOUND_WRITE_TO_DB.
    Now for posting the idoc, i need to create the function module, the main aim is to insert record to the Ztable, what should be my input and the output parameters,
    Can u provide the sample coding for it

    As you are dealing with a IDOC, the parameters will have to be standard as any other IDOC processing function module. For example take a look at IDOC_INPUT_BANK_CREATE.
    You will have to read the data exactly the way the standard code does and the only change will be once you read the data how do you want to handle the data.
    Regards,
    Ravi
    Note : Please mark all the helpful answers

  • Process code's function module required for the IDOC Message type PROACT

    Hi,
    I am trying to trigger an IDOC from ME32K transaction which will carry my Contract agreement details to XI. The IDOC I am using for this purpose is PROACT.PROACT01. But I couldn't find the outbound process code / Function module for the process code associated to this IDOC message type.
    Pls help me out....
    Thanks,
    Ram Kalyan

    I checked table EDIFCT for the message type and found this:
    Function module            Function type    Basic type                                      Message Type
    IDOC_INPUT_PROACT          F               PROACT01                                       PROACT
    Oops...I think you are looking for outbound..Ignore

  • Using RFC Function Module to send data to NON SAP Application

    Hi friends,
    Please guide me how can I send data from SAP -> Dotnet Applcation using Dotnet Connector through RFC function module from SAP side. In my scenerio, I Run Z transaction  to executte RFC function module which create some data to pass to dotnet connector.
    Regards,
    Rajesh Kumar

    Hi,
    You can make use of Dotnet connector to read the content of SAP RFC .. (eaiest of all)
    The RFC can be executed using connector , and can read the data simultaneously.. u need to code in dotnet for this..
    else create a webservice and read it from dot net ..
    Regards
    Renu Gusain
    Edited by: Renu Gusain on Jan 25, 2010 12:55 PM

  • Function Module to create a Sales Order in CRM

    Hi Experts,
    I want to create a function module which creates a Sales Order in CRM.
    As of now, I'm making use of the function module 'BAPI_BUSPROCESSND_CREATEMULTI'.
    I have product ID and Quantity.
    Please let me know what all rest of the fields are mandatory to create a Sales Order using this function module.
    Thanks in Advance,
    lakshman.

    Depending upon the configuration many things could be mandatory. Assuming no such things in your system, Process type (order type) is required and it is good to give the Sold-To business partner and the Org Details, for the Header information. For the item information, you need the Product and Quantity.
    In theory, in CRM, you can create a transaction and "save" it with lot of errors. So, even if you don't give enough information, you will have a transaction with error. You can later fix it the input to fix the errors.
    Best way to know is to use your SAPGUI (CRM Online) version crmd_order and find for your implementation.
    Easwar Ram
    http://www.parxlns.com

Maybe you are looking for

  • Show Custom Error Message in Apex

    Hi, I have created a Master-Detail form on Dept and Emp tables. In Dept table, I have deptsal column which is updated by a trigger on EMP table. DEPT table has following trigger: create or replace trigger "TRG_DEP_SAL" BEFORE UPDATE on "DEPT" FOR EAC

  • Hi SAP GURUs

    Can any one please tell me the details about investment order, my question here are i have an internal order (investment order) i am purchasing some material related to AUC so in purchase order what sort of account assignment type i need to use "F" o

  • Laptop resume fails on second suspend

    I have a 32bit Archlinux, completely up-to-date, running on a Dell Latitude D620 Laptop. Recently I've started having a problem whereby after putting my computer into suspend, when I try to wake it, it does a full boot and fixes file system problems

  • Mass upload of Documents/Folders in SolMan?

    Hi, We have a situation here. All the project documents and other documents are stored on the company portal. For any given process, they have a set of documents associated with it. Example: for a change request, they have at least  10 - 12 documents

  • How does the print gamut compare with mobile devices?

    I need to design a document for 4 color process printing, using only colors that will reproduce correctly on other platforms, such as computer monitors, smart phones, and tablets. I know how the print gamut compares with the RGB gamut of monitors. Bu