How do I increment table list data in an output parameter as input for another BAPI?
Application Type
Reactive
Service Studio Version
11.11.0 (Build 42742)
Platform Version
11.9.1 (Build 20359)

Hello everyone!

I have created two server side logics in reactive. One is called the "GetProcessDocNum" action and the other is called the "GetContractNum". My logic for the GetProcessDocNum action is working just fine and once you click on the publish button, you can see that the data I need is displayed in a table list with about 25 rows of Process Document numbers. Now, this data is stored in an output variable called Output_ProcessDocNum. I need to use the data in this variable as input for another BAPI.
For example, the first index shown as output for the GetProcessDocNum action is the number "4600381725". I need to use this as input for the BAPI that I am using in "GetContractNum" server logic that I have implemented. I need to repeat the same process again and again for each of the process document numbers I have stored in my output parameter.

In the logic I have created a server action called "GetContractNumber" where I am using the Output_ContractNum as output variable for my BAPI_Contract_Getdetail. I was able to get my logic to work for just the first index "4600381725" shown as output in the "EKKO_List" output parameter found in the "GetProcessDocumentNum" server action. I am unable to develop the logic to increment through the list of all these process document numbers and use them one by one to get the tracking number/contract number that I need using the BAPI_contract_getdetail found in the GetContractNumber server action.
So basically I am trying to figure out how to increment the indexes so that after the app is able to get the contract number using the first process doc number, then I want it to use the second process doc number stored in the output variable and get the second contract number and so on until I get all 25 contract numbers for all 25 process document numbers.
Is there a way to increment indexes for the data stored in a variable in outsystems?
Note: In the interface, I am using the SAP_READ_TABLE_FUNCTIONTEST screen to display my table lists to get the contract and process doc numbers. I have attached the oml file.

Thanks,
Zeeshan

ZeeshanKhalidReactiveTestfunction.oml

Solution

Hello @Zeeshan Khalid,

I was unable to get the code to work but if I have understood your ask, then all you are missing is a loop in the GetContractNum server action to loop through the EKKO_List:


Regards,

AJ

Hi AJ!

Thanks so much for this. I knew I had to use a loop but I was unable to figure out how to use it with my existing logic. I used the exact same method like you mentioned and voila, it worked! Appreciate your help. Thanks for taking the time to review my problem.

Best,
Zeeshan

Very welcome Zeeshan, happy to help

Regards,

AJ

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.