Automate

 View Only
  • 1.  Create routing through bapi "BAPI_ROUTING_CREATE"

    Posted 02-03-2021 08:24
      |   view attached
    ​​HI ,

    I am trying to create a script which creates routing header, operations, material assignments & operation long text(tcode CA01). I am using a bapi "BAPI_ROUTING_CREATE" for this .
    The script works well for creating routing header & operations. However I am not able to extend it for material assignment & operation long text. The issue is with the loops and I am not able to figure out how to handle those for material assignment & long text . As soon as I insert these two tables, the script doesn't work anymore.
    Can somebody have a look or share any example on how to handle this .?
    my version of script is attached.

    ------------------------------
    Aaksnha Gupta | SAP data migration
    Moog GmbH | +918130780074
    ------------------------------

    Attachment(s)



  • 2.  RE: Create routing through bapi "BAPI_ROUTING_CREATE"

    Posted 02-09-2021 02:28

    HI ​@Sigrid Kok

    any chance you could look at my query and advise .?

    Looking forward for your positive response.

    Regards
    Aakansha​



    ------------------------------
    Aaksnha Gupta | SAP data migration
    Moog GmbH | +918130780074
    ------------------------------



  • 3.  RE: Create routing through bapi "BAPI_ROUTING_CREATE"

    Employee
    Posted 02-09-2021 09:43
    Hi Aaksnha 

    Someone else posted about this BAPI not too long ago, and it's not one I've used before.  

    I see you have fields selected from these BAPI tables:
    -Operations
    -Long Text 
    -Task 

    By default, you'll have a separate loop you have to configure for each table. 

    So the questions I have - will you have only one long text line & task for each operation? 

    (A) -If so, you can usually delete the added loops and extend the loop you have to include the long text.
      (1) right click on the loop line and hit delete
      (2) click on the loop above and choose to extend it to include the text line - use the THROUGH number to include the table line and text-line
    (3) It will now look something like this

    (B)-If not, you'll need to map separate loops for each.

    I see in expert mode you have one loop, but I don't see the long text or task data in it.   If I look at the disabled fields, I see you did have the text line at one time, but it was outside of the loop.

    So overall - all of the table fields should be in a loop, unless there is a 1-1 relationship, i.e. 1 routing, 1 long text, 1 task for the routing.  The thing you have to determine for the items in the loop is - are all the table items 1-1 or 1-M.  That will drive the options I mentioned above.  

    Please remember there is online training available:
    Direct: https://customers.elearning.winshuttle.com/learner/courseinfo/id:186
    Transaction has a number of modules on loops:  https://customers.elearning.winshuttle.com/learner/courseinfo/id:138 

    Best Regards,
    Sigrid









    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------