Automate

 View Only
  • 1.  Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure

    Posted 20 days ago
      |   view attached

    Hi all,

    We have a requirement to mass update Joint Venture fields in thousands of PM orders. An end user can do that manually by using t-code IW32 to (change PM order) and Go To -> Assignments -> Joint Venture (first screenshot).  

    It takes them to the Joint Venture Accounting fields which they can update (second screenshot) and choose Continue -> Save the order
    Now there's no mass transaction in the system to do that but we can use BAPI_ALM_ORDER_MAINTAIN. My question is regarding the first structure IT_METHODS where there are 2 rows for each order, see the screenshot IT_METHODS structure for PM order below.
     As you can see, the BAPI requires 2 rows for this structure (the first with OBJECTTYPE = HEADER/ METHOD = CHANGE and the second row with OBJECTTYPE = ' '/ METHOD = SAVE).
    This is the first time I'm dealing with 2 rows in a Header field and not sure how to create a BAPI based script for such scenario. I tried the setting below and as expected, it is not working. Wondering if someone can help me with this problem? I have attached the script I developed so far. 
    Thanks,
    Moazzam


    ------------------------------
    Moazzam Mubarak
    Manager SAP
    De Beers Consolidated Mines
    AB
    ------------------------------

    Attachment(s)



  • 2.  RE: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure

    Posted 20 days ago

    Hello Moazzam,

    With BAPIs that I have used in scripts, the loop construct will initially show but I had no need for the loop function.  The yellow loop construct can be deleted using a right-click on the loop itself, the fields for the table will remain, so you will have the 2 IT_Header tables listed with their fields, but without the loop.  When you map to the Excel template all the fields will map to columns.  Then populate each column for each of the 2 sets of IT_Header fields as needed.  For each work order you would populate one row in the Excel template.



    ------------------------------
    JOHN NICKIAS JR
    IT Business Consultant
    International Paper Company
    Memphis TN
    ------------------------------



  • 3.  RE: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure

    Posted 20 days ago

    Hi John,

    I'm not sure I follow. Would you be able to attach a sample script to help me understand?

    Thanks,

    Moazzam



    ------------------------------
    Moazzam Mubarak
    Manager SAP
    De Beers Consolidated Mines
    AB
    ------------------------------



  • 4.  RE: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure

    Posted 20 days ago

    Unfortunately I cannot send a sample script, I am dead in the water with Studio as I allowed my PC to be upgraded to Win11 for some testing and our current version of Studio doesn't work with Win11.

    On the Expert View tab, you can right-click somewhere on the loop construct (pointed out) and you will get a popup menu with a Delete option.  The yellow loop that surrounds that header table will be deleted, but table IT_HEADER_JVA and it's fields will remain.  You are only deleting the fact that the table is part of a loop - it will no longer be "in a loop".

    When you map the fields, all the fields for both header tables will get mapped to columns in the Excel template.  So, for example, in the Excel template for field Order Number, you will see it in two columns - one will be for IT_HEADER, and one will be for IT_HEADER_JVA.  Just populate both with the same order number.



    ------------------------------
    JOHN NICKIAS JR
    IT Business Consultant
    International Paper Company
    Memphis TN
    ------------------------------



  • 5.  RE: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure

    Posted 20 days ago

    So I removed the loop and still getting the error. Not sure what else to try.



    ------------------------------
    Moazzam Mubarak
    Manager SAP
    De Beers Consolidated Mines
    AB
    ------------------------------



  • 6.  RE: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure

    Employee
    Posted 20 days ago
      |   view attached

    Hi Moazzam

    We don't have JV activated or I would try this.

    Since you stated you always have two rows for the IT Methods structure, you can copy that group and have two structures with the same fields.  I would just name them something meaningful, like Ref Num 1 and Ref Num 2, etc for the descriptions.

    Right click on the blue line - the one with the structure title - and click copy

    then paste after line 6 - so right click on row 6 and click paste after

    Then you'll have this and you can adjust your values in each

    Give it a try and see if that works for you.

    I'm uploading what I modified, but I hope you follow enough to do it for yourself next time. The key to copy the structure is to click on the title row, right click and copy - then you can paste it into other places. 

    We have done this in other BAPIs with success, such as journal postings with multiple COPA fields - copying and pasting that section to match the maximum number of COPA entries - it also flattens the structure so that you can enter the COPA entries on the same row and the rest of the line item for the journal entry.

    Best Regards,

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------

    Attachment(s)



  • 7.  RE: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure

    Posted 19 days ago

    Definitely look at the SAP Note that is referenced in the message.  If you run a google search for: sap note 2295840 - there are some links to threads where a similar message is issued for other function modules.  One mentions a system setting that has to do with blacklisting incompatible calls.

    At his point I would try a transaction recording.



    ------------------------------
    JOHN NICKIAS JR
    IT Business Consultant
    International Paper Company
    Memphis TN
    ------------------------------



  • 8.  RE: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure

    Employee
    Posted 19 days ago

    Good point, John.

    That note refers to other notes

    • 2298711 - Maintain RFC Blacklist in customer installations
    • 2480080 - RFC Blacklist Update 1610 FPS3 and 1709
    • 2295840 - Outbound / Inbound calls from external to RFC FM are blocked when the FM is blacklisted and the UCON-Check is active
    • 2465870 - CAD Services: MFLE changes for BOM related modules

    from https://me.sap.com/notes/2295840 - RZ11 ucon/rfc/check_blacklist could be set to 0, but that's something Basis would need to investigate and approve.  There look to be other options, including running reports, to allow using the Function Module from outside of SAP.

    Best Regards,

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------



  • 9.  RE: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure

    Posted 19 days ago

    Thanks Sigrid and John, copying IT_HEADER as suggested by Sigrid didn't work either and the script is still pointing to Note 2295840 so I've referred it to our Basis team. Once the Kernel patch identified by this note has been implemented, I will try that again and provide feedback.

    Regards,

    Moazzam



    ------------------------------
    Moazzam Mubarak
    Manager SAP
    De Beers Consolidated Mines
    AB
    ------------------------------