So I removed the loop and still getting the error. Not sure what else to try.
Original Message:
Sent: 01-31-2024 14:46
From: JOHN NICKIAS JR
Subject: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure
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
Original Message:
Sent: 01-31-2024 14:29
From: Moazzam Mubarak
Subject: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure
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
Original Message:
Sent: 01-31-2024 14:20
From: JOHN NICKIAS JR
Subject: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure
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
Original Message:
Sent: 01-31-2024 13:13
From: Moazzam Mubarak
Subject: Question on BAPI_ALM_ORDER_MAINTAIN - how to map IT_METHODS structure
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
------------------------------