Passing RFC output structure to another RFC input structure.

Hello Friends,
I have 2 views (i.e. SearchView & ResultView). In search view, I pass input parameter (PO Number) to BAPI_PO_GETITEMS and get back the output table PO_ITEMS correctly. I display this table in the ResultView correctly. Now, after displaying the order details, I need to pass this input to BAPI_GOODSMVT_CREATE in its GOODSMVT_ITEM structure to create a Good Movement Note.
Can somebody help me as to how could I pass values from PO_ITEMS to GOODSMVT_ITEM structure?
Thanking you in advance,
Maulin

Hi,
You can pass the input of BAPI_PO_GETITEMS  to the BAPI_GOODSMVT_CREATE .
For this u need to first understand and read the BAPI throughly, means u must read how your two bapi's are working and what are the relation ship b/w them.
Also, i assume that in a ur webdynpro application u already imported all required BAPI and just simple take the user Input from the context and pass it to the next Bapi.
Hope so it can solve ur pb,If there is any more query, put in forum.
Thanks
Dheerendra Shukla

Similar Messages

  • Using selected output from a RFC as input for another RFC

    Hi,
    I'm new at this so I may be doing things completely wrong.
    I have two models based on adaptive RFC.
    The first populates a list of Org Units. (Orgeh_Out)
    The user then selectes multiple Org Units from this list.
    I want to use the selected Org Units as Input for the second RFC which will display the personnel numbers in the selected Org Units. (Orgeh_Tab_In)
    Model 1 works fine but I am having difficulty in populating the Org Unit input table for the second model.
    public void RFCPernrFill( )
        //@@begin RFCPernrFill()
         Z_Wd_Pernr_Input pernrInput = new Z_Wd_Pernr_Input();
         wdContext.nodePernrList().bind(pernrInput);
        int orgCount = wdContext.nodeOrgeh_Out().size();
          for (int i=0; i<orgCount; i++) {
                if (wdContext.nodeOrgeh_Out().isMultiSelected(i)) {
                IOrgeh_OutElement thisOrgUnit = wdContext.nodeOrgeh_Out().getOrgeh_OutElementAt(i);     
              Zwd_Orgeh tmpOrgTab = new Zwd_Orgeh();
              String st = String.valueOf(thisOrgUnit);
              tmpOrgTab.setOrgeh(st);            //<-- Causes error but will only accept a String
              pernrInput.addOrgeh_Tab_In(tmpOrgTab); 
    I don't understand why tmpOrgTab.setOrgeh will only accept a String and not the 'thisOrgUnit' variable.
    i.e. why couldn't I say tmpOrgTab.setOrgeh(thisOrgUnit) ?
    The command tmpOrgTab.setOrgeh(st); causes an error however if I hard code a Org Unit tmpOrgTab.setOrgeh("5000011"); it works. The error I get is :
    Type conversion error, field ORGEH, complex type class com.sap.com.testing.pernrlist.model1.Zwd_Orgeh

    Hi
       Can you give me the structure of the proxy classes generated. I will give you the working code :).
    The lines of code
    Zwd_Orgeh tmpOrgTab = new Zwd_Orgeh();
    String st = String.valueOf(thisOrgUnit);
    tmpOrgTab.setOrgeh(st); //<-- Causes error but will only accept a String
    pernrInput.addOrgeh_Tab_In(tmpOrgTab);
    There is a structure in your RFC called ZWD_ORGEH.
    Instantiate this like you have done.
    Zwd_Orgeh tmpOrgTab = new Zwd_Orgeh();
    Now the following line of code
    tmpOrgTab.setOrgeh(st)
    Here you say it is only accepting a string. But what i feel is that you would have another internal structure and u need to instantiate that.
    Anyway if you just send me the proxy classes generated i will be able to help you in your code.
    Also give me the structure of the RFC.
    Meanwhile check this link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/effective web dynpro - adaptive rfc models
    The above link will also give you some input to your prob.
    regards
    Ravi

  • RFC input structure

    Hello,
    I am trying to call a RFC from my WebDynpro application.
    The RFC has a mandatory input structure called PERSDATA.
    I am using the following test code to call the RFC:
         IWDMessageManager manager = wdComponentAPI.getMessageManager();
         try{
              wdContext.nodeZ_Portal_Get_Timesheet_Input().bind(new Z_Portal_Get_Timesheet_Input());
              wdContext.currentZ_Portal_Get_Timesheet_InputElement().setKeydate(new Date(105,9,27));
              wdContext.nodePersdata().bind(new Cats_Its_Persdata());
              wdContext.currentPersdataElement().setPernr("00003000");
              wdContext.currentZ_Portal_Get_Timesheet_InputElement().modelObject().execute();
              wdContext.nodeOutput().invalidate();
         } catch(WDDynamicRFCExecuteException ce) {
              manager.reportException(ce.getMessage(), false);
    When I run this code I get the errormessage:
    <b>Mandatory parameter PERSDATA of method Z_PORTAL_GET_TIMESHEET missing.</b>
    When I display the input structure in my view (in a table) it displays one row with pernr set to 00003000 (so it seems to me that the input structure is ok).
    What am I doing wrong here?

    Hallo Johan,
    your mistake is based on the fakt, that you did not correctly aggregate your model object graph. Instead you operated on the context itself. The context only references the model objects within the model object graph. Relations between context nodes and context node elements are not automatcally mirrored within the model object graph. Principally you have to aggregate your model object graph first (independant from the contex) and afterwards you can reference the executable model class within the toplevel context node element.
    I assume, that your code should look like this:
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
    try {
      // Aggregate model object graph
      Z_Portal_Get_Timesheet_Input timeSheetInput =
      new Z_Portal_Get_Timesheet_Input();
      timeSheetInput.setKeydate(new Date(105, 9, 27));
      Cats_Its_Persdata persData = new Cats_Its_Persdata();
      persData.setPernr("00003000");
      timeSheetInput.setPersdata(persData);
      // Bind executable model object to context node 'Z_Portal_Get_Timesheet_Input'
      wdContext.nodeZ_Portal_Get_Timesheet_Input().bind(timeSheetInput);
      // Execute model object
      wdContext
        .currentZ_Portal_Get_Timesheet_InputElement()
        .modelObject()
        .execute();
      // Invalidate output node so that the context-to-model-object-references will be updated
      wdContext.nodeOutput().invalidate();
    } catch (WDDynamicRFCExecuteException ce) {
    manager.reportException(ce.getMessage(), false);
    Also have a look at my related answer within the forum thread Executing model : deep structure in importing parameter of RFC which deals with the same issue.
    Regards, Bertram
    Regards, Bertram

  • How do I pass a "deep structure" to an RFC?

    Okay, I am expecting to receive a table of data for processing from XI.  This data will be calling a BAPI to post Incoming Invoices.
    Each record in the table represents a single Incoming Invoice and will be a "deep structure."  The deep structure will consist of a structure of Header data (occuring once per Invoice) and a table of Line Item data (occuring one to many times per Invoice).
    After defining my deep structure, I assigned it as an IMPORTING parameter in my remote-enabled function.  SAP didn't like it, so I created a table type (with a line type equal to my deep structure) and assigned it to the TABLES parameter.  SAP came back and told me that deep structures weren't allowed with RFCs!
    Yikes!  I read SAP's recommendation about creating some sort of foreign key, and splitting the data into separate tables (breaking apart the deep structure).  I assume this means that I could read an Invoice Header Data table, then go read the Invoice Line Item Data table for all records matching whatever "key" I designate -- correct?  Is this what I am resigned to do, or is there a way I can keep my deep structure?
    Thank you.  All helpful posts receive points!
    Dave

    1st responder --
    LIKE isn't an option in the "Type" drop-down box; I tried entering it, but SAP will not accept it.  This is all within my function module, with the various tabs where I can specify IMPORT, TABLES, etc. (the parameters for my function).  Is there some other place I should be doing that?
    2nd responder --
    What do you mean by passing it "separately"?  I'm not sure I understand.

  • RFC Output to an Output Port

    Hi,
      My application has two nested windows inside a main window. I choose certain selection criterion in one nested window and press submit and certain information is shown in the other nested window.
      Second window content is shown only if user presses submit. This is done by passing a flag to the output port which in turn goes to the second window's input.
      My requirement is, after user presses submit, I want to call a certain RFC. At the end of the RFC I want to move the control to Output Port.
      Submit  -> RFC -> Output Port
      I can get two lines for the submit. One to call RFC and the other to the output port. But RFC execution needs to be completed first. I am able to connect RFC output to Output port(with some dummy output fields). But its giving an error while deployment.
    Thanks.
    Srinivas

    Hello Srinivas,
    The two lines doesn't work. I had a similiar problem, which you described.
    Can you post your model? - So that I can have a closer look at the problem? Maybe I have a solution.
    Best Regards,
    Marcel

  • Output of one Report as input to another report

    Hi friends,
             I want to pass output of my zreport as input to another report. I want to pass all the values of one column in the input put field of another report.
    Thanks and Regards
    Neelesh

    hi neelesh
    let assume u want send a data from Report 1 to Report 2 means
    use the following code
    SUBMIT report2  WITH parameter1 = parameter1
                             WITH selectoption IN selectoption1
                             AND RETURN.
    rewards if its usefull
    regards
    deva

  • Passing the output to another program

    Passing the output to another program
    The problem I have that I don�t know how to pass the results of my java Program ( as parameter) to another application!
    I have a class �A.class� should send result �VAR_result� to application �B.application�
    Now I am using it like this: System.out (VAR_result) >> B.application
    But it could not be the right way at least because I cant make any other System.out as debug now.
    My Question please: to pass a parameter to a java is clear: A.class ( var ..)
    But how to take a parameter from a class, to use it in another Applicatin ( script )?
    Thanks a lot

    slackware2007 wrote:
    Passing the output to another program
    The problem I have that I don&#146;t know how to pass the results of my java Program ( as parameter) to another application!
    I have a class &#147;A.class&#148; should send result &#147;VAR_result&#148; to application &#147;B.application&#148;
    Now I am using it like this: System.out (VAR_result) >> B.application
    But it could not be the right way at least because I cant make any other System.out as debug now.Then move your debug to System.err and use System.out as it should be used and pipe stdout to the stdin of the other application..

  • Duplicate records in input structure of model node

    Hi,
    Following is the way, I am assigning data to a model node:
    //Clearing the model input node
    for (int i = wdContext.nodeInsppointdata().size(); i > 0; i--)
         wdContext.nodeInsppointdata().removeElement(wdContext.nodeInsppointdata().getElementAt(i - 1));
    //Creating element of the input model node
    IPrivateResultsView.IInsppointdataElement eleInspPointData;
    //START A
    Bapi2045L4 objBapi2045L4_1 = new Bapi2045L4(); //Instance of the input structure type
    //Populating data
    eleInspPointData = wdContext.nodeInsppointdata().createInsppointdataElement(objBapi2045L4_1);
    wdContext.nodeInsppointdata().addElement(eleInspPointData);
    eleInspPointData.setInsplot(wdContext.currentContextElement().getInspectionLotNumber());
    eleInspPointData.setInspoper("0101");
    //Inspection_Validate_Input is the model node. Adding instance to main node
    wdContext.currentInspection_Validate_InputElement().modelObject().addInsppointdata(objBapi2045L4_1);
    //STOP A
    //Now executing the RFC
    Above code seems to be fine. Works very well for the first time. But, when the user clicks on the same button for the second time, I can see duplicate records getting passed to RFC [Debugged using external breakpoint]. When I am sending 4 records, I can see there are total of 6 records. The number keeps increasing when clicked on the button.
    I am adding multiple records to input model node using the code from START A to STOP A. Does the code look fine? Why do I see multiple records?
    Thanks,
    Sham

    Issue solved.
    After executing RFC, I used following code to clear the input model node:
    try
         wdContext.current<yourBAPI>_InputElement().modelObject().get<yourinputnode>().clear();
    catch (Exception e1)

  • How to force field to appear in input structure in content conversion

    Hi all,
    I am doing file content conversion in sender File adapter. Here is the structure
    Header
    Body
       field1 - length 2
       field2 - occurrence 1:1, length 3
       field3 - length 2
       field4  length 2
    Trailer
    Here is the fixed length file that is inputed into XI
    <b>header22   2211trailer</b>
    field2 occrence is 1:1 and as you se from the file example field2 from the body is empty(just space).But  When I do the content conversion I don;t have this field showing up in my structure!??!!
    I want to make sure that field2 appears even as empty field because that is screwing my mapping!?
    Can you please have any idea how to make sure that field is in my input structure when I pass spaces?Can I force it somehow?
    Thanks all.

    Hi Jon,
    Yes you are right.
    For Ex: ur XML is
    <1>a</1>
    <2>b</2>
    and sometime is there is no value ur FCC will become
    <1>a</1>
    So what you have to do is in the message mapping take the source element
    if <2> exists then <2>---->Target
    else
    <2>---->Constant(space)
    and this "exists" is a standard function in NodeFunctions.
    Regards,

  • RFC to RFC - Error in the target RFC - Message type I

    Dear all,
    I am making a message using from RFC(ECC 6.0) to RFC(ECC 5.0).
    It happens an error(System_Failure) because in the target RFC(source code), there is a message type I. I can't take off the message, so how can I create my message without error?
    Best Regards,
    Fernando

    hi,
    are you using a BAPI with direct commit fomr RFC adapter?
    read info about parameter:
    <b>Commit Control for Individual BAPI Calls</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/e80440a832e369e10000000a155106/content.htm
    "I" should not affect the commit
    if you have the commit inside then don't raise exception
    or raise it inside another Function module that will serve as a wrapper
    to the one you use) 
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • RFC -- XI --- SOAP adapter -- XI -- RFC

    Hi all,
    I need develop this scenario.
    Currently I have this one works:
    RFC <> XI <> RFC
    But we need change it connecting to a new XI system with SOAP adapter, and I don't have experience with SOAP.
    Could somebody give me documentation or help?
    Can I do this without changing nothing in the mapping except the communication channel in the old XI system?
    What it is necesary in the 2nd XI system? mapping?
    How I can configure both SOAP channels?
    Thanks a lot.
    Raú

    Hi
    please refer
    An Overview of SOAP
    /people/padmankumar.sahoo/blog/2005/02/15/an-overview-of-soap
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5474f19e-0701-0010-4eaa-97c4f78dbf9b
    Could somebody give me documentation or help?
    --> refer above links
    /people/shabarish.vijayakumar/blog/2008/01/08/troubleshooting--rfc-and-soap-scenarios-updated-on-20042009
    soap-rfc-file:how to start
    Help SOAP to RFC Scenario using BPM (Synchronous communication)
    /people/shabarish.vijayakumar/blog/2006/03/23/rfc--xi--webservice--a-complete-walkthrough-part-1
    /people/shabarish.vijayakumar/blog/2006/03/28/rfc--xi--webservice--a-complete-walkthrough-part-2
    Can I do this without changing nothing in the mapping except the communication channel in the old XI system?
    --->Then you need to release the receiver RFC as Webservice
    /people/kumar.prashant4/blog/2006/07/14/using-rfc-as-webservice-in-webdynpro
    RFC WSDL file
    What it is necesary in the 2nd XI system? mapping?
    -->the mapping will be same provided the structure of RFCs are same, or you could import the wsdl and use as external defination.
    How I can configure both SOAP channels?
    -->
    http://help.sap.com/saphelp_nw04s/helpdata/en/69/a6fb3fea9df028e10000000a1550b0/content.htm
    Sender
    http://help.sap.com/saphelp_nw04s/helpdata/en/fc/5ad93f130f9215e10000000a155106/content.htm
    Receiver
    http://help.sap.com/saphelp_nw04s/helpdata/en/29/5bd93f130f9215e10000000a155106/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/45/3418a0eabe072fe10000000a155369/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/02/6d5c034c182e4fbe7bfd25c2b56f9b/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/bf/27fd3b651f6a1ce10000000a11402f/frameset.htm
    Thanks
    Swarup

  • File to Rfc scenario,not updated in rfc

    Hi,
    File to RFC scenario,not updated in RFC?
    i checked communication channels ,smq1,smq2,sm58,cache refresh.but issue was not solved.
    Please advise where need to check?
    Thanks
    Amita

    Hi Amita,
    First check whether the configuration between PI and ECC has been set up properly.
    Are you using a stand RFC or custom RFC?
    Import the RFC metadata from ECC to PI and use that structure in your service interface and configure the remaining objects that we normally do.
    Now, try to process the file and check in the communication channel, whether file Adapter is able to pick up and send the message to PI system.
    If the message is successfully processed through PI system then check the messages in Queues. Also, check the RFC communication channel in the adapter engine.
    Follow the process, you might get some clue regarding the issue.

  • Having header line in the structure inside another structure

    How can I have a header line in a structure within a structure?
    (I have posted a question before...but seems to be unclear..so I closed that thread and open a new one)
    Thanks!
    When compiling the below codes, I got error message stating that 'The internal table "IT_SALES_ORDER-DETAIL" has no header line - explicit specification of an output area with "INTO wa" or "ASSIGNING <fs>" is required'.
    I know that the problem can be solved by using field symbols... but I wonder I can have a header line declared in a structure within another structure.
    types: begin of ty_header,
             vbeln like vbak-vbeln,
             erdat like vbak-erdat,
             audat like vbak-audat,
             vkorg like vbak-vkorg,
             vtweg like vbak-vtweg,
             spart like vbak-spart,
             kunnr like vbak-kunnr,
             netwr like vbak-netwr,
             end of ty_header.
    types: begin of ty_detail,
             posnr like vbep-posnr,
             edatu like vbep-edatu,
             etenr like vbep-etenr,
             ettyp like vbep-ettyp,
             wmeng like vbep-wmeng,
             bmeng like vbep-bmeng,
             vrkme like vbep-vrkme,
             mbdat like vbep-mbdat,
             lddat like vbep-lddat,
           end of ty_detail.
    types: begin of ty_sales_order,
               header type ty_header,
               detail type ty_detail occurs 0,
           end of ty_sales_order.
    data: it_sales_order type standard table of ty_sales_order
          with header line initial size 0.
    data: it_selected_order type standard table of ty_header
          with header line initial size 0.
    select *
      into corresponding fields of table it_selected_order
      from vbak
    where erdat > '01.01.2005' and erdat < '31.12.2005'.
    write :/ sy-subrc.
    loop at it_selected_order.
      clear: it_sales_order-header, it_sales_order-detail.
      move-corresponding it_selected_order to it_sales_order-header.
      select *
        into corresponding fields of table it_sales_order-detail
        from vbep
       where vbeln = it_sales_order-header-vbeln.
      append it_sales_order.
    endloop.
    loop at it_sales_order.
      write :/ it_sales_order-header-vbeln.
      loop at it_sales_order-detail.
      endloop.
    endloop.

    You have to use a work area here, no header lines.
    report zrich_0002 no standard page heading.
    types: begin of ty_header,
    vbeln like vbak-vbeln,
    erdat like vbak-erdat,
    audat like vbak-audat,
    vkorg like vbak-vkorg,
    vtweg like vbak-vtweg,
    spart like vbak-spart,
    kunnr like vbak-kunnr,
    netwr like vbak-netwr,
    end of ty_header.
    types: begin of ty_detail,
    posnr like vbep-posnr,
    edatu like vbep-edatu,
    etenr like vbep-etenr,
    ettyp like vbep-ettyp,
    wmeng like vbep-wmeng,
    bmeng like vbep-bmeng,
    vrkme like vbep-vrkme,
    mbdat like vbep-mbdat,
    lddat like vbep-lddat,
    end of ty_detail.
    types: begin of ty_sales_order,
    header type ty_header,
    detail type ty_detail occurs 0,
    end of ty_sales_order.
    data: it_sales_order type standard table of ty_sales_order
    with header line initial size 0.
    data: it_selected_order type standard table of ty_header
    with header line initial size 0.
    <b>data: wa_detail type ty_detail.</b>
    select *
    into corresponding fields of table it_selected_order
    from vbak
    where erdat > '01.01.2005' and erdat < '31.12.2005'.
    write :/ sy-subrc.
    loop at it_selected_order.
      clear: it_sales_order-header, it_sales_order-detail.
      move-corresponding it_selected_order to it_sales_order-header.
      select *
      into corresponding fields of table it_sales_order-detail
      from vbep
      where vbeln = it_sales_order-header-vbeln.
      append it_sales_order.
    endloop.
    loop at it_sales_order.
      write :/ it_sales_order-header-vbeln.
    <b> loop at it_sales_order-detail into wa_detail.</b>
      endloop.
    endloop.
    Regards,
    Rich Heilman
    Message was edited by: Rich Heilman

  • Output of One Query  is input to other Query??

    Hi All,
    How to make output of one query as input to other Query and what are the points to be takeb care of to do it?
    regards,
    murali.
    Message was edited by: Murali

    Hallo
    You got a second query where you also have 0date. Based on the selection on the second query, you get some value for 0date. this values are then passed in background to the first query which will show you the output based on the input date of the first query. You can also have othe variable in the query.
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
    I hope everything is fine.
    Mike

  • [RFC][Authorization] Prevent Dump on RFC Call

    Hi,
    I would like to have a tool to check consistencies throughout different SAP systems for a given user.
    For this, I call the Bapi called 'BAPI_USER_GET_DETAIL'. The problem is that, depending RFC user defined in SM59, it may end by a DUMP.
    Thus, is there a way to test the RFC user rights in order to prevent the Dump ?
    The problem is that calling another RFC function module may also result in a Dump, isn't it...
    Thanks for your replies!

    You may have to try for authorization before hand.  You have tried doing authority checks on one of the following authorization objects?
    S_RFC        Authorization check for RFC access                      
    S_RFCACL     Authorization Check for RFC User (e.g. Trusted System) 
    authority-check object 'S_RFC'
             id 'RFC_TYPE' field '__________'
             id 'RFC_NAME' field '__________'
             id 'ACTVT' field '__________'.
    if sy-subrc = 0.
    * Then do the BAPI
    Endif.
    authority-check object 'S_RFCACL'
             id 'RFC_SYSID' field '__________'
             id 'RFC_CLIENT' field '__________'
             id 'RFC_USER' field '__________'
             id 'RFC_EQUSER' field '__________'
             id 'RFC_TCODE' field '__________'
             id 'RFC_INFO' field '__________'
             id 'ACTVT' field '__________'.
    if sy-subrc = 0.
    * Then do the BAPI
    Endif.
    Regards,
    Rich Heilman

Maybe you are looking for

  • Cast to a literal (ex. "java.math.BigDecimal")

    I have an array with 2 columns like: "java.math.BigDecimal", "2" "java.lang.String", "Test 01" "java.math.BigDecimal","120" "java.math.BigDecimal","148" "java.lang.String", "Test 02" Is there way to cast the second string to the correct object type,

  • Can I sort "All Photos" by date ?

    Photos App on Mac appears to have no way to sort the album "All Photos" by the date the photo was taken, or by file name.  What am I missing?

  • Albums are in entirely incorrect order

    Using most recent itunes. Have imported many albums. Itunes has decided to not keep the original play order of my cd's. All tracks have the correct track numbers when "get info" is selected, but nothing plays in order. what is going on? shuffle is of

  • Why is my password auto saved on my 4gs?

    After installing IOS 6 i no longer need to enter my password to update apps. How do I change it back so that I have to enter my ID/Password to update or install an app? Thanks.

  • Can I install the Sun 1.4.2 JRE on 10gR1 RHEL?

    If I install a separate Sun JRE from rpm, (which ends up in /usr/java I believe) will that interfere in any way with the Oracle Portal?