cancel
Showing results for 
Search instead for 
Did you mean: 

How to set values for my node elements (fill the values with BCC code+description)?

0 Kudos

Hello dear community members!

I’m quite new to ABSL scripting but after a few days, I still have not found any info on this.

So… I have a custom BO that looks like this:

businessobject VATReturnEE {

element VatReturnID: ID;

element VatReturnDesc : LANGUAGEINDEPENDENT_LONG_Name;

node VatReturn [0,n] {

element TaxReturnGroupCode: TAXGROUPCode;

element TaxReturnGroupDescription: LANGUAGEINDEPENDENT_LONG_Description;

element GroupAmount: Amount;

}

}

I need to get multiple values for all the elements in node “VatReturn”.

I have a defined BCO in a different BO where I have my BCC with values:

In the end I need to have my VatReturn values the same as my BCC values.

TaxGroupCode = BCC Code

TaxReturnGroupDescription = BCC Description

My problem is that I can’t seem to find a way to set these values for my elements. I need to get a list that looks like that in my BO:

I'm trying to set the values in my custom action in the root node where I:

ABSL:

//Query the values of BCC

var QueryTaxGroups = TAXGROUP.QueryByElements;

var ResultTaxGroups = QueryTaxGroups.Execute();

//for each BCC value set the values for my elements:

foreach(var instance in ResultTaxGroups){

//this part is the question, how to i add these values to my elements:

TaxGroupCode = BCC Code?

TaxReturnGroupDescription = BCC Description?

}

If anyone has any information about this then please let me know!

It is maybe a really easy thing to do but I cannot figure it out.

Thank You!

Kind regards,

Siim

Accepted Solutions (0)

Answers (2)

Answers (2)

benjaminlatusek
Explorer
0 Kudos

Hello Siim-Jonas,

I'm not sure if I got your usecase right.
In my opinion you don't need the description in your BO-Model at all. You can obtain the description at any given point over the SAP standard / your custom BCC.

For ABSL coding you can use the GetDescription() function of the element of the codelist.
For UI it's getting loaded almost on it's own. Same for reporting.

So I don't really see any point to take the description of a codelist into your BO model as redundant data.

Except you want to make the code within your custom BO. In this case might I would use the after modify event of your node in mass enabled and read the regarding text of the bcc if the text is initial.

I hope that answer fits your requirements.

Take care and stay save!

Best regards
Benjamin

cianbarrett
Employee
Employee
0 Kudos

Hello Siim,

You should be able to retrieve your required info by a simple method. So for example for TaxGroup.bco:

var taxgroup : TaxGroupCode;
var result = taxgroup.GetAllValuesAndDescriptions();

result will be a collection of all available codes. Hope this helps!

- Cian