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

Similar Messages

  • Need a sample coding for  function module MRM_DBTAG_RSEG_READ

    hi,
    I am working on reports. I was asked to use the function module MRM_DBTAG_RSEG_READ for retrieving the line item information. I tried using the fucntion module, the problem i am facing in the declaration of the internal table I_TE_RSEG for the parameter TE_RSEG.
    It would be better if u provide a sample coding that uses this function module.
    Promise to award points.
    Regards,
    anitha

    Hi,
    you need to declare type-pools mrm. and declare the work area of type mrm_tab_rseg
    check out the code-
    REPORT zzswap .
    TYPE-POOLS mrm.
    DATA: is_te_rseg  TYPE mrm_tab_rseg.
    DATA: w_belnr type RSEG-BELNR,
          w_gjahr type RSEG-GJAHR.
    w_belnr = '1000000004'.
    w_gjahr = '2005'.
    CALL FUNCTION 'MRM_DBTAB_RSEG_READ'
         EXPORTING
              i_belnr         = w_belnr
              i_gjahr         = w_gjahr
              i_buffer_on     = 'x'
         IMPORTING
              te_rseg         = is_te_rseg
         EXCEPTIONS
              entry_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.
    hope it works.
    Regards,
    Swapnil.

  • A sample coding for 'MRM_DBTAB_RBKPV_READ'

    i need the sample coding for 'MRM_DBTAB_RBKPV_READ'. i need the coding through which i can reterieve the value.
    Promise to award points.
    Regards,
    Anitha

    report zrich_0003 .
    type-pools: mrm.
    data: xrbkpv type  mrm_rbkpv.
    parameters: p_belnr type rbkp-belnr.
    parameters: p_gjahr type rbkp-gjahr.
    start-of-selection.
      call function 'MRM_DBTAB_RBKPV_READ'
        exporting
          i_belnr               = p_belnr
          i_gjahr               = p_gjahr
    *   I_BUFFER_ON           = 'X'
       importing
          e_rbkpv               = xrbkpv
       exceptions
         entry_not_found       = 1
         others                = 2.
      write:/ xrbkpv-belnr, xrbkpv-gjahr, xrbkpv-blart,
              xrbkpv-bldat, xrbkpv-budat.
    Starting to see a pattern?
    Regards,
    Rich Heilman

  • Sample Program for Creating ALV Tree

    Hello Guys,
    Can some One Send me some sample program for creating ALV Tree.
    my Requirement is like below Diagram.
    ALV Tree |   ALV GrId
       |
       |
    I want to also about event in ALV , As per requirement when user select (Double click or press any push button) a node of ALV Tree That Node (Contain Sales order and as a child billing Doc No)  In the ALV Grid All the details about Sales order Will be display.
    Please guide me.
    Thanks
    Swati....

    Hi..
    check the following demo programs:
    RSDEMO_DRAG_DROP_EDIT_TREE
    RSDEMO_DRAG_DROP_TREE_MULTI
    BCALV_GRID_DND_TREE
    BCALV_GRID_DND_TREE_SIMPL
    BCALV_TEST_COLUMN_TREE
    BCALV_TEST_SIMPLE_TREE
    BCALV_TREE_01
    BCALV_TREE_02
    BCALV_TREE_03
    BCALV_TREE_04
    BCALV_TREE_05
    BCALV_TREE_06
    BCALV_TREE_DEMO
    BCALV_TREE_DND
    BCALV_TREE_DND_MULTIPLE
    BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_ITEMLAYOUT
    BCALV_TREE_MOVE_NODE_TEST
    BCALV_TREE_SIMPLE_DEMO
    BCALV_TREE_VERIFY
    hope this helps..
    -kothai

  • Required sample coding for invoice billing for script

    Hi,
            Required sample coding for invoice billing for script in form and endform.
         please help me its very urgent issue. thanks in advance.
    thanks&regards
    sirish

    Hi Sirish,
    these are some of the links where u can find ur solution plz check...
    <u>
    SAP SCRIPT
    SAP SCRIPT
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=invoicebillingfor+script&adv=false&sortby=cm_rnd_rankvalue</u>
    regards,
    Sana M.

  • Sample coding for multiple table join

    Hi,
    i need a sample coding for multiple table join. can anyone help me out.
    regards
    Gokul

    SELECT AVBELN AFKDAT AVTWEG ASPART AWAERK AKURRF AKUNAG AKNUMV
             BPOSNR BFKIMG BNETWR BMATNR
             DBEGRU ELABOR E~MATKL
             INTO CORRESPONDING FIELDS OF TABLE ITAB
             FROM VBRK AS A INNER JOIN VBRP AS B
                  ON AVBELN EQ BVBELN
             INNER JOIN J_1IEXCHDR AS C
                  ON AVBELN EQ CRDOC
             INNER JOIN KNVV AS D
                  ON DKUNNR EQ AKUNAG  AND
                     DVKORG EQ AVKORG  AND
                     DSPART EQ ASPART  AND
                     D~BEGRU NE SPACE
             INNER JOIN MARA AS E
                  ON EMATNR EQ BMATNR
             WHERE A~FKDAT IN S_FKDAT AND
                   A~FKART EQ 'F2'    AND
                   A~VTWEG IN S_VTWEG AND
                   A~SPART IN S_SPART AND
                   A~KUNAG IN S_KUNAG AND
                   A~FKSTO NE 'X'     AND
                   B~WERKS IN S_WERKS AND
                   C~TRNTYP = 'DLFC'  AND
                   E~LABOR IN S_LABOR AND
                C~SRGRP IN ('01','02','03','31','32','33','41','42','43',
                            '81','82','83','95','55','45', '48') AND
                   B~MATNR IN S_MATNR AND
                   D~BEGRU IN S_BEGRU AND
                   E~MATKL IN S_MATKL.
    but my suggestion not to use more than 2 table in inner join it will affect in performance use for all entries instead of join.
    regards
    shiba dutta

  • Query for getting all function and procedure inside the packages

    hi All
    Please provide me Query for getting all function and procedure inside the packages
    thanks

    As Todd said, you can use user_arguments data dictionary or you can join user_objects and user_procedures like below to get the name of the packaged function and procedure names.
    If you are looking for the packaged procedures and functions source then use user_source data dictionary
    select a.object_name,a.procedure_name from user_procedures a,
                  user_objects b
    where a.object_name is not null
    and a.procedure_name is not null
    and b.object_type='PACKAGE'        
    and a.object_name=b.object_name

  • Error while posting the IDoc for Customer Invoice.

    hi,
    I m posting Customer Invoice through LSMW using IDocs.
    Basic type is FIDCCP02 and message is FIDCC2.
    While posting the Idoc I m getting error as:
    'Document or line item does not exist for invoice reference'.
    I m not getting the error why it is asking for invoice reference because
    in FB01 it is not asking for any reference or anything.
    Even in f-22 also it is not asking for the same.
    In Idoc all the item level values are coming prorperly.
    If anybody worked on such issues then please reply.
    -Thanx.
    -Umesh

    Hi,
    Where you able to resolve your issue, I would appreciate if you can share the solution.
    Thanks

  • Recommendations, samples, etc for creating a "Vendor Invoice" Content Type.

    I am developing a "Vendor Invoice Approval" application in SharePoint 2013. My development platform is "Visual Studio 2013". This will be an "Intranet only" application running only on our internal SharePoint
    2013 Farm.
    I am planning on using a "Document Library" to store all of the Invoices. I believe the "correct" approach (or one of many, probably, lol) would be to create a "Content Type" called "Vendor Invoice". The "content
    type" would then need to have the following functionality:
    Custom Columns. Some columns would be "required", some would be "optional".
    Vendor Name - Chosen from a “Vendors” list (a SharePoint "custom" list that contains "Vendor Name" and "People Responsible" (which will be a "People" type column and allow multiple choices/people from
    a SharePoint Group called "Vendor Invoice Person Responsible"). The user may also enter a new Vendor Name.
    Person Responsible - Limited to the users in the “Vendor Invoice Person Responsible” SharePoint Group. Will allow the selection of 1 or more "people" from that Group. (When a Vendor Name is "chosen" (above), this field
    should be populated with the values from the "People Responsible" record for that Vendor. The user can then ONLY choose between those users or choose them all. Optionally, I may just store a single Person in the "Vendors" list and use that
    to populate this field with a "default" value, but then allow the user to pick ANY user from the "Vendor Invoice Person Responsible" SharePoint Group).
    Invoice Number (Will probably renamed the “Title” column.)
    Invoice Date
    Invoice Amount
    PO Number (When entered, look it up in our ERP system and populate as many fields as possible, such as the Vendor Name, Account Number and Plant.)
    Status - Most likely this field will only be adjusted via "workflows". Choices are:
    “Created” – The initial Status when an Invoice is created (BEFORE any “Issue” or “Approved”).
    "Pending Issue" - An "Issue" needs to be resolved. (See "Issue" below.)
    “Issue Resolved” – The current “Issue” has been resolved. The next status could be “Pending Issue” (if there is another Issue to resolve) or “Approved”.
    “Approved” – All Issues have been resolved.
    “Issue Check” – The Invoice was “Approved” and a check may now be issued to the Vendor.
    “Completed” – The Invoice has been “Approved” and the vendor has been issued a check.
    Issue - Chosen from an “Invoice Issues” list (a SharePoint "custom" list that contains "Issue" and the name of a "WorkFlow" to execute on the "Invoice" in order to resolve that particular "Issue").
    When an Issue is chosen, this will trigger a "Workflow" (or more than one?? probably only one...) to start.
    Account Number
    Plant (Choices: 1-New York, 2-Los Angeles,99-Headquarters)
    Invoice Notes
    Template/Forms (Insert/Update)/Development/Event Receivers/Display Template/"UI". This is the part that I am unsure of and where "Visual Studio" will be used. (I have quite a bit of experience developing "SharePoint
    Solutions". I am not interested in using the new "App Model". I have read about it, studied it, setup a local "App Store", etc, but for this particular application, I am going to stick with the "old" Solution based model.
    I am more familiar with it and "believe" it will give me the most "power" and "flexibility". As I said.... I am unsure how to "categorize" the following "needs", so I am just going to lump the rest of the "features"
    I need into the list below and ask for any feedback and/or help. :)
    Adding Invoices - Ideally, the "drag and drop" feature will (can) be utilized by the user to add the new Invoices (I can force them to only add one Invoice at a time). If this is just "too much trouble", I
    could require the user to only add them using the "Upload Document" control. Or, I could develop the UI  (or just the Insert/Update UI) using traditional "ASP .Net" controls and insert/update the data using the Server
    Object Model or the Client Object Model (CSOM).
    Preview Invoices - There are several times I would like to show the Invoice (pdf) as a "preview" (when the Invoice is being Added or Edited, when the user is "Approving" or "Denying"
    on Invoice via a "WorkFlow", or when an Invoice is "hovered" over in a Document Library View). Basically, anytime the Invoice needs to be acted on by a user, I would like to show the PDF in a "preview" window and
    I don't mean just open it in a separate Tab or Window. I mean use something like an "IFrame" in a certain area of the page (depending on what the page is doing: Inserting/Editing/Viewing/etc) to show that preview.  (For the "hover
    preview", I believe I can use the same skills I learned when modifying how the "Enterprise Search Center" works with PDFs. Basically, it involved adding a new Display Template for the Search Item and referencing that template
    in a new "Search Result Type". The new Display Template created an "IFrame" and populated it using our Office Web App Server via "WOPI". Anyway, I believe I can simply do the same thing in a Document Library View and most
    likely in whatever "form" or "page" is responsible for the Insert/Edit. I suppose I am just looking for someone to tell me if this is "doable" (and as "easy" as I think it might be), what the "best"
    way to accomplish it would be, or if it is a bad idea, etc. etc.)
    "Auto Populate" the columns. When a new Invoice is added, I would like to use the (Enterprise) Search functionality (OCR and "graphic matching") to somehow populate as many of the columns (metadata) as possible.
    This might involve looking for some particular "text" or graphic(s) (like a company logo?) to determine the Vendor. Then, once the Vendor is determined, I might be able to figure out other items, such as the "Invoice Number" and "PO".
    Usually our Vendor Invoices don't change very often. This would only serve as "default" values, so it wouldn't have to be 100% correct. Anything I can do to save the user time or make it easier to enter new Invoices will go along way towards
    acceptance of this application. (Currently, they use an Excel Spreadsheet, along with email. So, from their point of view, the existing "system", "works" and is very "easy" to use,  etc....)
    More uses for the "Search Index Results". It would also be "nice" if we could setup some "weighted rules" on a "per Vendor" basis to help determine who the "responsible user" is. (For instance,
    we may get Invoices from a single Vendor that could possibly go to 1 of several "responsible users". In order to determine the correct user, I would like to setup some "rules" for each vendor to give "weighted" values to
    certain "keywords". For instance, if the word "Computer" appears on the invoice, that might be worth "100 points" towards the "IT Manager". So, when the user is selecting the person responsible for this particular invoice,
    I could order the list they are choosing from by the "total points" (as calculated from the "weighted rules") which would put the "Person" who is most "likely" the "Person Responsible" at
    the top of the list, followed by the second most likely, and so on. I don't think this be that "hard" to do. I would simply need to store "keywords" and "values" and have access to the "Search Index Results" for the
    document (Invoice) the user is currently adding.
    **Another "option" I have for developing this application is to basically develop it using a traditional "ASP .Net" framework and controls (which I definitely have more experience with, but as I mentioned, I also
    have quite a bit (4-5 years) of SharePoint development experience) and just using the "out of the box" features of SharePoint (and Custom Lists, Document Libraries, SharePoint Security Groups, WorkFlows), etc. What I am trying to describe is that
    I would develop the "UI" (add/change/delete) using traditional "ASP .Net" controls and just use SharePoint for my "Data Source". (I DO need to AT LEAST use SharePoint as the "Data Source". This is for reasons that
    I don't want to get into here and just bog down the discussion. I certainly realize this application could easily be a "traditional" "ASP .Net" application using "SQL" for the Data Source. So that part really isn't what I am looking
    for "advise" on.)
    Any help/advice/samples would be very MUCH appreciated!
    Shayne

    You should generate the XSD form the DTD files. Also you should list values unless necessary. XMLSpy is good tool I use.
    You can send the XML schema file to me if you can't register it to XML DB. I will help you take a look.

  • Sample workflow for Create new user in IDM

    Hi,
    I'm new to Identity Manager. I had obtain task to create new workflow with this requirements:
    - create new user
    - make some approvals
    - deploy this user to some resource (AD, LDAP, SQL)
    I have problem with first step. I tried to create user by the help of http://www.javapassion.com/idm/ create user samples, but I'm affraid that mentioned samples aren't enough for real deployment. They are good for understanding of IDM.
    So I decided to explore workflows/rules that are used as default in IDM. I think Create User dialog that is in menu Accounts -> List Accounts -> New Actions -> New User . But I'm not sure which workflow is used for this dialog. Is it Create User in ProvisioningTask, or some template in TaskDefinition, or Create User Template in TaskTemplate, or something another?
    (I'm listing this templates through List Object in Debug interface).
    I appreciate every help
    Petr

    Chapo,
    thanks a lot for informations. I have try to find corresponding process mapping for 'Create User' under Configure tab. I found process 'createUser'. So I looked for 'createUser' workflow under 'Task definition' or 'Configuration' in debug. But there was no such workflow. Only workflow with similar name was 'Create Resource User', but it doesn't look like right workflow. I expected workflow with name 'Create User'. Does anybody have this workflow under 'Task Definition' in debug?

  • 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

  • If buyer side created an PO and send out the IDOC to us...

    Hi,
    I am seller side.  Normally to say, this IDOC will be automaticlly loaded and corresponding SO could be created.
    But for now, the corresponding SO has not beeen created.  How do i analysis what happened to this inbound IDOC?
    Currently i have the IDOC number which provided by Buyer, this IDOC number is not from my system.
    Based on this IDOC number, which Transaction could i analysis why the IDOC couldnt be loaded successfully...?
    Thanks!!

    First of all, request the below information from the buyer about the PO's IDOC.
    PO#
    IDOC Date
    IDOC Control numbers (interchange, message group control # and transaction control #).
    Then go to WE05 and give a date range per the information provided by customer. Without giving IDOC number, provide the message as ORDERS (hopefully you are using standard orders processing). Provide the port from where you receive EDI orders.
    Then on WE05, you should see the EDI selection tab. GO to that tab and enter the interchange control # (on Interchange file reference), group # (Reference to message group) and transaction control #(Message reference).
    You should see the corresponding IDOC in your system if you have received it in SAP. Otherwise, I suggest that you then follow up with your EDI team on whether the EDI sub-system received this PO or not.
    Thanks
    Nikhil

  • Outbound function module to post the data in to WMMBID02 IDOC

    Hi Experts,
    I am using standerd idoc WMMB1D02 to post the goods recipt data.
    I am using the outbound idoc , how to post the data in to idoc using FM or BAPI ?.
    please help me on this.
    Thanks,
    Venkat.

    Hi Hakim ,
    Thanks for tour replay , we are using the standerd message type and standerd idoc are WMMBXY,
    WMMBID02. I did't notice any standerd  FM or BAPI which will create the outbound idoc for the same.
    please help me on this.
    Thanks,
    Venkat.

  • A sample coding for fun. module ' MRM_DBTAB_RSEG_READ' using subroutine

    i need to have this function module within the subroutine. something like this
    perform item_detail using p_belnr p_gjahr changing  i_irseg
    loop at i_irseg.
    write:/ i_irseg-belnr.
    endloop.
    form item_detail using p_belnr p_gjahr changing  i_irseg
    CALL FUNCTION 'MRM_DBTAB_RSEG_READ'
        EXPORTING
          I_BELNR               = P_BELNR
          I_GJAHR               = P_GJAHR
      I_BUFFER_ON           = X
       IMPORTING
         TE_RSEG               = I_IRSEG
       EXCEPTIONS
         ENTRY_NOT_FOUND       = 1
         OTHERS                = 2.
    this is not correct. Pls do provide the exact coding.
    promise to reward points.

    Sample code.
    report zrich_0004 .
    type-pools: mrm.
    data: i_irseg type mrm_tab_rseg.
    data: x_irseg like line of i_irseg.
    parameters: p_belnr type rseg-belnr,
                p_gjahr type rseg-gjahr.
    start-of-selection.
      perform item_detail using p_belnr p_gjahr changing i_irseg.
    <b>  loop at i_irseg into x_irseg.
        write:/ x_irseg-belnr.
      endloop.</b>
    *       FORM item_detail                                              *
    form item_detail using p_belnr p_gjahr changing i_irseg.
      call function 'MRM_DBTAB_RSEG_READ'
      exporting
           i_belnr = p_belnr
           i_gjahr = p_gjahr
    * I_BUFFER_ON = X
      importing
           te_rseg = i_irseg
      exceptions
           entry_not_found = 1
           others = 2.
    endform.
    Regards,
    Rich Heilman

  • Sample code for AIMatchingArtSuite::GetSelectedArts() function

    Hello All,
    Could you please write here the sample code how can we use AIMatchingArtSuite::GetSelectedArts( ) function.

    //create the art set and select the arts
    AIArtSet artSet = NULL;
    error = sAIArtSet->NewArtSet(&artSet);
    error = sAIArtSet->SelectedArtSet(artSet);
     if (error) 
    return error;

Maybe you are looking for

  • Can you synch two ipods on one computer?

    I just bought a nano my husband has a classic, just wondering how to synch two, do I need to create a seperate folder or is this not possible?

  • How to use count with decode

    I want to count several categories(say a b c d) under same count and some catogories under another count ..there I need to use count with decode pls let me know the syntacs to write my query..this is ergent regards Buddhike

  • ESS Error message due to Leave Collision

    Dear Friends, We are doing new ESS MSS implementation on ECC 6.0. We have configured SAP R/3 to accomodate Collision of leaves in table V_T554Y (Global Time constraint raction) and we can create leave collision through PA30. E.g: A person who has tak

  • Next steps when a disk is MISSING

    Hi, I'm new to ASM and wanted to check what are the steps and how it might work when a disk fails. So I removed a disk randomly from the diskgroup. WHen I looked at the v$asm_disk. It said one disk was MISSING. Then it was taking a while to rebalance

  • Detail-Preserving Upscale Effect

    Hi all: This was the effect I have been waiting for - as I am working on a Lacrosse highlight video - and some of the footage was not zoomed in when it was shot (AVCD 1440x1080 29.97 fps). I have tried the new effect on a clip, and cannot get a much