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).
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.
I'm not sure I follow. Would you be able to attach a sample script to help me understand?
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.
So I removed the loop and still getting the error. Not sure what else to try.
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.
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.
Good point, John.
That note refers to other notes
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.
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.