Unable to extract the correct data from BAPI_OBJCL_GETDETAIL
Application Type
Reactive
Service Studio Version
11.11.0 (Build 42742)
Platform Version
11.9.1 (Build 20359)

Hi all! I am using an SAP BAPI called "BAPI_OBJCL_GETDETAIL". As shown in screenshot 1, I enter the object key here, the object table, the class number and class type. The output I need gets displayed in " ALLOCVALUESCHAR" which is a table. Here I need the "Variety_NAME" which is displayed in the column "VALUE_CHAR" as shown in the second screenshot. I have set up the logic in the correct way but my output only displays the first index of the "VALUE_CHAR" column. How do I set my logic in the way that it always gets the "14th index" each time whenever I run this BAPI? I would also like to know if there is a way to connect the value_char and "charact" column together in a way that if the variety_name changes from the 14th index to to say the 2nd index in SAP, the app should be able to get the correct record and store it in the output variable.

I have also attached my oml for your convenience. I am not sure if you will be able to access my output because I am using a specific server connection at my company but you would be able to see the logic that I impllemented.

Thanks,
ZK.

OutsystemsVarietyName.zip

Solution

Hi Nikhil,

Apologizes once again. Looks like you had my old oml and I made some changes to my most recent one. I used the list filter to work with my problem and it's giving me what I need. I have attached a picture  showing what I have done. I would be more than interested to know if there is a better way to do this. First, I tried with a for each loop but then I went with the listfilter.

mvp_badge
MVP

Hi ZK,

I can't check your oml because you have not mentioned which screen or action I have to see for this implementation. But from your question what I understand is that you want to show value of a column for specific row in your list but it always displays value in row with index 0.

So if you wan to read valued from specific index in list then you can use list index like this:

YourList[13].YourAttribure

Hi Nikhil,

I apologize for not mentioning in the post what screen or server action to see here. I am actually using the GetVarietyName server action in the logic where I am using the Bapi_Objcl_Getdetail. Apart from showing the value of a specific row, is there a way to tell the program to search for the column and row name I need which is the Charac (Column name) = "Variety_Name"? I think we could use a for loop here but I am not sure how to make that logic work with my code. Also, the output will be displayed under Home > SAP_READ_TABLE_FUNCTIONTEST > Variety Name (I have created a table list in this screen to map the variety name). Please let me know if this makes sense. Thanks!

mvp_badge
MVP

Hi ZK,

Looks like you have attached wrong oml as there is no such server and BAPI action with the given names.

Solution

Hi Nikhil,

Apologizes once again. Looks like you had my old oml and I made some changes to my most recent one. I used the list filter to work with my problem and it's giving me what I need. I have attached a picture  showing what I have done. I would be more than interested to know if there is a better way to do this. First, I tried with a for each loop but then I went with the listfilter.

mvp_badge
MVP

Hi ZK,

Yes, listfilter is the correct way to get the specific value from a list.

Hi Nikhil,

Thanks so much for your help!

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